Class MegaMoveTool
java.lang.Object
java.awt.event.MouseAdapter
javax.swing.event.MouseInputAdapter
org.graffiti.plugin.tool.AbstractTool
org.graffiti.plugin.tool.AbstractUndoableTool
org.graffiti.plugins.modes.defaults.MegaTools
org.graffiti.plugins.modes.defaults.MegaMoveTool
- All Implemented Interfaces:
MouseListener
,MouseMotionListener
,MouseWheelListener
,EventListener
,MouseInputListener
,PreferencesInterface
,Tool
,SelectionListener
,SessionListener
,Undoable
- Direct Known Subclasses:
IPK_MegaMoveTool
public class MegaMoveTool extends MegaTools implements PreferencesInterface
A tool for creating and editing a graph.
- Version:
- 2.6.5
- Author:
- Holleis, Klukas
- Recent revisions:
- 1.67.6.2
-
Field Summary
Fields Modifier and Type Field Description static boolean
gridEnabled
static int
gridMovement
static int
gridResizeLargeNodes
static int
gridResizeNormalNodes
static int
gridResizeSmallNodes
Fields inherited from class org.graffiti.plugins.modes.defaults.MegaTools
MouseWheelZoomEnabled
-
Constructor Summary
Constructors Constructor Description MegaMoveTool()
Constructor for this tool. -
Method Summary
Modifier and Type Method Description void
activate()
The method additionally registers a key used to delete graph elements.void
deactivate()
This method additionaly unregisters the key used for deleting graph elements.List<Parameter>
getDefaultParameters()
On first start or on reset there will be no preferences available.static int
getGrid(double sz)
static MegaMoveTool
getInstance()
static Vector2d
getLastMovementPosition()
String
getPreferencesAlternativeName()
return a custom preference category, that this class will reside in.String
getToolName()
static boolean
hit(Point2D pnt1, Point2D pnt2)
boolean
isSessionListener()
States whether this class wants to be registered as aSessionListener
.void
mouseClicked(MouseEvent e)
Empty method.void
mouseDragged(MouseEvent e)
Invoked when the mouse button has been pressed and dragged inside the editor panel and handles what has to happen.void
mouseMoved(MouseEvent e)
Temporarily marks the component under cursor.void
mousePressed(MouseEvent e)
Invoked when the mouse button has been pressed.void
mouseReleased(MouseEvent e)
Invoked when the mouse button has been released inside the editor panel and handles what has to happen.CoordinateAttribute
processBendCreation(MouseEvent e, Component c)
void
reset()
Resets the tool to initial values.void
sessionChanged(Session s)
Called when the active session is changed.void
updatePreferences(Preferences preferences)
This method will be called, when preferences for this class have changed and the implementing class gets the chance of setting class (static) variables having the values of the parameters.Methods inherited from class org.graffiti.plugins.modes.defaults.MegaTools
fireSelectionChanged, getFoundComponent, getLastMouseE, getLastMouseSrc, postProcessImageCreation, preProcessImageCreation, sessionDataChanged, setFoundComponent, unmarkAll, wasScrollPaneMovement
Methods inherited from class org.graffiti.plugin.tool.AbstractUndoableTool
isSelectionListener, setUndoSupport
Methods inherited from class org.graffiti.plugin.tool.AbstractTool
activateTool, deactivateAll, displayAsMarked, displayAsMarked, displayAsMarked, displayAsMarked, getActiveTool, highlight, isActive, isViewListener, selectionChanged, selectionListChanged, setGraph, setPrefs, unDisplayAsMarked, unDisplayAsMarked
Methods inherited from class java.awt.event.MouseAdapter
mouseEntered, mouseExited, mouseWheelMoved
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.awt.event.MouseListener
mouseEntered, mouseExited
-
Field Details
-
gridMovement
public static int gridMovement -
gridResizeSmallNodes
public static int gridResizeSmallNodes -
gridResizeNormalNodes
public static int gridResizeNormalNodes -
gridResizeLargeNodes
public static int gridResizeLargeNodes -
gridEnabled
public static boolean gridEnabled
-
-
Constructor Details
-
MegaMoveTool
public MegaMoveTool()Constructor for this tool. Registers a key used to delete graph elements.
-
-
Method Details
-
getDefaultParameters
Description copied from interface:PreferencesInterface
On first start or on reset there will be no preferences available. The PreferenceManager will read this list containing the set of settings, that the implementing class thinks can be configured provide default values. All Parameters in this list will also appear in the PreferenceDialog. Entities providing preferences should add parameters to this array.- Specified by:
getDefaultParameters
in interfacePreferencesInterface
-
updatePreferences
Description copied from interface:PreferencesInterface
This method will be called, when preferences for this class have changed and the implementing class gets the chance of setting class (static) variables having the values of the parameters. Setting static class variables will help increase speed, when querying the parameters. Direct variable access VS querying the Preferences Object for this class- Specified by:
updatePreferences
in interfacePreferencesInterface
-
getPreferencesAlternativeName
Description copied from interface:PreferencesInterface
return a custom preference category, that this class will reside in. If null is returned, this class will be put into a standard category dependent on its Super class- Specified by:
getPreferencesAlternativeName
in interfacePreferencesInterface
- Returns:
-
isSessionListener
public boolean isSessionListener()States whether this class wants to be registered as aSessionListener
. This tool returns true.- Specified by:
isSessionListener
in interfaceTool
- Overrides:
isSessionListener
in classAbstractUndoableTool
- Returns:
- DOCUMENT ME!
-
sessionChanged
Description copied from class:MegaTools
Called when the active session is changed.- Specified by:
sessionChanged
in interfaceSessionListener
- Overrides:
sessionChanged
in classMegaTools
- Parameters:
s
- DOCUMENT ME!- See Also:
SessionListener.sessionChanged(Session)
-
activate
public void activate()The method additionally registers a key used to delete graph elements.- Specified by:
activate
in interfaceTool
- Overrides:
activate
in classAbstractTool
- See Also:
AbstractTool.activate()
-
deactivate
public void deactivate()This method additionaly unregisters the key used for deleting graph elements.- Specified by:
deactivate
in interfaceTool
- Overrides:
deactivate
in classAbstractTool
- See Also:
AbstractTool.deactivate()
-
mouseClicked
Empty method. Invoked at mouse clicks. Does not do anything. All is done via mousePressed.- Specified by:
mouseClicked
in interfaceMouseListener
- Overrides:
mouseClicked
in classMouseAdapter
- Parameters:
e
- the mouse event
-
mouseMoved
Description copied from class:MegaTools
Temporarily marks the component under cursor.- Specified by:
mouseMoved
in interfaceMouseMotionListener
- Overrides:
mouseMoved
in classMegaTools
- Parameters:
e
- the mouse event
-
mouseDragged
Invoked when the mouse button has been pressed and dragged inside the editor panel and handles what has to happen.- Specified by:
mouseDragged
in interfaceMouseMotionListener
- Overrides:
mouseDragged
in classMouseAdapter
- Parameters:
e
- the mouse event
-
processBendCreation
-
getGrid
public static int getGrid(double sz) -
mousePressed
Invoked when the mouse button has been pressed.- Specified by:
mousePressed
in interfaceMouseListener
- Overrides:
mousePressed
in classMouseAdapter
- Parameters:
e
- the mouse event
-
mouseReleased
Invoked when the mouse button has been released inside the editor panel and handles what has to happen.- Specified by:
mouseReleased
in interfaceMouseListener
- Overrides:
mouseReleased
in classMouseAdapter
- Parameters:
e
- the mouse event
-
reset
public void reset()Resets the tool to initial values. -
hit
-
getLastMovementPosition
-
getInstance
-
getToolName
- Specified by:
getToolName
in interfaceTool
-