Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

cosmoworx.data
Class ViewNode  view ViewNode download ViewNode.java

java.lang.Object
  extended bycosmoworx.data.ViewNode
All Implemented Interfaces:
Node

public class ViewNode
extends java.lang.Object
implements Node

The ViewNode class is an implementation of the Node interface that allows any type of node to be used in a view structure.


Nested Class Summary
private  class ViewNode.ChildNodeHandler
          The node listener for the child nodes.
private  class ViewNode.DelegateNodeHandler
          The node listener for the delegate node.
 
Field Summary
private  ViewNode.ChildNodeHandler moChildNodeHandler
          The child node handler.
private  ViewNode.DelegateNodeHandler moDelegateNodeHandler
          The delegate node handler.
private  Node moNode
          The Node that this ViewNode wraps.
private  ViewNode moParent
          The parent ViewNode.
private  java.util.Vector mvChildren
          The child ViewNodes.
private  java.util.Vector mvListeners
          The listenener list.
 
Constructor Summary
ViewNode(RealNode aoNode)
          Construct a ViewNode with the specified node.
 
Method Summary
 void add(ViewNode aoNode)
          Add a node.
 void addNodeListener(NodeListener aoListener)
          Register a node listener.
 void clear()
          Remove all the children.
 boolean contains(Node aoNode)
          Does the node contain the child node.
 void copyFrom(Node aoNode)
          Copy the attributes and resources from the specified node.
static ViewNode createView(RealNode aoNode)
          Create a set of view nodes that mirrors the specified node.
protected  void finalize()
          Finalize.
 void fireNodeEventOccurred(NodeEvent aoEvent)
          Called when a node event occurs.
 java.lang.String get(java.lang.String asKey)
          Get a String attribute from the node.
 java.util.Enumeration getAttributeKeys()
          Get the attribute keys.
 boolean getBoolean(java.lang.String asKey)
          Get a boolean attribute from the node.
 Node getChild(int aiIndex)
          Get a child node.
 int getChildCount()
          Get the number of child nodes.
 double getDouble(java.lang.String asKey)
          Get a double attribute from the node.
 float getFloat(java.lang.String asKey)
          Get a float attribute from the node.
 int getIndex(Node aoNode)
          Get the index of the specified node.
 int getInt(java.lang.String asKey)
          Get a int attribute from the node.
 long getLong(java.lang.String asKey)
          Get a long attribute from the node.
 Node getNode()
          Get the node this ViewNode wraps.
 Node getParent()
          Get the parent node.
 RealNode getRealNode()
          Get the real node.
 java.lang.Object getResource(java.lang.String asKey)
          Get a node resource.
 java.util.Enumeration getResourceKeys()
          Get the keys for the resources.
 void insert(ViewNode aoNode, int aiIndex)
          Insert a node.
 void insertAfter(ViewNode aoNode, ViewNode aoPeer)
          Insert a node after a specified perr node.
 void insertBefore(ViewNode aoNode, ViewNode aoPeer)
          Insert a node before a specified peer node.
 boolean isModified()
          Whether the node is modified.
 void remove(ViewNode aoNode)
          Remove the specified child node.
 void removeNodeListener(NodeListener aoListener)
          Unregister a node listener.
private  void setParent(ViewNode aoNode)
          Set the parent node.
 void setResource(java.lang.String asKey, java.lang.Object aoResource)
          Set a node resource.
 java.lang.String toString()
          Format a string for this node.
private  void triggerNodeChanged()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

moNode

private Node moNode
The Node that this ViewNode wraps.


moParent

private ViewNode moParent
The parent ViewNode.


mvChildren

private java.util.Vector mvChildren
The child ViewNodes.


mvListeners

private java.util.Vector mvListeners
The listenener list.


moChildNodeHandler

private ViewNode.ChildNodeHandler moChildNodeHandler
The child node handler.


moDelegateNodeHandler

private ViewNode.DelegateNodeHandler moDelegateNodeHandler
The delegate node handler.

Constructor Detail

ViewNode

public ViewNode(RealNode aoNode)
Construct a ViewNode with the specified node.

Method Detail

getRealNode

public RealNode getRealNode()
Get the real node.

Specified by:
getRealNode in interface Node

getNode

public Node getNode()
Get the node this ViewNode wraps.


setParent

private void setParent(ViewNode aoNode)
Set the parent node.


getParent

public Node getParent()
Get the parent node.

Specified by:
getParent in interface Node

add

public void add(ViewNode aoNode)
Add a node.


insert

public void insert(ViewNode aoNode,
                   int aiIndex)
Insert a node.


insertBefore

public void insertBefore(ViewNode aoNode,
                         ViewNode aoPeer)
Insert a node before a specified peer node.


insertAfter

public void insertAfter(ViewNode aoNode,
                        ViewNode aoPeer)
Insert a node after a specified perr node.


getChildCount

public int getChildCount()
Get the number of child nodes.

Specified by:
getChildCount in interface Node

getChild

public Node getChild(int aiIndex)
Get a child node.

Specified by:
getChild in interface Node

getIndex

public int getIndex(Node aoNode)
Get the index of the specified node.

Specified by:
getIndex in interface Node

contains

public boolean contains(Node aoNode)
Does the node contain the child node.

Specified by:
contains in interface Node

remove

public void remove(ViewNode aoNode)
Remove the specified child node.


clear

public void clear()
Remove all the children.


isModified

public boolean isModified()
Whether the node is modified.

Specified by:
isModified in interface Node

get

public java.lang.String get(java.lang.String asKey)
Get a String attribute from the node.

Specified by:
get in interface Node

getBoolean

public boolean getBoolean(java.lang.String asKey)
Get a boolean attribute from the node.

Specified by:
getBoolean in interface Node

getInt

public int getInt(java.lang.String asKey)
Get a int attribute from the node.

Specified by:
getInt in interface Node

getLong

public long getLong(java.lang.String asKey)
Get a long attribute from the node.

Specified by:
getLong in interface Node

getFloat

public float getFloat(java.lang.String asKey)
Get a float attribute from the node.

Specified by:
getFloat in interface Node

getDouble

public double getDouble(java.lang.String asKey)
Get a double attribute from the node.

Specified by:
getDouble in interface Node

getAttributeKeys

public java.util.Enumeration getAttributeKeys()
Get the attribute keys.

Specified by:
getAttributeKeys in interface Node

setResource

public void setResource(java.lang.String asKey,
                        java.lang.Object aoResource)
Set a node resource.

Specified by:
setResource in interface Node

getResource

public java.lang.Object getResource(java.lang.String asKey)
Get a node resource.

Specified by:
getResource in interface Node

getResourceKeys

public java.util.Enumeration getResourceKeys()
Get the keys for the resources.

Specified by:
getResourceKeys in interface Node

copyFrom

public void copyFrom(Node aoNode)
Copy the attributes and resources from the specified node.

Specified by:
copyFrom in interface Node

toString

public java.lang.String toString()
Format a string for this node.


addNodeListener

public void addNodeListener(NodeListener aoListener)
Register a node listener.

Specified by:
addNodeListener in interface Node

removeNodeListener

public void removeNodeListener(NodeListener aoListener)
Unregister a node listener.

Specified by:
removeNodeListener in interface Node

triggerNodeChanged

private void triggerNodeChanged()

fireNodeEventOccurred

public void fireNodeEventOccurred(NodeEvent aoEvent)
Called when a node event occurs.


finalize

protected void finalize()
Finalize.


createView

public static final ViewNode createView(RealNode aoNode)
Create a set of view nodes that mirrors the specified node.