Annotation getAnnotation
public @Override Annotation getAnnotation()
Returns the (mutable) annotation used by this panel.
Embedding getEmbedding
public @Override Embedding getEmbedding()
Returns the (mutable) embedding used by this panel.
UndoableGraph getGraph
public @Override UndoableGraph getGraph()
Returns the (mutable) graph displayed by this panel.
addNewVertex
public Vertex addNewVertex(int mouseX,
int mouseY,
Object annotation,
boolean leader)
Add a new vertex at the given mouse coordinates
using the given annotation.
leader
- Is this command the first of an undo/redo group?
clear
public void clear()
Removes the current graph
closure
public void closure()
Replaces the current graph with its closure
complement
public void complement()
Replaces the current graph with its complement.
connectSelection
public void connectSelection()
Connects the current selected vertices (i.e. they become a clique).
deleteSelection
public void deleteSelection()
Delete the current selection.
edgeInducedSubGraph
public void edgeInducedSubGraph()
Replaces the current graph with the graph induced by the selected edges.
finalizeEmbeddingChange
public void finalizeEmbeddingChange(String key)
Finalize a change in embedding. Hands the change over to the undo manager.
key
- Resource key for the caption of the undo/redo button
initiateEmbeddingChange
public void initiateEmbeddingChange()
Initiate an upcoming change to an embedding. Saves a copy of the current
embedding. This copy can be retrieved later by means of
getSavedEmbedding()
.
lineGraph
public void lineGraph()
Replaces the current graph with its line graph
mergeSelection
public void mergeSelection()
Merges the current selected vertices.
moveSelection
public void moveSelection(int diffx,
int diffy)
Move the current selection by the given number of
pixels (in mouse coordinates)
setSnapToGuides
public void setSnapToGuides(boolean snapToGuides)
Indicates whether new vertices added should be 'snapped'
to the guides.
snapAllToGuides
public void snapAllToGuides()
Snap all the vertices to the current guides.
snapSelectionToGuides
public void snapSelectionToGuides()
Snap the current selection to the current guides.
splitEdge
public void splitEdge(Edge edge,
boolean joinToAnchor,
int mouseX,
int mouseY,
Object annotation,
boolean leader)
Split an edge and optionally join the new vertex to the anchor.
splitSelection
public void splitSelection()
Splits the current selected vertices.
undoEmbeddingChange
public void undoEmbeddingChange()
vertexInducedSubGraph
public void vertexInducedSubGraph()
Replaces the current graph with the graph induced by the selected vertices.
void close
public @Override void close()