com.sas.awt
Class Dialog

com.sas.awt.Dialog
All Implemented Interfaces:
ContainerInterface, VisualInterface, com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, com.sas.ComponentInterface, com.sas.DesignTimeDropTargetInterface, com.sas.lang.StringDataInterface, com.sas.LinkPropertiesInterface, com.sas.ModelInterface, ValidatorInterface, com.sas.ViewInterface, MultipleValueEventSourceInterface, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible
Direct Known Subclasses:
ButtonDialog, ColorDialog, DirectoryDialog, FontDialog, MessageBox, ProgressDialog

public class Dialog
implements java.awt.event.WindowListener, com.sas.lang.StringDataInterface

The Dialog class encapsulates a window that contains components that accept input from a user. Dialogs differ from other windows classes in that they are dependent on a Frame object. Actions that affect a Frame can affect any dialogs associated with the Frame (.ie if a Frame is destroyed, so are its dialogs).
The dialog may have a title and can be resizable. A dialog can be modal (blocks user input to other windows until it is closed) or modeless (does not block user input to other windows). The default LayoutManager for a dialog is BorderLayout.

Creation:

  1. Create a Dialog

    Dialog dialog1 = new Dialog(parent);
    dialog1.initialize();

    where parent is an instance of the Frame class that specifies the frame that the dialog is associated with

  2. Create a Dialog with the specified title

    Dialog dialog1 = new Dialog(parent, title);
    dialog1.initialize(); where:

  3. Create a Dialog with the specified title and modality

    Dialog dialog1 = new Dialog(parent, title, modal)
    dialog1.initialize(); where:

Default Size:
Notes:

See Also:
Serialized Form

Field Summary
protected static boolean _cantUseSASModal
           
protected static boolean _inApplet
           
protected  boolean _modal
           
protected  boolean autoDispose
           
static java.lang.String RB_KEY
           
protected  java.lang.Object READY
           
protected  int setVisibleCalled
           
protected  ModalDispatchThread t
           
 
Constructor Summary
Dialog(java.awt.Frame parent)
          Default constructor
Dialog(java.awt.Frame parent, java.lang.String title)
          Create a dialog with the specified parent and title
Dialog(java.awt.Frame parent, java.lang.String title, boolean modal)
          Create a dialog with the specified parent,title, and modality
 
Method Summary
 void center()
          Center the dialog on the screen.
 void centerOver(java.awt.Component component)
          Center the dialog over a component on the screen.
 void centerOverWindow(java.awt.Component component)
          Center the dialog over a Window on the screen.
 void dispose()
           
protected  void fireReadySignal()
          Internal method; only used for SASModal.
 boolean getAutoDispose()
          Returns the value of the autoDispose property (default value is true).
static int getDefaultHeight()
          Returns the default height for instances of this class
static int getDefaultWidth()
          Returns the default width for instances of this class
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
          Returns the ExtendedBeanInfo for this class.
 java.lang.String getText()
          Returns the Dialog title
 void hide()
          Deprecated.  
static boolean isSASModalEnabled()
          Returns whether modal dialogs use a non-AWT method of approximating modality.
protected  void newDispatchThread()
          Internal method; only used for SASModal.
protected  void processWindowEvent(java.awt.event.WindowEvent e)
          Internal method.
 void setAutoDispose(boolean autoDispose)
          Sets the value of the autoDispose property
static void setDefaultHeight(int newDefaultHeight)
          Sets the default height of the component when it is dropped within the IDE
static void setDefaultWidth(int newDefaultWidth)
          Sets the default width of the component when it is dropped within the IDE
 void setModal(boolean b)
          Sets the modal property to the specified boolean state
 void setResizable(boolean resizable)
          Sets the resizable property to the specified boolean state
static void setSASModalEnabled(boolean nonAWTModal)
          Sets whether modal dialogs use a non-AWT method of approximating modality.
 void setText(java.lang.String text)
          Sets the Dialog title
 void setTitle(java.lang.String text)
          Sets the Dialog title
 void setVisible(boolean visible)
          setVisible() is the set accessor method for the Visible attribute.
 void setVisible(boolean visible, boolean doBlock)
          This version of setVisible takes a boolean parameter that specifies whether the setVisible call should block until the dialog is no longer visible (standard modal behavior).
 void show()
          Deprecated.  
protected  void stopDispatchThread()
          Internal method; only used for SASModal.
 void waitForReadySignal()
          Internal method; only used for SASModal.
protected  void waitTilReady(boolean doBlock)
          Internal method; only used for SASModal.
 void windowActivated(java.awt.event.WindowEvent e)
          Part of the implementation of the WindowListener interface.
 void windowClosed(java.awt.event.WindowEvent e)
          Part of the implementation of the WindowListener interface.
 void windowClosing(java.awt.event.WindowEvent e)
          Part of the implementation of the WindowListener interface.
 void windowDeactivated(java.awt.event.WindowEvent e)
          Part of the implementation of the WindowListener interface.
 void windowDeiconified(java.awt.event.WindowEvent e)
          Part of the implementation of the WindowListener interface.
 void windowIconified(java.awt.event.WindowEvent e)
          Part of the implementation of the WindowListener interface.
 void windowOpened(java.awt.event.WindowEvent e)
          Part of the implementation of the WindowListener interface.
 
Methods inherited from class com.sas.awt.DialogContainerComponent
addNotify, clone, dragEnter, dragLeave, dragOver, drop, getContainerInterfaceSupportInfo, getErrorHandler, getInsets, getValidator, isIDEDnDDropBarrier, isIDEDnDDropTarget, isValid, removeNotify, setContainerInterfaceSupportInfo, setDefaultValues, setErrorHandler, setIDEDnDDropBarrier, setIDEDnDDropTarget, setInsets, setInsets, setValidator, superAddNotify, superGetInsets, superRemoveNotify, superSetDefaultValues
 
Methods inherited from class com.sas.awt.DialogVisualComponent
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachModel, attachView, computePreferredSize, detachModel, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getBackgroundColor, getBorder, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getFont, getForegroundColor, getHeight, getHorizontalPosition, getLinkInfo, getMinimumSize, getModelInterface, getPreferredSize, getPrePainter, getRequiredInterfaces, getVerticalPosition, getViewInterfaceSupportInfo, getVisualInterfaceSupportInfo, getWidth, initialize, initializeComponent, isDesignTime, isEnabled, isFocus, isLinked, isTransparent, isVisible, paint, propertyChange, queryLinks, queryLinks, refresh, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setBackgroundColor, setBorder, setBounds, setComponentDescription, setComponentSupportInfo, setEnabled, setFocus, setFont, setForegroundColor, setHeight, setHorizontalPosition, setLinkInfo, setModelInterface, setPreferredSize, setPrePainter, setRequiredInterfaces, setTransparent, setVerticalPosition, setViewInterfaceSupportInfo, setVisualInterfaceSupportInfo, setWidth, superGetFont, superGetMinimumSize, superGetPreferredSize, superIsEnabled, superIsVisible, superPaint, superSetBounds, superSetEnabled, superSetFont, superSetVisible, superUpdate, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, update, validateObject
 
Methods inherited from interface com.sas.awt.ContainerInterface
getComponents, getLayout, invalidate, setLayout, validate
 
Methods inherited from interface com.sas.awt.VisualInterface
computePreferredSize, getBackgroundColor, getBorder, getFont, getForegroundColor, getHeight, getHorizontalPosition, getMinimumSize, getPreferredSize, getPrePainter, getVerticalPosition, getVisualInterfaceSupportInfo, getWidth, isEnabled, isFocus, isTransparent, isVisible, setBackgroundColor, setBorder, setBounds, setEnabled, setFocus, setFont, setForegroundColor, setHeight, setHorizontalPosition, setPreferredSize, setPrePainter, setTransparent, setVerticalPosition, setVisualInterfaceSupportInfo, setWidth, superGetFont, superGetMinimumSize, superGetPreferredSize, superIsEnabled, superIsVisible, superPaint, superSetBounds, superSetEnabled, superSetFont, superSetVisible, superUpdate
 

Field Detail

autoDispose

protected boolean autoDispose

_modal

protected boolean _modal

_inApplet

protected static boolean _inApplet

_cantUseSASModal

protected static boolean _cantUseSASModal

setVisibleCalled

protected transient int setVisibleCalled

t

protected transient ModalDispatchThread t

READY

protected final java.lang.Object READY

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values
Constructor Detail

Dialog

public Dialog(java.awt.Frame parent)
Default constructor

Parameters:
parent - the frame that the dialog is associated with

Dialog

public Dialog(java.awt.Frame parent,
              java.lang.String title,
              boolean modal)
Create a dialog with the specified parent,title, and modality

Parameters:
parent - the frame that the dialog is associated with
title - dialog title
modal - a boolean indicating whether the dialog is modal or not

Dialog

public Dialog(java.awt.Frame parent,
              java.lang.String title)
Create a dialog with the specified parent and title

Parameters:
parent - the frame that the dialog is associated with
title - dialog title
Method Detail

isSASModalEnabled

public static boolean isSASModalEnabled()
Returns whether modal dialogs use a non-AWT method of approximating modality. The default value is false.

Returns:
whether modal dialogs use a non-AWT method of approximating modality.
See Also:
setSASModalEnabled(boolean)

setSASModalEnabled

public static void setSASModalEnabled(boolean nonAWTModal)
Sets whether modal dialogs use a non-AWT method of approximating modality. Note that nesting dialogs which use AWT modality (such as java.awt.Dialog) with com.sas.awt.Dialogs with sasModalEnabled set to true will likely cause the dialogs to stop accepting events. Calling this method will have no effect if running under the Microsoft Java VM.

Parameters:
nonAWTModal - true to use the SAS method, false to use AWT modality.
See Also:
isSASModalEnabled()

getDefaultWidth

public static int getDefaultWidth()
Returns the default width for instances of this class

Returns:
the value of the defaultWidth property
See Also:
setDefaultWidth(int)

setDefaultWidth

public static void setDefaultWidth(int newDefaultWidth)
Sets the default width of the component when it is dropped within the IDE

Parameters:
newDefaultWidth - the new value to assign to the defaultWidth property
See Also:
getDefaultWidth()

getDefaultHeight

public static int getDefaultHeight()
Returns the default height for instances of this class

Returns:
the value of the defaultHeight property
See Also:
setDefaultHeight(int)

setDefaultHeight

public static void setDefaultHeight(int newDefaultHeight)
Sets the default height of the component when it is dropped within the IDE

Parameters:
newDefaultHeight - the new value to assign to the defaultHeight property
See Also:
getDefaultHeight()

getExtendedBeanInfo

public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
Returns the ExtendedBeanInfo for this class.

Returns:
ExtendedBeanInfo for this class

dispose

public void dispose()
Overrides:
dispose in class java.awt.Window

setVisible

public void setVisible(boolean visible)
Description copied from interface: VisualInterface
setVisible() is the set accessor method for the Visible attribute. Pass in true to show the component. Pass in false to hide the component.

Specified by:
setVisible in interface VisualInterface
Overrides:
setVisible in class DialogVisualComponent
Parameters:
visible - Whether the component should be visible.
See Also:
VisualInterface.setVisible(boolean)

setVisible

public void setVisible(boolean visible,
                       boolean doBlock)
This version of setVisible takes a boolean parameter that specifies whether the setVisible call should block until the dialog is no longer visible (standard modal behavior). The parameter is only used when using SASModal. Don't use it as it will not be supported in the future.


show

public void show()
Deprecated. 

Overrides:
show in class java.awt.Dialog

hide

public void hide()
Deprecated. 

Overrides:
hide in class java.awt.Dialog

processWindowEvent

protected void processWindowEvent(java.awt.event.WindowEvent e)
Internal method.

Overrides:
processWindowEvent in class java.awt.Window

waitForReadySignal

public void waitForReadySignal()
Internal method; only used for SASModal.


fireReadySignal

protected void fireReadySignal()
Internal method; only used for SASModal.


stopDispatchThread

protected void stopDispatchThread()
Internal method; only used for SASModal.


newDispatchThread

protected void newDispatchThread()
Internal method; only used for SASModal.


waitTilReady

protected void waitTilReady(boolean doBlock)
Internal method; only used for SASModal.


getText

public java.lang.String getText()
Returns the Dialog title

Specified by:
getText in interface com.sas.lang.StringDataInterface
Returns:
Dialog title

setModal

public void setModal(boolean b)
Sets the modal property to the specified boolean state

Overrides:
setModal in class java.awt.Dialog
Parameters:
b - boolean state

setResizable

public void setResizable(boolean resizable)
Sets the resizable property to the specified boolean state

Overrides:
setResizable in class java.awt.Dialog
Parameters:
state - boolean state

setText

public void setText(java.lang.String text)
Sets the Dialog title

Specified by:
setText in interface com.sas.lang.StringDataInterface
Parameters:
title - Dialog title

setTitle

public void setTitle(java.lang.String text)
Sets the Dialog title

Overrides:
setTitle in class java.awt.Dialog
Parameters:
title - Dialog title

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Part of the implementation of the WindowListener interface. This interface is used to listen for the close event on the window.

Specified by:
windowOpened in interface java.awt.event.WindowListener
Parameters:
e - windowEvent

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Part of the implementation of the WindowListener interface. This interface is used to listen for the close event on the window.

When the window close button is clicked, the window is destroyed using dispose() and a MessageBoxEvent is sent with the button field as CANCEL.

Specified by:
windowClosing in interface java.awt.event.WindowListener
Parameters:
e - windowEvent

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Part of the implementation of the WindowListener interface. This interface is used to listen for the close event on the window.

Specified by:
windowClosed in interface java.awt.event.WindowListener
Parameters:
e - windowEvent

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Part of the implementation of the WindowListener interface. This interface is used to listen for the close event on the window.

Specified by:
windowIconified in interface java.awt.event.WindowListener
Parameters:
e - windowEvent

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Part of the implementation of the WindowListener interface. This interface is used to listen for the close event on the window.

Specified by:
windowDeiconified in interface java.awt.event.WindowListener
Parameters:
e - windowEvent

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Part of the implementation of the WindowListener interface. This interface is used to listen for the close event on the window.

Specified by:
windowActivated in interface java.awt.event.WindowListener
Parameters:
e - windowEvent

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Part of the implementation of the WindowListener interface. This interface is used to listen for the close event on the window.

Specified by:
windowDeactivated in interface java.awt.event.WindowListener
Parameters:
e - windowEvent

center

public void center()
Center the dialog on the screen.


centerOver

public void centerOver(java.awt.Component component)
Center the dialog over a component on the screen.

Parameters:
component - component

centerOverWindow

public void centerOverWindow(java.awt.Component component)
Center the dialog over a Window on the screen. The Window may be specified, or the containment hierarchy is walked until a Window is found.


getAutoDispose

public boolean getAutoDispose()
Returns the value of the autoDispose property (default value is true).

Returns:
value of the autoDispose property

setAutoDispose

public void setAutoDispose(boolean autoDispose)
Sets the value of the autoDispose property

Parameters:
autoDispose - boolean value



Copyright © 2009 SAS Institute Inc. All Rights Reserved.