org.base.apps.api.view.swing
Class BoundComponentView<C extends Component>
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.base.apps.util.view.swing.BasePanel
org.base.apps.util.view.swing.ViewPanel<C>
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
|
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. |
| 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 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 |
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.
BoundComponentView
protected BoundComponentView()
BoundComponentView
protected BoundComponentView(ComponentView.LabelStyle style)
BoundComponentView
protected BoundComponentView(ViewBuilder.Axis axis,
ComponentView.LabelStyle style)
- Parameters:
axis -
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)
Copyright 2011, Blue Agate Software Entity (BASE)