|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
edu.uci.ics.jung.visualization.BasicVisualizationServer<V,E>
public class BasicVisualizationServer<V,E>
A class that maintains many of the details necessary for creating visualizations of graphs. This is the old VisualizationViewer without tooltips and mouse behaviors. Its purpose is to be a base class that can also be used on the server side of a multi-tiered application.
| Nested Class Summary | |
|---|---|
protected class |
BasicVisualizationServer.VisualizationListener
VisualizationListener reacts to changes in the size of the VisualizationViewer. |
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Nested classes/interfaces inherited from interface edu.uci.ics.jung.visualization.VisualizationServer |
|---|
VisualizationServer.Paintable |
| Field Summary | |
|---|---|
protected ChangeEventSupport |
changeSupport
|
protected boolean |
doubleBuffered
user-settable choice to use the offscreen image or not. |
protected VisualizationModel<V,E> |
model
holds the state of this View |
protected BufferedImage |
offscreen
an offscreen image to render the graph Used if doubleBuffered is set to true |
protected Graphics2D |
offscreenG2d
graphics context for the offscreen image Used if doubleBuffered is set to true |
protected PickedState<E> |
pickedEdgeState
holds the state of which edges of the graph are currently 'picked' |
protected PickedState<V> |
pickedVertexState
holds the state of which vertices of the graph are currently 'picked' |
protected ItemListener |
pickEventListener
a listener used to cause pick events to result in repaints, even if they come from another view |
protected List<VisualizationServer.Paintable> |
postRenderers
a collection of user-implementable functions to render over the topology (after the graph is rendered) |
protected List<VisualizationServer.Paintable> |
preRenderers
a collection of user-implementable functions to render under the topology (before the graph is rendered) |
protected RenderContext<V,E> |
renderContext
|
protected Renderer<V,E> |
renderer
handles the actual drawing of graph elements |
protected Map<RenderingHints.Key,Object> |
renderingHints
rendering hints used in drawing. |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
BasicVisualizationServer(Layout<V,E> layout)
Create an instance with passed parameters. |
|
BasicVisualizationServer(Layout<V,E> layout,
Dimension preferredSize)
Create an instance with passed parameters. |
|
BasicVisualizationServer(VisualizationModel<V,E> model)
Create an instance with passed parameters. |
|
BasicVisualizationServer(VisualizationModel<V,E> model,
Dimension preferredSize)
Create an instance with passed parameters. |
|
| Method Summary | |
|---|---|
void |
addChangeListener(ChangeListener l)
Adds a ChangeListener. |
void |
addPostRenderPaintable(VisualizationServer.Paintable paintable)
|
void |
addPreRenderPaintable(VisualizationServer.Paintable paintable)
|
protected void |
checkOffscreenImage(Dimension d)
Ensure that, if doubleBuffering is enabled, the offscreen image buffer exists and is the correct size. |
void |
fireStateChanged()
Notifies all listeners that have registered interest for notification on this event type. |
Point2D |
getCenter()
|
ChangeListener[] |
getChangeListeners()
Returns an array of all the ChangeListeners added
with addChangeListener(). |
Layout<V,E> |
getGraphLayout()
Returns the current graph layout. |
VisualizationModel<V,E> |
getModel()
|
PickedState<E> |
getPickedEdgeState()
|
PickedState<V> |
getPickedVertexState()
|
GraphElementAccessor<V,E> |
getPickSupport()
|
RenderContext<V,E> |
getRenderContext()
|
Renderer<V,E> |
getRenderer()
Returns the renderer used by this instance. |
Map<RenderingHints.Key,Object> |
getRenderingHints()
|
Dimension |
getSize()
Always sanity-check getSize so that we don't use a value that is improbable |
boolean |
isDoubleBuffered()
whether this class uses double buffering. |
protected void |
paintComponent(Graphics g)
|
void |
prependPostRenderPaintable(VisualizationServer.Paintable paintable)
|
void |
prependPreRenderPaintable(VisualizationServer.Paintable paintable)
|
void |
removeChangeListener(ChangeListener l)
Removes a ChangeListener. |
void |
removePostRenderPaintable(VisualizationServer.Paintable paintable)
|
void |
removePreRenderPaintable(VisualizationServer.Paintable paintable)
|
protected void |
renderGraph(Graphics2D g2d)
|
void |
scaleToLayout(ScalingControl scaler)
|
void |
setDoubleBuffered(boolean doubleBuffered)
set whether this class uses its offscreen image or not. |
void |
setGraphLayout(Layout<V,E> layout)
Removes the current graph layout, and adds a new one. |
void |
setModel(VisualizationModel<V,E> model)
|
void |
setPickedEdgeState(PickedState<E> pickedEdgeState)
|
void |
setPickedVertexState(PickedState<V> pickedVertexState)
|
void |
setPickSupport(GraphElementAccessor<V,E> pickSupport)
|
void |
setRenderContext(RenderContext<V,E> renderContext)
|
void |
setRenderer(Renderer<V,E> r)
Sets the showing Renderer to be the input Renderer. |
void |
setRenderingHints(Map<RenderingHints.Key,Object> renderingHints)
|
void |
setVisible(boolean aFlag)
|
void |
stateChanged(ChangeEvent e)
In response to changes from the model, repaint the view, then fire an event to any listeners. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.uci.ics.jung.visualization.VisualizationServer |
|---|
repaint |
| Field Detail |
|---|
protected ChangeEventSupport changeSupport
protected VisualizationModel<V,E> model
protected Renderer<V,E> renderer
protected Map<RenderingHints.Key,Object> renderingHints
protected PickedState<V> pickedVertexState
protected PickedState<E> pickedEdgeState
protected ItemListener pickEventListener
protected BufferedImage offscreen
protected Graphics2D offscreenG2d
protected boolean doubleBuffered
protected List<VisualizationServer.Paintable> preRenderers
protected List<VisualizationServer.Paintable> postRenderers
protected RenderContext<V,E> renderContext
| Constructor Detail |
|---|
public BasicVisualizationServer(Layout<V,E> layout)
layout - The Layout to apply, with its associated Graphrenderer - The Renderer to draw it with
public BasicVisualizationServer(Layout<V,E> layout,
Dimension preferredSize)
layout - The Layout to apply, with its associated Graphrenderer - The Renderer to draw it withpreferredSize - the preferred size of this Viewpublic BasicVisualizationServer(VisualizationModel<V,E> model)
model - renderer -
public BasicVisualizationServer(VisualizationModel<V,E> model,
Dimension preferredSize)
model - renderer - preferredSize - initial preferred size of the view| Method Detail |
|---|
public void setDoubleBuffered(boolean doubleBuffered)
VisualizationServer
setDoubleBuffered in interface VisualizationServer<V,E>setDoubleBuffered in class JComponentpublic boolean isDoubleBuffered()
VisualizationServer
isDoubleBuffered in interface VisualizationServer<V,E>isDoubleBuffered in class JComponentpublic Dimension getSize()
getSize in class ComponentComponent.getSize()protected void checkOffscreenImage(Dimension d)
d - public VisualizationModel<V,E> getModel()
getModel in interface VisualizationServer<V,E>public void setModel(VisualizationModel<V,E> model)
setModel in interface VisualizationServer<V,E>model - The model to set.public void stateChanged(ChangeEvent e)
VisualizationServer
stateChanged in interface VisualizationServer<V,E>stateChanged in interface ChangeListenerpublic void setRenderer(Renderer<V,E> r)
VisualizationServer
setRenderer in interface VisualizationServer<V,E>public Renderer<V,E> getRenderer()
VisualizationServer
getRenderer in interface VisualizationServer<V,E>public void setGraphLayout(Layout<V,E> layout)
VisualizationServer
setGraphLayout in interface VisualizationServer<V,E>layout - the new layout to setpublic void scaleToLayout(ScalingControl scaler)
public Layout<V,E> getGraphLayout()
VisualizationServer
getGraphLayout in interface VisualizationServer<V,E>public void setVisible(boolean aFlag)
setVisible in interface VisualizationServer<V,E>setVisible in class JComponentJComponent.setVisible(boolean)public Map<RenderingHints.Key,Object> getRenderingHints()
getRenderingHints in interface VisualizationServer<V,E>public void setRenderingHints(Map<RenderingHints.Key,Object> renderingHints)
setRenderingHints in interface VisualizationServer<V,E>renderingHints - The renderingHints to set.protected void paintComponent(Graphics g)
paintComponent in class JComponentprotected void renderGraph(Graphics2D g2d)
public void addPreRenderPaintable(VisualizationServer.Paintable paintable)
addPreRenderPaintable in interface VisualizationServer<V,E>paintable - The paintable to add.public void prependPreRenderPaintable(VisualizationServer.Paintable paintable)
public void removePreRenderPaintable(VisualizationServer.Paintable paintable)
removePreRenderPaintable in interface VisualizationServer<V,E>paintable - The paintable to remove.public void addPostRenderPaintable(VisualizationServer.Paintable paintable)
addPostRenderPaintable in interface VisualizationServer<V,E>paintable - The paintable to add.public void prependPostRenderPaintable(VisualizationServer.Paintable paintable)
public void removePostRenderPaintable(VisualizationServer.Paintable paintable)
removePostRenderPaintable in interface VisualizationServer<V,E>paintable - The paintable to remove.public void addChangeListener(ChangeListener l)
VisualizationServerChangeListener.
addChangeListener in interface ChangeEventSupportaddChangeListener in interface VisualizationServer<V,E>l - the listener to be addedpublic void removeChangeListener(ChangeListener l)
ChangeEventSupport
removeChangeListener in interface ChangeEventSupportremoveChangeListener in interface VisualizationServer<V,E>l - the listener to be removedpublic ChangeListener[] getChangeListeners()
ChangeEventSupportChangeListeners added
with addChangeListener().
getChangeListeners in interface ChangeEventSupportgetChangeListeners in interface VisualizationServer<V,E>ChangeListeners added or an empty
array if no listeners have been addedpublic void fireStateChanged()
VisualizationServer
fireStateChanged in interface ChangeEventSupportfireStateChanged in interface VisualizationServer<V,E>EventListenerListpublic PickedState<V> getPickedVertexState()
getPickedVertexState in interface VisualizationServer<V,E>public PickedState<E> getPickedEdgeState()
getPickedEdgeState in interface VisualizationServer<V,E>public void setPickedVertexState(PickedState<V> pickedVertexState)
setPickedVertexState in interface VisualizationServer<V,E>public void setPickedEdgeState(PickedState<E> pickedEdgeState)
setPickedEdgeState in interface VisualizationServer<V,E>public GraphElementAccessor<V,E> getPickSupport()
getPickSupport in interface VisualizationServer<V,E>public void setPickSupport(GraphElementAccessor<V,E> pickSupport)
setPickSupport in interface VisualizationServer<V,E>pickSupport - The pickSupport to set.public Point2D getCenter()
getCenter in interface VisualizationServer<V,E>public RenderContext<V,E> getRenderContext()
getRenderContext in interface VisualizationServer<V,E>public void setRenderContext(RenderContext<V,E> renderContext)
setRenderContext in interface VisualizationServer<V,E>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||