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 booleangridEnabledstatic intgridMovementstatic intgridResizeLargeNodesstatic intgridResizeNormalNodesstatic intgridResizeSmallNodesFields 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 voidactivate()The method additionally registers a key used to delete graph elements.voiddeactivate()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 intgetGrid(double sz)static MegaMoveToolgetInstance()static Vector2dgetLastMovementPosition()StringgetPreferencesAlternativeName()return a custom preference category, that this class will reside in.StringgetToolName()static booleanhit(Point2D pnt1, Point2D pnt2)booleanisSessionListener()States whether this class wants to be registered as aSessionListener.voidmouseClicked(MouseEvent e)Empty method.voidmouseDragged(MouseEvent e)Invoked when the mouse button has been pressed and dragged inside the editor panel and handles what has to happen.voidmouseMoved(MouseEvent e)Temporarily marks the component under cursor.voidmousePressed(MouseEvent e)Invoked when the mouse button has been pressed.voidmouseReleased(MouseEvent e)Invoked when the mouse button has been released inside the editor panel and handles what has to happen.CoordinateAttributeprocessBendCreation(MouseEvent e, Component c)voidreset()Resets the tool to initial values.voidsessionChanged(Session s)Called when the active session is changed.voidupdatePreferences(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, wasScrollPaneMovementMethods inherited from class org.graffiti.plugin.tool.AbstractUndoableTool
isSelectionListener, setUndoSupportMethods inherited from class org.graffiti.plugin.tool.AbstractTool
activateTool, deactivateAll, displayAsMarked, displayAsMarked, displayAsMarked, displayAsMarked, getActiveTool, highlight, isActive, isViewListener, selectionChanged, selectionListChanged, setGraph, setPrefs, unDisplayAsMarked, unDisplayAsMarkedMethods inherited from class java.awt.event.MouseAdapter
mouseEntered, mouseExited, mouseWheelMovedMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:PreferencesInterfaceOn 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:
getDefaultParametersin interfacePreferencesInterface
-
updatePreferences
Description copied from interface:PreferencesInterfaceThis 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:
updatePreferencesin interfacePreferencesInterface
-
getPreferencesAlternativeName
Description copied from interface:PreferencesInterfacereturn 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:
getPreferencesAlternativeNamein interfacePreferencesInterface- Returns:
-
isSessionListener
public boolean isSessionListener()States whether this class wants to be registered as aSessionListener. This tool returns true.- Specified by:
isSessionListenerin interfaceTool- Overrides:
isSessionListenerin classAbstractUndoableTool- Returns:
- DOCUMENT ME!
-
sessionChanged
Description copied from class:MegaToolsCalled when the active session is changed.- Specified by:
sessionChangedin interfaceSessionListener- Overrides:
sessionChangedin 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:
activatein interfaceTool- Overrides:
activatein classAbstractTool- See Also:
AbstractTool.activate()
-
deactivate
public void deactivate()This method additionaly unregisters the key used for deleting graph elements.- Specified by:
deactivatein interfaceTool- Overrides:
deactivatein classAbstractTool- See Also:
AbstractTool.deactivate()
-
mouseClicked
Empty method. Invoked at mouse clicks. Does not do anything. All is done via mousePressed.- Specified by:
mouseClickedin interfaceMouseListener- Overrides:
mouseClickedin classMouseAdapter- Parameters:
e- the mouse event
-
mouseMoved
Description copied from class:MegaToolsTemporarily marks the component under cursor.- Specified by:
mouseMovedin interfaceMouseMotionListener- Overrides:
mouseMovedin 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:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin 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:
mousePressedin interfaceMouseListener- Overrides:
mousePressedin 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:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classMouseAdapter- Parameters:
e- the mouse event
-
reset
public void reset()Resets the tool to initial values. -
hit
-
getLastMovementPosition
-
getInstance
-
getToolName
- Specified by:
getToolNamein interfaceTool
-