giden.CORE
Class RowDialogMain

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--giden.CORE.RowDialogMain
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable

public class RowDialogMain
extends java.awt.Frame
implements java.awt.event.ActionListener, java.awt.event.MouseMotionListener, java.awt.event.MouseListener

Copyright (c) 1993-2004 C. R. Coullard, D. S. Dilworth, J. H. Owen, All Rights Reserved.
We make no representations or warranties about the suitability of the software, either express or implied, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. We shall not be liable for any damages suffered by user as a result of using, modifying or distributing this software or its derivatives.

RowDialogMain is a row-oriented dialog box that supports multiple objects derived from RowDialogEntry. This object displays each row, interacts with GIDEN, displays controls defined by the solver, and interacts with the user. Solvers retrieve the results of the interactions from the derived objects. The creation of a dialog box begins by creating a RowDialogMain object. Each row that is added to the dialog box inputs one type of information and returns an object that is used to retrieve the user selections. Currently these types rows can be added to the dialog box input:

In addition to rows, the dialog box needs to have control buttons added. The buttons appear at the bottom of the dialog box and perform the [Cancel], [OK] functionality. After the input rows and control buttons are added, the Interact() method is called. The dialog box then takes control of the GIDEN environment, and it will return when the user has selected one of the control buttons. The text from the control button is returned from the Interact() method. The results from each row method can then be processed. The example below is taken from the DialogSolver.java solver.
boolean InteractWithUser()
{
// create an empty dialog box
RowDialogMain Dialog = UI.CreateRowDialog("Dialog Solver");

// add the filename row 
RowDialogText TextRow = Dialog.AddRowText("Test Text","default text");          

// add the filename row 
RowDialogFilename FilenameRow = Dialog.AddRowFilename("Test Filename","default.csv",false); 

// add the choice row
String Choices[] = new String[3];
Choices[0]="Choice A";
Choices[1]="Choice B";
Choices[2]="Choice C";
RowDialogChoice ChoiceRow = Dialog.AddRowChoice("Test Choice",Choices);

// add the edge row
RowDialogEdge EdgeRow = Dialog.AddRowEdge("Test Edge",Net.GetEdgeIndexStrings());
EdgeRow.PutHelpFile("DialogSolverEdge.html"); // add a help button for edges

// add the node row
RowDialogNode NodeRow = Dialog.AddRowNode("Test Node",Net.GetNodeIndexStrings());

// add Cancel and OK buttons
Dialog.AddButton("Cancel");
Dialog.AddButton("OK");

// interact with the user        
String pushed_button = Dialog.Interact(); 

// retrieve results
TestText = TextRow.GetText();
TestFilename = FilenameRow.GetFilename();
TestChoice = ChoiceRow.GetChoice();
TestNode = NodeRow.GetNode();
TestEdge = EdgeRow.GetEdge();

// dispose of the dialog box
Dialog.dispose();

// returns true if the OK button was pushed
return pushed_button.equals("OK");
}   

Version:
4.0a 2004 08 27
Author:
D. S. Dilworth
See Also:
RowDialogChoice, RowDialogEdge, RowDialogEntry, RowDialogFilename, RowDialogNode, RowDialogText, Serialized Form

Field Summary
 giden.CORE.RowDialogController ControllerButtonResult
           
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
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
RowDialogMain(java.lang.String name, giden.CORE.UserBase user, java.awt.Point top_left, giden.CORE.ExecBase solver)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          internal method
 void AddButton(java.lang.String name)
          Adds a dialog control button to the bottom of the dialog box.
 void AddRow(giden.CORE.RowDialogEntry row)
          internal method
 RowDialogChoice AddRowChoice(java.lang.String name, java.lang.String[] choices)
          Adds a choice row to the diaglog box.
 RowDialogChoice AddRowChoice(java.lang.String name, java.lang.String[] choices, java.lang.String nominal)
          Adds a choice row to the dialog box.
 giden.CORE.RowDialogController AddRowController(java.lang.String name, java.lang.String value, giden.CORE.SolverController solver)
          internal method
 RowDialogEdge AddRowEdge(java.lang.String name, LinkList choices)
          Adds an edge selection row to the dialog box.
 RowDialogFilename AddRowFilename(java.lang.String name, java.lang.String nominal, boolean savemode)
          Adds a filename selection row to the diaglog box.
 RowDialogNode AddRowNode(java.lang.String name, LinkList choices)
          Adds a node selection row to the diaglog box.
 RowDialogText AddRowText(java.lang.String name, java.lang.String value)
          Adds a text row to the dialog box.
 java.awt.Point GetBottomLeft()
          internal method
 java.lang.String GetResultString()
          internal method
 java.lang.String Interact()
          Interacts with the user and returns the string associated with the dialog control button that was pushed.
 void mouseClicked(java.awt.event.MouseEvent event)
          internal method
 void mouseDragged(java.awt.event.MouseEvent event)
          internal method
 void mouseEntered(java.awt.event.MouseEvent event)
          internal method
 void mouseExited(java.awt.event.MouseEvent event)
          internal method
 void mouseMoved(java.awt.event.MouseEvent event)
          internal method
 void mousePressed(java.awt.event.MouseEvent event)
          internal method
 void mouseReleased(java.awt.event.MouseEvent event)
          internal method
 void PutHelpFile(java.lang.String helpfile)
          Sets the name of the HTML help file.
 
Methods inherited from class java.awt.Frame
addNotify, getAccessibleContext, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, isResizable, remove, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle
 
Methods inherited from class java.awt.Window
addWindowListener, applyResourceBundle, applyResourceBundle, dispose, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isShowing, pack, postEvent, removeWindowListener, setCursor, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, setFont, setLayout, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

ControllerButtonResult

public giden.CORE.RowDialogController ControllerButtonResult
Constructor Detail

RowDialogMain

public RowDialogMain(java.lang.String name,
                     giden.CORE.UserBase user,
                     java.awt.Point top_left,
                     giden.CORE.ExecBase solver)
Method Detail

AddRowController

public giden.CORE.RowDialogController AddRowController(java.lang.String name,
                                                       java.lang.String value,
                                                       giden.CORE.SolverController solver)
internal method

AddRowText

public RowDialogText AddRowText(java.lang.String name,
                                java.lang.String value)
Adds a text row to the dialog box.
Use "String RowDialogText.GetText()" to retrieve the text

AddRowChoice

public RowDialogChoice AddRowChoice(java.lang.String name,
                                    java.lang.String[] choices,
                                    java.lang.String nominal)
Adds a choice row to the dialog box.
Use "String RowDialogChoice.GetChoice()" to retrieve the text

AddRowChoice

public RowDialogChoice AddRowChoice(java.lang.String name,
                                    java.lang.String[] choices)
Adds a choice row to the diaglog box. The choices are an array strings that appear in a pulldown box. The user can select one of the strings.
Use "String RowDialogChoice.GetChoice()" to retrieve the text

AddRowNode

public RowDialogNode AddRowNode(java.lang.String name,
                                LinkList choices)
Adds a node selection row to the diaglog box. The row has a pulldown menu with the available Nodes and a button that allows the user to click on the Node.
Use "Node RowDialogNode.GetNode()" to retrieve the Node.

AddRowEdge

public RowDialogEdge AddRowEdge(java.lang.String name,
                                LinkList choices)
Adds an edge selection row to the dialog box. The row has a pulldown menu with the available Edges and a button that allows the user to click on the Edge.
Use "Edge RowDialogEdge.GetEdge()" to retrieve the Edgee.

AddRowFilename

public RowDialogFilename AddRowFilename(java.lang.String name,
                                        java.lang.String nominal,
                                        boolean savemode)
Adds a filename selection row to the diaglog box. The row has a text area to enter a filename and a button that allows the user to browse and click on a file.
Use "String RowDialogFilename.GetFilename()" to retrieve the text

PutHelpFile

public void PutHelpFile(java.lang.String helpfile)
Sets the name of the HTML help file. Note this file is assumed to be in the same folder as the solver. If no filename if specified, the HelpFile for the solver is used

AddRow

public void AddRow(giden.CORE.RowDialogEntry row)
internal method

AddButton

public void AddButton(java.lang.String name)
Adds a dialog control button to the bottom of the dialog box. These buttons are typically used to add [Cancel],[Back],and [OK] types of controls.

GetBottomLeft

public java.awt.Point GetBottomLeft()
internal method

Interact

public java.lang.String Interact()
Interacts with the user and returns the string associated with the dialog control button that was pushed.

GetResultString

public java.lang.String GetResultString()
internal method

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
internal method
Specified by:
actionPerformed in interface java.awt.event.ActionListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent event)
internal method
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent event)
internal method
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent event)
internal method
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent event)
internal method
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent event)
internal method
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent event)
internal method
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent event)
internal method
Specified by:
mouseReleased in interface java.awt.event.MouseListener