org.grinvin.gred
Class GraphContext
- Iterable
public class GraphContext
Keeps track of the following extra information about graph elements:
- Whether an element is currently selected.
- Whether an element is currently highlighted.
- What is the current 'roll over' element.
Other classes may be registered as observers for this class
and will then be notified of any changes.
addSelection , addSelection , clearSelection , getSelection , isSelected , isSelectionEmpty , iterator , notifySelectionChanged , selectionCount , setSelection , setSelection , toggleSelection , toggleSelection |
GraphContext
public GraphContext()
Default constructor
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.
- 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(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.
rollOver
- new 'roll over' element.