Class AbstractShapeTool

    • Field Detail

      • dropContainer

        protected javax.swing.JComponent dropContainer
      • cursor

        protected java.awt.Cursor cursor
    • Constructor Detail

      • AbstractShapeTool

        public AbstractShapeTool()
    • Method Detail

      • tt

        protected static java.lang.String tt​(java.lang.String key)
        Shortcut for:

         "<html>" + BundleUtil.get().getString("fpmi." + key);
         
      • 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
      • updateToolbar

        protected void updateToolbar​(java.util.List<javax.swing.JComponent> selection)
      • disableToolbar

        protected void disableToolbar()
      • createCursor

        protected abstract java.awt.Cursor createCursor()
      • onPress

        public void onPress​(java.awt.Point move,
                            int modifiers)
        Description copied from interface: IDesignTool
        Called when the user presses the mouse in the design space.
        Specified by:
        onPress in interface IDesignTool
        Overrides:
        onPress in class AbstractDesignTool
        Parameters:
        move - The point at which they pressed. Relative to the designable container.
        modifiers - A bitmask of modifiers. Comes from InputEvent.getModifiersEx()
      • onClick

        public void onClick​(java.awt.Point p,
                            int modifiers)
        Description copied from interface: IDesignTool
        Called when the user clicks in the design space.
        Specified by:
        onClick in interface IDesignTool
        Overrides:
        onClick in class AbstractDesignTool
        Parameters:
        p - The point at which they clicked. Relative to the designable container.
        modifiers - A bitmask of modifiers. Comes from InputEvent.getModifiersEx()
      • getCursor

        public java.awt.Cursor getCursor​(java.awt.Point point,
                                         int inputEventMask)
        Description copied from interface: IDesignTool
        The cursor to use given the current event mask, which can be used to detect what keys are being held down
        Specified by:
        getCursor in interface IDesignTool
        Overrides:
        getCursor in class AbstractDesignTool
      • onDragStart

        public void onDragStart​(java.awt.Point startPoint,
                                java.awt.Point lastPoint,
                                java.awt.Rectangle r,
                                int modifiers)
        Description copied from class: AbstractDesignTool
        Called when the user start's dragging while this tool is active. All coordinates are relative to the interaction panel and are in zoomed space.
        Specified by:
        onDragStart in interface IDesignTool
        Overrides:
        onDragStart in class AbstractDesignTool
      • onDrag

        public void onDrag​(java.awt.Point startPoint,
                           java.awt.Point lastPoint,
                           java.awt.Rectangle r,
                           int modifiers)
        Description copied from class: AbstractDesignTool
        Called while the user is dragging. All coordinates are relative to the interaction panel and are in zoomed space.
        Specified by:
        onDrag in interface IDesignTool
        Overrides:
        onDrag in class AbstractDesignTool
      • onDragEnd

        public void onDragEnd​(java.awt.Point startPoint,
                              java.awt.Point lastPoint,
                              java.awt.Rectangle r,
                              int modifiers)
        Description copied from class: AbstractDesignTool
        Called when the user stops dragging. All coordinates are relative to the interaction panel and are in zoomed space.
        Specified by:
        onDragEnd in interface IDesignTool
        Overrides:
        onDragEnd in class AbstractDesignTool
      • validSelection

        protected boolean validSelection​(java.util.List<javax.swing.JComponent> selection)
      • handlesShape

        protected boolean handlesShape​(ShapeDelegate shape)
      • getDelegateType

        protected abstract java.lang.Class<? extends ShapeDelegate> getDelegateType()
      • newShapeDelegate

        protected abstract ShapeDelegate newShapeDelegate​(java.awt.geom.Rectangle2D rect)
      • getNewShapeName

        protected abstract java.lang.String getNewShapeName()