IcanGui
Class GuiListDialog

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 IcanGui.GuiListDialog
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class GuiListDialog
extends java.awt.Dialog
implements java.awt.event.ActionListener, java.awt.event.KeyListener

Display a list dialog and return an item from the list.

Since:
1.0;
Version:
1.1.6;
Updated by Louis Handler on Dec 29, 2005, 11:43 EST (1.1.6).
Updated by Louis Handler on Jul 18, 2005, 08:11 EDT (1.1.5).
Updated by Louis Handler on Mar 28, 2000, 13:33 EST.
Updated by Louis Handler on Feb 22, 2000, 15:15 EST.
Updated by Louis Handler on Oct 27, 1999, 13:49 EDT.
Updated by Louis Handler on Jan 7, 1999, 10:02 EST.
Updated by Louis Handler on Jul 21, 1998, 07:54 EDT.
Updated by Matthew Der on Jul 7, 1998.
Updated by Matthew Der on Jun 24, 1998.
Updated by Louis Handler on Jun 18, 1998.
Author:
Louis Handler
See Also:
Dialog, Serialized Form

Nested Class Summary
(package private)  class GuiListDialog.Madapter
          Mouse Adapter Inner Class to Handle Mouse Events
 
Nested classes/interfaces inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  java.awt.Button bCancel
          Cancel Button closes this window without doing anything.
private  java.awt.Button bHelp
          Help Button generates a message to help decide what to do.
private  java.awt.Button bOk
          Ok Button stores the selected item.
private  java.lang.String chosen
          Item chosen from list.
private  boolean firstRun
          Variable to test for the first time the frame is displayed.
private  java.awt.List flist
          List of items to choose from.
private  int oldIndex
          The Old Index of the List
private  IcanFrame windowFrameParent
          Window frame of parent.
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
GuiListDialog(IcanFrame parent, java.lang.String title, java.lang.String[] theList)
          Constructor creates a List Dialog window.
GuiListDialog(IcanFrame parent, java.lang.String title, java.lang.String[] theList, int item)
          Constructor creates a List Dialog window.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
          Detect Action Events and process accordingly.
 void createList(java.lang.String[] theList)
          Create the List Dialog window contents.
 java.lang.String getName()
          Get class name.
 java.lang.String getValue()
          Return chosen item from the list.
 void helpMe()
          Display help message.
 void helpMe(java.awt.Component target)
          Display help message.
 void keyPressed(java.awt.event.KeyEvent evt)
          Does Nothing
 void keyReleased(java.awt.event.KeyEvent evt)
          Detect when the follow keys are released: Enter, Tab, Shift+Tab, Up arrow, Down Arrow, Alt+Right, Alt+Left F1 and handles them accordingly.
 void keyTyped(java.awt.event.KeyEvent evt)
          Does Nothing
 void remove()
          Dispose of any components required before disposing of parent.
 void selectItem(int item)
          Select default item in list.
 void setFocusFirstTime()
          Set focus to first list item, the first time the mouse enters the window.
 
Methods inherited from class java.awt.Dialog
addNotify, getAccessibleContext, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, paramString, setModal, setModalityType, setResizable, setTitle, setUndecorated, setVisible, 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, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, 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, addImpl, 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, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, 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, 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, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

windowFrameParent

private IcanFrame windowFrameParent
Window frame of parent.


chosen

private java.lang.String chosen
Item chosen from list.


flist

private java.awt.List flist
List of items to choose from.


bOk

private java.awt.Button bOk
Ok Button stores the selected item.


bCancel

private java.awt.Button bCancel
Cancel Button closes this window without doing anything.


bHelp

private java.awt.Button bHelp
Help Button generates a message to help decide what to do.


oldIndex

private int oldIndex
The Old Index of the List


firstRun

private boolean firstRun
Variable to test for the first time the frame is displayed. Used to set focus on entry.

Constructor Detail

GuiListDialog

public GuiListDialog(IcanFrame parent,
                     java.lang.String title,
                     java.lang.String[] theList)
Constructor creates a List Dialog window.

Parameters:
parent - Parent frame object.
title - Title at top of window frame.
theList - Array of String values to pick from.

GuiListDialog

public GuiListDialog(IcanFrame parent,
                     java.lang.String title,
                     java.lang.String[] theList,
                     int item)
Constructor creates a List Dialog window.

Parameters:
parent - Parent frame object.
title - Title at top of window frame.
theList - Array of String values to pick from.
item - Subscript of default item to select.
Method Detail

createList

public void createList(java.lang.String[] theList)
Create the List Dialog window contents.

Parameters:
theList - Array of String values to pick from.

remove

public void remove()
Dispose of any components required before disposing of parent.


getValue

public java.lang.String getValue()
Return chosen item from the list.

Returns:
Chosen item.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Detect Action Events and process accordingly.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
evt - Action event.

setFocusFirstTime

public void setFocusFirstTime()
Set focus to first list item, the first time the mouse enters the window.


keyTyped

public void keyTyped(java.awt.event.KeyEvent evt)
Does Nothing

Specified by:
keyTyped in interface java.awt.event.KeyListener
Parameters:
evt - Key event.

keyPressed

public void keyPressed(java.awt.event.KeyEvent evt)
Does Nothing

Specified by:
keyPressed in interface java.awt.event.KeyListener
Parameters:
evt - Key event.

keyReleased

public void keyReleased(java.awt.event.KeyEvent evt)
Detect when the follow keys are released: Enter, Tab, Shift+Tab, Up arrow, Down Arrow, Alt+Right, Alt+Left F1 and handles them accordingly.

Specified by:
keyReleased in interface java.awt.event.KeyListener
Parameters:
evt - Key event.

selectItem

public void selectItem(int item)
Select default item in list.

Parameters:
item - Subscript of item in list.

helpMe

public void helpMe()
Display help message.


helpMe

public void helpMe(java.awt.Component target)
Display help message.

Parameters:
target - Component for which error/help message is displayed.

getName

public java.lang.String getName()
Get class name.

Overrides:
getName in class java.awt.Component
Returns:
Class name.