public abstract class AbstractMultiInputDialog
extends javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
Modifier and Type | Field and Description |
---|---|
static int |
BOTH
Flag indicating that the main component will fill the space.
|
protected java.util.Map |
buttonGroupMap |
protected java.util.HashMap<java.lang.String,javax.swing.JComponent> |
fieldNameToComponentMap |
protected CollectionMap |
fieldNameToEnableCheckListMap |
protected java.util.HashMap |
fieldNameToLabelMap |
static int |
HORIZONTAL
Flag indicating that the main component will fill the space.
|
static int |
LEFT_LABEL
The label is displayed on the left of the control.
|
static int |
NO_LABEL
The label of the control is not displayed.
|
static java.lang.String |
NO_VALID_ATTRIBUTE
Attribute combobox message displayed if no valid attribute is available.
|
static int |
NONE
Flag indicating that the main component will always use its preferred size.
|
static int |
RIGHT_LABEL
The label is displayed on the right of the control.
|
static int |
VERTICAL
Flag indicating that the main component will fill the space vertically.
|
accessibleContext, rootPane, rootPaneCheckingEnabled
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Modifier | Constructor and Description |
---|---|
protected |
AbstractMultiInputDialog(java.awt.Frame frame,
java.lang.String title,
boolean modal) |
Modifier and Type | Method and Description |
---|---|
javax.swing.JComboBox |
addAttributeComboBox(java.lang.String fieldName,
java.lang.String layerFieldName,
AttributeTypeFilter filter,
java.lang.String toolTipText)
Add a JComboBox containing attributes of the Layer selected in
layerFieldName
|
javax.swing.JButton |
addButton(java.lang.String text)
Adds a JButton to this dialog.
|
javax.swing.JButton |
addButton(java.lang.String fieldName,
java.lang.String text,
java.lang.String toolTipText)
Adds a JButton to this dialog.
|
javax.swing.JCheckBox |
addCheckBox(java.lang.String fieldName,
boolean initialValue)
Create a CheckBox to get a boolean value from the user.
|
javax.swing.JCheckBox |
addCheckBox(java.lang.String fieldName,
boolean initialValue,
java.lang.String toolTipText)
Create a CheckBox to get a boolean value from the user.
|
javax.swing.JComboBox |
addComboBox(java.lang.String fieldName,
java.lang.Object selectedItem,
java.util.Collection items,
java.lang.String toolTipText)
Adds a JComboBox control to this dialog.
|
javax.swing.JTextField |
addDoubleField(java.lang.String fieldName,
double initialValue,
int approxWidthInChars)
Adds a JTextField control for positive integer inputs.
|
javax.swing.JTextField |
addDoubleField(java.lang.String fieldName,
double initialValue,
int approxWidthInChars,
java.lang.String toolTipText)
Adds a JTextField control for double value inputs.
|
javax.swing.JComboBox |
addEditableLayerComboBox(java.lang.String fieldName,
Layer initialValue,
java.lang.String toolTipText,
LayerManager layerManager)
Add a JComboBox containing editable layers of a LayerManager.
|
void |
addEnableChecks(java.lang.String fieldName,
java.util.Collection enableChecks)
Adding enableChecks to the fieldNameToEnableCheckListMap CollectionMap.
|
javax.swing.JTextField |
addIntegerField(java.lang.String fieldName,
int initialValue,
int approxWidthInChars,
java.lang.String toolTipText)
Adds a JTextField control for integer inputs.
|
javax.swing.JLabel |
addLabel(java.lang.String text)
Adds a JLabel to this dialog.
|
javax.swing.JComboBox |
addLayerComboBox(java.lang.String fieldName,
Layer initialValue,
LayerManager layerManager)
Add a JComboBox containing available layers from the current LayerManager.
|
javax.swing.JComboBox |
addLayerComboBox(java.lang.String fieldName,
Layer initialValue,
java.lang.String toolTipText,
java.util.Collection layers)
Add a JComboBox containing any collection of Layers.
|
javax.swing.JComboBox |
addLayerComboBox(java.lang.String fieldName,
Layer initialValue,
java.lang.String toolTipText,
LayerManager layerManager)
Add a JComboBox containing available layers from the current LayerManager.
|
javax.swing.JComboBox |
addLayerComboBox(java.lang.String fieldName,
java.lang.String toolTipText,
LayerManager layerManager,
AttributeTypeFilter filter)
Add a JComboBox containing layers containing the specified AttributeType.
|
javax.swing.JTextField |
addNonNegativeDoubleField(java.lang.String fieldName,
double initialValue,
int approxWidthInChars)
Adds a JTextField control for positive double value inputs.
|
javax.swing.JTextField |
addNonNegativeDoubleField(java.lang.String fieldName,
double initialValue,
int approxWidthInChars,
java.lang.String toolTipText)
Adds a JTextField control for positive double value inputs.
|
javax.swing.JTextField |
addPositiveDoubleField(java.lang.String fieldName,
double initialValue,
int approxWidthInChars)
Adds a JTextField control for positive double value inputs.
|
javax.swing.JTextField |
addPositiveDoubleField(java.lang.String fieldName,
double initialValue,
int approxWidthInChars,
java.lang.String toolTipText)
Adds a JTextField control for positive double value inputs.
|
javax.swing.JTextField |
addPositiveIntegerField(java.lang.String fieldName,
int initialValue,
int approxWidthInChars)
Adds a JTextField control for positive integer inputs.
|
javax.swing.JTextField |
addPositiveIntegerField(java.lang.String fieldName,
int initialValue,
int approxWidthInChars,
java.lang.String toolTipText)
Adds a JTextField control for positive integer inputs.
|
javax.swing.JRadioButton |
addRadioButton(java.lang.String fieldName,
java.lang.String buttonGroupName,
boolean initialValue,
java.lang.String toolTipText)
Adds a RadioButton to the buttonGroupName group.
|
protected abstract void |
addRow() |
protected abstract void |
addRow(javax.swing.JComponent c) |
protected abstract void |
addRow(java.lang.String fieldName,
javax.swing.JComponent label,
javax.swing.JComponent component,
EnableCheck[] enableChecks,
java.lang.String toolTipText,
int labelPos,
int fillMode)
Adds a row (containing either a control or a label) to the Dialog.
|
void |
addSeparator()
Adds a horizontal separator between two set of controls.
|
javax.swing.JLabel |
addSubTitle(java.lang.String text)
Adds a JLabel to display a subtitle in the dialog.
|
javax.swing.JTextArea |
addTextAreaField(java.lang.String fieldName,
java.lang.String initialValue,
int rowNumber,
int columnNumber,
boolean scrollable,
EnableCheck[] enableChecks,
java.lang.String toolTipText)
Adds a TextArea field.
|
javax.swing.JTextField |
addTextField(java.lang.String fieldName,
java.lang.String initialValue,
int approxWidthInChars,
EnableCheck[] enableChecks,
java.lang.String toolTipText)
Adds a JTextField control to this dialog.
|
EnableCheck |
createDoubleCheck(java.lang.String fieldName)
Check if the control contains a valid Double.
|
EnableCheck |
createIntegerCheck(java.lang.String fieldName)
Check if the control contains a valid Integer.
|
EnableCheck |
createNonNegativeCheck(java.lang.String fieldName)
Check if the control contains a non-negative Number.
|
EnableCheck |
createPositiveCheck(java.lang.String fieldName)
Check if the control contains a positive Number.
|
boolean |
getBoolean(java.lang.String fieldName)
Returns selected state for checkboxes, radio buttons.
|
javax.swing.JCheckBox |
getCheckBox(java.lang.String fieldName)
Gets JCheckBox component matching this fieldName.
|
javax.swing.JComboBox |
getComboBox(java.lang.String fieldName)
Gets JComboBox component matching this fieldName.
|
double |
getDouble(java.lang.String fieldName)
Returns double value from a JTextField control.
|
javax.swing.JFileChooser |
getFileChooser(java.lang.String fieldName)
Gets JFileChooser component matching this fieldName.
|
int |
getInteger(java.lang.String fieldName)
Returns integer value from a JTextField control.
|
javax.swing.JComponent |
getLabel(java.lang.String fieldName)
Gets JLabel matching this fieldName.
|
Layer |
getLayer(java.lang.String fieldName)
Returns a Layer from a JComboBox control.
|
javax.swing.JRadioButton |
getRadioButton(java.lang.String fieldName)
Gets JRadioButton component matching this fieldName.
|
java.lang.String |
getText(java.lang.String fieldName)
Gets the string value of a control
|
void |
setFieldEnabled(java.lang.String fieldName,
boolean enable) |
void |
setFieldVisible(java.lang.String fieldName,
boolean visible) |
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBack
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final int NO_LABEL
public static final int LEFT_LABEL
public static final int RIGHT_LABEL
public static final int HORIZONTAL
public static final int VERTICAL
public static final int BOTH
public static final int NONE
public static final java.lang.String NO_VALID_ATTRIBUTE
protected java.util.HashMap<java.lang.String,javax.swing.JComponent> fieldNameToComponentMap
protected java.util.HashMap fieldNameToLabelMap
protected java.util.Map buttonGroupMap
protected CollectionMap fieldNameToEnableCheckListMap
protected AbstractMultiInputDialog(java.awt.Frame frame, java.lang.String title, boolean modal)
frame
- the frame on which to make this dialog modal and centredtitle
- the title of the dialog boxmodal
- set if the dialog box is modal or notpublic EnableCheck createDoubleCheck(java.lang.String fieldName)
public EnableCheck createIntegerCheck(java.lang.String fieldName)
public EnableCheck createPositiveCheck(java.lang.String fieldName)
public EnableCheck createNonNegativeCheck(java.lang.String fieldName)
public javax.swing.JComponent getLabel(java.lang.String fieldName)
public javax.swing.JComboBox getComboBox(java.lang.String fieldName)
public javax.swing.JCheckBox getCheckBox(java.lang.String fieldName)
public javax.swing.JRadioButton getRadioButton(java.lang.String fieldName)
public javax.swing.JFileChooser getFileChooser(java.lang.String fieldName)
public java.lang.String getText(java.lang.String fieldName)
fieldName
- control to readpublic boolean getBoolean(java.lang.String fieldName)
public double getDouble(java.lang.String fieldName)
public int getInteger(java.lang.String fieldName)
public Layer getLayer(java.lang.String fieldName)
public void addEnableChecks(java.lang.String fieldName, java.util.Collection enableChecks)
fieldName
- fieldName of the controlenableChecks
- EnableCheck array to validate this control inputpublic javax.swing.JTextField addTextField(java.lang.String fieldName, java.lang.String initialValue, int approxWidthInChars, EnableCheck[] enableChecks, java.lang.String toolTipText)
fieldName
- field name of the controlinitialValue
- initial value of the controlapproxWidthInChars
- approximative width of the control in charactersenableChecks
- checks to validate the input valuetoolTipText
- tool tip to help the userpublic javax.swing.JComboBox addComboBox(java.lang.String fieldName, java.lang.Object selectedItem, java.util.Collection items, java.lang.String toolTipText)
fieldName
- field name of the controlselectedItem
- initial selected itemitems
- items displayed in the JComboBoxtoolTipText
- tool tip to help the userpublic javax.swing.JLabel addLabel(java.lang.String text)
text
- text to display in the JLabelpublic javax.swing.JLabel addSubTitle(java.lang.String text)
text
- text to display in the JLabelpublic javax.swing.JButton addButton(java.lang.String fieldName, java.lang.String text, java.lang.String toolTipText)
fieldName
- will be used for the label text on the left of the buttontext
- text to display in the JButtontoolTipText
- public javax.swing.JButton addButton(java.lang.String text)
text
- text to display in the JButtonpublic void addSeparator()
public javax.swing.JTextField addIntegerField(java.lang.String fieldName, int initialValue, int approxWidthInChars, java.lang.String toolTipText)
fieldName
- field name of the controlinitialValue
- initial value of the controlapproxWidthInChars
- approximative width of the control in characterstoolTipText
- tool tip to help the userpublic javax.swing.JTextField addPositiveIntegerField(java.lang.String fieldName, int initialValue, int approxWidthInChars, java.lang.String toolTipText)
fieldName
- field name of the controlinitialValue
- initial value of the controlapproxWidthInChars
- approximative width of the control in characterstoolTipText
- tool tip to help the userpublic javax.swing.JTextField addPositiveIntegerField(java.lang.String fieldName, int initialValue, int approxWidthInChars)
fieldName
- field name of the controlinitialValue
- initial value of the controlapproxWidthInChars
- approximative width of the control in characterspublic javax.swing.JTextField addDoubleField(java.lang.String fieldName, double initialValue, int approxWidthInChars)
fieldName
- field name of the controlinitialValue
- initial value of the controlapproxWidthInChars
- approximative width of the control in characterspublic javax.swing.JTextField addDoubleField(java.lang.String fieldName, double initialValue, int approxWidthInChars, java.lang.String toolTipText)
fieldName
- field name of the controlinitialValue
- initial value of the controlapproxWidthInChars
- approximative width of the control in characterstoolTipText
- tool tip to help the userpublic javax.swing.JTextField addPositiveDoubleField(java.lang.String fieldName, double initialValue, int approxWidthInChars, java.lang.String toolTipText)
fieldName
- field name of the controlinitialValue
- initial value of the controlapproxWidthInChars
- approximative width of the control in characterspublic javax.swing.JTextField addPositiveDoubleField(java.lang.String fieldName, double initialValue, int approxWidthInChars)
fieldName
- field name of the controlinitialValue
- initial value of the controlapproxWidthInChars
- approximative width of the control in characterspublic javax.swing.JTextField addNonNegativeDoubleField(java.lang.String fieldName, double initialValue, int approxWidthInChars, java.lang.String toolTipText)
fieldName
- field name of the controlinitialValue
- initial value of the controlapproxWidthInChars
- approximative width of the control in characterstoolTipText
- tool tip text associated with this text fieldpublic javax.swing.JTextField addNonNegativeDoubleField(java.lang.String fieldName, double initialValue, int approxWidthInChars)
fieldName
- field name of the controlinitialValue
- initial value of the controlapproxWidthInChars
- approximative width of the control in characterspublic javax.swing.JComboBox addLayerComboBox(java.lang.String fieldName, Layer initialValue, java.lang.String toolTipText, java.util.Collection layers)
fieldName
- field name of the controlinitialValue
- default layer visible in the combo boxtoolTipText
- tool tip text associated with this combo boxlayers
- layers to be proposed in the combo boxpublic javax.swing.JComboBox addLayerComboBox(java.lang.String fieldName, Layer initialValue, LayerManager layerManager)
fieldName
- field name of the controlinitialValue
- default layer visible in the combo boxlayerManager
- the LayerManager providing layers to the combo boxpublic javax.swing.JComboBox addLayerComboBox(java.lang.String fieldName, Layer initialValue, java.lang.String toolTipText, LayerManager layerManager)
fieldName
- field name of the controlinitialValue
- default layer visible in the combo boxtoolTipText
- tool tip text associated with this combo boxlayerManager
- the LayerManager providing layers to the combo boxpublic javax.swing.JComboBox addEditableLayerComboBox(java.lang.String fieldName, Layer initialValue, java.lang.String toolTipText, LayerManager layerManager)
fieldName
- field name of the controlinitialValue
- default layer visible in the combo boxtoolTipText
- tool tip text associated with this combo boxlayerManager
- the LayerManager providing layers to the combo boxpublic javax.swing.JComboBox addLayerComboBox(java.lang.String fieldName, java.lang.String toolTipText, LayerManager layerManager, AttributeTypeFilter filter)
fieldName
- field name of the controltoolTipText
- tool tip text associated with this combo boxlayerManager
- the LayerManager providing layers to the combo boxfilter
- a filter to select layers with specified AttributeTypespublic javax.swing.JComboBox addAttributeComboBox(java.lang.String fieldName, java.lang.String layerFieldName, AttributeTypeFilter filter, java.lang.String toolTipText)
fieldName
- field name for the attributelayerFieldName
- field name of the ComboBox used to choose the layerfilter
- filter valid attributes from their typetoolTipText
- public javax.swing.JCheckBox addCheckBox(java.lang.String fieldName, boolean initialValue)
fieldName
- field name of the controlinitialValue
- default boolean valuepublic javax.swing.JCheckBox addCheckBox(java.lang.String fieldName, boolean initialValue, java.lang.String toolTipText)
fieldName
- field name of the controlinitialValue
- default boolean valuetoolTipText
- tool tip text associated with this check boxpublic javax.swing.JRadioButton addRadioButton(java.lang.String fieldName, java.lang.String buttonGroupName, boolean initialValue, java.lang.String toolTipText)
fieldName
- field name of the controlbuttonGroupName
- buttonGroupName of this RadioButtoninitialValue
- default boolean valuetoolTipText
- tool tip text associated with this check boxpublic javax.swing.JTextArea addTextAreaField(java.lang.String fieldName, java.lang.String initialValue, int rowNumber, int columnNumber, boolean scrollable, EnableCheck[] enableChecks, java.lang.String toolTipText)
fieldName
- field name of the controlinitialValue
- default boolean valuerowNumber
- initial row numbercolumnNumber
- initial column numberscrollable
- if true, the textArea is embeded into a JScrollPaneenableChecks
- checks to validate the input valuetoolTipText
- tool tip text associated with this check boxprotected abstract void addRow(java.lang.String fieldName, javax.swing.JComponent label, javax.swing.JComponent component, EnableCheck[] enableChecks, java.lang.String toolTipText, int labelPos, int fillMode)
fieldName
- field name of the control (used as a key)label
- label of the controlcomponent
- the control itself (may also be a label or a separator)enableChecks
- checks to validate inputstoolTipText
- ToolTip textlabelPos
- 0, 1 or 2 depending on whether the label is hidden,
on the left side or on the right side of the componentfillMode
- true if the component must fill the available spaceprotected abstract void addRow(javax.swing.JComponent c)
protected abstract void addRow()
public void setFieldEnabled(java.lang.String fieldName, boolean enable)
public void setFieldVisible(java.lang.String fieldName, boolean visible)