harmonic.mz.data
Interface DataNode

All Known Implementing Classes:
ModelNode, SimpleNode

public interface DataNode

This interface alows objects to be stored in the database without extending the class ModelNode. The function set here is rather large because it is not expected this will be implemented often, but instead used often from the out side. Some function names, like getNodeParent() are named to avoid conflicts with the java awt.


Method Summary
 void addField(java.lang.String name, DataNode f)
          Implement to add node to field section.
 void addNode(DataNode child)
          Implement to add child node
 void addNodeListener(NodeListener listener)
           
 void assignFromXMLAttributes(MVGFileOpener opener, org.xml.sax.Attributes node)
          Implement to assign to XML element.
 void assignToXMLAttributes(MVGFileSaver saver, org.xml.sax.helpers.AttributesImpl node, boolean bUpdate)
          Implement to assign from XML element.
 DataNode at(int index)
          Implement to return data node at index
 boolean canSelect()
          Implement to return if node is selectable
 int childCount()
          Implement to return child count
 void clearAttrib(java.lang.Object key)
          Implement to remove attribute at key.
 org.w3c.dom.Element createXMLElement(org.w3c.dom.Document doc)
          Implement to create XML element
 FileNode fileRoot()
           
 void fromXMLNodes(XMLTransferNode[] nodes)
          Implement to create XMLTransferNodes for file reading.
 java.lang.Object getAttrib(java.lang.Object key)
          Implement to return attribute at key.
 java.lang.String getName()
          Implement to return name
 DataNode[] getNodeChildren()
          Implement to return children
 DataNode getNodeParent()
          Implement to return parent
 java.lang.String getRemoteOwner()
          Implement to return remote owner for collaboration
 boolean getSelect()
          Implement to return if is selected
 int getSerialNo()
          Implement to return serial number
 java.lang.String getTreeName()
          Implement to return name for tree gui
 java.awt.Image getTypeImage()
          Implement to remove image for tree gui
 long getUpdateTime()
          Implement to return update time
 XMLTransferNode[] getXMLNodes()
          Implement to create XMLTransferNodes for file saving.
 boolean isField()
          Implement to return whether node is a field
 DataNode linkedTo()
          Implement to return what this links to (input to this node)
 void makeReferenced(DataNode linkInput)
           
 void makeUnreferenced()
           
 void notifyListeners(NodeEvent event)
          Implement to send event
 void purge()
          Called by database purging system to just free unneeded memory, while still alowing nodes to return to fully functional state.
 void purgeFinal()
          Called by database when node is inteneded to never come back, such as when a file is closed.
 void removeNode(DataNode child, boolean bUnlink)
          Implement to remove child
 boolean removeNodeListener(NodeListener listener)
           
 void set(DataNode other)
          Implment to set value of this node to the other.
 void setAttrib(java.lang.Object key, java.lang.Object value)
          Implement to set attribute at key.
 void setIsField(boolean b)
          Implement to set if this node is a field.
 void setName(java.lang.String name)
          Implement to set users name
 void setNodeParent(DataNode parent)
          Implement to set parent
 void setRemoteOwner(java.lang.String owner)
          Implement to set remote owner for collaboration
 void setSelect(boolean b)
          Implement to set selection state of this node
 void setSerialNo(int sn)
          Implement to set serial number
 void setUpdateTime(long time)
          Implement to set update time for collaboration
 java.lang.String valueString()
          Implement to string representing value.
 

Method Detail

purge

public void purge()
Called by database purging system to just free unneeded memory, while still alowing nodes to return to fully functional state. Override to purge non essential memory that can be re computed based on other memory


purgeFinal

public void purgeFinal()
Called by database when node is inteneded to never come back, such as when a file is closed. Override to purge all memory usded by this node. Its easy to thing that just nulling the node in the tree would cause it to be garbage collected, but references to nodes can be hard to compleatly remove, so this function exists to minimize the damage of a leaked node.


set

public void set(DataNode other)
Implment to set value of this node to the other. Should recurse over children it needed


setNodeParent

public void setNodeParent(DataNode parent)
Implement to set parent


addNode

public void addNode(DataNode child)
Implement to add child node


addField

public void addField(java.lang.String name,
                     DataNode f)
Implement to add node to field section. A field is supposed to have assured existance.


removeNode

public void removeNode(DataNode child,
                       boolean bUnlink)
Implement to remove child


notifyListeners

public void notifyListeners(NodeEvent event)
Implement to send event


addNodeListener

public void addNodeListener(NodeListener listener)

removeNodeListener

public boolean removeNodeListener(NodeListener listener)

setSerialNo

public void setSerialNo(int sn)
Implement to set serial number


setName

public void setName(java.lang.String name)
Implement to set users name


setIsField

public void setIsField(boolean b)
Implement to set if this node is a field. Fields cannot come and go.


setAttrib

public void setAttrib(java.lang.Object key,
                      java.lang.Object value)
Implement to set attribute at key.


setRemoteOwner

public void setRemoteOwner(java.lang.String owner)
Implement to set remote owner for collaboration


setUpdateTime

public void setUpdateTime(long time)
Implement to set update time for collaboration


clearAttrib

public void clearAttrib(java.lang.Object key)
Implement to remove attribute at key.


setSelect

public void setSelect(boolean b)
Implement to set selection state of this node


getSelect

public boolean getSelect()
Implement to return if is selected


getNodeChildren

public DataNode[] getNodeChildren()
Implement to return children


getNodeParent

public DataNode getNodeParent()
Implement to return parent


fileRoot

public FileNode fileRoot()

childCount

public int childCount()
Implement to return child count


at

public DataNode at(int index)
Implement to return data node at index


getName

public java.lang.String getName()
Implement to return name


getTreeName

public java.lang.String getTreeName()
Implement to return name for tree gui


getTypeImage

public java.awt.Image getTypeImage()
Implement to remove image for tree gui


getSerialNo

public int getSerialNo()
Implement to return serial number


isField

public boolean isField()
Implement to return whether node is a field


linkedTo

public DataNode linkedTo()
Implement to return what this links to (input to this node)


makeReferenced

public void makeReferenced(DataNode linkInput)

makeUnreferenced

public void makeUnreferenced()

canSelect

public boolean canSelect()
Implement to return if node is selectable


getRemoteOwner

public java.lang.String getRemoteOwner()
Implement to return remote owner for collaboration


getUpdateTime

public long getUpdateTime()
Implement to return update time


getAttrib

public java.lang.Object getAttrib(java.lang.Object key)
Implement to return attribute at key.


valueString

public java.lang.String valueString()
Implement to string representing value.


createXMLElement

public org.w3c.dom.Element createXMLElement(org.w3c.dom.Document doc)
Implement to create XML element


assignFromXMLAttributes

public void assignFromXMLAttributes(MVGFileOpener opener,
                                    org.xml.sax.Attributes node)
Implement to assign to XML element.


assignToXMLAttributes

public void assignToXMLAttributes(MVGFileSaver saver,
                                  org.xml.sax.helpers.AttributesImpl node,
                                  boolean bUpdate)
Implement to assign from XML element.


getXMLNodes

public XMLTransferNode[] getXMLNodes()
Implement to create XMLTransferNodes for file saving.


fromXMLNodes

public void fromXMLNodes(XMLTransferNode[] nodes)
Implement to create XMLTransferNodes for file reading.