yfiles.client.tiles.GraphSelection
Class GraphSelection

This class realizes a client list of node and/or edge ids. It is independent of the server side. It does not provide highlighting of selected nodes and edges (see the graph canvas for this). The selectable types of graph elements (nodes and/or edges) are configurable for each instance.

 
Constructor Summary
GraphSelection(/*Boolean*/ selectNodes, /*Boolean*/ selectEdges)
           This class realizes a client list of node and/or edge ids.
 
Method Summary
 Boolean add(/*String*/ id)
          adds the given id to the selection and returns true on success.
  addAll(/*String[]*/ ids)
          calls add() for all the given ids.
  clear()
          clears the current selection.
 String[] get()
          returns an array of ids of all selected graph elements.
 String[] getEdges()
          returns an array of ids of selected edges.
 String[] getNodes()
          returns an array of ids of selected nodes.
 Number getSize()
          returns the number of selected elements.
 Boolean isSelected(/*String*/ id)
          returns true if the given id belongs to the selection and false otherwise.
  onAddEdge(/*String*/ edgeId)
          is called whenever an edge id is added to the selection.
  onAddNode(/*String*/ nodeId)
          is called whenever a node id is added to the selection.
  onRemoveEdge(/*String*/ edgeId)
          is called whenever an edge id is removed from the selection.
  onRemoveNode(/*String*/ nodeId)
          is called whenever a node id is removed from the selection.
 Boolean remove(/*String*/ id)
          removes the given id from the selection and returns true on success.
  removeAll(/*String[]*/ ids)
          calls remove() for all the given ids.
  setSelectEdges(/*Boolean*/ bool)
          allow or do not allow the selection of edges.
  setSelectNodes(/*Boolean*/ bool)
          allow or do not allow the selection of nodes.
 Boolean toggle(/*String*/ id)
          toggles the selection state for the given id.
  toggleAll(/*String[]*/ ids)
          calls toggle() for all the given ids.
 
Constructor Detail

GraphSelection

GraphSelection(/*Boolean*/ selectNodes, /*Boolean*/ selectEdges)
This class realizes a client list of node and/or edge ids. It is independent of the server side. It does not provide highlighting of selected nodes and edges (see the graph canvas for this). The selectable types of graph elements (nodes and/or edges) are configurable for each instance.
Parameters:
selectNodes - whether edges are allowed to be selected
Method Detail

add

Boolean add(/*String*/ id)
adds the given id to the selection and returns true on success. Adding fails, if the given id belongs to a graph element which is already in the selection or which is not allowed to be selected.

addAll

addAll(/*String[]*/ ids)
calls add() for all the given ids.

clear

clear()
clears the current selection.

get

String[] get()
returns an array of ids of all selected graph elements.

getEdges

String[] getEdges()
returns an array of ids of selected edges.

getNodes

String[] getNodes()
returns an array of ids of selected nodes.

getSize

Number getSize()
returns the number of selected elements.

isSelected

Boolean isSelected(/*String*/ id)
returns true if the given id belongs to the selection and false otherwise.

onAddEdge

onAddEdge(/*String*/ edgeId)
is called whenever an edge id is added to the selection.

onAddNode

onAddNode(/*String*/ nodeId)
is called whenever a node id is added to the selection.

onRemoveEdge

onRemoveEdge(/*String*/ edgeId)
is called whenever an edge id is removed from the selection.

onRemoveNode

onRemoveNode(/*String*/ nodeId)
is called whenever a node id is removed from the selection.

remove

Boolean remove(/*String*/ id)
removes the given id from the selection and returns true on success. Removing fails, if the given id belongs to a graph element which does not belong to the selection.

removeAll

removeAll(/*String[]*/ ids)
calls remove() for all the given ids.

setSelectEdges

setSelectEdges(/*Boolean*/ bool)
allow or do not allow the selection of edges.
Parameters:
bool - whether edges are allowed to be selected

setSelectNodes

setSelectNodes(/*Boolean*/ bool)
allow or do not allow the selection of nodes.
Parameters:
bool - whether nodes are allowed to be selected

toggle

Boolean toggle(/*String*/ id)
toggles the selection state for the given id. The id is removed from the selection, if it belongs to the selection. It is added, if it does not belong to the selection and is allowed to be selected. True is returned on success.

toggleAll

toggleAll(/*String[]*/ ids)
calls toggle() for all the given ids.

Copyright © 2006-2008 yWorks GmbH. All rights reserved.