ice.ri.common.dialog.awt
Class AbstractSettingsDialog

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Dialog
                  extended byice.ri.common.dialog.awt.AbstractSettingsDialog
All Implemented Interfaces:
Accessible, ActionListener, EventListener, ImageObserver, MenuContainer, Serializable, SettingsDialogInterface
Direct Known Subclasses:
DefaultSettingsDialog, ListSettingsDialog

public abstract class AbstractSettingsDialog
extends Dialog
implements SettingsDialogInterface, ActionListener

This class creates a skeletal implementation of the SettingsDialogInterface to minimize the effort required to implement this interface.

Since:
6.0
Version:
%I%, %G%
Author:
Patrick Corless
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog
 
Nested classes inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  Button applyButton
           
protected  Button cancelButton
           
protected  int displayType
           
static int OK_CANCEL
          Display the "OK" and "Cancel" buttons on the dialog.
static int OK_CANCEL_APPLY
          Default button model.
protected  Button okButton
           
protected  Vector panelGroups
           
protected  Vector panels
           
protected  Frame parentFrame
           
 
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
AbstractSettingsDialog(Frame parent, String title)
          Create a new AbstractSettingsDialog object.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Responds to the menu items and buttons.
 void add(AbstractSettingsDialogPanel panel)
          add ControlPanelPanel to control panel
 void add(SettingsDialogPanelGroup group)
          Add ControlPanelGroup to control panel
 boolean cancel()
          Iterate through ControlPanelPanel and call cancel method.
protected  void center()
           
 int getButtonDisplay()
          Return the value of the button display model.
 boolean hasChanged()
          Return the state of the data represented by the dialog.
 boolean save()
          Iterate through ControlPanelPanels and call save method.
 void setButtonDisplay(int displayType)
          Sets the button display model.
abstract  void setGui()
          Create the screen elements for the settings dialog
 void setHasChanged(boolean value)
          Set the has changed flag.
 void setVisible(boolean isVisible)
          Sets the visible state of the dialog window.
 void showDialog()
          Display the dialog.
 
Methods inherited from class java.awt.Dialog
addNotify, dispose, getAccessibleContext, getTitle, hide, isModal, isResizable, isUndecorated, paramString, setModal, setResizable, setTitle, setUndecorated, show
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, 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, 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, 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, isOpaque, 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, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OK_CANCEL_APPLY

public static final int OK_CANCEL_APPLY
Default button model. The "Ok", "Cancel" and "Apply" buttons are displayed on the dialog.

See Also:
Constant Field Values

OK_CANCEL

public static final int OK_CANCEL
Display the "OK" and "Cancel" buttons on the dialog.

See Also:
Constant Field Values

panelGroups

protected Vector panelGroups

panels

protected Vector panels

displayType

protected int displayType

parentFrame

protected Frame parentFrame

okButton

protected Button okButton

applyButton

protected Button applyButton

cancelButton

protected Button cancelButton
Constructor Detail

AbstractSettingsDialog

public AbstractSettingsDialog(Frame parent,
                              String title)
Create a new AbstractSettingsDialog object.

Parameters:
parent - parent frame used to center dialog
title - title text for dialog window
Method Detail

showDialog

public void showDialog()
Display the dialog.


setVisible

public void setVisible(boolean isVisible)
Sets the visible state of the dialog window.

Parameters:
isVisible - true if visible, false otherwise

setButtonDisplay

public void setButtonDisplay(int displayType)
Sets the button display model. The possible values are OK_CANCEL and OK_CANCEL_APPLY.

Parameters:
displayType - an integer that specifies the button layout model
See Also:
getButtonDisplay()

getButtonDisplay

public int getButtonDisplay()
Return the value of the button display model.

Returns:
the current button display model value
See Also:
setButtonDisplay(int)

setGui

public abstract void setGui()
Create the screen elements for the settings dialog


setHasChanged

public void setHasChanged(boolean value)
Set the has changed flag. The flag should be change to keep track of the relative state of the dialog data.

Parameters:
value - true if state has changed, false otherwise.
See Also:
hasChanged()

hasChanged

public boolean hasChanged()
Return the state of the data represented by the dialog.

Returns:
true if the data has been changed, false otherwise

add

public void add(SettingsDialogPanelGroup group)
Add ControlPanelGroup to control panel

Parameters:
group - group to be added to dialog.

add

public void add(AbstractSettingsDialogPanel panel)
add ControlPanelPanel to control panel

Parameters:
panel - panel to be added to the dialog

save

public boolean save()
Iterate through ControlPanelPanels and call save method.

Specified by:
save in interface SettingsDialogInterface
Returns:
true always

cancel

public boolean cancel()
Iterate through ControlPanelPanel and call cancel method.

Specified by:
cancel in interface SettingsDialogInterface
Returns:
true

actionPerformed

public void actionPerformed(ActionEvent e)
Responds to the menu items and buttons.

Specified by:
actionPerformed in interface ActionListener

center

protected void center()