y.view
Class Graph2D

java.lang.Object
  |
  +--y.base.Graph
        |
        +--y.layout.LayoutGraph
              |
              +--y.view.Graph2D
All Implemented Interfaces:
GraphInterface, GraphLayout

public class Graph2D
extends LayoutGraph

This class represents a graph with additional 2D support. It can be displayed within a Graph2DView. The visual representation of nodes and edges are encapsulated in so called realizer objects. A node in this graph has a NodeRealizer object associated with it and an edge in this graph has a EdgeRealizer object associated with it.

All geometric or visual changes that are performed to this graph result in an attribute or type change of an associated realizer. If nodes or edges get newly created in this graph then a default node or edge realizer will be automatically associated with these elements. To change the default appearance of edges or nodes one can assign different default realizers to the graph by using the methods Graph2D.setDefaultEdgeRealizer(EdgeRealizer) and Graph2D.setDefaultNodeRealizer(NodeRealizer).


Nested Class Summary
static interface Graph2D.BackupRealizersHandler
          Implementations of this interface are responsible for backing up the node and edge realizer of a Graph2D.
 
Field Summary
 
Fields inherited from class y.base.Graph
AFTER, BEFORE, listeners
 
Constructor Summary
Graph2D()
          Constructs an empty Graph2D.
Graph2D(Graph2D graph)
          Copy constructor of Graph2D.
Graph2D(Graph2D graph, YCursor nodeSubset)
          Creates a copy of the given subgraph.
 
Method Summary
 void addDrawable(Drawable d)
          Adds a drawable to this graph.
 void addGraph2DListener(Graph2DListener listener)
          Adds the given Graph2DListener to this graph.
 void addGraph2DSelectionListener(Graph2DSelectionListener listener)
          Adds the given Graph2DSelectionListener to this graph.
 void backupRealizers()
          A method that supports undoability of the changes performed on node and edge realizers.
 void backupRealizers(EdgeCursor ec)
          A method that supports undoability of the changes performed on the edge realizers associated with the given edges.
 void backupRealizers(NodeCursor nc)
          A method that supports undoability of the changes performed on the node realizers associated with the given nodes.
 BendCursor bends()
          Returns a bend cursor over all bends in this graph.
 Graph createCopy()
          Creates a copy of this graph.
 Edge createEdge(Node v, Edge e1, Node w, Edge e2, int d1, int d2)
          Creates a new edge in this graph.
 Edge createEdge(Node v, Edge e1, Node w, Edge e2, int d1, int d2, EdgeRealizer r)
          Creates a new edge with given realizer in this graph.
 Edge createEdge(Node v, Node w)
          Creates a new edge from node v to node w.
 Edge createEdge(Node v, Node w, EdgeRealizer r)
          Creates a new edge in this graph.
 Graph createGraph()
          Creates an empty view of the same type as this graph.
 Node createNode()
          Creates a new node.
 Node createNode(double x, double y)
          Creates a new node with center location (x,y).
 Node createNode(double x, double y, double w, double h, String label)
          Creates a new node with center location (x,y), dimension (w,h) and given label text.
 Node createNode(double x, double y, String label)
          Creates a new node with center location (x,y) and given label text.
 Node createNode(NodeRealizer r)
          Creates a new node in this graph.
 YCursor drawables()
          Returns a cursor iterating over all Drawables known to this graph.
protected  void fireGraph2DEvent(Object subject, String name, Object oldValue, Object newValue)
          Fires a Graph2DEvent
protected  void fireGraph2DSelectionEvent(Object subject)
          Fires a GraphSelectionEvent for the given subject
 void fitGraph2DView()
          Invokes fitContent() on the current view, if the current view is of type Graph2DView.
 Graph2D.BackupRealizersHandler getBackupRealizersHandler()
          Returns the handler for backupRealizer method calls.
 Rectangle getBoundingBox()
          Returns the bounding box of this graph.
 Rectangle getBoundingBox(byte layer)
          Returns the bounding box of all graph objects residing in the specified layer.
 double getCenterX(Node v)
          Returns the center x-coord of the given node.
 double getCenterY(Node v)
          Returns the center y-coord of the given node.
 View getCurrentView()
          Returns the current view.
 EdgeRealizer getDefaultEdgeRealizer()
          Returns the default edge realizer that will be bound to newly created edges.
 NodeRealizer getDefaultNodeRealizer()
          Returns the default node realizer that will be bound to newly created nodes.
 Edge getFeature(EdgeLabelLayout labelLayout)
          Returns the node which is described by a given label layout.
 Node getFeature(NodeLabelLayout labelLayout)
          Returns the node which is described by a given label layout.
 Iterator getGraph2DListeners()
          Returns an iterator that grants access to all registered Graph2DListeners
 Iterator getGraph2DSelectionListeners()
          Returns an iterator that grants access to all registered Graph2DSelectionListeners
 double getHeight(Node v)
          Returns the height of the given node.
 HitInfo getHitInfo(double x, double y)
          Returns hit info containing only the first hit object that was found.
 HitInfo getHitInfo(double x, double y, boolean firstHitOnly)
          Returns objects that are hit on position (x,y).
 EdgeLabelLayout[] getLabelLayout(Edge edge)
          Returns EdgeLabelLayout objects which describe the layouts of the labels that belong to the given edge.
 NodeLabelLayout[] getLabelLayout(Node node)
          Returns NodeLabelLayout objects which describe the layouts of the labels that belong to the given node.
 String getLabelText(Edge e)
          Returns the label text for the given edge.
 String getLabelText(Node v)
          Returns the label text for the given node.
 EdgeLayout getLayout(Edge edge)
          Returns the layout information for an edge in the drawing.
 NodeLayout getLayout(Node node)
          Returns the layout information for a node in the drawing.
 EdgeRealizer getRealizer(Edge e)
          Returns the EdgeRealizer bound to the given edge.
 NodeRealizer getRealizer(Node v)
          Returns the NodeRealizer bound to the given node.
 URL getURL()
          Returns the URL associatioed with this graph.
 YCursor getViews()
          Returns a cursor iterating through all registered views.
 double getWidth(Node v)
          Returns the width of the given node.
 double getX(Node v)
          Returns the upper left x-coord of the given node.
 double getY(Node v)
          Returns the upper left y-coord of the given node.
 boolean isSelected(Edge e)
          Returns the selection state of the given edge.
 boolean isSelected(Node v)
          Returns the selection state of the given node.
 boolean isSelectionEmpty()
          Returns true iff neither edge nor node nor bend in this graph is selected.
 boolean isSelectionSingleton()
          Returns true if and only if exactly one object is selected.
 void moveBends(BendCursor bc, double dx, double dy)
          Moves the given bends by (dx,dy).
 void moveNodes(NodeCursor nc, double dx, double dy)
          Moves the given nodes by (dx,dy).
 void registerView(View v)
          Adds this view to the set of views that display this graph.
 void removeDrawable(Drawable d)
          Removes the given drawable from this graph.
 void removeGraph2DListener(Graph2DListener listener)
          Removes the given Graph2DListener from this graph.
 void removeGraph2DSelectionListener(Graph2DSelectionListener listener)
          Removes the given Graph2DSelectionListener from this graph.
 void removeSelection()
          Removes all selected objects from this graph.
 void removeView(View v)
          Removes this view from the set of views that display this graph.
 void selectAllNodesAndBends(boolean s)
          Sets the selection state for all nodes and bends.
 void selectBoxContent(double x, double y, double width, double height)
          Selects the graph objects in a rectangle defined by the given arguments.
 void selectBoxContent(Rectangle r)
          Selects the graph objects in given rectangle.
 BendCursor selectedBends()
          Returns a bend cursor for all momentarily selected bends in this graph.
 EdgeCursor selectedEdges()
          Returns an edge cursor for all momentarily selected edges in this graph.
 NodeCursor selectedNodes()
          Returns a node cursor for all momentarily selected nodes in this graph.
 void setBackupRealizersHandler(Graph2D.BackupRealizersHandler brh)
          Sets the delegate class that is responsible for acting upon calls to the methods Graph2D.backupRealizers(EdgeCursor) and Graph2D.backupRealizers(NodeCursor).
 void setBendsSelected(BendCursor bc, boolean s)
          Sets the selection state for the given bends.
 void setBendsSelected(Edge e, boolean s)
          Sets the selection state for the bends given by the edge.
 void setBendsSelected(EdgeCursor ec, boolean s)
          Sets the selection state for the bends given by the edges.
 void setCenter(Node v, double x, double y)
          Sets the center coords of the given node.
 void setCurrentView(View view)
          Sets the current view.
 void setDefaultEdgeRealizer(EdgeRealizer r)
          Sets the default edge realizer.
 void setDefaultNodeRealizer(NodeRealizer r)
          Sets the default node realizer.
 void setLabelText(Edge e, String text)
          Sets the given label text for the given edge.
 void setLabelText(Node v, String text)
          Sets the given label text for the given node.
 void setLayerAll(byte layer)
          Sets the layer for all bound node and edge realizers of this graph.
 Rectangle setLocation(double x, double y)
          Moves the entire graph to some location.
 void setLocation(Node v, double x, double y)
          Sets the upper left coords of the given node.
 void setRealizer(Edge e, EdgeRealizer r)
          Sets the EdgeRealizer for the given edge.
 void setRealizer(Node v, NodeRealizer r)
          Sets the NodeRealizer for the given node.
 void setSelected(Edge e, boolean s)
          Sets the selected state for the given edge.
 void setSelected(EdgeCursor edges, boolean s)
          Sets the selection state for the given edges.
 void setSelected(Node v, boolean s)
          Sets the selection state for the given node.
 void setSelected(NodeCursor nodes, boolean s)
          Sets the selection state for the given nodes.
 void setSize(Node v, double w, double h)
          Sets the size of the given node.
 void setURL(URL url)
          Sets the URL of this Graph2D.
 void unselectAll()
          Unselects all nodes, edges and bends in this graph.
 void unselectBends()
          Unselects all bends in this graph.
 void unselectEdges()
          Unselects all edges in this graph.
 void unselectNodes()
          Unselects all nodes in this graph.
 void updateViews()
          Calls updateView on all registered views.
 
Methods inherited from class y.layout.LayoutGraph
getCenter, getEdgeLabelLayout, getEdgeLayout, getEdgeList, getLocation, getNodeLabelLayout, getNodeLayout, getPath, getPathList, getPointList, getPoints, getRectangle, getSize, getSourcePointAbs, getSourcePointRel, getTargetPointAbs, getTargetPointRel, moveBy, setCenter, setEndPointsAbs, setLocation, setPath, setPath, setPoints, setPoints, setSize, setSourcePointAbs, setSourcePointRel, setTargetPointAbs, setTargetPointRel
 
Methods inherited from class y.base.Graph
addDataProvider, addGraphListener, changeEdge, changeEdge, changeEdge, clear, contains, contains, containsEdge, createEdgeMap, createNodeMap, disposeEdgeMap, disposeNodeMap, E, edgeCount, edgeObjects, edges, fireGraphEvent, firePostEvent, firePostEvent, firePreEvent, firePreEvent, firstEdge, firstNode, firstOutEdge, getDataProvider, getDataProviderKeys, getEdgeArray, getGraphListeners, getNodeArray, getRegisteredEdgeMaps, getRegisteredNodeMaps, getSource, getTarget, hide, hide, isEmpty, lastEdge, lastNode, moveSubGraph, moveToFirst, moveToFirst, moveToLast, moveToLast, N, nodeCount, nodeObjects, nodes, printNodeSlotSize, reInsertEdge, reInsertNode, removeDataProvider, removeEdge, removeGraphListener, removeNode, reverseEdge, sortEdges, toString, unhide, unhide
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Graph2D

public Graph2D()
Constructs an empty Graph2D.


Graph2D

public Graph2D(Graph2D graph)
Copy constructor of Graph2D.


Graph2D

public Graph2D(Graph2D graph,
               YCursor nodeSubset)
Creates a copy of the given subgraph.

Method Detail

createCopy

public Graph createCopy()
Creates a copy of this graph. The returned graph can savely be cast to Graph2D.

Overrides:
createCopy in class Graph
Returns:
a copy of this graph.

createGraph

public Graph createGraph()
Creates an empty view of the same type as this graph. Thus the returned graph can savely be cast to Graph2D.

Overrides:
createGraph in class Graph
Returns:
an empty Graph2D.

createEdge

public Edge createEdge(Node v,
                       Node w)
Creates a new edge from node v to node w. The default edge realizer will be bound to the newly created edge.

Overrides:
createEdge in class Graph
Parameters:
v - the source node of the edge
w - the target node of the edge
Returns:
the newly created edge.

createEdge

public Edge createEdge(Node v,
                       Node w,
                       EdgeRealizer r)
Creates a new edge in this graph. The new edge has source node v and target node w. EdgeRealizer realizer will be bound to the created edge.

Parameters:
v - the source node of the edge
w - the target node of the edge
r - an EdgeRealizer associated with the create edge.
Returns:
newly created Edge object

createEdge

public Edge createEdge(Node v,
                       Edge e1,
                       Node w,
                       Edge e2,
                       int d1,
                       int d2)
Creates a new edge in this graph. The new edge e has source node v and target node w. Edge e is inserted in such a way that an iteration over the edges at node v returns e after (before) e1 if d1 == AFTER (d1 == BEFORE) and an iteration over the edges at w return e after (before) e2 if d2 == AFTER (d2 == BEFORE).

Precondition: Edge e1 must have source node v and edge e2 must have target node w

Overrides:
createEdge in class Graph
Parameters:
v - the source node of the edge
e1 - an edge with source node v
w - the target node of the edge
e2 - an edge with target node w
d1 - one of the object insertion specifiers BEFORE or AFTER
d2 - one of the object insertion specifiers BEFORE or AFTER

createEdge

public Edge createEdge(Node v,
                       Edge e1,
                       Node w,
                       Edge e2,
                       int d1,
                       int d2,
                       EdgeRealizer r)
Creates a new edge with given realizer in this graph. All other edge creation methods of this graph will eventually call this creation method.


createNode

public Node createNode()
Creates a new node. The default node realizer will be bound to the newly created node.

Overrides:
createNode in class Graph
Returns:
the newly created node.

createNode

public Node createNode(double x,
                       double y)
Creates a new node with center location (x,y). The default node realizer defines all other properties of this node.

Returns:
the newly created node.

createNode

public Node createNode(double x,
                       double y,
                       String label)
Creates a new node with center location (x,y) and given label text. The default node realizer defines all other properties of this node.

Returns:
the newly created node.

createNode

public Node createNode(double x,
                       double y,
                       double w,
                       double h,
                       String label)
Creates a new node with center location (x,y), dimension (w,h) and given label text. The default node realizer defines all other properties of this node.

Returns:
the newly created node.

createNode

public Node createNode(NodeRealizer r)
Creates a new node in this graph. NodeRealizer realizer will be bound to the created node.

Parameters:
r - a NodeRealizer associated with the create node
Returns:
newly created Node object

getBoundingBox

public Rectangle getBoundingBox()
Returns the bounding box of this graph. The bounding box of a Graph2D is the smallest rectangle that contains all visual representation of the graph given by its edge and node realizers.

If this graph is empty a rectangle with negative width and height will be returned.

Specified by:
getBoundingBox in interface GraphLayout
Overrides:
getBoundingBox in class LayoutGraph

getBoundingBox

public Rectangle getBoundingBox(byte layer)
Returns the bounding box of all graph objects residing in the specified layer.


setLayerAll

public void setLayerAll(byte layer)
Sets the layer for all bound node and edge realizers of this graph.


setLocation

public Rectangle setLocation(double x,
                             double y)
Moves the entire graph to some location. This method moves all realizer coordinates in such a way that the resulting bounding box of this graph has upper left coordinates (x,y).

Returns:
resulting bounding box of this graph

bends

public BendCursor bends()
Returns a bend cursor over all bends in this graph.

Returns:
BendCursor over all bends in this graph

setDefaultNodeRealizer

public void setDefaultNodeRealizer(NodeRealizer r)
Sets the default node realizer. A copy of this realizer will be bound to a newly created node if no other realizer is given explicitly.


setDefaultEdgeRealizer

public void setDefaultEdgeRealizer(EdgeRealizer r)
Sets the default edge realizer. A copy of this realizer will be bound to a newly created edge if no other realizer is given explicitly.


getDefaultNodeRealizer

public NodeRealizer getDefaultNodeRealizer()
Returns the default node realizer that will be bound to newly created nodes.


getDefaultEdgeRealizer

public EdgeRealizer getDefaultEdgeRealizer()
Returns the default edge realizer that will be bound to newly created edges.


getRealizer

public NodeRealizer getRealizer(Node v)
Returns the NodeRealizer bound to the given node.


getRealizer

public EdgeRealizer getRealizer(Edge e)
Returns the EdgeRealizer bound to the given edge.


setRealizer

public void setRealizer(Node v,
                        NodeRealizer r)
Sets the NodeRealizer for the given node.


setRealizer

public void setRealizer(Edge e,
                        EdgeRealizer r)
Sets the EdgeRealizer for the given edge.


getLayout

public NodeLayout getLayout(Node node)
Returns the layout information for a node in the drawing.

Specified by:
getLayout in class LayoutGraph
Parameters:
node - a node in the drawing.
Returns:
the layout information for node.

getLayout

public EdgeLayout getLayout(Edge edge)
Returns the layout information for an edge in the drawing.

Specified by:
getLayout in class LayoutGraph
Parameters:
edge - a edge in the drawing.
Returns:
the layout information for edge.

getLabelLayout

public NodeLabelLayout[] getLabelLayout(Node node)
Returns NodeLabelLayout objects which describe the layouts of the labels that belong to the given node.

Specified by:
getLabelLayout in class LayoutGraph
Parameters:
node - a node in the drawing.
Returns:
the node label layout information for node.

getLabelLayout

public EdgeLabelLayout[] getLabelLayout(Edge edge)
Returns EdgeLabelLayout objects which describe the layouts of the labels that belong to the given edge.

Specified by:
getLabelLayout in class LayoutGraph
Parameters:
edge - an edge in the drawing.
Returns:
the edge label layout information for edge.

getFeature

public Node getFeature(NodeLabelLayout labelLayout)
Returns the node which is described by a given label layout.

Specified by:
getFeature in class LayoutGraph

getFeature

public Edge getFeature(EdgeLabelLayout labelLayout)
Returns the node which is described by a given label layout.

Specified by:
getFeature in class LayoutGraph

isSelectionEmpty

public boolean isSelectionEmpty()
Returns true iff neither edge nor node nor bend in this graph is selected.


isSelectionSingleton

public boolean isSelectionSingleton()
Returns true if and only if exactly one object is selected.


selectedNodes

public NodeCursor selectedNodes()
Returns a node cursor for all momentarily selected nodes in this graph.


selectedEdges

public EdgeCursor selectedEdges()
Returns an edge cursor for all momentarily selected edges in this graph.


selectedBends

public BendCursor selectedBends()
Returns a bend cursor for all momentarily selected bends in this graph.


unselectAll

public void unselectAll()
Unselects all nodes, edges and bends in this graph.


unselectNodes

public void unselectNodes()
Unselects all nodes in this graph.


unselectEdges

public void unselectEdges()
Unselects all edges in this graph.


unselectBends

public void unselectBends()
Unselects all bends in this graph.


moveNodes

public void moveNodes(NodeCursor nc,
                      double dx,
                      double dy)
Moves the given nodes by (dx,dy).


moveBends

public void moveBends(BendCursor bc,
                      double dx,
                      double dy)
Moves the given bends by (dx,dy).


removeSelection

public void removeSelection()
Removes all selected objects from this graph. Note that this method does not only clear the selected state of all graph objects but does completely remove them from this graph as well.


selectBoxContent

public void selectBoxContent(Rectangle r)
Selects the graph objects in given rectangle. Formerly selected things will not be deselected.


selectBoxContent

public void selectBoxContent(double x,
                             double y,
                             double width,
                             double height)
Selects the graph objects in a rectangle defined by the given arguments. Formerly selected things will not be deselected.


getHitInfo

public HitInfo getHitInfo(double x,
                          double y,
                          boolean firstHitOnly)
Returns objects that are hit on position (x,y).

Parameters:
firstHitOnly - determines if search should be abandoned after the first hit object was found. If nothing's hit, null will be returned.

getHitInfo

public HitInfo getHitInfo(double x,
                          double y)
Returns hit info containing only the first hit object that was found.


setLabelText

public void setLabelText(Node v,
                         String text)
Sets the given label text for the given node.


getLabelText

public String getLabelText(Node v)
Returns the label text for the given node.


setLabelText

public void setLabelText(Edge e,
                         String text)
Sets the given label text for the given edge.


getLabelText

public String getLabelText(Edge e)
Returns the label text for the given edge.


setSelected

public void setSelected(Edge e,
                        boolean s)
Sets the selected state for the given edge.


setSelected

public void setSelected(EdgeCursor edges,
                        boolean s)
Sets the selection state for the given edges.


setSelected

public void setSelected(Node v,
                        boolean s)
Sets the selection state for the given node.


setSelected

public void setSelected(NodeCursor nodes,
                        boolean s)
Sets the selection state for the given nodes.


setBendsSelected

public void setBendsSelected(BendCursor bc,
                             boolean s)
Sets the selection state for the given bends.


setBendsSelected

public void setBendsSelected(Edge e,
                             boolean s)
Sets the selection state for the bends given by the edge.


setBendsSelected

public void setBendsSelected(EdgeCursor ec,
                             boolean s)
Sets the selection state for the bends given by the edges.


selectAllNodesAndBends

public void selectAllNodesAndBends(boolean s)
Sets the selection state for all nodes and bends.


isSelected

public boolean isSelected(Edge e)
Returns the selection state of the given edge.


isSelected

public boolean isSelected(Node v)
Returns the selection state of the given node.


getCenterX

public double getCenterX(Node v)
Returns the center x-coord of the given node.

Overrides:
getCenterX in class LayoutGraph

getCenterY

public double getCenterY(Node v)
Returns the center y-coord of the given node.

Overrides:
getCenterY in class LayoutGraph

getX

public double getX(Node v)
Returns the upper left x-coord of the given node.

Overrides:
getX in class LayoutGraph

getY

public double getY(Node v)
Returns the upper left y-coord of the given node.

Overrides:
getY in class LayoutGraph

getWidth

public double getWidth(Node v)
Returns the width of the given node.

Overrides:
getWidth in class LayoutGraph

getHeight

public double getHeight(Node v)
Returns the height of the given node.

Overrides:
getHeight in class LayoutGraph

setCenter

public void setCenter(Node v,
                      double x,
                      double y)
Sets the center coords of the given node.

Overrides:
setCenter in class LayoutGraph

setSize

public void setSize(Node v,
                    double w,
                    double h)
Sets the size of the given node.

Overrides:
setSize in class LayoutGraph

setLocation

public void setLocation(Node v,
                        double x,
                        double y)
Sets the upper left coords of the given node.

Overrides:
setLocation in class LayoutGraph

setURL

public void setURL(URL url)
Sets the URL of this Graph2D. The URL specifies the physical location to or from where this graph was loaded or stored. The URL should alwas denote the last location from where this model was loaded or stored. This method fires a Graph2DEvent with the property name "URL".


getURL

public URL getURL()
Returns the URL associatioed with this graph.

See Also:
Graph2D.setURL(URL url)

addDrawable

public void addDrawable(Drawable d)
Adds a drawable to this graph. Drawables serve as additional visual elements that part of this graph.


drawables

public YCursor drawables()
Returns a cursor iterating over all Drawables known to this graph.


removeDrawable

public void removeDrawable(Drawable d)
Removes the given drawable from this graph.


getViews

public YCursor getViews()
Returns a cursor iterating through all registered views.


getCurrentView

public View getCurrentView()
Returns the current view. If not set, returns the first view in list.


setCurrentView

public void setCurrentView(View view)
Sets the current view.
Precondition: The view has be registered in this graph.


registerView

public void registerView(View v)
Adds this view to the set of views that display this graph.


removeView

public void removeView(View v)
Removes this view from the set of views that display this graph.


updateViews

public void updateViews()
Calls updateView on all registered views.


fitGraph2DView

public void fitGraph2DView()
Invokes fitContent() on the current view, if the current view is of type Graph2DView. Otherwise no action is performed.


setBackupRealizersHandler

public void setBackupRealizersHandler(Graph2D.BackupRealizersHandler brh)
Sets the delegate class that is responsible for acting upon calls to the methods Graph2D.backupRealizers(EdgeCursor) and Graph2D.backupRealizers(NodeCursor).

By default no such handler is set.


getBackupRealizersHandler

public Graph2D.BackupRealizersHandler getBackupRealizersHandler()
Returns the handler for backupRealizer method calls. If no such handler is set then null will be returned.


backupRealizers

public void backupRealizers()
A method that supports undoability of the changes performed on node and edge realizers. Subclasses that want undoability should backup all edge and node realizers upon a call to this method. Calling this method signals that (some of) the realizers will change in a further unspecified way. By default this method calls backupRealizers for all edges and nodes in the graph.


backupRealizers

public void backupRealizers(EdgeCursor ec)
A method that supports undoability of the changes performed on the edge realizers associated with the given edges. Calls to this method will be delegated to the Graph2D.BackupRealizersHandler that has been registered to this graph.

See Also:
Graph2D.setBackupRealizersHandler(y.view.Graph2D.BackupRealizersHandler)

backupRealizers

public void backupRealizers(NodeCursor nc)
A method that supports undoability of the changes performed on the node realizers associated with the given nodes. Calls to this method will be delegated to the Graph2D.BackupRealizersHandler that has been registered to this graph.

See Also:
Graph2D.setBackupRealizersHandler(y.view.Graph2D.BackupRealizersHandler)

addGraph2DSelectionListener

public void addGraph2DSelectionListener(Graph2DSelectionListener listener)
Adds the given Graph2DSelectionListener to this graph.


removeGraph2DSelectionListener

public void removeGraph2DSelectionListener(Graph2DSelectionListener listener)
Removes the given Graph2DSelectionListener from this graph.


getGraph2DSelectionListeners

public Iterator getGraph2DSelectionListeners()
Returns an iterator that grants access to all registered Graph2DSelectionListeners


fireGraph2DSelectionEvent

protected void fireGraph2DSelectionEvent(Object subject)
Fires a GraphSelectionEvent for the given subject


addGraph2DListener

public void addGraph2DListener(Graph2DListener listener)
Adds the given Graph2DListener to this graph. The following property changes on Graph2D will be delivered to the registered listeners:

Subject typeProperty name
NodeLabeltext
EdgeLabeltext
Noderealizer
Edgerealizer


removeGraph2DListener

public void removeGraph2DListener(Graph2DListener listener)
Removes the given Graph2DListener from this graph.


getGraph2DListeners

public Iterator getGraph2DListeners()
Returns an iterator that grants access to all registered Graph2DListeners


fireGraph2DEvent

protected void fireGraph2DEvent(Object subject,
                                String name,
                                Object oldValue,
                                Object newValue)
Fires a Graph2DEvent


© Copyright 2000-2003,
yWorks GmbH.
All rights reserved.

2003