S-PLUS Connect/Java v1.0

com.insightful.controls
Class SplusDialog

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.insightful.controls.SplusDialog
All Implemented Interfaces:
WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
TransferFileDialog

public class SplusDialog
extends JDialog
implements WindowListener

Standard dialog used by the S-PLUS GUI. Has a main center pane and a button pane. The SplusDialog takes care of performing actions when the standard buttons are pressed. Other dialogs extend this one by creating a main pane with controls and defining an SplusFunctionInfo object specifying how to write out the command when OK or Apply is pressed. Use setCenterPanel() to add the main center pane to the dialog, and setFunctionInfo() to add the SplusFunctionInfo object.

See Also:
Serialized Form

Nested Class Summary
static interface SplusDialog.SplusDialogButtonListener
           
 
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 String APPLY_ACTION_CMD
           
static String CANCEL_ACTION_CMD
           
static String HELP_ACTION_CMD
           
static String OK_ACTION_CMD
           
 
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
SplusDialog()
          Dialog with default Frame as parent and no title.
SplusDialog(Frame frame, String title)
          Dialog with the specified parent and the specified title.
SplusDialog(String text)
          Dialog with default Frame as parent and the specified title.
 
Method Summary
 void addButtonListener(SplusDialog.SplusDialogButtonListener listener)
           
static void centerComponent(Component child, Component parent)
          Center a Component relative to another component.
 SplusFunctionInfo getFunctionInfo()
          Get the SplusFunctionInfo object.
static ActionListener getMainActionListener()
          The standard SplusGui has an SplusMainActionListener that can be used to launch a new dialog.
static JMenuBar getMainMenuBar()
          Get the main menu bar from SplusSystem.
 boolean isComplete()
          Called by performOk() and performApply().
 void notifyButtonListeners(String actionID)
           
 void performApply()
          Called when Apply button is pressed.
 void performCancel()
          Called when Cancel button is pressed.
 void performHelp()
          Called when Help button is pressed.
 void performOk()
          Called when OK button is pressed.
 void removeButtonListener(SplusDialog.SplusDialogButtonListener listener)
           
 void sendCommand()
          Called by performOk() and performApply().
 void setApplyVisible(boolean isVisible)
          Some dialogs don't have an Apply button.
 void setCenterPanel(JComponent centerPanel)
          Add component to center panel and size the dialog.
 void setFunctionInfo(SplusFunctionInfo info)
          Set the SplusFunctionInfo object.
 void show()
          Override show() method to set focus to the first focusable component in the first component added to the content pane when the dialog is shown.
static void showNewDialog(String className)
          Utility method to create and show a new dialog given the class name.
 boolean warnIfEmpty(SplusControlMethods field)
          This method can be used by isComplete() to check whether a required field is empty.
 void windowActivated(WindowEvent e)
           
 void windowClosed(WindowEvent e)
           
 void windowClosing(WindowEvent e)
           
 void windowDeactivated(WindowEvent e)
           
 void windowDeiconified(WindowEvent e)
           
 void windowIconified(WindowEvent e)
           
 void windowOpened(WindowEvent e)
           
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, 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
 
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

OK_ACTION_CMD

public static final String OK_ACTION_CMD
See Also:
Constant Field Values

CANCEL_ACTION_CMD

public static final String CANCEL_ACTION_CMD
See Also:
Constant Field Values

HELP_ACTION_CMD

public static final String HELP_ACTION_CMD
See Also:
Constant Field Values

APPLY_ACTION_CMD

public static final String APPLY_ACTION_CMD
See Also:
Constant Field Values
Constructor Detail

SplusDialog

public SplusDialog()
Dialog with default Frame as parent and no title.


SplusDialog

public SplusDialog(String text)
Dialog with default Frame as parent and the specified title.


SplusDialog

public SplusDialog(Frame frame,
                   String title)
Dialog with the specified parent and the specified title.

Method Detail

getFunctionInfo

public SplusFunctionInfo getFunctionInfo()
Get the SplusFunctionInfo object.


setFunctionInfo

public void setFunctionInfo(SplusFunctionInfo info)
Set the SplusFunctionInfo object.


setCenterPanel

public void setCenterPanel(JComponent centerPanel)
Add component to center panel and size the dialog. Call this after all components have been added to the panel.


windowActivated

public void windowActivated(WindowEvent e)
Specified by:
windowActivated in interface WindowListener

windowClosed

public void windowClosed(WindowEvent e)
Specified by:
windowClosed in interface WindowListener

windowClosing

public void windowClosing(WindowEvent e)
Specified by:
windowClosing in interface WindowListener

windowDeactivated

public void windowDeactivated(WindowEvent e)
Specified by:
windowDeactivated in interface WindowListener

windowDeiconified

public void windowDeiconified(WindowEvent e)
Specified by:
windowDeiconified in interface WindowListener

windowIconified

public void windowIconified(WindowEvent e)
Specified by:
windowIconified in interface WindowListener

windowOpened

public void windowOpened(WindowEvent e)
Specified by:
windowOpened in interface WindowListener

show

public void show()
Override show() method to set focus to the first focusable component in the first component added to the content pane when the dialog is shown.

Overrides:
show in class Dialog

addButtonListener

public void addButtonListener(SplusDialog.SplusDialogButtonListener listener)

removeButtonListener

public void removeButtonListener(SplusDialog.SplusDialogButtonListener listener)

notifyButtonListeners

public void notifyButtonListeners(String actionID)

performOk

public void performOk()
Called when OK button is pressed.


performApply

public void performApply()
Called when Apply button is pressed.


performCancel

public void performCancel()
Called when Cancel button is pressed.


isComplete

public boolean isComplete()
Called by performOk() and performApply(). Override this with a method to validate whether all of the necessary fields of the dialog are filled in. Typically it would throw up a message box explaining the problem and return false if the fields are not complete.


warnIfEmpty

public boolean warnIfEmpty(SplusControlMethods field)
This method can be used by isComplete() to check whether a required field is empty. If the field is empty we will throw up a message box and return false.


performHelp

public void performHelp()
Called when Help button is pressed. Requests help for the keyword generated by taking the title and replacing special characters with underscores as needed.


sendCommand

public void sendCommand()
Called by performOk() and performApply(). Gets the function call from the SplusFunctionInfo and asks the parent frame to process the command. Override this method to perform some other action on OK and Apply, while using the default logic for checking isComplete() and calling dispose().


setApplyVisible

public void setApplyVisible(boolean isVisible)
Some dialogs don't have an Apply button. Method to set whether the Apply button is visible.


getMainMenuBar

public static JMenuBar getMainMenuBar()
Get the main menu bar from SplusSystem. Useful for adding a static method to a class extending SplusDialog which adds a menu item that creates and shows a new instance of the dialog. This static method may then be called from S-PLUS to modify the menus.


getMainActionListener

public static ActionListener getMainActionListener()
The standard SplusGui has an SplusMainActionListener that can be used to launch a new dialog. This method gets the action listener for use in automatically creating a new dialog.


showNewDialog

public static void showNewDialog(String className)
                          throws ClassNotFoundException
Utility method to create and show a new dialog given the class name. Can be called from S-PLUS using .JavaMethod().

Throws:
ClassNotFoundException

centerComponent

public static final void centerComponent(Component child,
                                         Component parent)
Center a Component relative to another component. Does not currently handle null Components.


S-PLUS Connect/Java v1.0

Copyright © 2000, 2002 Insightful Corporation
Warning: Classes not documented in the S-PLUS Programmer's Guide may change in future releases.