org.grinvin.gred

Class GraphContext

Implemented Interfaces:
Iterable

public class GraphContext
extends SelectionModel<T>

Keeps track of the following extra information about graph elements:

Other classes may be registered as observers for this class and will then be notified of any changes.

Field Summary

Fields inherited from class org.grinvin.gui.SelectionModel<T>

selection

Constructor Summary

GraphContext()
Default constructor

Method Summary

void
extendEdgeSelection()
Extend the current selection by adding all end points of currently selected edges.
Element
getRollOver()
Get the current 'roll over' element.
boolean
isRollOver(Element el)
Is the given element the current 'roll over' element?
protected void
notifyHighlightChanged()
Inform all observers that there was a major change to the current highlight set.
protected void
notifyHighlightChanged(Element element)
Inform all observers that the highlight status of the given element was changed.
protected void
notifyRollOverChanged()
Inform all observers that the 'roll over' element was changed.
protected void
notifySelectionChanged()
Inform all observers that there was a major change to the current selection.
protected void
notifySelectionChanged(Element element)
Inform all observers that the selection status of the given element was changed.
void
setRollOver(Element rollOver)
Set the current 'roll over' element.

Methods inherited from class org.grinvin.gui.SelectionModel<T>

addSelection, addSelection, clearSelection, getSelection, isSelected, isSelectionEmpty, iterator, notifySelectionChanged, selectionCount, setSelection, setSelection, toggleSelection, toggleSelection

Constructor Details

GraphContext

public GraphContext()
Default constructor

Method Details

extendEdgeSelection

public void extendEdgeSelection()
Extend the current selection by adding all end points of currently selected edges.

getRollOver

public Element getRollOver()
Get the current 'roll over' element.
Returns:
The current roll over element, or null when there is none.

isRollOver

public boolean isRollOver(Element el)
Is the given element the current 'roll over' element?

notifyHighlightChanged

protected void notifyHighlightChanged()
Inform all observers that there was a major change to the current highlight set.

notifyHighlightChanged

protected void notifyHighlightChanged(Element element)
Inform all observers that the highlight status of the given element was changed.

notifyRollOverChanged

protected void notifyRollOverChanged()
Inform all observers that the 'roll over' element was changed.

notifySelectionChanged

protected void notifySelectionChanged()
Inform all observers that there was a major change to the current selection.
Overrides:
notifySelectionChanged in interface SelectionModel<T>

notifySelectionChanged

protected void notifySelectionChanged(Element element)
Inform all observers that the selection status of the given element was changed.

setRollOver

public void setRollOver(Element rollOver)
Set the current 'roll over' element.
Parameters:
rollOver - new 'roll over' element.