Documentation of 'CH.ifa.draw.standard.AbstractTool' Java class
AbstractTool
CH.ifa.draw.standard

Class AbstractTool

    • Constructor Summary

      Constructors 
      Constructor and Description
      AbstractTool(DrawingView itsView)
      Constructs a tool for the given view.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void activate()
      Activates the tool for the given view.
      void deactivate()
      Deactivates the tool.
      Drawing drawing()
      Gets the tool's drawing.
      DrawingEditor editor()
      Gets the tool's editor.
      void keyDown(java.awt.event.KeyEvent evt, int key)
      Handles key down events in the drawing view.
      void mouseDown(java.awt.event.MouseEvent e, int x, int y)
      Handles mouse down events in the drawing view.
      void mouseDrag(java.awt.event.MouseEvent e, int x, int y)
      Handles mouse drag events in the drawing view.
      void mouseMove(java.awt.event.MouseEvent evt, int x, int y)
      Handles mouse moves (if the mouse button is up).
      void mouseUp(java.awt.event.MouseEvent e, int x, int y)
      Handles mouse up in the drawing view.
      DrawingView view()
      Gets the tool's view.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractTool

        public AbstractTool(DrawingView itsView)
        Constructs a tool for the given view.
    • Method Detail

      • activate

        public void activate()
        Activates the tool for the given view. This method is called whenever the user switches to this tool. Use this method to reinitialize a tool.
        Specified by:
        activate in interface Tool
      • deactivate

        public void deactivate()
        Deactivates the tool. This method is called whenever the user switches to another tool. Use this method to do some clean-up when the tool is switched. Subclassers should always call super.deactivate.
        Specified by:
        deactivate in interface Tool
      • mouseDown

        public void mouseDown(java.awt.event.MouseEvent e,
                              int x,
                              int y)
        Handles mouse down events in the drawing view.
        Specified by:
        mouseDown in interface Tool
      • mouseDrag

        public void mouseDrag(java.awt.event.MouseEvent e,
                              int x,
                              int y)
        Handles mouse drag events in the drawing view.
        Specified by:
        mouseDrag in interface Tool
      • mouseUp

        public void mouseUp(java.awt.event.MouseEvent e,
                            int x,
                            int y)
        Handles mouse up in the drawing view.
        Specified by:
        mouseUp in interface Tool
      • mouseMove

        public void mouseMove(java.awt.event.MouseEvent evt,
                              int x,
                              int y)
        Handles mouse moves (if the mouse button is up).
        Specified by:
        mouseMove in interface Tool
      • keyDown

        public void keyDown(java.awt.event.KeyEvent evt,
                            int key)
        Handles key down events in the drawing view.
        Specified by:
        keyDown in interface Tool
      • drawing

        public Drawing drawing()
        Gets the tool's drawing.
      • view

        public DrawingView view()
        Gets the tool's view.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.