EASE.Sensing.Specification
Class NoEditDisplay

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--EASE.Sensing.Specification.NoEditDisplay

public class NoEditDisplay
extends javax.swing.JPanel
implements ChangeListener

This class is for displaying the available public information but not allowing editing.

Basically designed for Agent Specification system access to sensing stuff.

Has the very ugly property that a whole pile of EnhancedCombos are made but only one is instantiated.

Subtle bug for when new files are automatically opened by SpecExport this may not be updated in a timely way. The change listening does work but a little care needs to be taken to ensure the order of getting Cells and setting them is OK. In particular it seems they like seperate lines, i.e. don't get a cell and set it in the same line. See setSelected(CellReference cr) for an Example

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent, javax.swing.JComponent.IntVector, javax.swing.JComponent.KeyboardBinding, javax.swing.JComponent.KeyboardState
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Field Summary
static int ACTIVATION
          Choose a Satisfaction NoEdit
private  boolean allowNone
           
static int BASIC
          Choose an BASIC NoEdit This is designed for filling in parameters for agents.
(package private)  EnhancedCombo curr
           
private  java.util.Vector instantiated
           
private  Cell noneCell
           
(package private)  EnhancedCombo optionsAct
           
(package private)  EnhancedCombo optionsBasic
           
(package private)  EnhancedCombo optionsSatis
           
(package private)  EnhancedCombo optionsTran
           
static int SATISFACTION
          Choose a Satisfaction NoEdit
private  SpecExport spec
           
static int TRANSITION
          Choose a Transition NoEdit
private  int type
           
 
Fields inherited from class javax.swing.JPanel
defaultLayout, uiClassID
 
Fields inherited from class javax.swing.JComponent
_bounds, accessibleContext, alignmentX, alignmentY, ANCESTOR_USING_BUFFER, ancestorNotifier, autoscroller, border, changeSupport, clientProperties, flags, HAS_FOCUS, IS_DOUBLE_BUFFERED, IS_OPAQUE, IS_PAINTING_TILE, KEYBOARD_BINDINGS_KEY, listenerList, maximumSize, minimumSize, NEXT_FOCUS, paintImmediatelyClip, preferredSize, readObjectCallbacks, REQUEST_FOCUS_DISABLED, tmpRect, TOOL_TIP_TEXT_KEY, ui, uiClassID, UNDEFINED_CONDITION, vetoableChangeSupport, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, maxSize, ncomponents, serialVersionUID
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, assert, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, serialVersionUID, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
NoEditDisplay(SpecExport spec)
          Standard Constructor
 
Method Summary
 void addNone(boolean flag)
          Indicate whether or not a "none" option should be added to the list of options.
 void changeOccurred()
          Watches out for changes in main specification system
private  void createAct()
           
private  void createBasic()
           
private  void createSatis()
           
private  void createTran()
           
private  Cell getCell(CellReference ref)
          Returns the cell associated with a particular reference.
 CellReference getReference()
          Returns a cell reference for the currently selected cell May be a problem if multiple files are open.
private  void refresh()
           
private  void setInstantiated(java.util.Vector v)
          Set the instantiated parameters for the cell.
 void setSelected(CellReference cr)
          Set the currently selected item to be the one pointed to by CellReference.
 void setType(int type)
          Choose whether to display satisfactions or activations
 
Methods inherited from class javax.swing.JPanel
, getAccessibleContext, getUIClassID, paramString, updateUI, writeObject
 
Methods inherited from class javax.swing.JComponent
_paintImmediately, addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, adjustPaintFlags, alwaysOnTop, bindingForKeyStroke, computeVisibleRect, computeVisibleRect, contains, createToolTip, enableSerialization, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperties, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getFlag, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, keyboardBindings, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paintWithBuffer, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyBindings, processKeyBindingsForAllComponents, processKeyEvent, processMouseMotionEvent, putClientProperty, readObject, rectangleIsObscured, registerKeyboardAction, registerKeyboardAction, registerWithKeyboardManager, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFlag, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, shouldDebugGraphics, superProcessMouseMotionEvent, unregisterKeyboardAction, unregisterWithKeyboardManager, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyOrientation, countComponents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getLayout, getMouseEventTarget, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPrint, list, list, locate, minimumSize, nextFocus, paintComponents, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, print, printComponents, printOneComponent, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFocusOwner, setLayout, transferFocus, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, constructComponentName, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getToolkit, getToolkitImpl, getTreeLock, getWindowForObject, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isEnabledImpl, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

curr

EnhancedCombo curr

optionsSatis

EnhancedCombo optionsSatis

optionsAct

EnhancedCombo optionsAct

optionsTran

EnhancedCombo optionsTran

optionsBasic

EnhancedCombo optionsBasic

instantiated

private java.util.Vector instantiated

type

private int type

spec

private SpecExport spec

allowNone

private boolean allowNone

noneCell

private Cell noneCell

SATISFACTION

public static final int SATISFACTION
Choose a Satisfaction NoEdit


ACTIVATION

public static final int ACTIVATION
Choose a Satisfaction NoEdit


TRANSITION

public static final int TRANSITION
Choose a Transition NoEdit


BASIC

public static final int BASIC
Choose an BASIC NoEdit

This is designed for filling in parameters for agents.

Constructor Detail

NoEditDisplay

public NoEditDisplay(SpecExport spec)
Standard Constructor
Method Detail

setType

public void setType(int type)
Choose whether to display satisfactions or activations

addNone

public void addNone(boolean flag)
Indicate whether or not a "none" option should be added to the list of options.

At present this only affects basic panel.


changeOccurred

public void changeOccurred()
Watches out for changes in main specification system
Specified by:
changeOccurred in interface ChangeListener

getReference

public CellReference getReference()
Returns a cell reference for the currently selected cell

May be a problem if multiple files are open.

If the Cell has parameters they are properly stored (by SpecExport) as ParameterReferences.


getCell

private Cell getCell(CellReference ref)
Returns the cell associated with a particular reference. This function was designed so that instantiated parameters at the agent level can be set correctly.


setSelected

public void setSelected(CellReference cr)
Set the currently selected item to be the one pointed to by CellReference.

Notice that if this is combined into one line it doesn't work!!!


setInstantiated

private void setInstantiated(java.util.Vector v)
Set the instantiated parameters for the cell.


createSatis

private void createSatis()

createAct

private void createAct()

createTran

private void createTran()

createBasic

private void createBasic()

refresh

private void refresh()