org.PingOO.DLAI.lib.PWidget
Class FormPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--org.PingOO.DLAI.lib.PWidget.PPanel
                                |
                                +--org.PingOO.DLAI.lib.PWidget.FormPanel

public class FormPanel
extends PPanel

A panel that uses the FormLayout by default, and exposes its methods directly on the panel.
This panel is a convenience object only, and is simply a compound of JPanel and FormLayout.

Since:
PingOO 2.0
Version:
2.0
Author:
Byron Hawkins (bhawkins@oz.net), Fabrice Bouyé (bouye@cur-archamps.fr)
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
 
Fields inherited from class org.PingOO.DLAI.lib.PWidget.PPanel
DEFAULT_LAYOUT, manager, module, toolTipKey
 
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
FormPanel()
          Creates a new intentance.
FormPanel(int internalHGap, int internalVGap, int externalHGap, int externalVGap)
           
 
Method Summary
 java.awt.Component add(java.awt.Component comp)
           
 void add(java.awt.Component label, java.awt.Component field, int row, int column)
          Adds label and field with alignment respective to the other labels and fields in column.
 void add(java.awt.Component label, java.awt.Component field, int row, int column, double fillRightPct)
          Addq label and field with alignment respective to the other labels and fields in column, and will stretch as far as preferredSize.width * fillRightPct to right justify.
 void add(java.awt.Component label, java.awt.Component field, int row, int column, int mode)
          Adds label and field with alignment respective to the other labels and fields in column, subject to the specified mode.
 void add(java.awt.Component label, java.awt.Component field, int row, int column, int mode, double fillRightPct)
          Adds label and field with alignment respective to the other labels and fields in column, subject to the specified mode, and will stretch as far as preferredSize.width * fillRightPct to right justify.
 java.awt.Component add(java.awt.Component comp, int index)
           
 void add(java.awt.Component component, int row, int column)
          Adds a component that will align with the labels in column.
 void add(java.awt.Component component, int row, int column, double fillRightPct)
          Adds a component that will align with the labels in column, and will stretch as far as preferredSize.width * fillRightPct to right justify.
 void add(java.awt.Component comp, java.lang.Object constraints)
           
 void add(java.awt.Component comp, java.lang.Object constraints, int index)
           
 java.awt.Component add(java.lang.String name, java.awt.Component comp)
           
 void addMultiRow(java.awt.Component label, java.awt.Component field, int startRow, int endRow, int column)
          Adds label and field with alignment respective to the other labels and fields in column. and span from startRow to endRow.
 void addMultiRow(java.awt.Component label, java.awt.Component field, int startRow, int endRow, int column, double fillRightPct)
          Adds label and field with alignment respective to the other labels and fields in column, will span from startRow to endRow, and will stretch as far as preferredSize.width * fillRightPct to reach the right side.
 void addMultiRow(java.awt.Component label, java.awt.Component field, int startRow, int endRow, int column, int mode)
          Adds label and field with alignment respective to the other labels and fields in column, subject to the specified mode, and span from startRow to endRow.
 void addMultiRow(java.awt.Component label, java.awt.Component field, int startRow, int endRow, int column, int mode, double fillRightPct)
          Adds label and field with alignment respective to the other labels and fields in column, subject to the specified mode, will span from startRow to endRow, and will stretch as far as preferredSize.width * fillRightPct to reach the right side.
 void addMultiRow(java.awt.Component component, int startRow, int endRow, int column)
          Adds a component that will align with the labels in column, and span from startRow to endRow.
 void addMultiRow(java.awt.Component component, int startRow, int endRow, int column, double fillRightPct)
          Adds a component that will align with the labels in column, will span from startRow to endRow, and will stretch as far as preferredSize.width * fillRightPct to reach the right side.
 int getExternalHGap()
          Returns the external horizontal gap.
 int getExternalVGap()
          Returns the external vertical gap.
 int getInternalHGap()
          Returns the internal horizontal gap.
 int getInternalVGap()
          Returns the internal vertical gap.
 java.awt.Dimension getPreferredSize()
          Returns the preferred size fo this component.
 void remove(java.awt.Component comp)
          removes from the JPanel and the FormLayout
 void setDefaultFillRightPct(double fillRightPct)
          fillRightPct will be used from now on when an add() method is called that does not include a (double)fillRightPct parameter.
 void setExternalHGap(int gap)
          Sets the external horizontal gap.
 void setExternalVGap(int gap)
          Sets the external vertical gap.
 void setInternalHGap(int gap)
          Sets the internal horizontal gap.
 void setInternalVGap(int gap)
          Sets the internal vertical gap.
 
Methods inherited from class org.PingOO.DLAI.lib.PWidget.PPanel
getManager, getModule, getTextKey, getToolTipKey, setLocalizedText, setLocalizedToolTipText, setManager, setModule, updateFont, updateLanguage, updateLanguage
 
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, 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
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, 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
 

Constructor Detail

FormPanel

public FormPanel()
Creates a new intentance.

FormPanel

public FormPanel(int internalHGap,
                 int internalVGap,
                 int externalHGap,
                 int externalVGap)
Method Detail

getInternalHGap

public int getInternalHGap()
Returns the internal horizontal gap.
Returns:
The internal horizontal gap.

getInternalVGap

public int getInternalVGap()
Returns the internal vertical gap.
Returns:
The internal vertical gap.

getExternalHGap

public int getExternalHGap()
Returns the external horizontal gap.
Returns:
The external horizontal gap.

getExternalVGap

public int getExternalVGap()
Returns the external vertical gap.
Returns:
The external verticla gap.

setInternalVGap

public void setInternalVGap(int gap)
Sets the internal vertical gap.
Parameters:
gap - The internal vertical gap.

setInternalHGap

public void setInternalHGap(int gap)
Sets the internal horizontal gap.
Parameters:
gap - The internal horizontal gap.

setExternalVGap

public void setExternalVGap(int gap)
Sets the external vertical gap.
Parameters:
gap - The external vertical gap.

setExternalHGap

public void setExternalHGap(int gap)
Sets the external horizontal gap.
Parameters:
gap - The external horizontal gap.

getPreferredSize

public java.awt.Dimension getPreferredSize()
Returns the preferred size fo this component.
Returns:
the preferred size fo this component.
Overrides:
getPreferredSize in class javax.swing.JComponent

add

public void add(java.awt.Component component,
                int row,
                int column)
Adds a component that will align with the labels in column.
Parameters:
component - The component to be added.
row - The row where to put the component.
column - The column where to put the component.

add

public void add(java.awt.Component label,
                java.awt.Component field,
                int row,
                int column)
Adds label and field with alignment respective to the other labels and fields in column.
Parameters:
label - The label to be associated with the field.
field - The field to be associated with the label.
row - The row where to put the components.
colum - The column where to put the components.

add

public void add(java.awt.Component label,
                java.awt.Component field,
                int row,
                int column,
                int mode)
Adds label and field with alignment respective to the other labels and fields in column, subject to the specified mode.
Parameters:
label - The label to be associated with the field.
field - The field to be associated with the label.
row - The row where to put the components.
colum - The column where to put the components.
mode - The mode used.

addMultiRow

public void addMultiRow(java.awt.Component component,
                        int startRow,
                        int endRow,
                        int column)
Adds a component that will align with the labels in column, and span from startRow to endRow.
Parameters:
component - The component to be added.
startRow - The first row where to add the component.
endRow - The last row where to add the component.
column - The column where to add the component.

addMultiRow

public void addMultiRow(java.awt.Component label,
                        java.awt.Component field,
                        int startRow,
                        int endRow,
                        int column)
Adds label and field with alignment respective to the other labels and fields in column. and span from startRow to endRow.
Parameters:
label - The label to be associated with the field.
field - The field to be associated with the label.
startRow - The first row where to add the components.
endRow - The last row where to add the components.
column - The column where to add the components.

addMultiRow

public void addMultiRow(java.awt.Component label,
                        java.awt.Component field,
                        int startRow,
                        int endRow,
                        int column,
                        int mode)
Adds label and field with alignment respective to the other labels and fields in column, subject to the specified mode, and span from startRow to endRow.
Parameters:
label - The label to be associated with the field.
field - The field to be associated with the label.
startRow - The first row where to add the components.
endRow - The last row where to add the components.
column - The column where to add the components.
mode - The mode to use.

add

public void add(java.awt.Component component,
                int row,
                int column,
                double fillRightPct)
Adds a component that will align with the labels in column, and will stretch as far as preferredSize.width * fillRightPct to right justify.
Parameters:
component - The component to be added.
row - The row where to insert this component.
column - The column where to insert this component.
fillRightPct -  

add

public void add(java.awt.Component label,
                java.awt.Component field,
                int row,
                int column,
                double fillRightPct)
Addq label and field with alignment respective to the other labels and fields in column, and will stretch as far as preferredSize.width * fillRightPct to right justify.
Parameters:
label - The label to be associated with the field.
field - The field to be associated with the label.
row - The row where to insert this component.
column - The column where to insert this component.
fillRightPct -  

add

public void add(java.awt.Component label,
                java.awt.Component field,
                int row,
                int column,
                int mode,
                double fillRightPct)
Adds label and field with alignment respective to the other labels and fields in column, subject to the specified mode, and will stretch as far as preferredSize.width * fillRightPct to right justify.
Parameters:
label - The label to be associated with the field.
field - The field to be associated with the label.
row - The row where to insert this component.
column - The column where to insert this component.
mode - The mode to use.
fillRightPct -  

addMultiRow

public void addMultiRow(java.awt.Component component,
                        int startRow,
                        int endRow,
                        int column,
                        double fillRightPct)
Adds a component that will align with the labels in column, will span from startRow to endRow, and will stretch as far as preferredSize.width * fillRightPct to reach the right side.
Parameters:
component - The component to be added.
startRow - The first row where to add the components.
endRow - The last row where to add the components.
column - The column where to insert this component.
fillRightPct -  

addMultiRow

public void addMultiRow(java.awt.Component label,
                        java.awt.Component field,
                        int startRow,
                        int endRow,
                        int column,
                        double fillRightPct)
Adds label and field with alignment respective to the other labels and fields in column, will span from startRow to endRow, and will stretch as far as preferredSize.width * fillRightPct to reach the right side.
Parameters:
label - The label to be associated with the field.
field - The field to be associated with the label.
startRow - The first row where to add the components.
endRow - The last row where to add the components.
column - The column where to insert this component.
fillRightPct -  

addMultiRow

public void addMultiRow(java.awt.Component label,
                        java.awt.Component field,
                        int startRow,
                        int endRow,
                        int column,
                        int mode,
                        double fillRightPct)
Adds label and field with alignment respective to the other labels and fields in column, subject to the specified mode, will span from startRow to endRow, and will stretch as far as preferredSize.width * fillRightPct to reach the right side.
Parameters:
label - The label to be associated with the field.
field - The field to be associated with the label.
startRow - The first row where to add the components.
endRow - The last row where to add the components.
column - The column where to insert this component.
mode - the mode to use.
fillRightPct -  

remove

public void remove(java.awt.Component comp)
removes from the JPanel and the FormLayout
Parameters:
comp - The component to be removed.
Overrides:
remove in class java.awt.Container

setDefaultFillRightPct

public void setDefaultFillRightPct(double fillRightPct)
fillRightPct will be used from now on when an add() method is called that does not include a (double)fillRightPct parameter.
Parameters:
fillRightPct -  

add

public java.awt.Component add(java.awt.Component comp)
Overrides:
add in class java.awt.Container

add

public java.awt.Component add(java.lang.String name,
                              java.awt.Component comp)
Overrides:
add in class java.awt.Container

add

public java.awt.Component add(java.awt.Component comp,
                              int index)
Overrides:
add in class java.awt.Container

add

public void add(java.awt.Component comp,
                java.lang.Object constraints)
Overrides:
add in class java.awt.Container

add

public void add(java.awt.Component comp,
                java.lang.Object constraints,
                int index)
Overrides:
add in class java.awt.Container