edu.brook.ascape.view
Class ModelCustomizer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--edu.brook.ascape.view.PanelImp
                                |
                                +--edu.brook.ascape.view.PanelView
                                      |
                                      +--edu.brook.ascape.view.BaseCustomizer
                                            |
                                            +--edu.brook.ascape.view.ModelCustomizer
Direct Known Subclasses:
AutoCustomizer, ModelCustomizerSwing

public abstract class ModelCustomizer
extends BaseCustomizer

A panel for making changes to a model's settings.

Since:
1.1.1
Version:
1.2
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
 
Field Summary
protected  java.awt.Button applyButton
          The button for dismissing this dialog.
protected  java.awt.Button cancelButton
          The button for dismissing this dialog.
protected  java.awt.Button okButton
          The button for dismissing this dialog.
 
Fields inherited from class edu.brook.ascape.view.BaseCustomizer
buttonPanel, contentPanel, propertySupport, target
 
Fields inherited from class edu.brook.ascape.view.PanelView
awaitingUpdate, frame, name, recorder, recordNext, scape
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
ModelCustomizer()
          Constructs the dialog.
 
Method Summary
 void addScape(Scape scape)
          Sets the scape for the agent to act within.
protected abstract  void assignSettings()
          Assign the changes made in the panel's components back to the model.
 void build()
          Contructs the memebers of the customizer, a main panel to hold the customizer components, and ok, apply and cancel buttons to manage the interaction of the customizer with its target scape.
 boolean isLive()
          Returns true if the customizer is 'live' that is, changes to controls are reflected immeadiatly in the model, and false if changes are meant to take place only when the OK or Apply buttons are selected.
protected abstract  void retrieveSettings()
          Retrieve the settings from the model, and update the panel's components to reflect them.
 void update()
          Sets up model settings.
 
Methods inherited from class edu.brook.ascape.view.BaseCustomizer
addPropertyChangeListener, display, getButtonPanel, getContentPanel, getObject, removePropertyChangeListener, setButtonPanel, setContentPanel, setObject
 
Methods inherited from class edu.brook.ascape.view.PanelView
getGraphicsRecorder, getName, getScape, getViewFrame, onIterate, onSetup, onStart, onStop, onUpdate, paint, removeScape, scapeUpdated, setGraphicsRecorder, setName, setViewFrame, toString, updated
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, 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, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, 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, setSize, setSize, show, show, size, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

okButton

protected java.awt.Button okButton
The button for dismissing this dialog.

cancelButton

protected java.awt.Button cancelButton
The button for dismissing this dialog.

applyButton

protected java.awt.Button applyButton
The button for dismissing this dialog.
Constructor Detail

ModelCustomizer

public ModelCustomizer()
Constructs the dialog.
Method Detail

addScape

public void addScape(Scape scape)
              throws java.util.TooManyListenersException
Sets the scape for the agent to act within.
Parameters:
agent - the target agent.
Throws:
java.util.TooManyListenersException - on attempt to add a scape when one is allready added
Overrides:
addScape in class PanelView

isLive

public boolean isLive()
Returns true if the customizer is 'live' that is, changes to controls are reflected immeadiatly in the model, and false if changes are meant to take place only when the OK or Apply buttons are selected. False by default.

build

public void build()
Contructs the memebers of the customizer, a main panel to hold the customizer components, and ok, apply and cancel buttons to manage the interaction of the customizer with its target scape.
Overrides:
build in class BaseCustomizer

update

public void update()
Sets up model settings.
Overrides:
update in class BaseCustomizer

retrieveSettings

protected abstract void retrieveSettings()
Retrieve the settings from the model, and update the panel's components to reflect them.

assignSettings

protected abstract void assignSettings()
Assign the changes made in the panel's components back to the model.

(c) 1998-2000 The Brookings Insitution
Webpage