|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.view.Graph2DClipboard
public class Graph2DClipboard
Provides clipboard functionality for diagrams of type Graph2D.
The clipboard can be used to create a copy of the selected parts of
a Graph2D instance. Also it can be used to paste a formerly copied
subgraph into a graph again. Swing Actions are provided that encapsulate
Cut, Copy and Paste functionality.
The clipboard uses a GraphFactory to create copies of graph elements.
By default an instance of Graph2DCopyFactory is used as
factory.
setGraphFactory(GraphFactory)| Field Summary | |
|---|---|
protected PropertyChangeSupport |
propertyChangeSupport
Utility field used by bound properties. |
| Constructor Summary | |
|---|---|
Graph2DClipboard(ViewContainer vc)
Creates a new clipboard for the graphs managed by the given view container. |
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
Adds a PropertyChangeListener to this clipboard. |
protected NodeList |
copyGraph(Graph sourceGraph,
Graph targetGraph,
NodeCursor sourceNodes)
Copies parts of one graph to another graph. |
void |
copyToClipBoard(Graph graph,
NodeCursor nc)
Copies parts the given graph to the clipboard. |
protected Graph |
getClipboardGraph()
Returns the internal graph that is used to store the contents of the clipboard. |
Action |
getCopyAction()
Returns a swing action that provides the Copy operation on graphs. |
Action |
getCutAction()
Returns a swing action that provides the Cut operation on graphs. |
protected Graph2D |
getGraph2D()
Returns the graph that is displayed in the current view. |
GraphFactory |
getGraphFactory()
Returns the graph factory used by this class. |
Action |
getPasteAction()
Returns a swing action that provides the Paste operation on graphs. |
ViewContainer |
getViewContainer()
Returns the viewContainer associated with this clipboard. |
boolean |
isEmpty()
Returns whether or not the clipboard is currently empty. |
boolean |
isSelectionEmpty()
Returns whether or not there are selected nodes in the active graph. |
boolean |
isSelectionStateObserverEnabled()
Whether or not the selection state of the current graph will be observed. |
NodeList |
pasteFromClipBoard(Graph targetGraph)
Pastes the elements of the clipboard graph to the given graph. |
NodeList |
pasteFromClipBoard(Graph targetGraph,
double x,
double y)
Pastes the elements of the clipboard graph to the given graph. |
void |
removePropertyChangeListener(PropertyChangeListener l)
Removes a PropertyChangeListener from this clipboard. |
void |
setGraphFactory(GraphFactory graphFactory)
Sets the graph factory used to create copies of graph elements. |
void |
setSelectionStateObserverEnabled(boolean enabled)
Whether or not to enable the observation of the selection state of the current graph. |
void |
updateSelectionState()
Forces update of the selection state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PropertyChangeSupport propertyChangeSupport
| Constructor Detail |
|---|
public Graph2DClipboard(ViewContainer vc)
| Method Detail |
|---|
public void setGraphFactory(GraphFactory graphFactory)
public GraphFactory getGraphFactory()
protected Graph getClipboardGraph()
public boolean isEmpty()
public boolean isSelectionEmpty()
public void copyToClipBoard(Graph graph,
NodeCursor nc)
protected Graph2D getGraph2D()
protected NodeList copyGraph(Graph sourceGraph,
Graph targetGraph,
NodeCursor sourceNodes)
public NodeList pasteFromClipBoard(Graph targetGraph,
double x,
double y)
targetGraph - the graph pasted to.x - the x-coordinate of the paste locationy - the y-coordinate of the paste locationpublic NodeList pasteFromClipBoard(Graph targetGraph)
targetGraph - the graph pasted to.public Action getCutAction()
public Action getCopyAction()
public Action getPasteAction()
YPoint that specifies the preferred paste location.
public void addPropertyChangeListener(PropertyChangeListener l)
public void removePropertyChangeListener(PropertyChangeListener l)
public ViewContainer getViewContainer()
public void updateSelectionState()
public boolean isSelectionStateObserverEnabled()
public void setSelectionStateObserverEnabled(boolean enabled)
|
© Copyright 2000-2008, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||