org.wilmascope.graph
Class GraphElement

java.lang.Object
  extended by org.wilmascope.graph.GraphElement
Direct Known Subclasses:
Edge, Node

public abstract class GraphElement
extends java.lang.Object

A GraphElement is the basic ancestor of anything that can appear in graph be it a Node, Edge or Cluster.


Field Summary
protected  Layable layout
           
protected  Cluster owner
           
protected  Viewable view
           
protected  boolean visible
           
 
Constructor Summary
GraphElement()
           
 
Method Summary
abstract  void delete()
          delete the element, removing all references to it, forever!
 void draw()
          draw the element if it's visible
 Cluster getOwner()
          get the parent cluster or owner of this graph element
abstract  java.util.Properties getProperties()
          Any properties loaded or saved in files con be stored in a Properties object.
 java.lang.Object getUserData(java.lang.Object key)
          The graphElement maintains a hashtable allowing the user to associate it with miscellaneous data.
 void hide()
           
 boolean isVisible()
           
 void setOwner(Cluster c)
          add this element to a particular owner cluster
abstract  void setProperties(java.util.Properties p)
           
 void show(GraphCanvas graphCanvas)
           
 void storeUserData(java.lang.Object key, java.lang.Object value)
          The following method may be used to associate data with a graph element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

view

protected Viewable view

layout

protected Layable layout

visible

protected boolean visible

owner

protected Cluster owner
Constructor Detail

GraphElement

public GraphElement()
Method Detail

setOwner

public void setOwner(Cluster c)
add this element to a particular owner cluster

Parameters:
c - the new owner

getOwner

public Cluster getOwner()
get the parent cluster or owner of this graph element


draw

public void draw()
draw the element if it's visible


isVisible

public boolean isVisible()

hide

public void hide()

show

public void show(GraphCanvas graphCanvas)

storeUserData

public void storeUserData(java.lang.Object key,
                          java.lang.Object value)
The following method may be used to associate data with a graph element. Try not to use this too much or things will get slow and messy. An example usage can be seen in

Parameters:
key - usually, the key should be a string
value - reference to your user data

getUserData

public java.lang.Object getUserData(java.lang.Object key)
The graphElement maintains a hashtable allowing the user to associate it with miscellaneous data. Use this method to access it.

Parameters:
key -
Returns:
the data object
See Also:
for an example usage

delete

public abstract void delete()
delete the element, removing all references to it, forever!


getProperties

public abstract java.util.Properties getProperties()
Any properties loaded or saved in files con be stored in a Properties object. This method is called to extract the GraphElement's properties when the file is created.

Returns:
Custom properties associated with this GraphElement.

setProperties

public abstract void setProperties(java.util.Properties p)