org.openbp.cockpit.modeler.tools
Class ModelerTool

java.lang.Object
  extended by org.openbp.cockpit.modeler.tools.ModelerTool
Direct Known Subclasses:
ParamReorderTracker, ProcessElementInPlaceEditorTool, RotationTracker, RubberBandTool, ScaleTracker, ScrollTool, SimpleSelectTool, XConnectionTool, XDragTracker, XHandleTracker, ZoomTool

public abstract class ModelerTool
extends java.lang.Object

Abstract modeler tool.

Author:
Heiko Erhardt

Constructor Summary
ModelerTool(ModelerToolSupport toolSupport)
          Default constructor.
 
Method Summary
 void activate()
           
 boolean appliesTo(java.lang.Object affectedObject)
          Checks if the tool can be applied to the given figure.
 void deactivate()
           
 CH.ifa.draw.framework.Figure getAffectedFigure()
          Gets the affected figure.
 java.lang.Object getAffectedObject()
          Gets the affected object.
 CH.ifa.draw.framework.Drawing getDrawing()
           
 DrawingEditorPlugin getEditor()
          Gets the editor that owns this tool.
 java.awt.Point getLastPoint()
          Returns the last known mouse coordinates.
 java.awt.Cursor getToolCursor()
          Gets the tool cursor.
 java.lang.String getToolHintMsg()
          Gets the hint message for this tool.
 ModelerToolSupport getToolSupport()
          Gets the tool support object that owns this tool.
 WorkspaceDrawingView getView()
          Gets the view that owns this tool.
 void keyDown(java.awt.event.KeyEvent e, int key)
           
 void keyUp(java.awt.event.KeyEvent e, int key)
           
 void mouseDown(java.awt.event.MouseEvent e, int x, int y)
           
 void mouseDrag(java.awt.event.MouseEvent e, int x, int y)
           
 void mouseMove(java.awt.event.MouseEvent e, int x, int y)
           
 void mouseUp(java.awt.event.MouseEvent e, int x, int y)
           
 void setAffectedObject(java.lang.Object affectedObject)
          Sets the affected object.
 void setToolCursor(java.awt.Cursor toolCursor)
          Sets the tool cursor.
 void setToolHintMsg(java.lang.String toolHintMsg)
          Sets the hint message for this tool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelerTool

public ModelerTool(ModelerToolSupport toolSupport)
Default constructor.

Parameters:
toolSupport - Tool support object that owns this tool
Method Detail

appliesTo

public boolean appliesTo(java.lang.Object affectedObject)
Checks if the tool can be applied to the given figure.

Parameters:
affectedObject - Object the cursor is over
Returns:
true if the tool is suitable for the figure

getToolCursor

public java.awt.Cursor getToolCursor()
Gets the tool cursor.


setToolCursor

public void setToolCursor(java.awt.Cursor toolCursor)
Sets the tool cursor.


getToolHintMsg

public java.lang.String getToolHintMsg()
Gets the hint message for this tool.


setToolHintMsg

public void setToolHintMsg(java.lang.String toolHintMsg)
Sets the hint message for this tool.


getAffectedFigure

public CH.ifa.draw.framework.Figure getAffectedFigure()
Gets the affected figure.


getAffectedObject

public java.lang.Object getAffectedObject()
Gets the affected object.


setAffectedObject

public void setAffectedObject(java.lang.Object affectedObject)
Sets the affected object.


getEditor

public DrawingEditorPlugin getEditor()
Gets the editor that owns this tool.

Returns:
The editor

getView

public WorkspaceDrawingView getView()
Gets the view that owns this tool.

Returns:
The view

getDrawing

public CH.ifa.draw.framework.Drawing getDrawing()

getLastPoint

public java.awt.Point getLastPoint()
Returns the last known mouse coordinates. Used for break out box display.


getToolSupport

public ModelerToolSupport getToolSupport()
Gets the tool support object that owns this tool.


activate

public void activate()

deactivate

public void deactivate()

mouseMove

public void mouseMove(java.awt.event.MouseEvent e,
                      int x,
                      int y)

mouseDown

public void mouseDown(java.awt.event.MouseEvent e,
                      int x,
                      int y)

mouseUp

public void mouseUp(java.awt.event.MouseEvent e,
                    int x,
                    int y)

mouseDrag

public void mouseDrag(java.awt.event.MouseEvent e,
                      int x,
                      int y)

keyDown

public void keyDown(java.awt.event.KeyEvent e,
                    int key)

keyUp

public void keyUp(java.awt.event.KeyEvent e,
                  int key)


Copyright © 2011. All Rights Reserved.