public class DefaultVisualizationModel<V,E> extends java.lang.Object implements VisualizationModel<V,E>, ChangeEventSupport
| Modifier and Type | Field and Description |
|---|---|
protected javax.swing.event.ChangeListener |
changeListener
listens for changes in the layout, forwards to the viewer
|
protected edu.uci.ics.jung.algorithms.layout.Layout<V,E> |
layout
the layout algorithm currently in use
|
protected edu.uci.ics.jung.algorithms.layout.util.Relaxer |
relaxer
manages the thread that applies the current layout algorithm
|
| Constructor and Description |
|---|
DefaultVisualizationModel(edu.uci.ics.jung.algorithms.layout.Layout<V,E> layout) |
DefaultVisualizationModel(edu.uci.ics.jung.algorithms.layout.Layout<V,E> layout,
java.awt.Dimension d) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChangeListener(javax.swing.event.ChangeListener l)
Adds a
ChangeListener. |
void |
fireStateChanged()
Notifies all listeners that have registered interest for
notification on this event type.
|
javax.swing.event.ChangeListener[] |
getChangeListeners()
Returns an array of all the
ChangeListeners added
with addChangeListener(). |
edu.uci.ics.jung.algorithms.layout.Layout<V,E> |
getGraphLayout()
Returns the current graph layout.
|
edu.uci.ics.jung.algorithms.layout.util.Relaxer |
getRelaxer() |
void |
removeChangeListener(javax.swing.event.ChangeListener l)
Removes a ChangeListener.
|
void |
setGraphLayout(edu.uci.ics.jung.algorithms.layout.Layout<V,E> layout)
set the graph Layout and if it is not already initialized, initialize
it to the default VisualizationViewer preferred size of 600x600
|
void |
setGraphLayout(edu.uci.ics.jung.algorithms.layout.Layout<V,E> layout,
java.awt.Dimension viewSize)
Removes the current graph layout, and adds a new one.
|
void |
setRelaxer(edu.uci.ics.jung.algorithms.layout.util.VisRunner relaxer) |
protected edu.uci.ics.jung.algorithms.layout.util.Relaxer relaxer
protected edu.uci.ics.jung.algorithms.layout.Layout<V,E> layout
protected javax.swing.event.ChangeListener changeListener
public DefaultVisualizationModel(edu.uci.ics.jung.algorithms.layout.Layout<V,E> layout)
layout - The Layout to apply, with its associated Graphpublic void setGraphLayout(edu.uci.ics.jung.algorithms.layout.Layout<V,E> layout, java.awt.Dimension viewSize)
setGraphLayout in interface VisualizationModel<V,E>layout - the new layout to useviewSize - the size of the View that will display this layoutpublic void setGraphLayout(edu.uci.ics.jung.algorithms.layout.Layout<V,E> layout)
setGraphLayout in interface VisualizationModel<V,E>public edu.uci.ics.jung.algorithms.layout.Layout<V,E> getGraphLayout()
getGraphLayout in interface VisualizationModel<V,E>public edu.uci.ics.jung.algorithms.layout.util.Relaxer getRelaxer()
getRelaxer in interface VisualizationModel<V,E>public void setRelaxer(edu.uci.ics.jung.algorithms.layout.util.VisRunner relaxer)
relaxer - the relaxer to setpublic void addChangeListener(javax.swing.event.ChangeListener l)
ChangeListener.addChangeListener in interface ChangeEventSupportaddChangeListener in interface VisualizationModel<V,E>l - the listener to be addedpublic void removeChangeListener(javax.swing.event.ChangeListener l)
removeChangeListener in interface ChangeEventSupportremoveChangeListener in interface VisualizationModel<V,E>l - the listener to be removedpublic javax.swing.event.ChangeListener[] getChangeListeners()
ChangeListeners added
with addChangeListener().getChangeListeners in interface ChangeEventSupportgetChangeListeners in interface VisualizationModel<V,E>ChangeListeners added or an empty
array if no listeners have been addedpublic void fireStateChanged()
fireStateChanged in interface ChangeEventSupportEventListenerList