Documentation of 'org.jhotdraw.draw.tool.AbstractTool' Java class
AbstractTool
org.jhotdraw.draw.tool

Class AbstractTool

    • Constructor Detail

      • AbstractTool

        public AbstractTool()
        Creates a new instance.
    • Method Detail

      • addUndoableEditListener

        public void addUndoableEditListener(javax.swing.event.UndoableEditListener l)
      • removeUndoableEditListener

        public void removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
      • activate

        public void activate(DrawingEditor editor)
        Description copied from interface: Tool
        Activates the tool for the given editor. This method is called whenever the user switches to this tool.
        Specified by:
        activate in interface Tool
      • deactivate

        public void deactivate(DrawingEditor editor)
        Description copied from interface: Tool
        Deactivates the tool. This method is called whenever the user switches to another tool.
        Specified by:
        deactivate in interface Tool
      • isActive

        public boolean isActive()
      • getInputMap

        public javax.swing.InputMap getInputMap()
        Gets the input map of the Tool
      • getActionMap

        public javax.swing.ActionMap getActionMap()
        Gets the action map of the Tool
      • editDelete

        public void editDelete()
        Deletes the selection. Depending on the tool, this could be selected figures, selected points or selected text.
        Specified by:
        editDelete in interface Tool
      • editCut

        public void editCut()
        Cuts the selection into the clipboard. Depending on the tool, this could be selected figures, selected points or selected text.
        Specified by:
        editCut in interface Tool
      • editCopy

        public void editCopy()
        Copies the selection into the clipboard. Depending on the tool, this could be selected figures, selected points or selected text.
        Specified by:
        editCopy in interface Tool
      • editDuplicate

        public void editDuplicate()
        Duplicates the selection. Depending on the tool, this could be selected figures, selected points or selected text.
        Specified by:
        editDuplicate in interface Tool
      • editPaste

        public void editPaste()
        Pastes the contents of the clipboard. Depending on the tool, this could be selected figures, selected points or selected text.
        Specified by:
        editPaste in interface Tool
      • keyReleased

        public void keyReleased(java.awt.event.KeyEvent evt)
        Specified by:
        keyReleased in interface java.awt.event.KeyListener
      • keyTyped

        public void keyTyped(java.awt.event.KeyEvent evt)
        Specified by:
        keyTyped in interface java.awt.event.KeyListener
      • keyPressed

        public void keyPressed(java.awt.event.KeyEvent evt)
        The Tool uses the InputMap to determine what to do, when a key is pressed. If the corresponding value of the InputMap is a String, the ActionMap of the tool is used, to find the action to be performed. If the corresponding value of the InputMap is a ActionListener, the actionPerformed method of the ActionListener is performed.
        Specified by:
        keyPressed in interface java.awt.event.KeyListener
      • mouseClicked

        public void mouseClicked(java.awt.event.MouseEvent evt)
        Specified by:
        mouseClicked in interface java.awt.event.MouseListener
      • mouseEntered

        public void mouseEntered(java.awt.event.MouseEvent evt)
        Specified by:
        mouseEntered in interface java.awt.event.MouseListener
      • mouseExited

        public void mouseExited(java.awt.event.MouseEvent evt)
        Specified by:
        mouseExited in interface java.awt.event.MouseListener
      • mouseMoved

        public void mouseMoved(java.awt.event.MouseEvent evt)
        Specified by:
        mouseMoved in interface java.awt.event.MouseMotionListener
      • mousePressed

        public void mousePressed(java.awt.event.MouseEvent evt)
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
      • mouseReleased

        public void mouseReleased(java.awt.event.MouseEvent evt)
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
      • addToolListener

        public void addToolListener(ToolListener l)
        Description copied from interface: Tool
        Adds a listener for this tool.
        Specified by:
        addToolListener in interface Tool
      • removeToolListener

        public void removeToolListener(ToolListener l)
        Description copied from interface: Tool
        Removes a listener for this tool.
        Specified by:
        removeToolListener in interface Tool
      • draw

        public void draw(java.awt.Graphics2D g)
        Description copied from interface: Tool
        Draws the tool.
        Specified by:
        draw in interface Tool
      • updateCursor

        public void updateCursor(DrawingView view,
                                 java.awt.Point p)
      • getToolTipText

        public java.lang.String getToolTipText(DrawingView view,
                                               java.awt.event.MouseEvent evt)
        Description copied from interface: Tool
        Returns the tooltip text for a mouse event on a drawing view.
        Specified by:
        getToolTipText in interface Tool
        Parameters:
        view - A drawing view.
        evt - A mouse event.
        Returns:
        A tooltip text or null.
      • supportsHandleInteraction

        public boolean supportsHandleInteraction()
        Returns true, if this tool lets the user interact with handles.

        Handles may draw differently, if interaction is not possible.

        Specified by:
        supportsHandleInteraction in interface Tool
        Returns:
        True, if this tool supports interaction with the handles.

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.