edu.iris.dmc.pdcc.gui
Class PdccTreeNodeObject

java.lang.Object
  extended byjavax.swing.tree.DefaultMutableTreeNode
      extended byedu.iris.dmc.pdcc.gui.PdccObject
          extended byedu.iris.dmc.pdcc.gui.PdccTreeNodeObject
All Implemented Interfaces:
java.lang.Cloneable, edu.iris.dmc.isis.Displayable, edu.iris.dmc.isis.Editable, edu.iris.dmc.isis.Listable, javax.swing.tree.MutableTreeNode, edu.iris.dmc.isis.ObjectController, java.io.Serializable, javax.swing.tree.TreeNode

public class PdccTreeNodeObject
extends PdccObject

Generic Tree node complement to the set of PdccObjects. Used for volume and category nodes. The field contents are stored in Vectors.

Version:
May 23, 2006
Author:
Robert Casey, IRIS DMC
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.iris.dmc.pdcc.gui.PdccObject
allowedChildTypes, boundContainer, boundObject, defaultTreeModel, insertAt, originalString, ourParent, uniqueId, userGeneratedObject, validatedString
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Fields inherited from interface edu.iris.dmc.isis.Listable
DEFAULT_ICON
 
Constructor Summary
PdccTreeNodeObject(java.lang.Object dataObject)
          Get a new tree node instance.
 
Method Summary
protected  edu.iris.dmc.isis.ObjectController constructController()
          process the return of an ObjectController appropriate to the type of data object bound to us.
protected  edu.iris.dmc.isis.EditPanel constructEditPanel()
          process the return of an EditPanel appropriate to the type of the data object bound to us.
 void deleteGroupRow(int rowNum, int startField)
          not implemented
 java.util.Vector getChildren()
          return a Vector of child objects associated with this object
 PdccObject getDictionaryObject(int fieldNum)
          we never reference dictionary objects, so always return null.
 PdccObject getDictionaryObject(int fieldNum, int fieldIndex)
          we never reference dictionary objects, so always return null.
 int getDictionaryReferenceType(int fieldNum)
          we have no dictionary references, so the return is always 0, which means no dictionary type referenced at this field
 java.lang.String getDictionaryReferenceVal()
          we are not a dictionary object, so always return 0.
 java.util.Vector getDictionaryVector(int fieldNum, int fieldIndex)
          we never reference dictionary objects, so always return null.
 java.lang.String getFieldLength(int fieldNum)
          return a string representation of the length of the indicated field number, which is either a single integer, or two integers separated by a hyphen, which suggests a min and max length.
 java.lang.String getFieldName(int fieldNum)
          return the field name string from the indicated field number in the bound data object
 java.lang.String getFieldType(int fieldNum)
          return a string representing the data type of the indicated field number of the bound data object
 java.lang.String getFieldValue(int fieldNum)
          return a String representation of the value contained in the indicated field number of the bound data object
 java.lang.String getFieldValue(int fieldNum, int fieldIndex)
          Get the value at the indicated field number.
 int getId()
          return a unique ID number for this object, perhaps identical to the unique ID of the bound data object.
 java.lang.String getName()
          return the name of the type of the bound data object
 int getNumFields()
          return an integer indicating the number of fields in the bound data object
 int getNumFieldValues(int fieldNum)
          We don't have repeating fields, so the number of values is always 1.
 java.lang.String getRepeatGroupName(int fieldNum)
          we don't have repeating fields, so always return an empty string
 int getRepeatGroupSize(int fieldNum)
          We don't have repeating fields, so the group size returned is always 1.
protected  java.lang.String getSerialFileName()
           
 int getType()
          return an integer representing the 'type' of the bound data object
 void insertGroupRow(int rowNum, int startField)
          not implemented
 boolean isDictionaryField(int fieldNum)
          we have no dictionary fields, so always return false.
 boolean isDictionaryReference(int fieldNum)
          we have no dictionary references, so always return false.
 boolean isDisplayable(int fieldNum)
          indicate whether the field should be displayed in the edit window or not
 boolean isRepeatingField(int fieldNum)
          we don't have repeating fields, so always return false.
 int numberOfChildren()
          return the number of child objects associated with this object
protected  void registerSerialFile(java.lang.String filename)
           
 void releaseBoundObject()
          This is not impelmented.
protected  void releaseEditPanel()
          implementing abstract method.
 void restoreOriginal(java.lang.Object restoreObj, int start, int end)
          Restore the original values before changes were made.
 java.lang.String toString()
          Return a string representation (label) of this object.
 void updateDictionaryLookup(int fieldNum, PdccObject newDictionary)
          we don't have dictionary lookups, so this is not implemented.
 int validate(java.lang.String value, int fieldNum, int fieldIndex)
          Validate the offered string value against the field specification of the given field number and fieldIndex.
 int validate(java.lang.String value, int fieldNum, int fieldIndex, int listIndex)
          we never have list fields, so does nothing and always returns a -1
 
Methods inherited from class edu.iris.dmc.pdcc.gui.PdccObject
canHaveChild, getBoundObject, getContainer, getController, getDictionaryListCount, getDisplayPanel, getEditPanel, getObjectContainer, getOriginalString, getParentNode, getSortField, getSortField, getValidatedString, handleObject, isUserGenerated, listIcon, listString, refreshTreeModel, registerDefaultTreeModel, registerObjectContainer, releaseDisplayPanel, removeBoundObject, resolveDictionaryLookup, resolveDictionaryLookup, resolveDictionaryLookup, setId, setInsertAt, setParentNode, setUserGenerated, validate
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PdccTreeNodeObject

public PdccTreeNodeObject(java.lang.Object dataObject)
Get a new tree node instance. dataObject is a vector of vectors. In each vector position is a vector for the following kind of data: 0: Field Name (0-N) [String] 1: Field Value (0-N) [String] 2: Display Flag (0-N) [Boolean] 3: Field Length (0-N) [Integer] 4: Field Type (0-N) [String] The first four fields pertain to a fixed set of values. The labels may vary, but the values should contain the intended meaning: 0: type (negative value) 1: name 2: unique ID 3: category number 4: label prefix

Parameters:
dataObject - a vector of vectors.
Method Detail

toString

public java.lang.String toString()
Return a string representation (label) of this object.

Overrides:
toString in class PdccObject

constructEditPanel

protected edu.iris.dmc.isis.EditPanel constructEditPanel()
process the return of an EditPanel appropriate to the type of the data object bound to us. Acts as a broker for the getEditPanel() method.

Specified by:
constructEditPanel in class PdccObject

constructController

protected edu.iris.dmc.isis.ObjectController constructController()
process the return of an ObjectController appropriate to the type of data object bound to us. Acts as a broker for the getController() method.

Specified by:
constructController in class PdccObject

getId

public int getId()
return a unique ID number for this object, perhaps identical to the unique ID of the bound data object.

Specified by:
getId in class PdccObject

getType

public int getType()
return an integer representing the 'type' of the bound data object

Specified by:
getType in class PdccObject

getName

public java.lang.String getName()
                         throws java.lang.Exception
return the name of the type of the bound data object

Specified by:
getName in class PdccObject
Throws:
java.lang.Exception

getNumFields

public int getNumFields()
                 throws java.lang.Exception
return an integer indicating the number of fields in the bound data object

Specified by:
getNumFields in class PdccObject
Throws:
java.lang.Exception

getFieldName

public java.lang.String getFieldName(int fieldNum)
                              throws java.lang.Exception
return the field name string from the indicated field number in the bound data object

Specified by:
getFieldName in class PdccObject
Throws:
java.lang.Exception

getFieldValue

public java.lang.String getFieldValue(int fieldNum)
return a String representation of the value contained in the indicated field number of the bound data object

Specified by:
getFieldValue in class PdccObject

getFieldValue

public java.lang.String getFieldValue(int fieldNum,
                                      int fieldIndex)
Get the value at the indicated field number. field index is not implemented in this class.

Specified by:
getFieldValue in class PdccObject

getFieldType

public java.lang.String getFieldType(int fieldNum)
                              throws java.lang.Exception
return a string representing the data type of the indicated field number of the bound data object

Specified by:
getFieldType in class PdccObject
Throws:
java.lang.Exception

getFieldLength

public java.lang.String getFieldLength(int fieldNum)
                                throws java.lang.Exception
return a string representation of the length of the indicated field number, which is either a single integer, or two integers separated by a hyphen, which suggests a min and max length.

Specified by:
getFieldLength in class PdccObject
Throws:
java.lang.Exception

isDictionaryField

public boolean isDictionaryField(int fieldNum)
we have no dictionary fields, so always return false.

Specified by:
isDictionaryField in class PdccObject

isDictionaryReference

public boolean isDictionaryReference(int fieldNum)
we have no dictionary references, so always return false.

Specified by:
isDictionaryReference in class PdccObject

getDictionaryReferenceType

public int getDictionaryReferenceType(int fieldNum)
we have no dictionary references, so the return is always 0, which means no dictionary type referenced at this field

Specified by:
getDictionaryReferenceType in class PdccObject

getDictionaryReferenceVal

public java.lang.String getDictionaryReferenceVal()
we are not a dictionary object, so always return 0.

Specified by:
getDictionaryReferenceVal in class PdccObject

getDictionaryObject

public PdccObject getDictionaryObject(int fieldNum)
                               throws java.lang.Exception
we never reference dictionary objects, so always return null.

Specified by:
getDictionaryObject in class PdccObject
Throws:
java.lang.Exception

getDictionaryObject

public PdccObject getDictionaryObject(int fieldNum,
                                      int fieldIndex)
                               throws java.lang.Exception
we never reference dictionary objects, so always return null.

Specified by:
getDictionaryObject in class PdccObject
Throws:
java.lang.Exception

getDictionaryVector

public java.util.Vector getDictionaryVector(int fieldNum,
                                            int fieldIndex)
                                     throws java.lang.Exception
we never reference dictionary objects, so always return null.

Specified by:
getDictionaryVector in class PdccObject
Throws:
java.lang.Exception

updateDictionaryLookup

public void updateDictionaryLookup(int fieldNum,
                                   PdccObject newDictionary)
we don't have dictionary lookups, so this is not implemented.

Specified by:
updateDictionaryLookup in class PdccObject

isRepeatingField

public boolean isRepeatingField(int fieldNum)
                         throws java.lang.Exception
we don't have repeating fields, so always return false.

Specified by:
isRepeatingField in class PdccObject
Throws:
java.lang.Exception

getRepeatGroupName

public java.lang.String getRepeatGroupName(int fieldNum)
                                    throws java.lang.Exception
we don't have repeating fields, so always return an empty string

Specified by:
getRepeatGroupName in class PdccObject
Throws:
java.lang.Exception

getNumFieldValues

public int getNumFieldValues(int fieldNum)
                      throws java.lang.Exception
We don't have repeating fields, so the number of values is always 1.

Specified by:
getNumFieldValues in class PdccObject
Throws:
java.lang.Exception

getRepeatGroupSize

public int getRepeatGroupSize(int fieldNum)
                       throws java.lang.Exception
We don't have repeating fields, so the group size returned is always 1.

Specified by:
getRepeatGroupSize in class PdccObject
Throws:
java.lang.Exception

validate

public int validate(java.lang.String value,
                    int fieldNum,
                    int fieldIndex)
Validate the offered string value against the field specification of the given field number and fieldIndex. Return 0 if the string is validated successfully. Place the validated string so that it can be accessed by getValidatedString(). Else, return 1 if there is an error and place the error message in the same holding place to be accessed by getValidatedString(). Return 2 if there is no change detected between the current value and the new value.

Specified by:
validate in class PdccObject

validate

public int validate(java.lang.String value,
                    int fieldNum,
                    int fieldIndex,
                    int listIndex)
we never have list fields, so does nothing and always returns a -1

Specified by:
validate in class PdccObject

restoreOriginal

public void restoreOriginal(java.lang.Object restoreObj,
                            int start,
                            int end)
                     throws java.lang.Exception
Restore the original values before changes were made.

Specified by:
restoreOriginal in class PdccObject
Throws:
java.lang.Exception

numberOfChildren

public int numberOfChildren()
                     throws java.lang.Exception
return the number of child objects associated with this object

Specified by:
numberOfChildren in class PdccObject
Throws:
java.lang.Exception

getChildren

public java.util.Vector getChildren()
                             throws java.lang.Exception
return a Vector of child objects associated with this object

Specified by:
getChildren in class PdccObject
Throws:
java.lang.Exception

isDisplayable

public boolean isDisplayable(int fieldNum)
indicate whether the field should be displayed in the edit window or not


releaseBoundObject

public void releaseBoundObject()
This is not impelmented.


insertGroupRow

public void insertGroupRow(int rowNum,
                           int startField)
                    throws java.lang.Exception
not implemented

Specified by:
insertGroupRow in class PdccObject
Throws:
java.lang.Exception

deleteGroupRow

public void deleteGroupRow(int rowNum,
                           int startField)
                    throws java.lang.Exception
not implemented

Specified by:
deleteGroupRow in class PdccObject
Throws:
java.lang.Exception

releaseEditPanel

protected void releaseEditPanel()
implementing abstract method. free memory by removing the reference to boundEditPanel.

Specified by:
releaseEditPanel in class PdccObject

registerSerialFile

protected void registerSerialFile(java.lang.String filename)

getSerialFileName

protected java.lang.String getSerialFileName()


brought to you by Incorporated Research Institutions for Seismology
June 29 2006