com.vividsolutions.jump.workbench.ui
Class MultiInputDialog

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Dialog
                  extended by javax.swing.JDialog
                      extended by com.vividsolutions.jump.workbench.ui.MultiInputDialog
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class MultiInputDialog
extends javax.swing.JDialog

Flexible generic dialog for prompting the user to type in several values.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Dialog
java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
 
Fields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPE
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MultiInputDialog()
           
MultiInputDialog(java.awt.Frame frame, java.lang.String title, boolean modal)
           
 
Method Summary
 javax.swing.JButton addButton(java.lang.String text)
           
 javax.swing.JCheckBox addCheckBox(java.lang.String fieldName, boolean initialValue)
           
 javax.swing.JCheckBox addCheckBox(java.lang.String fieldName, boolean initialValue, java.lang.String toolTipText)
           
 javax.swing.JComboBox addComboBox(java.lang.String fieldName, java.lang.Object selectedItem, java.util.Collection items, java.lang.String toolTipText)
           
 javax.swing.JTextField addDoubleField(java.lang.String fieldName, double initialValue, int approxWidthInChars)
           
 javax.swing.JTextField addDoubleField(java.lang.String fieldName, double initialValue, int approxWidthInChars, java.lang.String toolTipText)
           
 javax.swing.JComboBox addEditableLayerComboBox(java.lang.String fieldName, Layer initialValue, java.lang.String toolTipText, LayerManager layerManager)
           
 void addEnableChecks(java.lang.String fieldName, java.util.Collection enableChecks)
           
 javax.swing.JTextField addIntegerField(java.lang.String fieldName, int initialValue, int approxWidthInChars, java.lang.String toolTipText)
           
 javax.swing.JLabel addLabel(java.lang.String text)
           
 javax.swing.JComboBox addLayerComboBox(java.lang.String fieldName, Layer initialValue, LayerManager layerManager)
           
 javax.swing.JComboBox addLayerComboBox(java.lang.String fieldName, Layer initialValue, java.lang.String toolTipText, java.util.Collection layers)
           
 javax.swing.JComboBox addLayerComboBox(java.lang.String fieldName, Layer initialValue, java.lang.String toolTipText, LayerManager layerManager)
           
 javax.swing.JTextField addNonNegativeDoubleField(java.lang.String fieldName, double initialValue, int approxWidthInChars)
           
 javax.swing.JTextField addPositiveDoubleField(java.lang.String fieldName, double initialValue, int approxWidthInChars)
           
 javax.swing.JTextField addPositiveIntegerField(java.lang.String fieldName, int initialValue, int approxWidthInChars)
           
 javax.swing.JRadioButton addRadioButton(java.lang.String fieldName, java.lang.String buttonGroupName, boolean initialValue, java.lang.String toolTipText)
           
 void addRow(javax.swing.JComponent c)
           
 void addRow(java.lang.String fieldName, javax.swing.JComponent label, javax.swing.JComponent component, EnableCheck[] enableChecks, java.lang.String toolTipText)
           
 void addSeparator()
           
 javax.swing.JTextField addTextField(java.lang.String fieldName, java.lang.String initialValue, int approxWidthInChars, EnableCheck[] enableChecks, java.lang.String toolTipText)
           
 EnableCheck createDoubleCheck(java.lang.String fieldName)
           
 EnableCheck createIntegerCheck(java.lang.String fieldName)
           
 EnableCheck createNonNegativeCheck(java.lang.String fieldName)
           
 EnableCheck createPositiveCheck(java.lang.String fieldName)
           
 boolean getBoolean(java.lang.String fieldName)
          Returns selected state for checkboxes, radio buttons.
 javax.swing.JCheckBox getCheckBox(java.lang.String fieldName)
           
 javax.swing.JComboBox getComboBox(java.lang.String fieldName)
           
 double getDouble(java.lang.String fieldName)
           
 int getInteger(java.lang.String fieldName)
           
 javax.swing.JComponent getLabel(java.lang.String fieldName)
           
 Layer getLayer(java.lang.String fieldName)
           
 javax.swing.JRadioButton getRadioButton(java.lang.String fieldName)
           
 java.lang.String getText(java.lang.String fieldName)
          Gets the string value of a control
 void indentLabel(java.lang.String comboBoxFieldName)
           
static void main(java.lang.String[] args)
           
 void setInset(int inset)
          If the dialog contains a single tabbed panel, it looks better to have a 0 inset.
 void setSideBarDescription(java.lang.String description)
           
 void setSideBarImage(javax.swing.Icon icon)
           
 void setVisible(boolean visible)
           
 void startNewColumn()
          This method can be called once only.
 boolean wasOKPressed()
           
 
Methods inherited from class javax.swing.JDialog
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update
 
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setModalityType, setResizable, setTitle, setUndecorated, show, toBack
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, toFront
 
Methods inherited from class java.awt.Container
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, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, 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, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultiInputDialog

public MultiInputDialog(java.awt.Frame frame,
                        java.lang.String title,
                        boolean modal)
Parameters:
frame - the frame on which to make this dialog modal and centred

MultiInputDialog

public MultiInputDialog()
Method Detail

createDoubleCheck

public EnableCheck createDoubleCheck(java.lang.String fieldName)

createIntegerCheck

public EnableCheck createIntegerCheck(java.lang.String fieldName)

createPositiveCheck

public EnableCheck createPositiveCheck(java.lang.String fieldName)

createNonNegativeCheck

public EnableCheck createNonNegativeCheck(java.lang.String fieldName)

getComboBox

public javax.swing.JComboBox getComboBox(java.lang.String fieldName)

getCheckBox

public javax.swing.JCheckBox getCheckBox(java.lang.String fieldName)

getRadioButton

public javax.swing.JRadioButton getRadioButton(java.lang.String fieldName)

getLabel

public javax.swing.JComponent getLabel(java.lang.String fieldName)

setVisible

public void setVisible(boolean visible)
Overrides:
setVisible in class java.awt.Dialog

getText

public java.lang.String getText(java.lang.String fieldName)
Gets the string value of a control

Parameters:
fieldName - control to read
Returns:
the string value of the control

getBoolean

public boolean getBoolean(java.lang.String fieldName)
Returns selected state for checkboxes, radio buttons.

Parameters:
fieldName - the name of the control to test
Returns:
the selected state of the control

getDouble

public double getDouble(java.lang.String fieldName)

getInteger

public int getInteger(java.lang.String fieldName)

getLayer

public Layer getLayer(java.lang.String fieldName)

addTextField

public javax.swing.JTextField addTextField(java.lang.String fieldName,
                                           java.lang.String initialValue,
                                           int approxWidthInChars,
                                           EnableCheck[] enableChecks,
                                           java.lang.String toolTipText)

addComboBox

public javax.swing.JComboBox addComboBox(java.lang.String fieldName,
                                         java.lang.Object selectedItem,
                                         java.util.Collection items,
                                         java.lang.String toolTipText)

addLabel

public javax.swing.JLabel addLabel(java.lang.String text)

addButton

public javax.swing.JButton addButton(java.lang.String text)

addRow

public void addRow(javax.swing.JComponent c)

addSeparator

public void addSeparator()

addIntegerField

public javax.swing.JTextField addIntegerField(java.lang.String fieldName,
                                              int initialValue,
                                              int approxWidthInChars,
                                              java.lang.String toolTipText)

addPositiveIntegerField

public javax.swing.JTextField addPositiveIntegerField(java.lang.String fieldName,
                                                      int initialValue,
                                                      int approxWidthInChars)

addDoubleField

public javax.swing.JTextField addDoubleField(java.lang.String fieldName,
                                             double initialValue,
                                             int approxWidthInChars)

addDoubleField

public javax.swing.JTextField addDoubleField(java.lang.String fieldName,
                                             double initialValue,
                                             int approxWidthInChars,
                                             java.lang.String toolTipText)

addPositiveDoubleField

public javax.swing.JTextField addPositiveDoubleField(java.lang.String fieldName,
                                                     double initialValue,
                                                     int approxWidthInChars)

addNonNegativeDoubleField

public javax.swing.JTextField addNonNegativeDoubleField(java.lang.String fieldName,
                                                        double initialValue,
                                                        int approxWidthInChars)

main

public static void main(java.lang.String[] args)

addLayerComboBox

public javax.swing.JComboBox addLayerComboBox(java.lang.String fieldName,
                                              Layer initialValue,
                                              LayerManager layerManager)

addLayerComboBox

public javax.swing.JComboBox addLayerComboBox(java.lang.String fieldName,
                                              Layer initialValue,
                                              java.lang.String toolTipText,
                                              LayerManager layerManager)

addEditableLayerComboBox

public javax.swing.JComboBox addEditableLayerComboBox(java.lang.String fieldName,
                                                      Layer initialValue,
                                                      java.lang.String toolTipText,
                                                      LayerManager layerManager)

addLayerComboBox

public javax.swing.JComboBox addLayerComboBox(java.lang.String fieldName,
                                              Layer initialValue,
                                              java.lang.String toolTipText,
                                              java.util.Collection layers)

addCheckBox

public javax.swing.JCheckBox addCheckBox(java.lang.String fieldName,
                                         boolean initialValue)

addCheckBox

public javax.swing.JCheckBox addCheckBox(java.lang.String fieldName,
                                         boolean initialValue,
                                         java.lang.String toolTipText)

addRadioButton

public javax.swing.JRadioButton addRadioButton(java.lang.String fieldName,
                                               java.lang.String buttonGroupName,
                                               boolean initialValue,
                                               java.lang.String toolTipText)

setSideBarImage

public void setSideBarImage(javax.swing.Icon icon)

setSideBarDescription

public void setSideBarDescription(java.lang.String description)

wasOKPressed

public boolean wasOKPressed()

setInset

public void setInset(int inset)
If the dialog contains a single tabbed panel, it looks better to have a 0 inset.


startNewColumn

public void startNewColumn()
This method can be called once only.


addRow

public void addRow(java.lang.String fieldName,
                   javax.swing.JComponent label,
                   javax.swing.JComponent component,
                   EnableCheck[] enableChecks,
                   java.lang.String toolTipText)

addEnableChecks

public void addEnableChecks(java.lang.String fieldName,
                            java.util.Collection enableChecks)

indentLabel

public void indentLabel(java.lang.String comboBoxFieldName)