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
ChangeListener s 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 ChangeEventSupport
addChangeListener
in interface VisualizationModel<V,E>
l
- the listener to be addedpublic void removeChangeListener(javax.swing.event.ChangeListener l)
removeChangeListener
in interface ChangeEventSupport
removeChangeListener
in interface VisualizationModel<V,E>
l
- the listener to be removedpublic javax.swing.event.ChangeListener[] getChangeListeners()
ChangeListener
s added
with addChangeListener().getChangeListeners
in interface ChangeEventSupport
getChangeListeners
in interface VisualizationModel<V,E>
ChangeListener
s added or an empty
array if no listeners have been addedpublic void fireStateChanged()
fireStateChanged
in interface ChangeEventSupport
EventListenerList