org.wilmascope.control
Class GraphControl.Cluster

java.lang.Object
  extended by org.wilmascope.control.GraphControl.GraphElementFacade
      extended by org.wilmascope.control.GraphControl.Node
          extended by org.wilmascope.control.GraphControl.Cluster
Enclosing class:
GraphControl

public class GraphControl.Cluster
extends GraphControl.Node

the interface for clusters which are collections of nodes, note that a cluster is also a node so you can add a cluster as a member to a cluster using the addNode(GraphControl.Node)method


Method Summary
 void add(GraphControl.GraphElementFacade e)
           
 GraphControl.Cluster addCluster()
          Create a new cluster and add it as a member of this cluster
 GraphControl.Cluster addCluster(java.lang.String viewType)
          Create a new cluster and add it as a member of this cluster
 GraphControl.Cluster addCluster(java.util.Vector nodeFacades)
          Create a new cluster and add it as a member of this cluster
 GraphControl.Edge addEdge(GraphControl.Node start, GraphControl.Node end)
          Add the new edge of the default type to the cluster
 GraphControl.Edge addEdge(GraphControl.Node start, GraphControl.Node end, EdgeView view)
          Create a new edge between two nodes and add it to the cluster
 GraphControl.Edge addEdge(GraphControl.Node start, GraphControl.Node end, java.lang.String edgeType)
          Add a new edge
 GraphControl.Edge addEdge(GraphControl.Node start, GraphControl.Node end, java.lang.String edgeType, float radius)
           
 GraphControl.Node addNode()
           
 void addNode(GraphControl.Node n)
          Add a pre-existing node to the cluster
 GraphControl.Node addNode(NodeView view)
          create a new node and add it to the cluster
 GraphControl.Node addNode(java.lang.String nodeType)
           
 void childrenPickable()
          makes children pickable...
 void collapse()
           
 void deleteAll()
           
 void draw()
          Cause this cluster and it's children to be redrawn
 void expand()
           
 void freeze()
          halts layout for this cluster
 Cluster getCluster()
           
 GraphControl.Edge[] getEdges()
           
 LayoutEngine getLayoutEngine()
           
 GraphControl.Node[] getNodes()
           
 boolean isExpanded()
           
 void makeJustChildrenPickable()
          make just the children of this cluster pickable, ie all other graph elements are not pickable, used for removing things from the cluster
 void makeNonChildrenPickable()
          make just the graph elements other than this cluster pickable, used for adding things to the cluster.
 void moveToParent(GraphControl.Node n)
          move a node out of this cluster and into the parent cluster
 void setAllPickable(boolean pickable)
          kind of dodgy all access method for controlling the pick status of all nodes and edges in the graph, reverts clusters to their default colour (to indicate they are pickable again
 void setBalancedEventClient(BalancedEventClient client)
          set the callback client for when the system reaches a balanced state
 void setLayoutEngine(LayoutEngine layoutEngine)
           
 void showHiddenChildren()
           
 void unfreeze()
          Triggers the layout engine for this cluster and it's children
 
Methods inherited from class org.wilmascope.control.GraphControl.Node
getDegree, getMass, getNode, getPosition, getProperties, getRadius, moveToCanvasPos, removeProperty, setMass, setPosition, setProperties, setProperty, setRadius, setTransparency, setView
 
Methods inherited from class org.wilmascope.control.GraphControl.GraphElementFacade
addPickingClient, defaultColour, delete, getColour, getDefaultColour, getLabel, getUserData, getView, getViewType, hide, highlightColour, initView, isDefaultColour, setColour, setColour, setLabel, setLabel, setPickable, setUserData, show
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setBalancedEventClient

public void setBalancedEventClient(BalancedEventClient client)
set the callback client for when the system reaches a balanced state

Parameters:
client - the class whose BalancedEventClient.callback() method will be called when the graph is balanced

deleteAll

public void deleteAll()

getLayoutEngine

public LayoutEngine getLayoutEngine()

setLayoutEngine

public void setLayoutEngine(LayoutEngine layoutEngine)

addNode

public void addNode(GraphControl.Node n)
Add a pre-existing node to the cluster


add

public void add(GraphControl.GraphElementFacade e)

addNode

public GraphControl.Node addNode()

addNode

public GraphControl.Node addNode(java.lang.String nodeType)

addNode

public GraphControl.Node addNode(NodeView view)
create a new node and add it to the cluster


addEdge

public GraphControl.Edge addEdge(GraphControl.Node start,
                                 GraphControl.Node end,
                                 EdgeView view)
Create a new edge between two nodes and add it to the cluster

Parameters:
start - the start node
end - the end node
view - the view to use for the edge
Returns:
the new edge

addEdge

public GraphControl.Edge addEdge(GraphControl.Node start,
                                 GraphControl.Node end,
                                 java.lang.String edgeType)
Add a new edge

Parameters:
start - the start node
end - the end node
edgeType - the type of edge to add, from the ViewManager
Returns:
the new Edge

addEdge

public GraphControl.Edge addEdge(GraphControl.Node start,
                                 GraphControl.Node end,
                                 java.lang.String edgeType,
                                 float radius)

addEdge

public GraphControl.Edge addEdge(GraphControl.Node start,
                                 GraphControl.Node end)
Add the new edge of the default type to the cluster

Parameters:
start - the start node
end - the end node
Returns:
the new edge

addCluster

public GraphControl.Cluster addCluster()
Create a new cluster and add it as a member of this cluster


addCluster

public GraphControl.Cluster addCluster(java.lang.String viewType)
Create a new cluster and add it as a member of this cluster


addCluster

public GraphControl.Cluster addCluster(java.util.Vector nodeFacades)
Create a new cluster and add it as a member of this cluster


moveToParent

public void moveToParent(GraphControl.Node n)
move a node out of this cluster and into the parent cluster

Parameters:
n - node to move

expand

public void expand()

collapse

public void collapse()

isExpanded

public boolean isExpanded()
Returns:
true if the cluster is expanded else false

makeJustChildrenPickable

public void makeJustChildrenPickable()
make just the children of this cluster pickable, ie all other graph elements are not pickable, used for removing things from the cluster


makeNonChildrenPickable

public void makeNonChildrenPickable()
make just the graph elements other than this cluster pickable, used for adding things to the cluster. Also sets the cluster to the highlight colour to indicate we're doing something to it.


childrenPickable

public void childrenPickable()
makes children pickable... call this method on the rootCluster to reverse the effects of all


setAllPickable

public void setAllPickable(boolean pickable)
kind of dodgy all access method for controlling the pick status of all nodes and edges in the graph, reverts clusters to their default colour (to indicate they are pickable again


getCluster

public Cluster getCluster()

showHiddenChildren

public void showHiddenChildren()

getNodes

public GraphControl.Node[] getNodes()

getEdges

public GraphControl.Edge[] getEdges()

freeze

public void freeze()
halts layout for this cluster


unfreeze

public void unfreeze()
Triggers the layout engine for this cluster and it's children


draw

public void draw()
Cause this cluster and it's children to be redrawn