org.graffiti.plugins.modes.advanced
Class AbstractEditingTool

java.lang.Object
  extended by java.awt.event.MouseAdapter
      extended by javax.swing.event.MouseInputAdapter
          extended by org.graffiti.plugins.modes.deprecated.AbstractTool
              extended by org.graffiti.plugins.modes.deprecated.AbstractUndoableTool
                  extended by org.graffiti.plugins.modes.advanced.AbstractEditingTool
All Implemented Interfaces:
MouseListener, MouseMotionListener, MouseWheelListener, EventListener, MouseInputListener, ViewListener, FunctionComponent, org.graffiti.plugins.modes.deprecated.Tool, SelectionListener, SessionListener, Undoable
Direct Known Subclasses:
CreateTool, LabelTool, NodeResizeTool, SelectionTool

Deprecated.

@Deprecated
public abstract class AbstractEditingTool
extends org.graffiti.plugins.modes.deprecated.AbstractUndoableTool
implements FunctionComponent, ViewListener

Abstract superclass for all advanced editing-tools.


Field Summary
static String BOTTOM
          Deprecated. Constant for alignment bottom
static String CENTER
          Deprecated. Constant for alignment center
static String CENTER_HORIZONTAL
          Deprecated. Constant for alignment center-horizontal
static String CENTER_VERTICAL
          Deprecated. Constant for alignment center-vertical
static int DEFAULT
          Deprecated. default mode
static String DOWN
          Deprecated. Constant for cursor movement down
static String LEFT
          Deprecated. Constant for alignment and cursor movement left
static String RIGHT
          Deprecated. Constant for alignment and cursor movement right
static String TOP
          Deprecated. Constant for alignment top
static String UP
          Deprecated. Constant for cursor movement up
 
Constructor Summary
AbstractEditingTool(ToolPlugin toolPlugin, PositionInfo positionInfo)
          Deprecated. Performs all construction-activities being unique to all editing tools.
 
Method Summary
 void activate()
          Deprecated. Classes that overwrite this method should call super.active first.
 void addAttributesToMap(CoordinateAttribute coordinateAttribute, Object coordinateAttributeCopyValue)
          Deprecated. Adds the parameters to the Map attributesMap (Copy)
 void addAttributesToMap(HashMapAttribute coordinateAttribute, Object coordinateAttributeCopyValue)
          Deprecated. Adds the parameters to the Map attributesMap
 void afterEvent(Point position)
          Deprecated. Is called after an event
 void beforeEvent(Point position)
          Deprecated. Is called before an event.
 void deactivate()
          Deprecated. Classes that overwrite this method should call super.deactive first.
 void fireSelectionChanged()
          Deprecated. Informs the registered listeners that the active session has changed.
 JComponent getActiveJComponent()
          Deprecated. Return the currently active JComponent, e.g.
 Map<Attribute,Object> getAttributesMap()
          Deprecated. Returns the attributeMap
 LinkedList<CoordinateAttribute> getBendCoords()
          Deprecated. Returns the coordinates of the stored bends.
 CoordinateAttribute getCooAttNode(Node node)
          Deprecated. Returns the CoordinateAttribute of a given node.
 List<DummySupportView> getDummySupportViews()
          Deprecated. Get a list of all views, which support dummies.
 FunctionAction getFunctionAction(String functionName)
          Deprecated. Returns the name of the function (Here null, because the abstract tool does not provide any functions
 Map<GraphElement,GraphElement> getGEMap()
          Deprecated. Returns the GEMap (The reference for the map between graph elements recreated after undo processing and original graph elements)
 Graph getGraph()
          Deprecated. Returns the graph this tool works on.
 int getMode()
          Deprecated. Returns the mode of the actual tool
 CoordinateAttribute[] getNodeCoords()
          Deprecated. Returns the node coordinates.
 DimensionAttribute[] getNodeDims()
          Deprecated. Returns the node dimensions.
 List<Node> getNodesUnderMouse(Point pos)
          Deprecated. Returns a list with the nodes under the given mouse position.
 PositionInfo getPositionInfo()
          Deprecated. Returns the position-info-object for this object.
 Preferences getPrefs()
          Deprecated. Returns the preferences of this tool.
 Selection getSelection()
          Deprecated. Returns the current selection.
 FunctionComponent getSubComponent(String name)
          Deprecated. Returns the sub component (here: null)
 ToolPlugin getToolPlugin()
          Deprecated. Returns the ToolPlugin which controls this tool.
 Edge getTopEdge(Point position)
          Deprecated. Returns the top-edge at the given position, null if it does not exist.
 EdgeComponent getTopEdgeComponent(Point position)
          Deprecated. Returns the EdgeComponent of the top-edge at the given position, null if it does not exist
 AbstractGraphElementComponent getTopGEComponent(Point position)
          Deprecated. Returns the top GraphElementComponent at the given position, null if it does not exist.
 GraphElement getTopGraphElement(Point position)
          Deprecated. Returns the top graph-element at the given position, null if it does not exist.
 Node getTopNode(Point position)
          Deprecated. Returns the top-node at the given position, null if it doesn't exist
 NodeComponent getTopNodeComponent(Point position)
          Deprecated. Returns the NodeComponent of the top-node at the given position, if it exists, null otherwise.
 UndoableEditSupport getUndoSupport()
          Deprecated. Returns the support object for doing undo properly.
 JComponent getViewComponent()
          Deprecated. Returns a reference to the JComponent currently used for painting (all bindings also work on it).
 Point getZoomedPosition(Point p)
          Deprecated.  
 boolean isInDefaultMode()
          Deprecated. Returns if the tool currently is in DEFAULT_MODE.
 boolean isInMultiCommandMode()
          Deprecated. Returns if the tool currently is in MULTI_COMMAND_MODE.
 boolean isMarked(GraphElement graphElement)
          Deprecated. Returns if the given GraphElement is marked.
 boolean isMarked(GraphElementComponent gec)
          Deprecated. Returns if the GraphElement displayed by the given GraphElementComponent is marked.
 boolean isViewListener()
          Deprecated. States whether this class wants to be registered as a ViewListener, i.e.
 void mark(GraphElement graphElement)
          Deprecated. Marks the given GraphElement.
 void mark(GraphElementComponent gec)
          Deprecated. Marks the GraphElement displayed by the GraphElementComponent.
 void mouseDragged(MouseEvent e)
          Deprecated. Stores the mouse position and the component under the mouse
 void mouseEntered(MouseEvent e)
          Deprecated. Activates key bindings of the view component.
 void mouseExited(MouseEvent e)
          Deprecated. Deactivates the key bindings.
 void mouseMoved(MouseEvent e)
          Deprecated. Stores mouse-position and the component under the mouse
 void nodeAdded(Node node)
          Deprecated. Performs operations that need to be done after a new node was added to the graph.
 void sessionChanged(Session s)
          Deprecated. Is called when session has changed.
 void setAttributesMap(Map<Attribute,Object> map)
          Deprecated. Sets the attributeMap to map
 void setBendCoords(LinkedList<CoordinateAttribute> bendCoords)
          Deprecated. Sets the bend coordinates.
 void setModeToDefault()
          Deprecated. Sets the mode to default
 void setNodeCoords(CoordinateAttribute[] nodeCoords)
          Deprecated. Sets the node coordinates.
 void setNodeDims(DimensionAttribute[] nodeDims)
          Deprecated. Sets the node dimensions.
 void switchToDefaultMode()
          Deprecated. Switches to DEFAULT_MODE.
 void switchToMultiCommandMode()
          Deprecated. Switches to MULTI_COMMAND_MODE.
 void unmark(GraphElement graphElement)
          Deprecated. Unmarks the given GraphElement.
 void unmark(GraphElementComponent gec)
          Deprecated. Unmarks the GraphElement displayed by the given GraphElementComponent.
 void unmarkAll()
          Deprecated. Unmarks all (Graph)Elements being marked.
 void viewChanged(View newView)
          Deprecated. This method is called when the view changes.
 
Methods inherited from class org.graffiti.plugins.modes.deprecated.AbstractUndoableTool
isSelectionListener, isSessionListener, sessionDataChanged, setUndoSupport
 
Methods inherited from class org.graffiti.plugins.modes.deprecated.AbstractTool
displayAsMarked, displayAsMarked, displayAsMarked, displayAsMarked, highlight, isActive, selectionChanged, selectionListChanged, setGraph, setPrefs, unDisplayAsMarked, unDisplayAsMarked, unDisplayAsMarked, unDisplayAsMarked
 
Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mousePressed, mouseReleased, 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
mouseClicked, mousePressed, mouseReleased
 

Field Detail

DEFAULT

public static final int DEFAULT
Deprecated. 
default mode

See Also:
Constant Field Values

TOP

public static final String TOP
Deprecated. 
Constant for alignment top

See Also:
Constant Field Values

CENTER_HORIZONTAL

public static final String CENTER_HORIZONTAL
Deprecated. 
Constant for alignment center-horizontal

See Also:
Constant Field Values

BOTTOM

public static final String BOTTOM
Deprecated. 
Constant for alignment bottom

See Also:
Constant Field Values

RIGHT

public static final String RIGHT
Deprecated. 
Constant for alignment and cursor movement right

See Also:
Constant Field Values

CENTER_VERTICAL

public static final String CENTER_VERTICAL
Deprecated. 
Constant for alignment center-vertical

See Also:
Constant Field Values

LEFT

public static final String LEFT
Deprecated. 
Constant for alignment and cursor movement left

See Also:
Constant Field Values

CENTER

public static final String CENTER
Deprecated. 
Constant for alignment center

See Also:
Constant Field Values

UP

public static final String UP
Deprecated. 
Constant for cursor movement up

See Also:
Constant Field Values

DOWN

public static final String DOWN
Deprecated. 
Constant for cursor movement down

See Also:
Constant Field Values
Constructor Detail

AbstractEditingTool

public AbstractEditingTool(ToolPlugin toolPlugin,
                           PositionInfo positionInfo)
Deprecated. 
Performs all construction-activities being unique to all editing tools.

Parameters:
toolPlugin - ToolPlugin which handles this tool
positionInfo - Information about the mouse position
Method Detail

setAttributesMap

public void setAttributesMap(Map<Attribute,Object> map)
Deprecated. 
Sets the attributeMap to map

Parameters:
map - the given Map

getAttributesMap

public Map<Attribute,Object> getAttributesMap()
Deprecated. 
Returns the attributeMap

Returns:
attributeMap

getCooAttNode

public CoordinateAttribute getCooAttNode(Node node)
Deprecated. 
Returns the CoordinateAttribute of a given node.

Parameters:
node - The given node.
Returns:
the CoordinateAttribute of a given node.

getDummySupportViews

public List<DummySupportView> getDummySupportViews()
Deprecated. 
Get a list of all views, which support dummies.

Returns:
List of all views supporting dummies.

getZoomedPosition

public Point getZoomedPosition(Point p)
Deprecated. 

getFunctionAction

public FunctionAction getFunctionAction(String functionName)
Deprecated. 
Returns the name of the function (Here null, because the abstract tool does not provide any functions

Specified by:
getFunctionAction in interface FunctionComponent
Parameters:
functionName - The given function name
Returns:
The action of the function

getGEMap

public Map<GraphElement,GraphElement> getGEMap()
Deprecated. 
Returns the GEMap (The reference for the map between graph elements recreated after undo processing and original graph elements)

Returns:
The GEMap

getGraph

public Graph getGraph()
Deprecated. 
Returns the graph this tool works on.

Returns:
Returns the graph this tool works on.

isInDefaultMode

public boolean isInDefaultMode()
Deprecated. 
Returns if the tool currently is in DEFAULT_MODE.

Returns:
if the tool currently is in DEFAULT_MODE.

isInMultiCommandMode

public boolean isInMultiCommandMode()
Deprecated. 
Returns if the tool currently is in MULTI_COMMAND_MODE.

Returns:
if the tool currently is in MULTI_COMMAND_MODE

isMarked

public boolean isMarked(GraphElementComponent gec)
Deprecated. 
Returns if the GraphElement displayed by the given GraphElementComponent is marked.

Parameters:
gec - any GraphElementComponent
Returns:
if the GraphElement displayed by the given GraphElementComponent is marked.

isMarked

public boolean isMarked(GraphElement graphElement)
Deprecated. 
Returns if the given GraphElement is marked.

Parameters:
graphElement - any GraphElement
Returns:
if the given GraphElement is marked

getMode

public int getMode()
Deprecated. 
Returns the mode of the actual tool

Returns:
the mode of the actual tool

setModeToDefault

public void setModeToDefault()
Deprecated. 
Sets the mode to default


getNodesUnderMouse

public List<Node> getNodesUnderMouse(Point pos)
Deprecated. 
Returns a list with the nodes under the given mouse position.

Parameters:
pos - The actual mouse position
Returns:
A list with the nodes under the given mouse position.

getPositionInfo

public PositionInfo getPositionInfo()
Deprecated. 
Returns the position-info-object for this object.

Specified by:
getPositionInfo in interface FunctionComponent
Returns:
the position-info-object for this object

getPrefs

public Preferences getPrefs()
Deprecated. 
Returns the preferences of this tool.

Returns:
the preferences of this tool.

getSelection

public Selection getSelection()
Deprecated. 
Returns the current selection.

Returns:
the current selection.

getSubComponent

public FunctionComponent getSubComponent(String name)
Deprecated. 
Returns the sub component (here: null)

Specified by:
getSubComponent in interface FunctionComponent
Parameters:
name - The given name of the sub component
Returns:
FunctionComponent

getToolPlugin

public ToolPlugin getToolPlugin()
Deprecated. 
Returns the ToolPlugin which controls this tool.

Returns:
the ToolPlugin which controls this tool

getTopEdge

public Edge getTopEdge(Point position)
Deprecated. 
Returns the top-edge at the given position, null if it does not exist.

Parameters:
position - any position
Returns:
the top-edge at the given position, null if it does not exist

getTopEdgeComponent

public EdgeComponent getTopEdgeComponent(Point position)
Deprecated. 
Returns the EdgeComponent of the top-edge at the given position, null if it does not exist

Parameters:
position - any position
Returns:
the EdgeComponent of the top-edge at the given position, null if it does not exist

getTopGEComponent

public AbstractGraphElementComponent getTopGEComponent(Point position)
Deprecated. 
Returns the top GraphElementComponent at the given position, null if it does not exist. NodeComponents are preferred upon EdgeComponents.

Parameters:
position - any position
Returns:
the top GEC at the given position, null if it doesn't exist

getTopGraphElement

public GraphElement getTopGraphElement(Point position)
Deprecated. 
Returns the top graph-element at the given position, null if it does not exist. Preferres nodes upon edges.

Parameters:
position - any position
Returns:
the top graph-element at the given position, null if it does not exist.

getTopNode

public Node getTopNode(Point position)
Deprecated. 
Returns the top-node at the given position, null if it doesn't exist

Parameters:
position - any position
Returns:
the top-node at the given position, null if it doesn't exist

getTopNodeComponent

public NodeComponent getTopNodeComponent(Point position)
Deprecated. 
Returns the NodeComponent of the top-node at the given position, if it exists, null otherwise.

Parameters:
position - any position
Returns:
NodeComponent of the top-node at the given position, null if it does not exist

getUndoSupport

public UndoableEditSupport getUndoSupport()
Deprecated. 
Returns the support object for doing undo properly.

Returns:
The support for undo.

getViewComponent

public JComponent getViewComponent()
Deprecated. 
Returns a reference to the JComponent currently used for painting (all bindings also work on it).

Returns:
a reference to the JComponent currently used for painting

activate

public void activate()
Deprecated. 
Classes that overwrite this method should call super.active first.

Specified by:
activate in interface org.graffiti.plugins.modes.deprecated.Tool
Overrides:
activate in class org.graffiti.plugins.modes.deprecated.AbstractTool
See Also:
Tool.activate()

addAttributesToMap

public void addAttributesToMap(HashMapAttribute coordinateAttribute,
                               Object coordinateAttributeCopyValue)
Deprecated. 
Adds the parameters to the Map attributesMap

Parameters:
coordinateAttribute - the given CoordinateAttribute
coordinateAttributeCopyValue - Value of the copy of the CoordinateAttribute

addAttributesToMap

public void addAttributesToMap(CoordinateAttribute coordinateAttribute,
                               Object coordinateAttributeCopyValue)
Deprecated. 
Adds the parameters to the Map attributesMap (Copy)

Parameters:
coordinateAttribute - the given CoordinateAttribute
coordinateAttributeCopyValue - Value of the copy of the CoordinateAttribute

afterEvent

public void afterEvent(Point position)
Deprecated. 
Is called after an event

Specified by:
afterEvent in interface FunctionComponent
Parameters:
position - The given mouse position

beforeEvent

public void beforeEvent(Point position)
Deprecated. 
Is called before an event.

Specified by:
beforeEvent in interface FunctionComponent
Parameters:
position - The given mouse position

deactivate

public void deactivate()
Deprecated. 
Classes that overwrite this method should call super.deactive first.

Specified by:
deactivate in interface org.graffiti.plugins.modes.deprecated.Tool
Overrides:
deactivate in class org.graffiti.plugins.modes.deprecated.AbstractTool
See Also:
Tool.deactivate()

fireSelectionChanged

public void fireSelectionChanged()
Deprecated. 
Informs the registered listeners that the active session has changed.


mark

public void mark(GraphElementComponent gec)
Deprecated. 
Marks the GraphElement displayed by the GraphElementComponent.

Parameters:
gec - any GraphElementComponent

mark

public void mark(GraphElement graphElement)
Deprecated. 
Marks the given GraphElement.

Parameters:
graphElement - any GraphElement

mouseDragged

public void mouseDragged(MouseEvent e)
Deprecated. 
Stores the mouse position and the component under the mouse

Specified by:
mouseDragged in interface MouseMotionListener
Overrides:
mouseDragged in class MouseAdapter
Parameters:
e - The given MouseEvent

mouseEntered

public void mouseEntered(MouseEvent e)
Deprecated. 
Activates key bindings of the view component.

Specified by:
mouseEntered in interface MouseListener
Overrides:
mouseEntered in class MouseAdapter
Parameters:
e - The given MouseEvent.

mouseExited

public void mouseExited(MouseEvent e)
Deprecated. 
Deactivates the key bindings.

Specified by:
mouseExited in interface MouseListener
Overrides:
mouseExited in class MouseAdapter
Parameters:
e - The given MouseEvent

mouseMoved

public void mouseMoved(MouseEvent e)
Deprecated. 
Stores mouse-position and the component under the mouse

Specified by:
mouseMoved in interface MouseMotionListener
Overrides:
mouseMoved in class MouseAdapter
Parameters:
e - The given MouseEvent

nodeAdded

public void nodeAdded(Node node)
Deprecated. 
Performs operations that need to be done after a new node was added to the graph. Must always be called after adding a new node!!!

Parameters:
node - the newly added Node

sessionChanged

public void sessionChanged(Session s)
Deprecated. 
Is called when session has changed.

Specified by:
sessionChanged in interface SessionListener
Overrides:
sessionChanged in class org.graffiti.plugins.modes.deprecated.AbstractUndoableTool
Parameters:
s - The given session.
See Also:
SessionListener.sessionChanged(Session)

switchToDefaultMode

public void switchToDefaultMode()
Deprecated. 
Switches to DEFAULT_MODE.


switchToMultiCommandMode

public void switchToMultiCommandMode()
Deprecated. 
Switches to MULTI_COMMAND_MODE.


unmark

public void unmark(GraphElementComponent gec)
Deprecated. 
Unmarks the GraphElement displayed by the given GraphElementComponent.

Parameters:
gec - any GraphElementComponent

unmark

public void unmark(GraphElement graphElement)
Deprecated. 
Unmarks the given GraphElement.

Parameters:
graphElement - any GraphElement

unmarkAll

public void unmarkAll()
Deprecated. 
Unmarks all (Graph)Elements being marked.


getActiveJComponent

public JComponent getActiveJComponent()
Deprecated. 
Return the currently active JComponent, e.g. to set the cursor to use.

Returns:
Returns the active JComponent.

isViewListener

public boolean isViewListener()
Deprecated. 
Description copied from class: org.graffiti.plugins.modes.deprecated.AbstractTool
States whether this class wants to be registered as a ViewListener, i.e. if it wants to get informed when another view in the same session becomes active. This method is not called when another session is activated. Implement SessionListener if you are interested in session changed events.

Specified by:
isViewListener in interface org.graffiti.plugins.modes.deprecated.Tool
Overrides:
isViewListener in class org.graffiti.plugins.modes.deprecated.AbstractTool
Returns:
DOCUMENT ME!

viewChanged

public void viewChanged(View newView)
Deprecated. 
This method is called when the view changes. This method is not called when another session is activated. Implement SessionListener if you are interested in session changed events.

Specified by:
viewChanged in interface ViewListener
Parameters:
newView - the new View.

getBendCoords

public LinkedList<CoordinateAttribute> getBendCoords()
Deprecated. 
Returns the coordinates of the stored bends.

Returns:
the coordinates of the stored bends.

setBendCoords

public void setBendCoords(LinkedList<CoordinateAttribute> bendCoords)
Deprecated. 
Sets the bend coordinates.

Parameters:
bendCoords - The bend coordinates to set.

getNodeCoords

public CoordinateAttribute[] getNodeCoords()
Deprecated. 
Returns the node coordinates.

Returns:
the node coordinates.

setNodeCoords

public void setNodeCoords(CoordinateAttribute[] nodeCoords)
Deprecated. 
Sets the node coordinates.

Parameters:
nodeCoords - the node coordinates.

getNodeDims

public DimensionAttribute[] getNodeDims()
Deprecated. 
Returns the node dimensions.

Returns:
the node dimensions.

setNodeDims

public void setNodeDims(DimensionAttribute[] nodeDims)
Deprecated. 
Sets the node dimensions.

Parameters:
nodeDims - the node dimensions to set.


Generated at 2012-05-30 11:01:25 PM CEST