wt.clients.beans.graph
Class DefaultGraphSelectionModel

java.lang.Object
  extended bywt.clients.beans.graph.DefaultGraphSelectionModel
All Implemented Interfaces:
GraphSelectionModel

public class DefaultGraphSelectionModel
extends Object
implements GraphSelectionModel


Field Summary
private static String CLASSNAME
           
private  boolean linkSelectionAllowed
           
private  EventListenerList listenerList
           
private  boolean multiSelectionAllowed
           
private  boolean nodeSelectionAllowed
           
private static String RESOURCE
           
private  Vector selectedLinks
           
private  Vector selectedNodes
           
private static String versionID
           
 
Constructor Summary
DefaultGraphSelectionModel()
           
 
Method Summary
 void add(GraphLink pSelectedLink)
           
 void add(GraphNode pSelectedNode)
           
 void addGraphSelectionModelListener(GraphSelectionModelListener listener)
           
 Enumeration allSelectedLinks()
           
 Enumeration allSelectedNodes()
           
 void clearSelection()
           
 void fireGraphSelectionModelChanged(int change, GraphSelectionModel source, GraphNode pNode, GraphLink pLink)
           
 GraphLink getLastSelectedLink()
          Answer the last selected link.
 GraphNode getLastSelectedNode()
          Answer the last selected node.
 int getLinksSelectedCount()
           
 int getNodesSelectedCount()
           
 Vector getSelectedLinks()
          Gets the object for the association that plays role: selectedLinks.
 Vector getSelectedNodes()
          Gets the object for the association that plays role: selectedNodes.
 boolean isLinkSelectionAllowed()
          Gets the value of the attribute: linkSelectionAllowed.
 boolean isMultiSelectionAllowed()
          Gets the value of the attribute: multiSelectionAllowed.
 boolean isNodeSelectionAllowed()
          Gets the value of the attribute: nodeSelectionAllowed.
 boolean isSelected(GraphLink pLink)
           
 boolean isSelected(GraphNode pNode)
           
 void remove(GraphLink pLink)
           
 void remove(GraphNode pNode)
           
 void removeGraphSelectionModelListener(GraphSelectionModelListener listener)
           
 void setLinkSelectionAllowed(boolean a_LinkSelectionAllowed)
          Sets the value of the attribute: linkSelectionAllowed.
 void setMultiSelectionAllowed(boolean a_MultiSelectionAllowed)
          Sets the value of the attribute: multiSelectionAllowed.
 void setNodeSelectionAllowed(boolean a_NodeSelectionAllowed)
          Sets the value of the attribute: nodeSelectionAllowed.
 void setSelectedLinks(Vector a_SelectedLinks)
          Sets the object for the association that plays role: selectedLinks.
 void setSelectedNodes(Vector a_SelectedNodes)
          Sets the object for the association that plays role: selectedNodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

versionID

private static final String versionID
See Also:
Constant Field Values

nodeSelectionAllowed

private boolean nodeSelectionAllowed

linkSelectionAllowed

private boolean linkSelectionAllowed

multiSelectionAllowed

private boolean multiSelectionAllowed

selectedNodes

private Vector selectedNodes

selectedLinks

private Vector selectedLinks

listenerList

private EventListenerList listenerList
Constructor Detail

DefaultGraphSelectionModel

public DefaultGraphSelectionModel()
Method Detail

isNodeSelectionAllowed

public boolean isNodeSelectionAllowed()
Gets the value of the attribute: nodeSelectionAllowed.

Returns:
boolean

setNodeSelectionAllowed

public void setNodeSelectionAllowed(boolean a_NodeSelectionAllowed)
                             throws WTPropertyVetoException
Sets the value of the attribute: nodeSelectionAllowed.

Parameters:
a_NodeSelectionAllowed -
Throws:
WTPropertyVetoException

isLinkSelectionAllowed

public boolean isLinkSelectionAllowed()
Gets the value of the attribute: linkSelectionAllowed.

Returns:
boolean

setLinkSelectionAllowed

public void setLinkSelectionAllowed(boolean a_LinkSelectionAllowed)
                             throws WTPropertyVetoException
Sets the value of the attribute: linkSelectionAllowed.

Parameters:
a_LinkSelectionAllowed -
Throws:
WTPropertyVetoException

isMultiSelectionAllowed

public boolean isMultiSelectionAllowed()
Gets the value of the attribute: multiSelectionAllowed.

Returns:
boolean

setMultiSelectionAllowed

public void setMultiSelectionAllowed(boolean a_MultiSelectionAllowed)
                              throws WTPropertyVetoException
Sets the value of the attribute: multiSelectionAllowed.

Parameters:
a_MultiSelectionAllowed -
Throws:
WTPropertyVetoException

getSelectedNodes

public Vector getSelectedNodes()
Gets the object for the association that plays role: selectedNodes.

Returns:
Vector

setSelectedNodes

public void setSelectedNodes(Vector a_SelectedNodes)
                      throws WTPropertyVetoException
Sets the object for the association that plays role: selectedNodes.

Parameters:
a_SelectedNodes -
Throws:
WTPropertyVetoException

getSelectedLinks

public Vector getSelectedLinks()
Gets the object for the association that plays role: selectedLinks.

Returns:
Vector

setSelectedLinks

public void setSelectedLinks(Vector a_SelectedLinks)
                      throws WTPropertyVetoException
Sets the object for the association that plays role: selectedLinks.

Parameters:
a_SelectedLinks -
Throws:
WTPropertyVetoException

fireGraphSelectionModelChanged

public void fireGraphSelectionModelChanged(int change,
                                           GraphSelectionModel source,
                                           GraphNode pNode,
                                           GraphLink pLink)
Parameters:
change -
source -
pNode -
pLink -

isSelected

public boolean isSelected(GraphNode pNode)
Specified by:
isSelected in interface GraphSelectionModel
Parameters:
pNode -
Returns:
boolean

isSelected

public boolean isSelected(GraphLink pLink)
Specified by:
isSelected in interface GraphSelectionModel
Parameters:
pLink -
Returns:
boolean

getNodesSelectedCount

public int getNodesSelectedCount()
Specified by:
getNodesSelectedCount in interface GraphSelectionModel
Returns:
int

getLinksSelectedCount

public int getLinksSelectedCount()
Specified by:
getLinksSelectedCount in interface GraphSelectionModel
Returns:
int

clearSelection

public void clearSelection()
Specified by:
clearSelection in interface GraphSelectionModel

add

public void add(GraphNode pSelectedNode)
Specified by:
add in interface GraphSelectionModel
Parameters:
pSelectedNode -

remove

public void remove(GraphNode pNode)
Specified by:
remove in interface GraphSelectionModel
Parameters:
pNode -

add

public void add(GraphLink pSelectedLink)
Specified by:
add in interface GraphSelectionModel
Parameters:
pSelectedLink -

remove

public void remove(GraphLink pLink)
Specified by:
remove in interface GraphSelectionModel
Parameters:
pLink -

allSelectedNodes

public Enumeration allSelectedNodes()
Specified by:
allSelectedNodes in interface GraphSelectionModel
Returns:
Enumeration

allSelectedLinks

public Enumeration allSelectedLinks()
Specified by:
allSelectedLinks in interface GraphSelectionModel
Returns:
Enumeration

addGraphSelectionModelListener

public void addGraphSelectionModelListener(GraphSelectionModelListener listener)
Specified by:
addGraphSelectionModelListener in interface GraphSelectionModel
Parameters:
listener -

removeGraphSelectionModelListener

public void removeGraphSelectionModelListener(GraphSelectionModelListener listener)
Specified by:
removeGraphSelectionModelListener in interface GraphSelectionModel
Parameters:
listener -

getLastSelectedNode

public GraphNode getLastSelectedNode()
Answer the last selected node. The node must still be selected. If the current selected node is unselected, the method would return the previous last selected node.

Specified by:
getLastSelectedNode in interface GraphSelectionModel
Returns:
null if no node is selected

getLastSelectedLink

public GraphLink getLastSelectedLink()
Answer the last selected link. The link must still be selected. If the current selected link is unselected, the method would return the previous last selected link.

Specified by:
getLastSelectedLink in interface GraphSelectionModel
Returns:
null if no link is selected