|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--EASE.Sensing.Specification.Specification
This is the main class for the condition specification subsystem.
This class works together extensively with the class SpecExport to provide the core functionality of the condition subsystem.
It is intended that only one instance of this class is created (as a static variable in SpecExport).
The seperation between Specification and SpecExport should be things that are not needed externally are here and visa versa.
Inner Class Summary | |
(package private) class |
Specification.ActionCoupler
Takes either an ActionEvent or a list selection event and sends it to an action. |
(package private) class |
Specification.WindowCloser
Either get rid of the window or just hide it when the close button is pressed, depends on the value of exit (true for dispose). |
Field Summary | |
private CellStore |
allCells
Storage system for all the cells. |
javax.swing.JTree |
cellTree
|
private javax.swing.tree.DefaultTreeModel |
cellTreeModel
|
private javax.swing.tree.DefaultMutableTreeNode |
cellTreeRootNode
|
javax.swing.JPanel |
container
|
javax.swing.JComponent |
current
|
private Debugger |
debugger
|
static java.lang.String |
DEFAULT_FILE_NAME
Name of the Cell Tree branch holding environment Cells. |
DeleteSimpleAction |
deleteAction
|
EditItemAction |
editItemAction
|
private javax.swing.JMenu |
editM
|
javax.swing.JPanel |
emptyPane
|
(package private) static EnvironmentSpecification |
env
|
private javax.swing.tree.DefaultMutableTreeNode |
exportRootNode
|
private javax.swing.JMenu |
fileM
|
javax.swing.JFrame |
frame
|
private javax.swing.tree.DefaultMutableTreeNode |
internalRootNode
|
javax.swing.JPanel |
listPane
|
private javax.swing.JScrollPane |
listScrollPane
|
javax.swing.JSplitPane |
mainPane
|
javax.swing.JScrollPane |
mainScrollPane
|
private javax.swing.JMenuBar |
menuBar
|
ActivationAction |
newActivationAction
|
NewConstant |
newConstantAction
|
NewExpressionAction |
newExpressionAction
|
NewIfAction |
newIfAction
|
private javax.swing.JMenu |
newM
|
SatisfactionAction |
newSatisfactionAction
|
NewTransitionConditionAction |
newTransitionConditionAction
|
NewUnaryAction |
newUnaryAction
|
private OpenFileAction |
openFileAction
|
private QuitAction |
quitAction
|
private SaveAction |
saveAction
|
java.util.Vector |
sensors
|
private SpecExport |
spec
|
private TreeKeyHandler |
treeHandler
|
private Specification.WindowCloser |
windowCloser
|
Constructor Summary | |
Specification(boolean display,
java.lang.String envClass)
The boolean argument gives the oppurtunity to turn the condition specification system on or off. |
|
Specification(boolean display,
java.lang.String envClass,
boolean quitable)
This constructor can be used by the agent specification system. |
Method Summary | |
(package private) void |
|
(package private) void |
|
private void |
addCellsToFormat(javax.swing.tree.DefaultMutableTreeNode node,
FileFormat format)
This function traverses the branch for a single file, adding all the cells that should be added to the given FileFormat object |
void |
addCellsToModels(java.io.File file,
FileFormat input)
Function that adds new cells to the Cell Tree |
private void |
addCellToStore(Cell c)
Adds a Cell to the hashtable containing all the Cells. |
void |
addCellToTree(Cell c)
Adds a single cell to the tree |
private void |
addDefaultCellsToModels()
Add Cells that come with the Environment to the CellTree |
private void |
addToTree(Cell c)
Adds a cell to a tree. |
private void |
addToTree(javax.swing.tree.DefaultTreeModel dtm,
java.util.Vector v,
javax.swing.tree.DefaultMutableTreeNode root)
Adds a vector of cells to the model. |
void |
addWindowListener(java.awt.event.WindowListener w)
|
private java.util.Vector |
checkNotNull(java.util.Vector v)
|
void |
display()
|
Cell |
getCell(CellReference cr)
Gets a cell from a reference from the Cell Store. |
Cell |
getCellFromStore(java.lang.String name)
|
java.util.Vector |
getCellsByCellType(java.lang.Class c)
|
java.util.Vector |
getCellsByReturnType(int type)
|
java.util.Vector |
getFileFormats()
Get all the FileFormat objects for saving This traverses the entire Cell tree to make up a Vector of File Format objects to be saved. |
private javax.swing.tree.DefaultMutableTreeNode |
getInsertPoint(Cell c,
javax.swing.tree.DefaultMutableTreeNode root,
javax.swing.tree.DefaultTreeModel dtm)
Expects the tree path to be the path where the Cell should be attached, i.e. |
NoEditDisplay |
getNoEditDisplay()
Get a no editable display. |
void |
hide()
|
static void |
main(java.lang.String[] args)
Start up -path command line gives the list of % separated directories in which to look for condition files. |
void |
openFile(java.lang.String name)
Called to open a file |
private void |
removeCellFromStore(Cell c)
Removes a Cell from the hashtable containing all the Cells. |
void |
removeCellFromTree(Cell c)
Removes a single cell from the cell tree |
void |
removeWindowListener(java.awt.event.WindowListener w)
|
void |
setAllFileNames()
Set the filenames for all the cells The filenames are set so that an agent specification can automatically load up the appropriate condition files at runtime. |
void |
setAllPaths()
Sets the tree paths for all the cells Needed so that a correct tree can be recreated again later |
void |
setPath(javax.swing.tree.DefaultMutableTreeNode node)
Sets the Tree path for a particular node Top part of the tree is excluded from the path name. |
private void |
setPaths(javax.swing.tree.DefaultMutableTreeNode root)
Helper function for setAllPaths Excludes the top levels of hierachy and doesn't touch environment cells. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
Field Detail |
private Debugger debugger
static EnvironmentSpecification env
public java.util.Vector sensors
private SpecExport spec
public NewConstant newConstantAction
public NewExpressionAction newExpressionAction
public NewUnaryAction newUnaryAction
public NewIfAction newIfAction
public SatisfactionAction newSatisfactionAction
public ActivationAction newActivationAction
public NewTransitionConditionAction newTransitionConditionAction
public EditItemAction editItemAction
public DeleteSimpleAction deleteAction
private OpenFileAction openFileAction
private SaveAction saveAction
private QuitAction quitAction
private javax.swing.JScrollPane listScrollPane
private javax.swing.tree.DefaultMutableTreeNode internalRootNode
private javax.swing.tree.DefaultMutableTreeNode exportRootNode
private javax.swing.tree.DefaultMutableTreeNode cellTreeRootNode
private javax.swing.tree.DefaultTreeModel cellTreeModel
public javax.swing.JTree cellTree
private Specification.WindowCloser windowCloser
public javax.swing.JPanel emptyPane
public javax.swing.JPanel listPane
public javax.swing.JSplitPane mainPane
public javax.swing.JPanel container
public javax.swing.JScrollPane mainScrollPane
public javax.swing.JComponent current
private javax.swing.JMenuBar menuBar
private javax.swing.JMenu fileM
private javax.swing.JMenu newM
private javax.swing.JMenu editM
public javax.swing.JFrame frame
private TreeKeyHandler treeHandler
private CellStore allCells
public static final java.lang.String DEFAULT_FILE_NAME
Constructor Detail |
public Specification(boolean display, java.lang.String envClass)
public Specification(boolean display, java.lang.String envClass, boolean quitable)
Method Detail |
public static void main(java.lang.String[] args)
-path command line gives the list of % separated directories in which to look for condition files.
-env name Tells EASE to use environment name. Default is TACSIEnvironment
void()
void()
public void addWindowListener(java.awt.event.WindowListener w)
public void removeWindowListener(java.awt.event.WindowListener w)
public void display()
public void hide()
public NoEditDisplay getNoEditDisplay()
A new one is created every request so that different states in agent specification can have their own.
private java.util.Vector checkNotNull(java.util.Vector v)
public void addCellsToModels(java.io.File file, FileFormat input)
public void addCellToTree(Cell c)
public void removeCellFromTree(Cell c)
public Cell getCell(CellReference cr)
public Cell getCellFromStore(java.lang.String name)
public java.util.Vector getCellsByCellType(java.lang.Class c)
public java.util.Vector getCellsByReturnType(int type)
private void addCellToStore(Cell c)
Stores the Cell by its fullName.
private void removeCellFromStore(Cell c)
public void setAllPaths()
public void setPath(javax.swing.tree.DefaultMutableTreeNode node)
Top part of the tree is excluded from the path name.
private javax.swing.tree.DefaultMutableTreeNode getInsertPoint(Cell c, javax.swing.tree.DefaultMutableTreeNode root, javax.swing.tree.DefaultTreeModel dtm)
private void addDefaultCellsToModels()
private void addToTree(javax.swing.tree.DefaultTreeModel dtm, java.util.Vector v, javax.swing.tree.DefaultMutableTreeNode root)
Validate as we go along.
private void addToTree(Cell c)
If the cell has no filename then stuck into root.
private void setPaths(javax.swing.tree.DefaultMutableTreeNode root)
Excludes the top levels of hierachy and doesn't touch environment cells.
public void openFile(java.lang.String name)
public void setAllFileNames()
public java.util.Vector getFileFormats()
private void addCellsToFormat(javax.swing.tree.DefaultMutableTreeNode node, FileFormat format)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |