tico.board.components
Class TComponent

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by org.jgraph.graph.DefaultGraphCell
          extended by tico.board.components.TComponent
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode, org.jgraph.graph.GraphCell
Direct Known Subclasses:
TCell, TControllerCell, TGrid, TGridCell, TLabel, TLine, TOval, TRectangle, TRoundRect, TTextArea

public abstract class TComponent
extends org.jgraph.graph.DefaultGraphCell

Defines a TComponent and its attributes. Only subclasses of TComponent can be part of a TBoard.

Version:
1.0 Nov 20, 2006
Author:
Pablo Muñoz
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
EMPTY_ENUMERATION
 
Constructor Summary
TComponent()
          Creates a new TComponent.
TComponent(java.lang.String id)
          Creates a new TComponent with the specified initial id.
TComponent(java.lang.String id, TComponent[] childs)
          Creates a new TComponent with the specified initial id and childs.
TComponent(TComponent[] childs)
          Creates a new TComponent with the specified initial childs.
 
Method Summary
 java.lang.String getId()
          Returns the component id.
abstract  java.lang.String newId()
          Generates a new id for this component.
 java.lang.String toString()
           
static TComponent XMLDecodeType(org.w3c.dom.Element element)
          Returns a TComponent object from the data contained in the XML Element.
abstract  org.w3c.dom.Node XMLEncode(org.w3c.dom.Document doc)
          Generates an XML Element that contains the component information.
 
Methods inherited from class org.jgraph.graph.DefaultGraphCell
changeAttributes, clone, getAttributes, getChildren, setAttributes
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TComponent

public TComponent()
Creates a new TComponent.


TComponent

public TComponent(java.lang.String id)
Creates a new TComponent with the specified initial id.

Parameters:
id - The specified initial id

TComponent

public TComponent(TComponent[] childs)
Creates a new TComponent with the specified initial childs.

Parameters:
childs - The specified initial childs

TComponent

public TComponent(java.lang.String id,
                  TComponent[] childs)
Creates a new TComponent with the specified initial id and childs.

Parameters:
id - The specified initial id
childs - The specified initial childs
Method Detail

newId

public abstract java.lang.String newId()
Generates a new id for this component.

Returns:
Returns the new id.

getId

public java.lang.String getId()
Returns the component id.

Returns:
The component id

toString

public java.lang.String toString()
Overrides:
toString in class javax.swing.tree.DefaultMutableTreeNode

XMLEncode

public abstract org.w3c.dom.Node XMLEncode(org.w3c.dom.Document doc)
Generates an XML Element that contains the component information.

Parameters:
doc - The Document represents that represents the entire XML document
Returns:
The XML Element generated

XMLDecodeType

public static TComponent XMLDecodeType(org.w3c.dom.Element element)
                                throws InvalidFormatException
Returns a TComponent object from the data contained in the XML Element.

Parameters:
element - The XML Element that contains the component data
Returns:
The generated TComponent
Throws:
InvalidFormatException - If Element has an invalid format