Provides a view of the Graph.
TODO: clean this up, refactor common code with GraphPanel
componentHidden
public void componentHidden(ComponentEvent e)
componentMoved
public void componentMoved(ComponentEvent e)
componentResized
public void componentResized(ComponentEvent e)
Recenters the drawing when the component changes size.
componentShown
public void componentShown(ComponentEvent e)
dimensionChanged
public void dimensionChanged(int oldDimension)
Called when the dimension of the embedding was changed, and as a
consequence that all coordinates have changed as well.
- dimensionChanged in interface EmbeddingListener
edgeAdded
public void edgeAdded(Edge edge)
Called after an edge was added to the graph.
- edgeAdded in interface GraphListener
edge
- Edge that was added to the graph.
edgeRestored
public void edgeRestored(Edge edge)
Called when an edge that was previously removed
was restored to the graph.
- edgeRestored in interface GraphListener
embeddingChanged
public void embeddingChanged()
Called after a major change in the embedding. For instance when the
coordinates of all vertices change at the same time. Note that
also the peer of the embedding may have changed.
- embeddingChanged in interface EmbeddingListener
graphChanged
public void graphChanged()
Called when the graph was changed in a major way. For instance, when all
vertices and edges were removed in one go or when the graph was
reinitialized from a file.
- graphChanged in interface GraphListener
paintBackground
protected void paintBackground(Graphics2D g2)
Paint a background overlay.
See
GraphViewPanel
for the order in which the various
paint methods are executed.
This implementation is delegates to the current guides object.
paintEdges
protected void paintEdges(Graphics2D g2)
Paint all edges of the graph using the current renderer.
See
GraphViewPanel
for the order in which the various
paint methods are executed.
paintVertices
protected void paintVertices(Graphics2D g2)
Paint all vertices of the graph using the current vertex renderer.
See
GraphViewPanel
for the order in which the various
paint methods are executed.
update
public void update(Observable o,
Object arg)
vertexAdded
public void vertexAdded(Vertex vertex)
Called after a vertex was added to the graph.
- vertexAdded in interface GraphListener
vertex
- Vertex that was added to the graph
vertexRemoved
public void vertexRemoved(Vertex vertex)
Called when a vertex was removed from the graph. Implies that
all edges through this vertex were also removed. These removals will
not be notified separately.
- vertexRemoved in interface GraphListener
vertex
- vertex that was removed
vertexRestored
public void vertexRestored(Vertex vertex)
Called when a vertex that was previously removed
was restored to the graph.
- vertexRestored in interface GraphListener
void paintComponent
protected @Override void paintComponent(Graphics g)
Paints the graph on the panel using the current renderer.
Paints background, edges and then vertices.