Arch4J 1.1

org.arch4j.ui.components
Class PropertiesPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--org.arch4j.ui.components.PropertiesPanel
All Implemented Interfaces:
Accessible, ActionListener, EditablePropertyPanel, EventListener, ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
ChoicePanel, MultiChoicePanel, NullPanel

public abstract class PropertiesPanel
extends JPanel
implements EditablePropertyPanel, ActionListener

This is the base panel for all panels in the user interfaces.

See Also:
Serialized Form

Field Summary
protected  int bottomOffset
           
protected  int boxOffset
           
protected  int buttonOffset
           
protected  JButton cancelButton
           
 JDialog dialog
           
protected  int fieldOffset
           
 FractionalLayout layout
           
protected  int leftIndent
           
protected  boolean m_isDirty
           
protected  JButton okButton
           
 Performer performer
           
 boolean returnValue
           
protected  int rightIndent
           
protected  int topOffset
           
protected  int x
           
protected  int y
           
protected  int yHeight
           
protected  int yIncrement
           
 
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
PropertiesPanel()
          PropertiesPanel constructor comment.
PropertiesPanel(int aLeftMargin, int aLeftIndent, int aRightIndent, int aFieldOffset)
          PropertiesPanel constructor comment.
 
Method Summary
 void actionPerformed(ActionEvent arg1)
          Listener callback method.
 JCheckBox addCheckBox(JLabel label)
          Add a comboBox field.
 JCheckBox addCheckBox(String labelString)
          Add a comboBox field.
 JComboBox addComboBox(JLabel label, Vector possibleValues, Object initialValue)
          Add a comboBox field.
 JComboBox addComboBox(JLabel label, Vector possibleValues, Object initialValue, int aWidth)
          Add a comboBox field.
 JComboBox addComboBox(String labelString, Vector possibleValues, Object initialValue)
          Add a comboBox field.
 JComboBox addComboBox(String labelString, Vector possibleValues, Object initialValue, int aWidth)
          Add a comboBox field.
protected  void addComponent(Component aComponent, int aStartingOffset, int aWidth)
          Add a component to the panel without positioning to the next line.
protected  void addComponentRelativeToBottom(Component aComponent, int aBottomOffset)
          Add a component to the panel starting at the current y location and the bottom constraint on the bottom of the panel as it streches.
protected  void addComponentRelativeToBottom(Component aComponent, int aBottomOffset, int aHeight)
          Add a component to the panel starting at the current y location and the bottom constraint on the bottom of the panel as it streches.
protected  void addComponentRelativeToBottom(Component aComponent, int aBottomOffset, int aHeight, int aWidth)
          Add a component to the panel starting at the current y location and the bottom constraint on the bottom of the panel as it streches.
protected  void addComponentRelativeToBottomWithWidth(Component aComponent, int aBottomOffset, int aWidth)
          Add a component to the panel starting at the current y location and the bottom constraint on the bottom of the panel as it streches.
protected  void addComponentRelativeToRight(Component aComponent, int aStartingOffset)
          Add a component to the panel without positioning to the next line.
protected  void addComponentRelativeToRight(Component aComponent, int aStartingOffset, int aHeight)
          Add a component to the panel without positioning to the next line.
 void addComponents()
          This method was created by a SmartGuide.
 JButton addHelpButton()
           
 JButton addHelpButton(int yIncrement)
           
 JLabel addLabel(String aLabel)
           
 JLabel addLabel(String aLabel, int yIncrement)
           
protected  JList addList(JLabel label, Vector contents, String selectedItem, int height)
          Add a text area.
protected  JList addList(String labelString, Vector contents, String selectedItem, int height)
          Add a text area.
 JTextField addNewlineTextField(JLabel label, String initialValue)
          Add a label and a text field, with the text field on the line below the label example: label: [textfield].
 JTextField addNewlineTextField(String labelString, String initialValue)
          Add a label and a text field, with the text field on the line below the label example: label: [textfield].
protected  void addOkCancelButtons()
          Add the OK and Cancel buttons to the panel.
protected  void addPanel(JPanel aPanel)
          Add the panel to our canvas and used the height of the panel.
protected  void addPanel(JPanel aPanel, int aHeight)
          Add the panel to our canvas with the given height.
protected  void addPanel(JPanel aPanel, int anOffset, int aWidth, int aHeight)
          Add the panel to our canvas with the given height.
 void addPanelTypeForDebug()
           
protected  void addScrollPane(JScrollPane aScrollPane, int aHeight)
          Add the scroll pane to our canvas with the given height.
 SearchComboBox addSearchComboBox(JLabel label, Vector possibleValues, Object initialValue)
          Add a comboBox field.
 SearchComboBox addSearchComboBox(JLabel label, Vector possibleValues, Object initialValue, int aWidth)
          Add a comboBox field.
 SearchComboBox addSearchComboBox(String labelString, Vector possibleValues, Object initialValue)
          Add a comboBox field.
 SearchComboBox addSearchComboBox(String labelString, Vector possibleValues, Object initialValue, int aWidth)
          Add a comboBox field.
 JTable addTable(JLabel label, TableModel tableModel, int height)
          This method was created by a SmartGuide.
 JTable addTable(String tableLabel, TableModel tableModel, int height)
          This method was created by a SmartGuide.
protected  MaxLengthTextArea addTextArea(JLabel label, String contents, int height)
          Add a max length text area.
protected  MaxLengthTextArea addTextArea(JLabel label, String contents, int height, boolean tabTraversable)
          Add a max length text area.
protected  MaxLengthTextArea addTextArea(String labelString, String contents, int height)
          Add a max length text area.
protected  MaxLengthTextArea addTextArea(String labelString, String contents, int height, boolean tabTraversable)
          Add a max length text area.
protected  JTextArea addTextAreaToBottom(JLabel label, String contents, int bottomOffset)
          Add a text area.
protected  JTextArea addTextAreaToBottom(String labelString, String contents, int bottomOffset)
          Add a text area.
 MaxLengthField addTextField(JLabel label, String initialValue)
          Add a text field.
 MaxLengthField addTextField(JLabel label, String initialValue, int width)
          Add a text field.
 MaxLengthField addTextField(String labelString, String initialValue)
          Add a text field.
 MaxLengthField addTextField(String labelString, String initialValue, int aWidth)
          Add a text field.
 JLabel addTextLabel(JLabel label, String value)
          Add non-editable text preceded by a label.
 JLabel addTextLabel(String labelString, String value)
          Add non-editable text preceded by a label.
 void addTitle()
           
 void cancelPressed()
          Invoked when the cancel button is pressed.
protected  void closeWindow()
          Close the top level window.
static void disableTextField(JTextField aTextField)
          Disable a text field.
 boolean displayConfirm(String aMessage, String aTitle)
          Display an Confirmation dialog to the user
 void displayError(String anError, String aTitle)
          Display an error to the user.
 void displayInformation(String aMessage, String aTitle)
          Display an informational message to the user.
 void displayWarning(String aWarning, String aTitle)
          Display a warning to the user.
static void enableTextField(JTextField aTextField)
          Enable a text field.
 void ensureVisible(JComponent aComponent)
          Make sure the component is visible if in a scroll pane.
 void focusGained(FocusEvent e)
           
 void focusLost(FocusEvent e)
           
protected  JButton getDefaultButton()
           
 int getFieldOffset()
          accessor for fieldOffset
 int getPanelHeight()
          Get the height of the panel.
 int getPanelWidth()
          Gets the calculated width of the panel.
 Dimension getPreferredSize()
          This method was created by a SmartGuide.
 int getRightIndent()
          accessor for rightIndent
 ComponentStateMonitor getStateMonitor()
          Gets the state monitor for this panel.
 String getTitle()
          This method was created by a SmartGuide.
 void highlightAndEnsureVisible(FocusEvent e)
           
 void initialize()
          This method was created by a SmartGuide.
 boolean isAdjustingFieldValues()
           
 boolean isDialog()
          Returns true if this panel is being shown in a dialog.
 boolean isDirty()
          Returns true if there have been any changes to the panel that have not been committed.
 boolean isDisplayingMessage()
           
 boolean isValidSize(String sizeString, String applicationName)
           
protected  void monitorComponentState(JCheckBox aCheckBox)
          Add the field to the monitor.
protected  void monitorComponentState(JComboBox aComboBox)
          Add the field to the monitor.
protected  void monitorComponentState(JList aList)
          Add the field to the monitor.
protected  void monitorComponentState(JTable aTable)
          Add the field to the monitor.
protected  void monitorComponentState(JTextArea aTextArea)
          Add the field to the monitor.
protected  void monitorComponentState(JTextField aTextField)
          Add the field to the monitor.
 void okPressed()
          Invoked when the ok/apply button is pressed on the user interface.
protected  void positionToNextLine()
          Position the x and y coordinates for the next row.
 void resetStateMonitor()
          Reset the state of the monitor.
protected  void resizePanel(JPanel aPanel, int aHeight)
          Resize panel on our canvas with the given height.
protected  void resizePanel(JPanel aPanel, int aWidth, int aHeight)
          Resize panel on our canvas with the given height.
 void setDefaultCursor()
          Set the wait cursor.
 void setFieldOffset(int newFieldOffset)
          mutator for fieldOffset
 void setIsAdjustingFieldValues(boolean isAdjusting)
          Marked by implementors if PropertiesPanel to flag when fields are being adjusted programatically.
 void setLeftIndent(int anIndent)
          Set the indentation from the left when placing elements.
 void setLeftMargin(int aPosition)
          Set the left margin for placing elements.
 void setRightIndent(int newRightIndent)
          mutator for rightIndent
protected  void setupComponentMonitoring()
          Setup the components that you wish to have their state tracked.
 void setWaitCursor()
          Set the wait cursor.
 boolean showDialog(Component parent, String title)
          Show this panel as a dialog without resizing.
 boolean showDialog(Component parent, String title, boolean resizable)
          Show this panel as a dialog.
 boolean update()
          Update the values from the interface back to the domain object.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, getPropertyChangeListeners, getPropertyChangeListeners, 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, removePropertyChangeListener, removePropertyChangeListener, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, 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, 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, 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
 

Field Detail

layout

public FractionalLayout layout

performer

public Performer performer

dialog

public JDialog dialog

returnValue

public boolean returnValue

m_isDirty

protected boolean m_isDirty

okButton

protected JButton okButton

cancelButton

protected JButton cancelButton

x

protected int x

y

protected int y

leftIndent

protected int leftIndent

rightIndent

protected int rightIndent

topOffset

protected int topOffset

bottomOffset

protected int bottomOffset

fieldOffset

protected int fieldOffset

yHeight

protected int yHeight

yIncrement

protected int yIncrement

boxOffset

protected int boxOffset

buttonOffset

protected int buttonOffset
Constructor Detail

PropertiesPanel

public PropertiesPanel()
PropertiesPanel constructor comment.


PropertiesPanel

public PropertiesPanel(int aLeftMargin,
                       int aLeftIndent,
                       int aRightIndent,
                       int aFieldOffset)
PropertiesPanel constructor comment.

Method Detail

actionPerformed

public void actionPerformed(ActionEvent arg1)
Listener callback method. Default is to have *this* perform the actionCommand.

Specified by:
actionPerformed in interface ActionListener

addCheckBox

public JCheckBox addCheckBox(String labelString)
Add a comboBox field.


ensureVisible

public void ensureVisible(JComponent aComponent)
Make sure the component is visible if in a scroll pane.


addCheckBox

public JCheckBox addCheckBox(JLabel label)
Add a comboBox field.


addComboBox

public JComboBox addComboBox(String labelString,
                             Vector possibleValues,
                             Object initialValue)
Add a comboBox field.

Parameters:
labelString - The text for the label.
possibleValues - The list of possible values.
initialValue - The initial selection.

addComboBox

public JComboBox addComboBox(String labelString,
                             Vector possibleValues,
                             Object initialValue,
                             int aWidth)
Add a comboBox field.

Parameters:
labelString - The text for the label.
possibleValues - The list of possible values.
initialValue - The initial selection.
aWidth - The width of the field in pixels

addComboBox

public JComboBox addComboBox(JLabel label,
                             Vector possibleValues,
                             Object initialValue)
Add a comboBox field.

Parameters:
label - The label to use for the combo-box.
possibleValues - The list of possible values.
initialValue - The initial selection.

addComboBox

public JComboBox addComboBox(JLabel label,
                             Vector possibleValues,
                             Object initialValue,
                             int aWidth)
Add a comboBox field.

Parameters:
label - The label to use for the combo-box.
possibleValues - The list of possible values.
initialValue - The initial selection.
aWidth - The width of the field in pixels

addSearchComboBox

public SearchComboBox addSearchComboBox(String labelString,
                                        Vector possibleValues,
                                        Object initialValue)
Add a comboBox field.

Parameters:
labelString - The text for the label.
possibleValues - The list of possible values.
initialValue - The initial selection.

addSearchComboBox

public SearchComboBox addSearchComboBox(String labelString,
                                        Vector possibleValues,
                                        Object initialValue,
                                        int aWidth)
Add a comboBox field.

Parameters:
labelString - The text for the label.
possibleValues - The list of possible values.
initialValue - The initial selection.
aWidth - The width of the field in pixels

addSearchComboBox

public SearchComboBox addSearchComboBox(JLabel label,
                                        Vector possibleValues,
                                        Object initialValue)
Add a comboBox field.

Parameters:
label - The label to use for the combo-box.
possibleValues - The list of possible values.
initialValue - The initial selection.

addSearchComboBox

public SearchComboBox addSearchComboBox(JLabel label,
                                        Vector possibleValues,
                                        Object initialValue,
                                        int aWidth)
Add a comboBox field.

Parameters:
label - The label to use for the combo-box.
possibleValues - The list of possible values.
initialValue - The initial selection.
aWidth - The width of the field in pixels

addComponents

public void addComponents()
This method was created by a SmartGuide.


addHelpButton

public JButton addHelpButton()

disableTextField

public static void disableTextField(JTextField aTextField)
Disable a text field. Disable, and don't allow the field to be tabbed into and don't use the disabled color.

Parameters:
aTextField - The text field to disable.

enableTextField

public static void enableTextField(JTextField aTextField)
Enable a text field. Enable, and allow the field to be tabbed into.

Parameters:
aTextField - The text field to enable.

addHelpButton

public JButton addHelpButton(int yIncrement)

addLabel

public JLabel addLabel(String aLabel)

addLabel

public JLabel addLabel(String aLabel,
                       int yIncrement)

addList

protected JList addList(String labelString,
                        Vector contents,
                        String selectedItem,
                        int height)
Add a text area.


addList

protected JList addList(JLabel label,
                        Vector contents,
                        String selectedItem,
                        int height)
Add a text area.


addNewlineTextField

public JTextField addNewlineTextField(String labelString,
                                      String initialValue)
Add a label and a text field, with the text field on the line below the label example: label: [textfield].


addNewlineTextField

public JTextField addNewlineTextField(JLabel label,
                                      String initialValue)
Add a label and a text field, with the text field on the line below the label example: label: [textfield].


addOkCancelButtons

protected void addOkCancelButtons()
Add the OK and Cancel buttons to the panel.


addPanel

protected void addPanel(JPanel aPanel)
Add the panel to our canvas and used the height of the panel.

Parameters:
aPanel - The panel to add.

addPanel

protected void addPanel(JPanel aPanel,
                        int anOffset,
                        int aWidth,
                        int aHeight)
Add the panel to our canvas with the given height.

Parameters:
aPanel - The panel to add.
aHeight - The height of the panel on our canvas.

addPanel

protected void addPanel(JPanel aPanel,
                        int aHeight)
Add the panel to our canvas with the given height.

Parameters:
aPanel - The panel to add.
aHeight - The height of the panel on our canvas.

resizePanel

protected void resizePanel(JPanel aPanel,
                           int aHeight)
Resize panel on our canvas with the given height.

Parameters:
aPanel - The panel to resize.
aHeight - The height of the panel on our canvas.

resizePanel

protected void resizePanel(JPanel aPanel,
                           int aWidth,
                           int aHeight)
Resize panel on our canvas with the given height.

Parameters:
aPanel - The panel to resize.
aWidth - The width of the panel on our canvas.
aHeight - The height of the panel on our canvas.

addScrollPane

protected void addScrollPane(JScrollPane aScrollPane,
                             int aHeight)
Add the scroll pane to our canvas with the given height.

Parameters:
aScrollPane - The scroll pane to add.
aHeight - The height of the scroll pane on our canvas.

addTable

public JTable addTable(String tableLabel,
                       TableModel tableModel,
                       int height)
This method was created by a SmartGuide.


addTable

public JTable addTable(JLabel label,
                       TableModel tableModel,
                       int height)
This method was created by a SmartGuide.


addTextArea

protected MaxLengthTextArea addTextArea(String labelString,
                                        String contents,
                                        int height)
Add a max length text area.


addTextArea

protected MaxLengthTextArea addTextArea(String labelString,
                                        String contents,
                                        int height,
                                        boolean tabTraversable)
Add a max length text area.


addTextArea

protected MaxLengthTextArea addTextArea(JLabel label,
                                        String contents,
                                        int height)
Add a max length text area.


addTextArea

protected MaxLengthTextArea addTextArea(JLabel label,
                                        String contents,
                                        int height,
                                        boolean tabTraversable)
Add a max length text area.


addTextAreaToBottom

protected JTextArea addTextAreaToBottom(String labelString,
                                        String contents,
                                        int bottomOffset)
Add a text area.


addTextAreaToBottom

protected JTextArea addTextAreaToBottom(JLabel label,
                                        String contents,
                                        int bottomOffset)
Add a text area.


addTextField

public MaxLengthField addTextField(String labelString,
                                   String initialValue)
Add a text field. Used for fixed width text fields.

Parameters:
labelString - The text for the label that is placed next to the field.
initialValue - The initial value for the text field.
Returns:
A class which extends JTextField and can be used to specify max character length.

addTextField

public MaxLengthField addTextField(String labelString,
                                   String initialValue,
                                   int aWidth)
Add a text field. Used for fixed width text fields.

Parameters:
labelString - The text for the label that is placed next to the field.
initialValue - The initial value for the text field.
aWidth - The width of the field in pixels.
Returns:
A class which extends JTextField and can be used to specify max character length.

addTextField

public MaxLengthField addTextField(JLabel label,
                                   String initialValue)
Add a text field. Note the field size will shrink/grow based on the screen size.

Parameters:
label - The label to place next to the field.
initialValue - The initial value for the text field.
Returns:
A class which extends JTextField and can be used to specify max character length.

addTextField

public MaxLengthField addTextField(JLabel label,
                                   String initialValue,
                                   int width)
Add a text field. Used for fixed width text fields.

Parameters:
label - The label to place next to the field.
initialValue - The initial value for the text field.
width - The width to make the text field.
Returns:
A class which extends JTextField and can be used to specify max character length.

addTextLabel

public JLabel addTextLabel(String labelString,
                           String value)
Add non-editable text preceded by a label.


addTextLabel

public JLabel addTextLabel(JLabel label,
                           String value)
Add non-editable text preceded by a label.


addPanelTypeForDebug

public void addPanelTypeForDebug()

addTitle

public void addTitle()

closeWindow

protected void closeWindow()
Close the top level window.


getFieldOffset

public int getFieldOffset()
accessor for fieldOffset

Returns:
fieldOffset

getPreferredSize

public Dimension getPreferredSize()
This method was created by a SmartGuide.

Overrides:
getPreferredSize in class JComponent
Returns:
java.awt.Dimension

getRightIndent

public int getRightIndent()
accessor for rightIndent

Returns:
rightIndent

getStateMonitor

public ComponentStateMonitor getStateMonitor()
Gets the state monitor for this panel.

Returns:
The state monitor for this panel.

resetStateMonitor

public void resetStateMonitor()
Reset the state of the monitor.


getTitle

public String getTitle()
This method was created by a SmartGuide.

Returns:
java.lang.String

initialize

public void initialize()
This method was created by a SmartGuide.


setLeftIndent

public void setLeftIndent(int anIndent)
Set the indentation from the left when placing elements.

Parameters:
anIndent - The amount to indent from the left when placing elements.

setLeftMargin

public void setLeftMargin(int aPosition)
Set the left margin for placing elements.

Parameters:
aPosition - The left margin for placing elements.

isDialog

public boolean isDialog()
Returns true if this panel is being shown in a dialog.

Returns:
Whether or not this panel is being shown in a dialog.

isDirty

public boolean isDirty()
Returns true if there have been any changes to the panel that have not been committed.

Specified by:
isDirty in interface EditablePropertyPanel
Returns:
true if changes have been made.

monitorComponentState

protected void monitorComponentState(JCheckBox aCheckBox)
Add the field to the monitor.

Parameters:
aCheckBox - The field to monitor.

monitorComponentState

protected void monitorComponentState(JComboBox aComboBox)
Add the field to the monitor.

Parameters:
aComboBox - The field to monitor.

monitorComponentState

protected void monitorComponentState(JList aList)
Add the field to the monitor.

Parameters:
aList - The field to monitor.

monitorComponentState

protected void monitorComponentState(JTable aTable)
Add the field to the monitor.

Parameters:
aTable - The field to monitor.

monitorComponentState

protected void monitorComponentState(JTextField aTextField)
Add the field to the monitor.

Parameters:
aTextField - The field to monitor.

monitorComponentState

protected void monitorComponentState(JTextArea aTextArea)
Add the field to the monitor.

Parameters:
aTextArea - The field to monitor.

okPressed

public void okPressed()
Invoked when the ok/apply button is pressed on the user interface.


cancelPressed

public void cancelPressed()
Invoked when the cancel button is pressed.


setDefaultCursor

public void setDefaultCursor()
Set the wait cursor.


setFieldOffset

public void setFieldOffset(int newFieldOffset)
mutator for fieldOffset


setRightIndent

public void setRightIndent(int newRightIndent)
mutator for rightIndent


setupComponentMonitoring

protected void setupComponentMonitoring()
Setup the components that you wish to have their state tracked.


setWaitCursor

public void setWaitCursor()
Set the wait cursor.


showDialog

public boolean showDialog(Component parent,
                          String title)
Show this panel as a dialog without resizing.

Parameters:
parent - The parent component that the dialog will be centered on.
title - The title for the dialog.
Returns:
Whether or not the user pressed ok. Will return "false" if cancel was pressed.

showDialog

public boolean showDialog(Component parent,
                          String title,
                          boolean resizable)
Show this panel as a dialog.

Parameters:
parent - The parent component that the dialog will be centered on.
title - The title for the dialog.
resizable - Whether or not to allow the user to resize the dialog.
Returns:
Whether or not the user pressed ok. Will return "false" if cancel was pressed.

getDefaultButton

protected JButton getDefaultButton()

update

public boolean update()
Update the values from the interface back to the domain object.

Specified by:
update in interface EditablePropertyPanel
Returns:
Whether or not the update was as success.

isValidSize

public boolean isValidSize(String sizeString,
                           String applicationName)

displayError

public void displayError(String anError,
                         String aTitle)
Display an error to the user.

Parameters:
anError - The error message.
aTitle - The title for the dialog.

displayConfirm

public boolean displayConfirm(String aMessage,
                              String aTitle)
Display an Confirmation dialog to the user

Parameters:
aMessage - The confirmation message.
aTitle - The title for the dialog.
Returns:
OK == true

displayWarning

public void displayWarning(String aWarning,
                           String aTitle)
Display a warning to the user.

Parameters:
aWarning - The warning message.
aTitle - The title for the dialog.

displayInformation

public void displayInformation(String aMessage,
                               String aTitle)
Display an informational message to the user.

Parameters:
aMessage - The informational message.
aTitle - The title for the dialog.

getPanelHeight

public int getPanelHeight()
Get the height of the panel.

Returns:
The height of the panel.

addComponent

protected void addComponent(Component aComponent,
                            int aStartingOffset,
                            int aWidth)
Add a component to the panel without positioning to the next line.

Parameters:
aComponent - The component to add.
aStartingOffset - The amount of space to put in to separate from last component.
aWidth - The width of the component on the panel.

addComponentRelativeToRight

protected void addComponentRelativeToRight(Component aComponent,
                                           int aStartingOffset)
Add a component to the panel without positioning to the next line. This method also streaches the component out to the right side of the panel as it expands.

Parameters:
aComponent - The component to add.
aStartingOffset - The amount of space to put in to separate from last component.

addComponentRelativeToRight

protected void addComponentRelativeToRight(Component aComponent,
                                           int aStartingOffset,
                                           int aHeight)
Add a component to the panel without positioning to the next line. This method also streaches the component out to the right side of the panel as it expands.

Parameters:
aComponent - The component to add.
aStartingOffset - The amount of space to put in to separate from last component.
aHeight - The height of the component to add.

addComponentRelativeToBottomWithWidth

protected void addComponentRelativeToBottomWithWidth(Component aComponent,
                                                     int aBottomOffset,
                                                     int aWidth)
Add a component to the panel starting at the current y location and the bottom constraint on the bottom of the panel as it streches.

Parameters:
aComponent - The component to add.
aBottomOffset - The amount of space to leave at the bottom of the panel.
aWidth - The width of the component to add.

addComponentRelativeToBottom

protected void addComponentRelativeToBottom(Component aComponent,
                                            int aBottomOffset)
Add a component to the panel starting at the current y location and the bottom constraint on the bottom of the panel as it streches.

Parameters:
aComponent - The component to add.
aBottomOffset - The amount of space to leave at the bottom of the panel.

addComponentRelativeToBottom

protected void addComponentRelativeToBottom(Component aComponent,
                                            int aBottomOffset,
                                            int aHeight)
Add a component to the panel starting at the current y location and the bottom constraint on the bottom of the panel as it streches.

Parameters:
aComponent - The component to add.
aBottomOffset - The amount of space to leave at the bottom of the panel.
aHeight - The height of the component.

addComponentRelativeToBottom

protected void addComponentRelativeToBottom(Component aComponent,
                                            int aBottomOffset,
                                            int aHeight,
                                            int aWidth)
Add a component to the panel starting at the current y location and the bottom constraint on the bottom of the panel as it streches.

Parameters:
aComponent - The component to add.
aBottomOffset - The amount of space to leave at the bottom of the panel.
aHeight - The height of the component.
aWidth - The width of the component.

positionToNextLine

protected void positionToNextLine()
Position the x and y coordinates for the next row.


getPanelWidth

public int getPanelWidth()
Gets the calculated width of the panel. This is pretty iffy right now...

Returns:

isDisplayingMessage

public boolean isDisplayingMessage()
Returns:
boolean

focusGained

public void focusGained(FocusEvent e)

highlightAndEnsureVisible

public void highlightAndEnsureVisible(FocusEvent e)

focusLost

public void focusLost(FocusEvent e)

setIsAdjustingFieldValues

public void setIsAdjustingFieldValues(boolean isAdjusting)
Marked by implementors if PropertiesPanel to flag when fields are being adjusted programatically. This allows for code to distinguish from user initiated UI events.


isAdjustingFieldValues

public boolean isAdjustingFieldValues()
Returns:
true if the panel is currently being adjusted programatically, otherwise false

Arch4J 1.1

Copyright © 2000-2004 SpiderLogic, a service of Wipfli Ullrich Bertelson LLP.