org.graffiti.selection
Class SelectionModel

java.lang.Object
  extended by org.graffiti.event.AbstractGraphListener
      extended by org.graffiti.selection.SelectionModel
All Implemented Interfaces:
EventListener, GraphListener, TransactionListener

public class SelectionModel
extends AbstractGraphListener

Contains a list of selections and a reference to the current selection.

Version:
$Revision: 5767 $
Author:
flierl

Field Summary
static String ACTIVE
          DOCUMENT ME!
 
Constructor Summary
SelectionModel()
          Constructs a new SelectionModel.
 
Method Summary
 void add(Selection selection)
          Adds the given selection to the list of selections.
 void addSelectionListener(SelectionListener listener)
          Adds the given selection listener to the list of listeners.
 Selection getActiveSelection()
          Returns the active selection.
 void postEdgeRemoved(GraphEvent e)
          Called after an edge has been removed from the graph.
 void postNodeRemoved(GraphEvent e)
          Called after a node has been removed from the graph.
 void remove(Selection selection)
          Removes the given selection for the list of selections.
 void removeSelectionListener(SelectionListener listener)
          Removes the given selection listener from the list of listeners.
 void selectionChanged()
          Informs the registered listeners that the active session has changed.
 void setActiveSelection(Selection sel)
          Sets the active selection to the given value.
 void setActiveSelection(String selectionName)
          Sets the active selection to the given value.
 void updateLastActive()
          DOCUMENT ME!
 
Methods inherited from class org.graffiti.event.AbstractGraphListener
postEdgeAdded, postGraphCleared, postNodeAdded, preEdgeAdded, preEdgeRemoved, preGraphCleared, preNodeAdded, preNodeRemoved, transactionFinished, transactionStarted
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTIVE

public static final String ACTIVE
DOCUMENT ME!

See Also:
Constant Field Values
Constructor Detail

SelectionModel

public SelectionModel()
Constructs a new SelectionModel.

Method Detail

setActiveSelection

public void setActiveSelection(String selectionName)
Sets the active selection to the given value. Informs all listeners about the change.

Parameters:
selectionName - the name of the new selection.

setActiveSelection

public void setActiveSelection(Selection sel)
Sets the active selection to the given value. Informs all listeners about the change.

Parameters:
sel - the name of the new selection.

getActiveSelection

public Selection getActiveSelection()
Returns the active selection.

Returns:
DOCUMENT ME!

add

public void add(Selection selection)
Adds the given selection to the list of selections.

Parameters:
selection - the selection object to add.

addSelectionListener

public void addSelectionListener(SelectionListener listener)
Adds the given selection listener to the list of listeners.

Parameters:
listener - the selection listener to add.

remove

public void remove(Selection selection)
Removes the given selection for the list of selections.

Parameters:
selection - the selection to remove from the list.

removeSelectionListener

public void removeSelectionListener(SelectionListener listener)
Removes the given selection listener from the list of listeners.

Parameters:
listener - the selection listener to remove.

selectionChanged

public void selectionChanged()
Informs the registered listeners that the active session has changed.


updateLastActive

public void updateLastActive()
DOCUMENT ME!


postNodeRemoved

public void postNodeRemoved(GraphEvent e)
Description copied from class: AbstractGraphListener
Called after a node has been removed from the graph. All edges incident to this node have already been removed (preEdgeRemoved and postEdgeRemoved have been called).

Specified by:
postNodeRemoved in interface GraphListener
Overrides:
postNodeRemoved in class AbstractGraphListener
Parameters:
e - the GraphEvent detailing the changes.

postEdgeRemoved

public void postEdgeRemoved(GraphEvent e)
Description copied from class: AbstractGraphListener
Called after an edge has been removed from the graph.

Specified by:
postEdgeRemoved in interface GraphListener
Overrides:
postEdgeRemoved in class AbstractGraphListener
Parameters:
e - the GraphEvent detailing the changes.


Generated at 2012-05-30 11:00:14 PM CEST