|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.tree.DefaultTreeModel | +--did.xml.DIDDefaultTreeModel
File: DIDDefaultTreeModel.java Version: 1.0 Description: Implementation of the Java DefaultTreeModel. A DefaultTreeModel handles data stored in a series of nodes organized in a tree structure. An XML document can be parsed into a DOM tree which is also a series of nodes organized into a tree structure but Java can not use the DOM tree directly. So, to accomodate this shortcoming a Java based node structure (DIDNodes) is create based off of the DOM Tree. The Java tree references the corresponding node in the DOM Tree by setting the DOM node as its userObject. This way the Java Tree is always aware of what part of the DOM tree it represents. NOTE: This class also contains several attributes that also make reference to the Document node of independed DOM trees. Their purpose is aid in the creation of new data files (Pages) as well as aid in the creation of specific portions or the data file architecture (Zone, Line, Charater, Vertex). This architecture is a stopgap messure until an adeqaute and efficient means of generating well formed, valid XML directly from the DTD can be established. Modification Log: Date Name Comment xx-xx-xxxx XXX xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
DIDNode
, Serialized FormField Summary | |
static DIDEntityType |
EntityType
Attribute that specify the entity types |
static java.util.Vector |
myROIs
Vector whose purpose is to hold and track all the DIDRoiIFC object implementations currently on the screen. |
Fields inherited from class javax.swing.tree.DefaultTreeModel |
asksAllowsChildren,
listenerList,
root |
Constructor Summary | |
DIDDefaultTreeModel(javax.swing.tree.TreeNode root)
Method used to instantiate this class. |
|
DIDDefaultTreeModel(javax.swing.tree.TreeNode root,
java.lang.String nodeMessage)
Method used to instantiate this class. |
Method Summary | |
DIDNode |
addROI(int n,
DIDNode anchorNode,
java.lang.String dataType)
Method used to add the data behind an ROI (whether it be a Zone, Line, or Character) to both the Java and DOM Trees. |
void |
buildDIDModel(java.lang.String fileName)
Method used to build the tree of nodes this model manages. |
void |
buildLogicalLinks(DIDNode anchorNode)
Method used to build logical links. |
void |
buildROI(DIDNode anchorNode,
java.lang.String roiType)
Method used to build ROI objects from the XML. |
java.util.Enumeration |
findChildren(DIDNode anchorNode,
java.lang.String nodeName)
Method used to locate a specific set of children by the name. |
java.util.Enumeration |
findNodes(DIDNode anchorNode,
java.lang.String nodeName)
Method used to locate a specific set of nodes by the name their userObjects (DOM Nodes). |
java.util.Enumeration |
findNodesByID(DIDNode anchorNode,
java.lang.String idName)
Method used to locate a specific set of nodes by the ID. |
java.util.Enumeration |
findNodesHaving(DIDNode anchorNode,
java.lang.String suffix)
Method used to find a specific set of nodes the suffix of whose name equals to the suffix parameter. |
java.lang.String |
getAttribute(DIDNode anchorNode,
java.lang.String attrName)
Method used to find the value of entity attribute. |
DIDNode |
getChild(DIDNode anchorNode,
java.lang.String nodeName)
Method used to get the first children of a specific node whose name is same as the nodeName parameter. |
DIDNode |
getNodeByID(DIDNode anchorNode,
java.lang.String idName)
Method used to get the first node whose ID is same as the idName parameter. |
java.util.Vector |
getROIs()
Method used to return all the ROIs built from the open docuement (XML file loaded into the myDocument attibute). |
void |
loadStub(java.lang.String dataType)
Method used to create a document stub from an XML file. |
void |
printTree(DIDNode startNode)
Convenience method used to print out the structure of the nodes rooted at the startNode. |
void |
saveModel(java.lang.String fileName)
Method used to persist the DOM tree structure rooted at myDocument to a physical storage device. |
void |
valueForPathChanged(javax.swing.tree.TreePath path,
java.lang.Object newValue)
Method used to respond to the editing of a node in the tree. |
Methods inherited from class javax.swing.tree.DefaultTreeModel |
addTreeModelListener,
asksAllowsChildren,
fireTreeNodesChanged,
fireTreeNodesInserted,
fireTreeNodesRemoved,
fireTreeStructureChanged,
getChild,
getChildCount,
getIndexOfChild,
getPathToRoot,
getPathToRoot,
getRoot,
insertNodeInto,
isLeaf,
nodeChanged,
nodesChanged,
nodeStructureChanged,
nodesWereInserted,
nodesWereRemoved,
reload,
reload,
removeNodeFromParent,
removeTreeModelListener,
setAsksAllowsChildren,
setRoot |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static DIDEntityType EntityType
public static java.util.Vector myROIs
Constructor Detail |
public DIDDefaultTreeModel(javax.swing.tree.TreeNode root)
root
- The root node for this models node tree.public DIDDefaultTreeModel(javax.swing.tree.TreeNode root, java.lang.String nodeMessage)
root
- The root node for this models node tree.nodeMessage
- The name of the node created by this method.Method Detail |
public void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
path
- TreePath to the node being edited.newValue
- new value for the node being edited.public void buildDIDModel(java.lang.String fileName)
fileName
- Fully qualified path to the XML file this model should mirror.public void saveModel(java.lang.String fileName)
fileName
- Fully qualified path to the file that the DOM tree is to be saved.public void printTree(DIDNode startNode)
startNode
- Node from which to begin recursively walking down.public java.util.Vector getROIs()
public void buildROI(DIDNode anchorNode, java.lang.String roiType)
anchorNode
- A DIDNode representing the starting point from which Verticies (a set
of x, y corrdinates) can be extracted.roiType
- A String denoting the type of data (Zone, Line, Character)public void buildLogicalLinks(DIDNode anchorNode)
anchorNode
- is a starting point.public java.util.Enumeration findNodes(DIDNode anchorNode, java.lang.String nodeName)
nodeName
- A String that is the name of the node this method should find.public java.util.Enumeration findNodesHaving(DIDNode anchorNode, java.lang.String suffix)
suffix
- A String that is the suffix of the node name this method
should find.public DIDNode getNodeByID(DIDNode anchorNode, java.lang.String idName)
idName
- A String that is the ID of the node this method should
find.public java.util.Enumeration findNodesByID(DIDNode anchorNode, java.lang.String idName)
idName
- A String that is the ID of the node this method should
find.public DIDNode getChild(DIDNode anchorNode, java.lang.String nodeName)
nodeName
- A String that is the name of the node this method
should find.public java.util.Enumeration findChildren(DIDNode anchorNode, java.lang.String nodeName)
nodeName
- A String that is the name of the node this method
should find.public java.lang.String getAttribute(DIDNode anchorNode, java.lang.String attrName)
attrName
- is a String that is the name of attribute to find.public void loadStub(java.lang.String dataType)
dataType
- The type of data stub to load (Page, Zone, Line, Character).public DIDNode addROI(int n, DIDNode anchorNode, java.lang.String dataType)
n
- An Integer representing the number of Verticies this ROI contains.anchorNode
- The parent node of the ROI being added. If null the Page assumed.dataType
- A String representing the type of data the ROI represents (Zone, Line, etc.)#processDomNode
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |