Package org.jungrapht.visualization
Class AbstractVisualizationModel<V,E>
- java.lang.Object
-
- org.jungrapht.visualization.AbstractVisualizationModel<V,E>
-
- Type Parameters:
V- vertex typeE- edge type
- All Implemented Interfaces:
LayoutSizeChange.Listener<V>,LayoutSizeChange.Producer<V>,ModelChange.Listener,ModelChange.Producer,ViewChange.Listener,ViewChange.Producer,VisualizationModel<V,E>
public abstract class AbstractVisualizationModel<V,E> extends Object
Provided as a public base class for extending the DefaultVisualizationModel
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jungrapht.visualization.VisualizationModel
VisualizationModel.Builder<V,E,T extends VisualizationModel,B extends VisualizationModel.Builder<V,E,T,B>>, VisualizationModel.SpatialSupport
-
-
Field Summary
Fields Modifier and Type Field Description protected Function<org.jgrapht.Graph<V,?>,Pair<Integer>>initialDimensionFunctionprotected LayoutAlgorithm<V>layoutAlgorithmprotected LayoutModel<V>layoutModelprotected LayoutSizeChange.SupportlayoutSizeChangeSupportprotected ModelChange.SupportmodelChangeSupportprotected ViewChange.SupportviewChangeSupport
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractVisualizationModel(VisualizationModel.Builder<V,E,?,?> builder)Constructor for extending classes
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.jgrapht.Graph<V,E>getGraph()Function<org.jgrapht.Graph<V,?>,Pair<Integer>>getInitialDimensionFunction()LayoutAlgorithm<V>getLayoutAlgorithm()LayoutModel<V>getLayoutModel()DimensiongetLayoutSize()Returns the current layoutSize of the visualization space, accoring to the last call to resize().LayoutSizeChange.Support<V>getLayoutSizeChangeSupport()ModelChange.SupportgetModelChangeSupport()ViewChange.SupportgetViewChangeSupport()voidlayoutSizeChanged(LayoutSizeChange.Event<V> evt)voidmodelChanged()voidsetGraph(org.jgrapht.Graph<V,E> graph)voidsetGraph(org.jgrapht.Graph<V,E> graph, boolean forceUpdate)voidsetInitialDimensionFunction(Function<org.jgrapht.Graph<V,?>,Pair<Integer>> initialDimensionFunction)voidsetLayoutAlgorithm(LayoutAlgorithm<V> layoutAlgorithm)voidsetLayoutModel(LayoutModel<V> layoutModel)voidviewChanged()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jungrapht.visualization.VisualizationModel
getLayoutSizeChangeListener
-
-
-
-
Field Detail
-
layoutModel
protected LayoutModel<V> layoutModel
-
layoutAlgorithm
protected LayoutAlgorithm<V> layoutAlgorithm
-
initialDimensionFunction
protected Function<org.jgrapht.Graph<V,?>,Pair<Integer>> initialDimensionFunction
-
modelChangeSupport
protected ModelChange.Support modelChangeSupport
-
viewChangeSupport
protected ViewChange.Support viewChangeSupport
-
layoutSizeChangeSupport
protected LayoutSizeChange.Support layoutSizeChangeSupport
-
-
Constructor Detail
-
AbstractVisualizationModel
protected AbstractVisualizationModel(VisualizationModel.Builder<V,E,?,?> builder)
Constructor for extending classes- Parameters:
builder- to set properties
-
-
Method Detail
-
getLayoutModel
public LayoutModel<V> getLayoutModel()
- Specified by:
getLayoutModelin interfaceVisualizationModel<V,E>- Returns:
- the layout model that holds vertex location state
-
setLayoutModel
public void setLayoutModel(LayoutModel<V> layoutModel)
- Specified by:
setLayoutModelin interfaceVisualizationModel<V,E>- Parameters:
layoutModel- the layout model to hold vertex locations
-
setLayoutAlgorithm
public void setLayoutAlgorithm(LayoutAlgorithm<V> layoutAlgorithm)
- Specified by:
setLayoutAlgorithmin interfaceVisualizationModel<V,E>- Parameters:
layoutAlgorithm- the algorithm to apply to the vertex locations
-
getLayoutSize
public Dimension getLayoutSize()
Returns the current layoutSize of the visualization space, accoring to the last call to resize().- Specified by:
getLayoutSizein interfaceVisualizationModel<V,E>- Returns:
- the current layoutSize of the screen
-
setGraph
public void setGraph(org.jgrapht.Graph<V,E> graph)
- Specified by:
setGraphin interfaceVisualizationModel<V,E>- Parameters:
graph- the graph to visualize
-
setGraph
public void setGraph(org.jgrapht.Graph<V,E> graph, boolean forceUpdate)- Specified by:
setGraphin interfaceVisualizationModel<V,E>- Parameters:
graph- the graph to visualizeforceUpdate- whether to force an update
-
getInitialDimensionFunction
public Function<org.jgrapht.Graph<V,?>,Pair<Integer>> getInitialDimensionFunction()
- Specified by:
getInitialDimensionFunctionin interfaceVisualizationModel<V,E>
-
setInitialDimensionFunction
public void setInitialDimensionFunction(Function<org.jgrapht.Graph<V,?>,Pair<Integer>> initialDimensionFunction)
- Specified by:
setInitialDimensionFunctionin interfaceVisualizationModel<V,E>
-
getLayoutAlgorithm
public LayoutAlgorithm<V> getLayoutAlgorithm()
- Specified by:
getLayoutAlgorithmin interfaceVisualizationModel<V,E>- Returns:
- the layout algorithm that was used to place the vertices
-
getGraph
public org.jgrapht.Graph<V,E> getGraph()
- Specified by:
getGraphin interfaceVisualizationModel<V,E>- Returns:
- the graph being visualized
-
getViewChangeSupport
public ViewChange.Support getViewChangeSupport()
- Specified by:
getViewChangeSupportin interfaceViewChange.Producer
-
viewChanged
public void viewChanged()
- Specified by:
viewChangedin interfaceViewChange.Listener
-
getModelChangeSupport
public ModelChange.Support getModelChangeSupport()
- Specified by:
getModelChangeSupportin interfaceModelChange.Producer
-
modelChanged
public void modelChanged()
- Specified by:
modelChangedin interfaceModelChange.Listener
-
getLayoutSizeChangeSupport
public LayoutSizeChange.Support<V> getLayoutSizeChangeSupport()
- Specified by:
getLayoutSizeChangeSupportin interfaceLayoutSizeChange.Producer<V>
-
layoutSizeChanged
public void layoutSizeChanged(LayoutSizeChange.Event<V> evt)
- Specified by:
layoutSizeChangedin interfaceLayoutSizeChange.Listener<V>
-
-