EASE.Sensing.Specification
Class SpecExport

java.lang.Object
  |
  +--EASE.Sensing.Specification.SpecExport

class SpecExport
extends java.lang.Object
implements ChangeProducer, Constants

This is to give actions etc. enough access to Specification to do whatever it needs.


Field Summary
private  java.util.Vector changeListeners
           
private  Debugger debugger
           
static javax.swing.JFileChooser fileChooser
           
private static OpenFileAction openFileAction
           
private static java.util.HashMap openFiles
           
private static Specification s
           
static boolean unsavedChanges
          This variable records whether changes have occurred since last save.
 
Constructor Summary
SpecExport(Specification s)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e, java.awt.Component source)
           
 java.util.Vector activations()
           
 void addChangeListener(ChangeListener l)
           
 void Cancel()
           
private  void changePanel(javax.swing.JComponent panel)
          Change over the centre panel
 java.util.Vector constants()
           
 void currentPanelDone()
           
 void editActivationPanel(Activation s)
           
 void editConditionalPanel(Conditional c)
           
 void editConstantPanel(Constant c)
           
 void editIfPanel(IfStatement i)
           
 void editSatisfactionPanel(Satisfaction s)
           
 void editTransitionPanel(TransitionCondition tc)
           
 void editUnaryPanel(UnaryExpression c)
           
 java.util.Vector expressions()
           
 javax.swing.JFrame frame()
          Get the main specification frame.
static Cell getCell(CellReference cr)
           
private static Cell getCell(java.lang.String name)
          Gets a Cell from the store.
private  java.util.Vector getCellsByCellType(java.lang.String cellType)
           
 java.util.Vector getCellsByReturnType(int type)
           
static ExtensionFileFilter getConditionFilter()
          Get an extension filter for condition files
 java.util.Vector getFileOutput()
           
 NoEditDisplay getNoEditDisplay()
          Get a non editiable display of the available Cells.
 CellReference getReference(Cell c)
          Access for storable reference to a condition.
 Cell getSelectedCell()
          Get the currently selected Tree node Set its treepath in case its needed.
static ExtensionFileFilter getSpecificationFilter()
          Get an extension filter for condition files
 java.util.Vector ifs()
           
 void newActivationPanel()
           
 void newConstantPanel()
           
 void newExpressionPanel()
           
 void newIfPanel()
           
 void newSatisfactionPanel()
           
 void newTransitionPanel()
           
 void newUnaryPanel()
           
 void notifyChange()
           
 void openFile(java.lang.String fileName)
           
 void removeCell(Cell c)
           
 void removeChangeListener(ChangeListener l)
           
 java.util.Vector satisfactions()
           
 java.util.Vector sensors()
           
static void setCellFileName(javax.swing.tree.DefaultMutableTreeNode node)
          Set the file name for a single Node
 java.util.Vector transitions()
           
 java.util.Vector unaryExpressions()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

fileChooser

public static javax.swing.JFileChooser fileChooser

unsavedChanges

public static boolean unsavedChanges
This variable records whether changes have occurred since last save. Any object that makes a change should set this to true.

The SaveAction sets it back to false if all saves succeed.


openFiles

private static java.util.HashMap openFiles

openFileAction

private static OpenFileAction openFileAction

s

private static Specification s

debugger

private Debugger debugger

changeListeners

private java.util.Vector changeListeners
Constructor Detail

SpecExport

public SpecExport(Specification s)
Method Detail

editConstantPanel

public void editConstantPanel(Constant c)

editConditionalPanel

public void editConditionalPanel(Conditional c)

editUnaryPanel

public void editUnaryPanel(UnaryExpression c)

editIfPanel

public void editIfPanel(IfStatement i)

editSatisfactionPanel

public void editSatisfactionPanel(Satisfaction s)

editActivationPanel

public void editActivationPanel(Activation s)

editTransitionPanel

public void editTransitionPanel(TransitionCondition tc)

newConstantPanel

public void newConstantPanel()

newExpressionPanel

public void newExpressionPanel()

newUnaryPanel

public void newUnaryPanel()

newIfPanel

public void newIfPanel()

newSatisfactionPanel

public void newSatisfactionPanel()

newActivationPanel

public void newActivationPanel()

newTransitionPanel

public void newTransitionPanel()

changePanel

private void changePanel(javax.swing.JComponent panel)
Change over the centre panel


Cancel

public void Cancel()

currentPanelDone

public void currentPanelDone()

getSelectedCell

public Cell getSelectedCell()
Get the currently selected Tree node

Set its treepath in case its needed.


getCellsByCellType

private java.util.Vector getCellsByCellType(java.lang.String cellType)

sensors

public java.util.Vector sensors()

constants

public java.util.Vector constants()

expressions

public java.util.Vector expressions()

unaryExpressions

public java.util.Vector unaryExpressions()

ifs

public java.util.Vector ifs()

satisfactions

public java.util.Vector satisfactions()

activations

public java.util.Vector activations()

transitions

public java.util.Vector transitions()

getCellsByReturnType

public java.util.Vector getCellsByReturnType(int type)

frame

public javax.swing.JFrame frame()
Get the main specification frame.


getNoEditDisplay

public NoEditDisplay getNoEditDisplay()
Get a non editiable display of the available Cells.


removeCell

public void removeCell(Cell c)

getFileOutput

public java.util.Vector getFileOutput()

getConditionFilter

public static ExtensionFileFilter getConditionFilter()
Get an extension filter for condition files

getSpecificationFilter

public static ExtensionFileFilter getSpecificationFilter()
Get an extension filter for condition files

setCellFileName

public static void setCellFileName(javax.swing.tree.DefaultMutableTreeNode node)
Set the file name for a single Node


openFile

public void openFile(java.lang.String fileName)

getReference

public CellReference getReference(Cell c)
Access for storable reference to a condition.

Parameters:
c - Cell that a reference should be retrieved for.

If the cell is a parameter a parameter reference is returned.

Otherwise a proper CellReference is returned, possibly with a list of parameter references included if the cell has parameters. The parameter references are stored as ParameterReferences.

The parameter reference part may not work correctly for multiple files, need to check.

Perhaps should be moved to CellStore?


getCell

public static Cell getCell(CellReference cr)

getCell

private static Cell getCell(java.lang.String name)
Gets a Cell from the store.

Name needs to be fullname


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e,
                            java.awt.Component source)

addChangeListener

public void addChangeListener(ChangeListener l)
Specified by:
addChangeListener in interface ChangeProducer

removeChangeListener

public void removeChangeListener(ChangeListener l)
Specified by:
removeChangeListener in interface ChangeProducer

notifyChange

public void notifyChange()