org.base.apps.api.view.swing
Class BoundComponentView<C extends Component>

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.base.apps.util.view.swing.BasePanel
                      extended by org.base.apps.util.view.swing.ViewPanel<C>
                          extended by org.base.apps.api.view.swing.BoundComponentView<C>
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, AppViewBuilder<BoundComponentView<C>,C>, BoundView, ComponentView<C>, Mutable<Object>, ViewBuilder<C>
Direct Known Subclasses:
AbstractBoundText, BoundViewPanel

public abstract class BoundComponentView<C extends Component>
extends ViewPanel<C>
implements BoundView, ComponentView<C>, AppViewBuilder<BoundComponentView<C>,C>

Base class for all bound JComponent views, implemented as an abstract class (rather than an interface) to mirror Swing's JComponent class hierarchy.

Author:
Kevan Simpson
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Nested classes/interfaces inherited from interface org.base.apps.api.view.BoundView
BoundView.Widget
 
Nested classes/interfaces inherited from interface org.base.apps.api.view.swing.ComponentView
ComponentView.LabelStyle
 
Nested classes/interfaces inherited from interface org.base.apps.util.view.swing.ViewBuilder
ViewBuilder.Axis
 
Field Summary
protected static int DEFAULT_COLUMNS
          Default number of columns for fields.
protected static int DEFAULT_ROWS
          Default number of rows for multi-line fields.
 
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
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
protected BoundComponentView()
           
protected BoundComponentView(ComponentView.LabelStyle style)
           
protected BoundComponentView(ViewBuilder.Axis axis, ComponentView.LabelStyle style)
           
 
Method Summary
protected static int align(ComponentView.LabelStyle style)
           
protected static ViewBuilder.Axis axis(ComponentView.LabelStyle style)
           
 BoundProperty bind(String name, BoundView view)
           
 void bindView(String name, BoundComponentView<C> view)
          Utility method to bind a subview and add it, and its label, to this container view.
 BoundComponentView<C> getAppView()
           
protected  C getBoundComponent()
           
protected  BoundViewSupport getBoundSupport()
           
 C getComponent()
           
 ComponentView.LabelStyle getLabelStyle()
           
 BoundProperty getProperty()
           
 Object getValue()
          Returns the object's Mutable value.
protected  JLabel newLabel(String name)
           
protected  void setBoundComponent(C boundComponent)
           
protected  void setBoundSupport(BoundViewSupport support)
           
 void setLabelStyle(ComponentView.LabelStyle style)
           
 void setProperty(BoundProperty prop)
           
 void setValue(Object val)
          Sets the object's Mutable value.
 
Methods inherited from class org.base.apps.util.view.swing.ViewPanel
addSection, addToRow, addView, endSection, getAxis, getCurrentRow, getRows, init, nextSection, nextSection, setAxis, setCurrentRow, setRows, startSection, startSection
 
Methods inherited from class org.base.apps.util.view.swing.BasePanel
initLog, log
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, 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, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, 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, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.base.apps.util.view.swing.ViewBuilder
addSection, addView, endSection, nextSection, nextSection, startSection, startSection
 

Field Detail

DEFAULT_COLUMNS

protected static int DEFAULT_COLUMNS
Default number of columns for fields.


DEFAULT_ROWS

protected static int DEFAULT_ROWS
Default number of rows for multi-line fields.

Constructor Detail

BoundComponentView

protected BoundComponentView()

BoundComponentView

protected BoundComponentView(ComponentView.LabelStyle style)

BoundComponentView

protected BoundComponentView(ViewBuilder.Axis axis,
                             ComponentView.LabelStyle style)
Parameters:
axis -
Method Detail

bindView

public void bindView(String name,
                     BoundComponentView<C> view)
Utility method to bind a subview and add it, and its label, to this container view.

Specified by:
bindView in interface AppViewBuilder<BoundComponentView<C extends Component>,C extends Component>
Parameters:
name - The bound property name of the subview.
view - The subview to bind and add.

getAppView

public BoundComponentView<C> getAppView()
Specified by:
getAppView in interface AppViewBuilder<BoundComponentView<C extends Component>,C extends Component>
See Also:
AppViewBuilder.getAppView()

bind

public BoundProperty bind(String name,
                          BoundView view)
Specified by:
bind in interface BoundView
See Also:
BoundView.bind(java.lang.String, org.base.apps.api.view.BoundView)

getProperty

public BoundProperty getProperty()
Specified by:
getProperty in interface BoundView
See Also:
BoundView.getProperty()

setProperty

public void setProperty(BoundProperty prop)
Specified by:
setProperty in interface BoundView
See Also:
BoundView.setProperty(org.base.apps.beans.BoundProperty)

getComponent

public C getComponent()
Specified by:
getComponent in interface ComponentView<C extends Component>
See Also:
ComponentView.getComponent()

getLabelStyle

public ComponentView.LabelStyle getLabelStyle()
Specified by:
getLabelStyle in interface ComponentView<C extends Component>
See Also:
ComponentView.getLabelStyle()

setLabelStyle

public void setLabelStyle(ComponentView.LabelStyle style)
Specified by:
setLabelStyle in interface ComponentView<C extends Component>
See Also:
ComponentView.setLabelStyle(org.base.apps.api.view.swing.ComponentView.LabelStyle)

getValue

public Object getValue()
Description copied from interface: Mutable
Returns the object's Mutable value.

Specified by:
getValue in interface Mutable<Object>
Returns:
the object's Mutable value.
See Also:
Mutable.getValue()

setValue

public void setValue(Object val)
Description copied from interface: Mutable
Sets the object's Mutable value.

Specified by:
setValue in interface Mutable<Object>
Parameters:
val - The value to set.
See Also:
Mutable.setValue(java.lang.Object)

getBoundSupport

protected BoundViewSupport getBoundSupport()
Returns:
the support

getBoundComponent

protected C getBoundComponent()
Returns:
the boundComponent

setBoundComponent

protected void setBoundComponent(C boundComponent)
Parameters:
boundComponent - the boundComponent to set

setBoundSupport

protected void setBoundSupport(BoundViewSupport support)
Parameters:
support - the support to set

newLabel

protected JLabel newLabel(String name)

align

protected static int align(ComponentView.LabelStyle style)

axis

protected static ViewBuilder.Axis axis(ComponentView.LabelStyle style)

Please visit Base Apps, hosted on Sourceforge.net.

Copyright 2011, Blue Agate Software Entity (BASE)