java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.scopemvc.view.swing.SwingView
org.scopemvc.view.swing.SPanel
- All Implemented Interfaces:
- javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, org.scopemvc.view.util.ModelBindable, org.scopemvc.core.PropertyView, Refreshable, java.io.Serializable, org.scopemvc.core.View
- public class SPanel
- extends SwingView
- implements org.scopemvc.view.util.ModelBindable, Refreshable, org.scopemvc.core.PropertyView
A JPanel implementation of View for use
in Swing-based user interfaces.
org.scopemvc.controller.swing.SwingContext
uses the following
methods from the SwingView base class
that should be overridden in subclasses
that can be shown as top-level views in a Window:
SPanel can be bound either to an entire model object,
or to a property of a model. In either case it binds
child components to the model it shows (either the
entire model or a property of it, assumed to be a submodel).
Note: See SUnboundPanel for an SPanel that doesn't
bind to a model, isolating its contained views from the model-binding
hierarchy.
SPanel uses a
SwingBoundModel
delegate.
SPanel implements the
CHANGE_MODEL_CONTROL_ID Control
when the shown model object changes.
This supports BasicController which
needs to know when its current model changes.
- Version:
- $Revision: 1.3 $ $Date: 2002/01/26 09:46:20 $
| Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Fields inherited from class java.awt.Container |
|
| Methods inherited from class org.scopemvc.view.swing.SwingView |
getCloseControl, getController, getDisplayMode, getLastShownBounds, getMenuBar, getTitle, getViewBounds, isResizable, issueControl, setController, setLastShownBounds, setViewBounds, toString |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle |
LOG
private static final org.apache.commons.logging.Log LOG
boundModel
private SwingBoundModel boundModel
- Helper to manage model to view binding.
shownModel
private java.lang.Object shownModel
- The model object that the SPanel presents, which may be
a property of the bound model if a Selector
is specified.
SPanel
public SPanel()
getBoundModel
public final java.lang.Object getBoundModel()
- Specified by:
getBoundModel in interface org.scopemvc.core.View
setBoundModel
public void setBoundModel(java.lang.Object inModel)
- Specified by:
setBoundModel in interface org.scopemvc.core.View
getSelector
public final org.scopemvc.core.Selector getSelector()
- Specified by:
getSelector in interface org.scopemvc.core.PropertyView
setSelector
public final void setSelector(org.scopemvc.core.Selector inSelector)
- Specified by:
setSelector in interface org.scopemvc.core.PropertyView
setSelectorString
public final void setSelectorString(java.lang.String inSelectorString)
updateFromProperty
public void updateFromProperty(java.lang.Object inValue,
boolean inReadOnly)
- Ignores inReadOnly.
- Specified by:
updateFromProperty in interface org.scopemvc.view.util.ModelBindable
getViewValue
public final java.lang.Object getViewValue()
- Makes no sense: can't change the property using an SPanel!
- Specified by:
getViewValue in interface org.scopemvc.view.util.ModelBindable
validationFailed
public void validationFailed(java.lang.Exception inException)
- Makes no sense.
- Specified by:
validationFailed in interface org.scopemvc.view.util.ModelBindable
validationSuccess
public void validationSuccess()
- Makes no sense.
- Specified by:
validationSuccess in interface org.scopemvc.view.util.ModelBindable
getShownModel
public final java.lang.Object getShownModel()
- Get the model object that the SPanel presents, which may be
a property of the bound model if a Selector
is specified.
setShownModel
private void setShownModel(java.lang.Object inModel)
- Called internally from updateFromProperty(). Issues
a CHANGE_MODEL_CONTROL_ID Control to notify parent Controller
of the change.
populateSubComponents
private static void populateSubComponents(java.awt.Component inComponent,
java.lang.Object inModel)
refresh
public void refresh()
- Description copied from interface:
Refreshable
- Update the widget with the current state of the bound model.
Probably something like this:
Object propertyValue = boundModel.getPropertyValue();
boolean propertyReadOnly = boundModel.getPropertyReadOnly();
updateFromProperty(propertyValue, propertyReadOnly);
- Specified by:
refresh in interface Refreshable
refreshSubComponents
private static void refreshSubComponents(java.awt.Component inComponent)