Package org.jungrapht.visualization
Interface VisualizationServer<V,E>
-
- Type Parameters:
V- the vertex typeE- the edge type
- All Superinterfaces:
ChangeListener,EventListener,LayoutSizeChange.Listener,LayoutStateChange.Listener,ModelChange.Listener,RenderContextStateChange.Listener,ViewChange.Listener,VisualizationComponent
- All Known Subinterfaces:
SatelliteVisualizationViewer<V,E>,VisualizationViewer<V,E>
- All Known Implementing Classes:
AbstractSatelliteVisualizationViewer,AbstractVisualizationServer,AbstractVisualizationViewer,DefaultSatelliteVisualizationViewer,VisualizationImageServer
public interface VisualizationServer<V,E> extends VisualizationComponent, ViewChange.Listener, ModelChange.Listener, ChangeListener, LayoutStateChange.Listener, LayoutSizeChange.Listener, RenderContextStateChange.Listener
The interface for the visualization view- Author:
- Tom Nelson
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classVisualizationServer.Builder<V,E,T extends org.jungrapht.visualization.DefaultVisualizationServer<V,E>,B extends VisualizationServer.Builder<V,E,T,B>>A builder for creating instances of aVisualizationServerwith user defined propertiesstatic interfaceVisualizationServer.Paintablean interface for the preRender and postRender
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddChangeListener(ChangeListener l)Adds aChangeListener.voidaddPostRenderPaintable(VisualizationServer.Paintable paintable)voidaddPreRenderPaintable(VisualizationServer.Paintable paintable)static <V,E>
VisualizationServer.Builder<V,E,?,?>builder()static <V,E>
VisualizationServer.Builder<V,E,?,?>builder(org.jgrapht.Graph<V,E> graph)static <V,E>
VisualizationServer.Builder<V,E,?,?>builder(VisualizationModel<V,E> visualizationModel)voidfireStateChanged()Notifies all listeners that have registered interest for notification on this event type.Point2DgetCenter()ChangeListener[]getChangeListeners()Returns an array of all theChangeListeners added with addChangeListener().Spatial<E,V>getEdgeSpatial()GraphElementAccessor<V,E>getPickSupport()RenderContext<V,E>getRenderContext()ModalRenderer<V,E>getRenderer()Map<RenderingHints.Key,Object>getRenderingHints()Set<E>getSelectedEdges()MutableSelectedState<E>getSelectedEdgeState()MutableSelectedState<V>getSelectedVertexState()Set<V>getSelectedVertices()TransformSupport<V,E>getTransformSupport()Spatial<V,V>getVertexSpatial()VisualizationModel<V,E>getVisualizationModel()booleanisDoubleBuffered()Returns whether this class uses double buffering.voidprependPreRenderPaintable(VisualizationServer.Paintable paintable)voidremoveChangeListener(ChangeListener l)Removes a ChangeListener.voidremovePostRenderPaintable(VisualizationServer.Paintable paintable)voidremovePreRenderPaintable(VisualizationServer.Paintable paintable)voidrepaint()voidreset()resets all transforms in the visualizationvoidresizeToLayout()Deprecated.voidscaleToLayout()scale the graph visualization to fit within the view windowvoidscaleToLayout(boolean resizeToPoints)scale the graph visualization to fit within the view windowvoidscaleToLayout(ScalingControl scaler)scale the graph layout to fit withon the view windowvoidscaleToLayout(ScalingControl scaler, boolean resizeToPoints)scale the graph layout to fit withon the view windowvoidsetDoubleBuffered(boolean doubleBuffered)Specify whether this class uses its offscreen image or not.voidsetEdgeSpatial(Spatial<E,V> spatial)voidsetInitialDimensionFunction(Function<org.jgrapht.Graph<V,?>,Pair<Integer>> initialDimensionFunction)voidsetPickSupport(GraphElementAccessor<V,E> pickSupport)voidsetRenderContext(RenderContext<V,E> renderContext)voidsetRenderingHints(Map<RenderingHints.Key,Object> renderingHints)voidsetSelectedEdgeState(MutableSelectedState<E> selectedEdgeState)voidsetSelectedVertexState(MutableSelectedState<V> selectedVertexState)voidsetTransformSupport(TransformSupport<V,E> transformSupport)voidsetVertexSpatial(Spatial<V,V> spatial)voidsetVisible(boolean aFlag)Makes the component visible ifaFlagis true, or invisible if false.voidsetVisualizationModel(VisualizationModel<V,E> visualizationModel)voidstateChanged(ChangeEvent e)In response to changes from the model, repaint the view, then fire an event to any listeners.ShapeviewOnLayout()-
Methods inherited from interface org.jungrapht.visualization.layout.event.LayoutSizeChange.Listener
layoutSizeChanged
-
Methods inherited from interface org.jungrapht.visualization.layout.event.LayoutStateChange.Listener
layoutStateChanged
-
Methods inherited from interface org.jungrapht.visualization.layout.event.ModelChange.Listener
modelChanged
-
Methods inherited from interface org.jungrapht.visualization.RenderContextStateChange.Listener
renderContextStateChanged
-
Methods inherited from interface org.jungrapht.visualization.layout.event.ViewChange.Listener
viewChanged
-
Methods inherited from interface org.jungrapht.visualization.VisualizationComponent
add, add, getBackground, getBounds, getComponent, getFont, getHeight, getPreferredSize, getSize, getToolTipText, getWidth, setBackground, setCursor, setFont, setForeground, setLayout, setPreferredSize
-
-
-
-
Method Detail
-
builder
static <V,E> VisualizationServer.Builder<V,E,?,?> builder()
- Type Parameters:
V- vertex typeE- edge type- Returns:
- a Builder to create a VisualizationServer instance
-
builder
static <V,E> VisualizationServer.Builder<V,E,?,?> builder(org.jgrapht.Graph<V,E> graph)
- Type Parameters:
V- the vertex typeE- the edge type- Parameters:
graph- the graph to visualize- Returns:
- the builder
-
builder
static <V,E> VisualizationServer.Builder<V,E,?,?> builder(VisualizationModel<V,E> visualizationModel)
- Type Parameters:
V- the vertex typeE- the edge type- Parameters:
visualizationModel- the visualization model- Returns:
- the builder
-
setDoubleBuffered
void setDoubleBuffered(boolean doubleBuffered)
Specify whether this class uses its offscreen image or not.- Parameters:
doubleBuffered- if true, then doubleBuffering in the superclass is set to 'false'
-
reset
void reset()
resets all transforms in the visualization
-
isDoubleBuffered
boolean isDoubleBuffered()
Returns whether this class uses double buffering. The superclass will be the opposite state.- Returns:
- the double buffered state
-
viewOnLayout
Shape viewOnLayout()
-
getTransformSupport
TransformSupport<V,E> getTransformSupport()
-
setTransformSupport
void setTransformSupport(TransformSupport<V,E> transformSupport)
-
getVisualizationModel
VisualizationModel<V,E> getVisualizationModel()
- Returns:
- the model.
-
setVisualizationModel
void setVisualizationModel(VisualizationModel<V,E> visualizationModel)
- Parameters:
visualizationModel- the model for this class to use
-
stateChanged
void stateChanged(ChangeEvent e)
In response to changes from the model, repaint the view, then fire an event to any listeners. Examples of listeners are the VisualizationScrollPane and the BirdsEyeVisualizationViewer- Specified by:
stateChangedin interfaceChangeListener- Parameters:
e- the change event
-
getRenderer
ModalRenderer<V,E> getRenderer()
- Returns:
- the renderer used by this instance.
-
setVisible
void setVisible(boolean aFlag)
Makes the component visible ifaFlagis true, or invisible if false.- Parameters:
aFlag- true iff the component should be visible- See Also:
JComponent.setVisible(boolean)
-
getRenderingHints
Map<RenderingHints.Key,Object> getRenderingHints()
- Returns:
- the renderingHints
-
setRenderingHints
void setRenderingHints(Map<RenderingHints.Key,Object> renderingHints)
- Parameters:
renderingHints- The renderingHints to set.
-
prependPreRenderPaintable
void prependPreRenderPaintable(VisualizationServer.Paintable paintable)
- Parameters:
paintable- The paintable to add.
-
addPreRenderPaintable
void addPreRenderPaintable(VisualizationServer.Paintable paintable)
- Parameters:
paintable- The paintable to add.
-
removePreRenderPaintable
void removePreRenderPaintable(VisualizationServer.Paintable paintable)
- Parameters:
paintable- The paintable to remove.
-
addPostRenderPaintable
void addPostRenderPaintable(VisualizationServer.Paintable paintable)
- Parameters:
paintable- The paintable to add.
-
removePostRenderPaintable
void removePostRenderPaintable(VisualizationServer.Paintable paintable)
- Parameters:
paintable- The paintable to remove.
-
addChangeListener
void addChangeListener(ChangeListener l)
Adds aChangeListener.- Parameters:
l- the listener to be added
-
removeChangeListener
void removeChangeListener(ChangeListener l)
Removes a ChangeListener.- Parameters:
l- the listener to be removed
-
getChangeListeners
ChangeListener[] getChangeListeners()
Returns an array of all theChangeListeners added with addChangeListener().- Returns:
- all of the
ChangeListeners added or an empty array if no listeners have been added
-
fireStateChanged
void fireStateChanged()
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created.- See Also:
EventListenerList
-
getSelectedVertexState
MutableSelectedState<V> getSelectedVertexState()
- Returns:
- the vertex MutableSelectedState instance
-
getSelectedEdgeState
MutableSelectedState<E> getSelectedEdgeState()
- Returns:
- the edge MutableSelectedState instance
-
setSelectedVertexState
void setSelectedVertexState(MutableSelectedState<V> selectedVertexState)
-
setSelectedEdgeState
void setSelectedEdgeState(MutableSelectedState<E> selectedEdgeState)
-
getPickSupport
GraphElementAccessor<V,E> getPickSupport()
- Returns:
- the GraphElementAccessor
-
setPickSupport
void setPickSupport(GraphElementAccessor<V,E> pickSupport)
- Parameters:
pickSupport- The pickSupport to set.
-
getCenter
Point2D getCenter()
- Returns:
- the x,y coordinates of the view center
-
getRenderContext
RenderContext<V,E> getRenderContext()
- Returns:
- the
RenderContextused to draw the graph
-
setRenderContext
void setRenderContext(RenderContext<V,E> renderContext)
- Parameters:
renderContext- theRenderContextused to draw the graph
-
repaint
void repaint()
-
scaleToLayout
void scaleToLayout(ScalingControl scaler)
scale the graph layout to fit withon the view window- Parameters:
scaler- theScalingControlto change the view scale
-
scaleToLayout
void scaleToLayout()
scale the graph visualization to fit within the view window
-
resizeToLayout
@Deprecated void resizeToLayout()
Deprecated.
-
scaleToLayout
void scaleToLayout(ScalingControl scaler, boolean resizeToPoints)
scale the graph layout to fit withon the view window- Parameters:
scaler- theScalingControlto change the view scale
-
scaleToLayout
void scaleToLayout(boolean resizeToPoints)
scale the graph visualization to fit within the view window
-
-