Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
JPanel
org.grinvin.list.GraphViewPanel
public class GraphViewPanel
extends JPanel
implements ComponentListener, EmbeddingListener, GraphListener, Observer
Field Summary | |
protected Color |
|
protected GraphContext | |
protected EmbeddingView | |
protected GraphView | |
protected Guides | |
protected Renderer | |
protected double |
Constructor Summary | |
|
Method Summary | |
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void | |
void | |
protected void |
|
protected void |
|
protected void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
protected @Override |
|
public GraphViewPanel(EmbeddingView embedding, Renderer renderer, GraphContext context, double scale)
Create a new graph panel with given peer. The panel is given a preferred size large enough to display the coordinate range (-1.1,-1.1)-(1.1,1.1).
- Parameters:
embedding
- Embedding displayed in this panel. The peer of this embedding should be of type GraphModel.renderer
- Renderer for this panel.context
- Graph context for this panel.scale
- Number of pixels corresponding to a unit length in the embedding.
public void componentHidden(ComponentEvent e)
public void componentMoved(ComponentEvent e)
public void componentResized(ComponentEvent e)
Recenters the drawing when the component changes size.
public void componentShown(ComponentEvent e)
public void dimensionChanged(int oldDimension)
- Specified by:
- dimensionChanged in interface EmbeddingListener
public void embeddingChanged()
- Specified by:
- embeddingChanged in interface EmbeddingListener
protected void paintBackground(Graphics2D g2)
Paint a background overlay. SeeGraphViewPanel
for the order in which the various paint methods are executed. This implementation is delegates to the current guides object.
protected void paintEdges(Graphics2D g2)
Paint all edges of the graph using the current renderer. SeeGraphViewPanel
for the order in which the various paint methods are executed.
protected void paintVertices(Graphics2D g2)
Paint all vertices of the graph using the current vertex renderer. SeeGraphViewPanel
for the order in which the various paint methods are executed.
public void update(Observable o, Object arg)
public void vertexAdded(Vertex vertex)
- Specified by:
- vertexAdded in interface GraphListener
public void vertexChanged(Vertex vertex)
- Specified by:
- vertexChanged in interface GraphListener
public void vertexCoordinatesChanged(Vertex vertex)
- Specified by:
- vertexCoordinatesChanged in interface EmbeddingListener
public void vertexRemoved(Vertex vertex)
- Specified by:
- vertexRemoved in interface GraphListener
public void vertexRestored(Vertex vertex)
- Specified by:
- vertexRestored in interface GraphListener
protected @Override void paintComponent(Graphics g)
Paints the graph on the panel using the current renderer. Paints background, edges and then vertices.