Class AbstractLayoutTool

  • All Implemented Interfaces:
    IDesignTool
    Direct Known Subclasses:
    SelectionTool

    public abstract class AbstractLayoutTool
    extends AbstractDesignTool
    This tool defines and installs a number of visual layout related actions. Things like nudging, z-order positioning, and alignment are implemented here.
    • Constructor Detail

      • AbstractLayoutTool

        protected AbstractLayoutTool()
    • Method Detail

      • install

        public void install​(DesignPanel panel)
        Description copied from interface: IDesignTool
        Installs the tool for the given panel. Tools are built to be re-used by repeatedly being installed and then uninstalled as tools get switched out.
        Specified by:
        install in interface IDesignTool
        Overrides:
        install in class AbstractDesignTool
      • evaluateEnabled

        protected void evaluateEnabled​(java.util.List<javax.swing.JComponent> newSelection)
      • removeDescendents

        public static void removeDescendents​(DesignableDelegate delegate,
                                             java.util.List<javax.swing.JComponent> items)
        Removes items in the list whose ancestors are also in the list.
      • componentsAreSiblings

        public static boolean componentsAreSiblings​(DesignableDelegate delegate,
                                                    java.util.List<javax.swing.JComponent> items)
        Checks to see if all of the components are siblings (have the same .getParent()) and that there is at least 1 component in the list
      • convertBoundsToParent

        public static java.util.Map<javax.swing.JComponent,​java.awt.geom.Rectangle2D> convertBoundsToParent​(java.util.Map<javax.swing.JComponent,​java.awt.geom.Rectangle2D> originalBounds,
                                                                                                                  javax.swing.JComponent interactionLayer,
                                                                                                                  DesignableDelegate delegate)
        Converts the rectangles so that their bounds are relative to each object's parent. It is assumed that the rectangles are currently relative to the interaction layer.