jwo.utils.gui
Class JWDialogue

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 jwo.utils.gui.JWDialogue
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
About3d, AboutBox, AttributeSelectionBox, AttributeTableBox, BinarySizeBox, BlendBox, ColourChooseBox, CombineBox, ContourBox, DemToTinBox, DigitizeBox, EditBox, FeatureTolBox, FlowBox, GPSConfigBox, GPSExportBox, GPSImportBox, HistoBox, ImageOutputBox, JWColourSelect, MovementBox, MultiScaleBox, PeakClassificationBox, PitRemovalBox, PrintAssembly, ProfileQueryBox, ProjectionEditBox, RasterStatsBox, RectifyBox, RelativeDropBox, ReprojectBox, ResolutionBox, ScaleDrapeBox, ScaleGraphBox, ScatterplotBox, SelectVectorBox, ShadeReliefBox, SimplifyBox, SurfaceDetailBox, SurfParamBox, TimeSpaceBox, TransRastBox, VectAppearanceBox, VectAppearanceBox, WindowScaleBox

public class JWDialogue
extends JDialog

Class for displaying for dialogue windows. Can be in two forms. Dialogues contain OK and Cancel return buttons and allow validation of input. Monologues contain a single OK return button and do not validate input.

Version:
2.4, 4th October, 2007.
Author:
Jo Wood
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialog
 
Nested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static int DIALOGUE
          Indicates OK and CANCEL buttons with some input.
static int MONOLOGUE
          Indicates a simple OK button with no input.
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
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
JWDialogue(Frame parentFrame)
          Creates a simple modal dialogue window with, OK and Cancel buttons.
JWDialogue(Frame parentFrame, String winTitle)
          Creates a simple modal dialogue window with title, OK and Cancel buttons.
JWDialogue(Frame parentFrame, String winTitle, int type, boolean modal)
          Creates a simple monologue/dialogue window with title and return buttons.
 
Method Summary
 void addDialogueListener(JWDialogueListener dialogueListener)
          Adds a dialogue listener.
 boolean checkInput()
          Method to validate input for dialogue values.
 void closedown()
          Closes down the dialogue window.
 Container getContentPane()
          Identifies the pane into which content can be added.
 boolean isChanged()
          Notifies if contents of dialogue have changed
 void removeDialogueListener(JWDialogueListener dialogueListener)
          Removes a given listener from the list of objects to be informed when a dialogue message is sent.
 void setFullBackground(Color colour)
          Sets the background colour of the dialogue window (including buttons etc).
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Dialog
addNotify, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, toBack, 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, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MONOLOGUE

public static final int MONOLOGUE
Indicates a simple OK button with no input.

See Also:
Constant Field Values

DIALOGUE

public static final int DIALOGUE
Indicates OK and CANCEL buttons with some input.

See Also:
Constant Field Values
Constructor Detail

JWDialogue

public JWDialogue(Frame parentFrame)
Creates a simple modal dialogue window with, OK and Cancel buttons.

Parameters:
parentFrame - Container associated with modal dialogue.

JWDialogue

public JWDialogue(Frame parentFrame,
                  String winTitle)
Creates a simple modal dialogue window with title, OK and Cancel buttons.

Parameters:
parentFrame - Container associated with modal dialogue.
winTitle - Title placed on window bar.

JWDialogue

public JWDialogue(Frame parentFrame,
                  String winTitle,
                  int type,
                  boolean modal)
Creates a simple monologue/dialogue window with title and return buttons.

Parameters:
parentFrame - Container associated with modal dialogue.
winTitle - Title placed on window bar.
type - Type of window - either MONOLOGUE or DIALOGUE
modal - Determines whether dialogue is modal or not.
Method Detail

isChanged

public boolean isChanged()
Notifies if contents of dialogue have changed

Returns:
Boolean indication of dialogue change.

addDialogueListener

public void addDialogueListener(JWDialogueListener dialogueListener)
Adds a dialogue listener. This allows the non-modal version of this dialogue box to inform the listener to update changes.

Parameters:
dialogueListener - The object to listen for changes.

removeDialogueListener

public void removeDialogueListener(JWDialogueListener dialogueListener)
Removes a given listener from the list of objects to be informed when a dialogue message is sent.

Parameters:
dialogueListener - Object to be removed from listeners.

closedown

public void closedown()
Closes down the dialogue window. It is automatically called if the window is closed by the user via the OK/Cancel buttons or usual window closing icon. This method also informs any listeners that the window has been closed.


checkInput

public boolean checkInput()
Method to validate input for dialogue values. This default behaviour does not validate any input

Returns:
True if input is valid.

setFullBackground

public void setFullBackground(Color colour)
Sets the background colour of the dialogue window (including buttons etc).

Parameters:
colour - New colour to set.

getContentPane

public Container getContentPane()
Identifies the pane into which content can be added. This will be a JPanel below the title and above the return buttons of the dialogue.

Specified by:
getContentPane in interface RootPaneContainer
Overrides:
getContentPane in class JDialog
Returns:
Container into which content can be added.


Copyright Jo Wood, 1996-2009, last modified, 17th April, 2009