Java 2 Platform
v1.3

edu.umich.visualsoar.operatorwindow
Class FileOperatorNode

java.lang.Object
  |
  +--javax.swing.tree.DefaultMutableTreeNode
        |
        +--edu.umich.visualsoar.operatorwindow.TreeNode
              |
              +--edu.umich.visualsoar.operatorwindow.OperatorNode
                    |
                    +--edu.umich.visualsoar.operatorwindow.FileNode
                          |
                          +--edu.umich.visualsoar.operatorwindow.SoarOperatorNode
                                |
                                +--edu.umich.visualsoar.operatorwindow.FileOperatorNode
All Implemented Interfaces:
java.lang.Cloneable, javax.swing.tree.MutableTreeNode, java.io.Serializable, javax.swing.tree.TreeNode

class FileOperatorNode
extends SoarOperatorNode

FileOperatorNode class is for File Operators. Similar to SoarOperatorNode in every way other than writing to disk and does not have a datamap associated with itself, instead, it uses the datamap of its' Operator parent Supports sub-filing.


Nested Class Summary
 
Nested classes inherited from class javax.swing.tree.DefaultMutableTreeNode
 
Field Summary
protected  edu.umich.visualsoar.graph.SoarIdentifierVertex dataMapId
           
protected  int dataMapIdNumber
           
protected  java.lang.String folderName
           
protected  boolean isHighLevel
           
 
Fields inherited from class edu.umich.visualsoar.operatorwindow.FileNode
fileAssociation, fullTransferFileName, ruleEditor, transferTreePath
 
Fields inherited from class edu.umich.visualsoar.operatorwindow.OperatorNode
addFileItem, addSuboperatorItem, checkChildrenAgainstDataMapItem, conflictImpasseItem, constraintImpasseItem, contextMenu, deleteItem, exportItem, id, impasseSubMenu, importItem, name, openDataMapItem, openRulesItem, renameItem, stateNoChangeImpasseItem, tieImpasseItem
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
FileOperatorNode(java.lang.String inName, int inId, java.lang.String inFileName)
          this creates a low-level operator with the given name and file
FileOperatorNode(java.lang.String inName, int inId, java.lang.String inFileName, java.lang.String inFolderName, int inDataMapIdNumber)
          This will construct a high-level operator node, this one supports serialization, restoreId must be called to get this object into a good state
FileOperatorNode(java.lang.String inName, int inId, java.lang.String inFileName, java.lang.String inFolderName, edu.umich.visualsoar.graph.SoarIdentifierVertex inDataMapId)
          this creates a highlevel operator with the given name, file, folder and dataMapId
 
Method Summary
 edu.umich.visualsoar.operatorwindow.OperatorNode addFileOperator(edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow, edu.umich.visualsoar.datamap.SoarWorkingMemoryModel swmm, java.lang.String newFileName)
          This is the function that gets called when you want to add a sub file operator to this node
 edu.umich.visualsoar.operatorwindow.OperatorNode addImpasseOperator(edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow, edu.umich.visualsoar.datamap.SoarWorkingMemoryModel swmm, java.lang.String newOperatorName)
          This is the function that gets called when you want to add a sub Impasse Operator to this node
 void addLink(edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow, edu.umich.visualsoar.operatorwindow.LinkNode linkNode)
           
 edu.umich.visualsoar.operatorwindow.OperatorNode addSuboperator(edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow, edu.umich.visualsoar.datamap.SoarWorkingMemoryModel swmm, java.lang.String newOperatorName)
          This is the function that gets called when you want to add a suboperator to this node
 void copyStructures(java.io.File folderToWriteTo)
           
 void delete(edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow)
          Removes the selected operator from the tree if it is allowed
 void exportDataMap(java.io.Writer w)
           
 void exportDesc(java.io.Writer w)
          Given a Writer this writes out a description of the soar operator node that can be read back in later
 void exportType(java.io.Writer w)
           
 void firstTimeAdd(edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow, edu.umich.visualsoar.datamap.SoarWorkingMemoryModel swmm)
           
 java.lang.String getFileName()
          Use this getter function to get the path to the rule file
 java.lang.String getFolderName()
          Use this getter function to get the path to the folder
protected  java.lang.String getFullPathName()
           
 edu.umich.visualsoar.graph.SoarIdentifierVertex getState()
           
 edu.umich.visualsoar.graph.SoarIdentifierVertex getStateIdVertex()
           
 void importFunc(java.io.Reader r, edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow, edu.umich.visualsoar.datamap.SoarWorkingMemoryModel swmm)
           
 boolean isDragOk(int action)
           
 java.awt.datatransfer.DataFlavor isDropOk(int action, java.awt.datatransfer.DataFlavor[] dataFlavors)
           
 boolean isHighLevel()
           
 boolean move(edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow, edu.umich.visualsoar.operatorwindow.OperatorNode newParent)
           
 void notifyDeletionOfChild(edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow, edu.umich.visualsoar.operatorwindow.OperatorNode child)
          A child has been deleted from this node, so check if this node has become a low-level operator now
(package private)  void notifyLinksOfUpdate(edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow)
           
 void openDataMap(edu.umich.visualsoar.datamap.SoarWorkingMemoryModel swmm, edu.umich.visualsoar.MainFrame pw)
          This opens/shows a dataMap with this nodes associated Data Map File
 void registerLink(edu.umich.visualsoar.operatorwindow.LinkNode inLinkNode)
           
 void removeLink(edu.umich.visualsoar.operatorwindow.LinkNode inLinkNode)
           
 void rename(edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow, java.lang.String newName)
          The user wants to rename this node
protected  void renameFolder(java.lang.String newFolderName)
          This is a helper function that renames the folder for which this node is associated to it's new folder name, and also notifies the children of this node that there has been a change
 void restoreId(edu.umich.visualsoar.datamap.SoarWorkingMemoryModel swmm)
           
 void showContextMenu(java.awt.Component c, int x, int y)
          This adjusts the context menu so that only the valid commands are displayed
 void source(java.io.Writer w)
           
 void sourceChildren()
           
 void sourceRecursive()
           
 void write(java.io.Writer w)
          Given a Writer this writes out a description of the operator node that can be read back in later
 
Methods inherited from class edu.umich.visualsoar.operatorwindow.FileNode
addFile, clearRuleEditor, exportFile, getTransferTreePath, moveAssociations, needsToSourceChildren, notifyChildrenOfRename, openRules, openRules, parseProductions, renameFile, setRuleEditor, setTransferFullPath
 
Methods inherited from class edu.umich.visualsoar.operatorwindow.OperatorNode
checkChildrenAgainstDataMap, export, getId, getUniqueName, notifyRenameOfAncestor, okayToCreate, okayToCreate, okayToCreateReplace, recursiveDelete, renameToDeleted, toString
 
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
 

Field Detail

isHighLevel

protected boolean isHighLevel

folderName

protected java.lang.String folderName

dataMapId

protected edu.umich.visualsoar.graph.SoarIdentifierVertex dataMapId

dataMapIdNumber

protected int dataMapIdNumber
Constructor Detail

FileOperatorNode

public FileOperatorNode(java.lang.String inName,
                        int inId,
                        java.lang.String inFileName)
this creates a low-level operator with the given name and file


FileOperatorNode

public FileOperatorNode(java.lang.String inName,
                        int inId,
                        java.lang.String inFileName,
                        java.lang.String inFolderName,
                        edu.umich.visualsoar.graph.SoarIdentifierVertex inDataMapId)
this creates a highlevel operator with the given name, file, folder and dataMapId


FileOperatorNode

public FileOperatorNode(java.lang.String inName,
                        int inId,
                        java.lang.String inFileName,
                        java.lang.String inFolderName,
                        int inDataMapIdNumber)
This will construct a high-level operator node, this one supports serialization, restoreId must be called to get this object into a good state

Method Detail

showContextMenu

public void showContextMenu(java.awt.Component c,
                            int x,
                            int y)
This adjusts the context menu so that only the valid commands are displayed

Overrides:
showContextMenu in class SoarOperatorNode
Parameters:
c - the owner of the context menu, should be the OperatorWindow
x - the horizontal position on the screen where the context menu should be displayed
y - the vertical position on the screen where the context menu should be displayed

exportDesc

public void exportDesc(java.io.Writer w)
                throws java.io.IOException
Given a Writer this writes out a description of the soar operator node that can be read back in later

Overrides:
exportDesc in class SoarOperatorNode
Parameters:
w - the writer
Throws:
java.io.IOException - if there is an error writing to the writer

write

public void write(java.io.Writer w)
           throws java.io.IOException
Description copied from class: FileNode
Given a Writer this writes out a description of the operator node that can be read back in later

Overrides:
write in class FileNode
Parameters:
w - the writer
Throws:
java.io.IOException - if there is an error writing to the writer

firstTimeAdd

public void firstTimeAdd(edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow,
                         edu.umich.visualsoar.datamap.SoarWorkingMemoryModel swmm)
                  throws java.io.IOException
java.io.IOException

importFunc

public void importFunc(java.io.Reader r,
                       edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow,
                       edu.umich.visualsoar.datamap.SoarWorkingMemoryModel swmm)
                throws java.io.IOException,
                       java.lang.NumberFormatException
Overrides:
importFunc in class OperatorNode
java.io.IOException
java.lang.NumberFormatException

isDragOk

public boolean isDragOk(int action)
Overrides:
isDragOk in class OperatorNode

isDropOk

public java.awt.datatransfer.DataFlavor isDropOk(int action,
                                                 java.awt.datatransfer.DataFlavor[] dataFlavors)
Overrides:
isDropOk in class OperatorNode

exportType

public void exportType(java.io.Writer w)
                throws java.io.IOException
Overrides:
exportType in class FileNode
java.io.IOException

getFolderName

public java.lang.String getFolderName()
Use this getter function to get the path to the folder

Overrides:
getFolderName in class OperatorNode
Returns:
the path to the folder

getFileName

public java.lang.String getFileName()
Use this getter function to get the path to the rule file

Overrides:
getFileName in class FileNode
Returns:
the path to the rule file

getFullPathName

protected java.lang.String getFullPathName()
Overrides:
getFullPathName in class FileNode

getStateIdVertex

public edu.umich.visualsoar.graph.SoarIdentifierVertex getStateIdVertex()
Overrides:
getStateIdVertex in class OperatorNode

renameFolder

protected void renameFolder(java.lang.String newFolderName)
This is a helper function that renames the folder for which this node is associated to it's new folder name, and also notifies the children of this node that there has been a change

Parameters:
newFolderName - a String that represents the new folder path

restoreId

public void restoreId(edu.umich.visualsoar.datamap.SoarWorkingMemoryModel swmm)

rename

public void rename(edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow,
                   java.lang.String newName)
            throws java.io.IOException
The user wants to rename this node

Overrides:
rename in class FileNode
Parameters:
newName - the new name that the user wants this node to be called
java.io.IOException

addSuboperator

public edu.umich.visualsoar.operatorwindow.OperatorNode addSuboperator(edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow,
                                                                       edu.umich.visualsoar.datamap.SoarWorkingMemoryModel swmm,
                                                                       java.lang.String newOperatorName)
                                                                throws java.io.IOException
This is the function that gets called when you want to add a suboperator to this node

Overrides:
addSuboperator in class OperatorNode
Parameters:
newOperatorName - the name of the new operator to add
java.io.IOException

addImpasseOperator

public edu.umich.visualsoar.operatorwindow.OperatorNode addImpasseOperator(edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow,
                                                                           edu.umich.visualsoar.datamap.SoarWorkingMemoryModel swmm,
                                                                           java.lang.String newOperatorName)
                                                                    throws java.io.IOException
This is the function that gets called when you want to add a sub Impasse Operator to this node

Overrides:
addImpasseOperator in class OperatorNode
Parameters:
newOperatorName - the name of the new operator to add
java.io.IOException

addFileOperator

public edu.umich.visualsoar.operatorwindow.OperatorNode addFileOperator(edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow,
                                                                        edu.umich.visualsoar.datamap.SoarWorkingMemoryModel swmm,
                                                                        java.lang.String newFileName)
                                                                 throws java.io.IOException
This is the function that gets called when you want to add a sub file operator to this node

Overrides:
addFileOperator in class OperatorNode
Parameters:
newFileName - the name of the new operator to add
java.io.IOException

addLink

public void addLink(edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow,
                    edu.umich.visualsoar.operatorwindow.LinkNode linkNode)
Overrides:
addLink in class OperatorNode

delete

public void delete(edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow)
Removes the selected operator from the tree if it is allowed

Overrides:
delete in class FileNode

notifyDeletionOfChild

public void notifyDeletionOfChild(edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow,
                                  edu.umich.visualsoar.operatorwindow.OperatorNode child)
A child has been deleted from this node, so check if this node has become a low-level operator now

Overrides:
notifyDeletionOfChild in class OperatorNode

openDataMap

public void openDataMap(edu.umich.visualsoar.datamap.SoarWorkingMemoryModel swmm,
                        edu.umich.visualsoar.MainFrame pw)
This opens/shows a dataMap with this nodes associated Data Map File

Overrides:
openDataMap in class OperatorNode
Parameters:
pw - the MainFrame

getState

public edu.umich.visualsoar.graph.SoarIdentifierVertex getState()

exportDataMap

public void exportDataMap(java.io.Writer w)
                   throws java.io.IOException
Overrides:
exportDataMap in class FileNode
java.io.IOException

isHighLevel

public boolean isHighLevel()

registerLink

public void registerLink(edu.umich.visualsoar.operatorwindow.LinkNode inLinkNode)

removeLink

public void removeLink(edu.umich.visualsoar.operatorwindow.LinkNode inLinkNode)

notifyLinksOfUpdate

void notifyLinksOfUpdate(edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow)

copyStructures

public void copyStructures(java.io.File folderToWriteTo)
                    throws java.io.IOException
Overrides:
copyStructures in class FileNode
java.io.IOException

move

public boolean move(edu.umich.visualsoar.operatorwindow.OperatorWindow operatorWindow,
                    edu.umich.visualsoar.operatorwindow.OperatorNode newParent)
Overrides:
move in class OperatorNode

source

public void source(java.io.Writer w)
            throws java.io.IOException
Overrides:
source in class FileNode
java.io.IOException

sourceChildren

public void sourceChildren()
                    throws java.io.IOException
Overrides:
sourceChildren in class FileNode
java.io.IOException

sourceRecursive

public void sourceRecursive()
                     throws java.io.IOException
Overrides:
sourceRecursive in class FileNode
java.io.IOException

Java 2 Platform
v1.3