dog.gui
Class DDialog

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Dialog
                          |
                          +--dog.gui.DDialog
All Implemented Interfaces:
javax.accessibility.Accessible, DRootPane, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class DDialog
extends java.awt.Dialog
implements DRootPane

A dialog container for displaying lightweight components.

See Also:
Serialized Form

Inner classes inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog
 
Inner classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
protected  java.awt.Image backgroundImage
          The image to use as the background.
protected  DButton cancelButton
          The cancel button in this container.
protected  DButton defaultButton
          The default button in this container.
protected  int mode
          The rendering mode for the background image.
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface dog.gui.DRootPane
CENTER, CENTER_TILE, INTEGER_TILE, MAXIMIZE, MAXIMIZE_ASPECT, MAXIMIZE_HORIZONTAL, MAXIMIZE_VERTICAL, TILE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DDialog(java.awt.Frame parent)
          Constructs a gui dialog with no background image.
DDialog(java.awt.Frame parent, boolean modal)
          Constructs a gui dialog with no background image.
DDialog(java.awt.Frame parent, java.lang.String title)
          Constructs a gui dialog with the specified title and no background image.
DDialog(java.awt.Frame parent, java.lang.String title, boolean modal)
          Constructs a gui dialog with the specified title and no background image.
DDialog(java.awt.Frame parent, java.lang.String title, java.awt.Image backgroundImage)
          Constructs a gui dialog with the specified title and background image.
DDialog(java.awt.Frame parent, java.lang.String title, java.awt.Image backgroundImage, boolean modal)
          Constructs a gui dialog with the specified title and background image.
DDialog(java.awt.Frame parent, java.lang.String title, java.lang.String backgroundImage)
          Constructs a gui dialog with the specified title and background image.
DDialog(java.awt.Frame parent, java.lang.String title, java.lang.String backgroundImage, boolean modal)
          Constructs a gui dialog with the specified title and background image.
DDialog(java.awt.Frame parent, java.lang.String title, java.net.URL backgroundImage)
          Constructs a gui dialog with the specified title and background image.
DDialog(java.awt.Frame parent, java.lang.String title, java.net.URL backgroundImage, boolean modal)
          Constructs a gui dialog with the specified title and background image.
 
Method Summary
 java.awt.Component add(java.awt.Component component)
          Adds the specified component to this pane.
protected  void addImpl(java.awt.Component component, java.lang.Object constraints, int index)
          Overrides addImpl to manage lightweight popups.
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Adds a property change listener to receive notification of changes to this component.
 void centre()
          Centres the frame in the screen.
 void doLayout()
          Lays out the dialog.
 java.awt.Image getBackgroundImage()
          Returns the background image.
 DButton getCancelButton()
          Returns the cancel button in this container.
 DButton getDefaultButton()
          Returns the default button in this container.
 java.awt.Frame getFrame()
          Returns the frame this root pane represents or is part of.
 java.awt.Dimension getMaximumSize()
          Returns the maximum size for a gui frame.
 java.awt.Dimension getMinimumSize()
          Returns the minimum size for a gui frame.
 int getMode()
          Returns the rendering mode for the background image.
 java.awt.Dimension getPreferredSize()
          Returns the preferred size for a gui frame.
 boolean imageUpdate(java.awt.Image image, int flags, int x, int y, int w, int h)
          The background image has arrived...
 void invalidate()
          Flushes the offscreen buffer as part of invalidation.
 void paint(java.awt.Graphics gPrime)
          Paints the children into an offscreen buffer, then copies the entire image into the graphics context.
protected  void paintImpl(java.awt.Graphics g)
          This method can be overridden to paint onto the dialog.
 void processCancelAction(java.awt.event.ActionEvent event)
          Activates the cancel button in the container.
 void processDefaultAction(java.awt.event.ActionEvent event)
          Activates the default button in the container.
protected  void processKeyEvent(java.awt.event.KeyEvent event)
           
 void remove(java.awt.Component component)
          Removes the specified component from this pane.
 void removeAll()
          Removes all components from this pane.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Removes a property change listener so it no longer receives notification of changes to this component.
 void setBackgroundImage(java.awt.Image image)
          Sets the background image.
 void setBackgroundImage(java.lang.String file)
          Sets the background image from a file.
 void setBackgroundImage(java.net.URL url)
          Sets the background image from a URL.
 void setCancelButton(DButton button)
          Sets the cancel button in this container.
 void setDefaultButton(DButton button)
          Sets the default button in this container.
 void setLayout(java.awt.LayoutManager layout)
          Sets the layout manager for this pane.
 void setMode(int mode)
          Sets the rendering mode for the background image.
 void update(java.awt.Graphics g)
          Update does not erase the background before painting (why bother?).
 
Methods inherited from class java.awt.Dialog
addNotify, dispose, getAccessibleContext, getTitle, hide, isModal, isResizable, paramString, setModal, setResizable, setTitle, show
 
Methods inherited from class java.awt.Window
addWindowListener, applyResourceBundle, applyResourceBundle, finalize, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isShowing, pack, postEvent, processEvent, processWindowEvent, removeWindowListener, setCursor, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, addContainerListener, countComponents, deliverEvent, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, insets, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeContainerListener, removeNotify, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, 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, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, 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
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface dog.gui.DRootPane
getFont, getFontMetrics, getInsets, getSize, getTitle, setCursor, setTitle
 

Field Detail

mode

protected int mode
The rendering mode for the background image.

backgroundImage

protected java.awt.Image backgroundImage
The image to use as the background.

defaultButton

protected DButton defaultButton
The default button in this container.

cancelButton

protected DButton cancelButton
The cancel button in this container.
Constructor Detail

DDialog

public DDialog(java.awt.Frame parent)
Constructs a gui dialog with no background image.
Parameters:
parent - the parent frame

DDialog

public DDialog(java.awt.Frame parent,
               java.lang.String title)
Constructs a gui dialog with the specified title and no background image.
Parameters:
parent - the parent frame

DDialog

public DDialog(java.awt.Frame parent,
               java.lang.String title,
               java.awt.Image backgroundImage)
Constructs a gui dialog with the specified title and background image.
Parameters:
parent - the parent frame

DDialog

public DDialog(java.awt.Frame parent,
               java.lang.String title,
               java.lang.String backgroundImage)
Constructs a gui dialog with the specified title and background image.
Parameters:
parent - the parent frame

DDialog

public DDialog(java.awt.Frame parent,
               java.lang.String title,
               java.net.URL backgroundImage)
Constructs a gui dialog with the specified title and background image.
Parameters:
parent - the parent frame

DDialog

public DDialog(java.awt.Frame parent,
               boolean modal)
Constructs a gui dialog with no background image.
Parameters:
parent - the parent frame

DDialog

public DDialog(java.awt.Frame parent,
               java.lang.String title,
               boolean modal)
Constructs a gui dialog with the specified title and no background image.
Parameters:
parent - the parent frame

DDialog

public DDialog(java.awt.Frame parent,
               java.lang.String title,
               java.awt.Image backgroundImage,
               boolean modal)
Constructs a gui dialog with the specified title and background image.
Parameters:
parent - the parent frame

DDialog

public DDialog(java.awt.Frame parent,
               java.lang.String title,
               java.lang.String backgroundImage,
               boolean modal)
Constructs a gui dialog with the specified title and background image.
Parameters:
parent - the parent frame

DDialog

public DDialog(java.awt.Frame parent,
               java.lang.String title,
               java.net.URL backgroundImage,
               boolean modal)
Constructs a gui dialog with the specified title and background image.
Parameters:
parent - the parent frame
Method Detail

getMode

public int getMode()
Returns the rendering mode for the background image.
Specified by:
getMode in interface DRootPane
See Also:
setMode(int)

setMode

public void setMode(int mode)
Sets the rendering mode for the background image.
Specified by:
setMode in interface DRootPane
Parameters:
mode - one of CENTER, TILE, INTEGER_TILE, CENTER_TILE, MAXIMIZE, MAXIMIZE_ASPECT, MAXIMIZE_VERTICAL, or MAXIMIZE_HORIZONTAL
See Also:
getMode()

getBackgroundImage

public java.awt.Image getBackgroundImage()
Returns the background image.
Specified by:
getBackgroundImage in interface DRootPane
See Also:
setBackgroundImage(java.awt.Image)

setBackgroundImage

public void setBackgroundImage(java.awt.Image image)
Sets the background image.
Specified by:
setBackgroundImage in interface DRootPane
Parameters:
image - the background image.
See Also:
getBackgroundImage()

setBackgroundImage

public void setBackgroundImage(java.lang.String file)
Sets the background image from a file.
Specified by:
setBackgroundImage in interface DRootPane
Parameters:
file - the image file.
See Also:
getBackgroundImage()

setBackgroundImage

public void setBackgroundImage(java.net.URL url)
Sets the background image from a URL.
Specified by:
setBackgroundImage in interface DRootPane
Parameters:
url - the image URL.
See Also:
getBackgroundImage()

getDefaultButton

public DButton getDefaultButton()
Returns the default button in this container.
Specified by:
getDefaultButton in interface DRootPane

setDefaultButton

public void setDefaultButton(DButton button)
Sets the default button in this container.
Specified by:
setDefaultButton in interface DRootPane

processDefaultAction

public void processDefaultAction(java.awt.event.ActionEvent event)
Activates the default button in the container.
Specified by:
processDefaultAction in interface DRootPane

getCancelButton

public DButton getCancelButton()
Returns the cancel button in this container.
Specified by:
getCancelButton in interface DRootPane

setCancelButton

public void setCancelButton(DButton button)
Sets the cancel button in this container.
Specified by:
setCancelButton in interface DRootPane

processCancelAction

public void processCancelAction(java.awt.event.ActionEvent event)
Activates the cancel button in the container.
Specified by:
processCancelAction in interface DRootPane

getFrame

public java.awt.Frame getFrame()
Returns the frame this root pane represents or is part of.
Specified by:
getFrame in interface DRootPane

setLayout

public void setLayout(java.awt.LayoutManager layout)
Sets the layout manager for this pane.
Overrides:
setLayout in class java.awt.Container

add

public java.awt.Component add(java.awt.Component component)
Adds the specified component to this pane.
Specified by:
add in interface DRootPane
Overrides:
add in class java.awt.Container
Parameters:
component - the component to be added.
Returns:
the component.

addImpl

protected void addImpl(java.awt.Component component,
                       java.lang.Object constraints,
                       int index)
Overrides addImpl to manage lightweight popups.
Overrides:
addImpl in class java.awt.Container

remove

public void remove(java.awt.Component component)
Removes the specified component from this pane.
Specified by:
remove in interface DRootPane
Overrides:
remove in class java.awt.Container
Parameters:
component - the component to be removed
See Also:
add(java.awt.Component)

removeAll

public void removeAll()
Removes all components from this pane.
Overrides:
removeAll in class java.awt.Container

centre

public void centre()
Centres the frame in the screen.

getMinimumSize

public java.awt.Dimension getMinimumSize()
Returns the minimum size for a gui frame.
Overrides:
getMinimumSize in class java.awt.Container

getPreferredSize

public java.awt.Dimension getPreferredSize()
Returns the preferred size for a gui frame.
Overrides:
getPreferredSize in class java.awt.Container

getMaximumSize

public java.awt.Dimension getMaximumSize()
Returns the maximum size for a gui frame.
Overrides:
getMaximumSize in class java.awt.Container

imageUpdate

public boolean imageUpdate(java.awt.Image image,
                           int flags,
                           int x,
                           int y,
                           int w,
                           int h)
The background image has arrived...
Overrides:
imageUpdate in class java.awt.Component

invalidate

public void invalidate()
Flushes the offscreen buffer as part of invalidation.
Overrides:
invalidate in class java.awt.Container

doLayout

public void doLayout()
Lays out the dialog.
Overrides:
doLayout in class java.awt.Container

update

public void update(java.awt.Graphics g)
Update does not erase the background before painting (why bother?).
Overrides:
update in class java.awt.Container

paint

public void paint(java.awt.Graphics gPrime)
Paints the children into an offscreen buffer, then copies the entire image into the graphics context.
Overrides:
paint in class java.awt.Container

paintImpl

protected void paintImpl(java.awt.Graphics g)
This method can be overridden to paint onto the dialog. Double-buffering is preserved.

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a property change listener to receive notification of changes to this component.
Overrides:
addPropertyChangeListener in class java.awt.Component
Parameters:
l - the listener

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a property change listener so it no longer receives notification of changes to this component.
Overrides:
removePropertyChangeListener in class java.awt.Component
Parameters:
l - the listener

processKeyEvent

protected void processKeyEvent(java.awt.event.KeyEvent event)
Overrides:
processKeyEvent in class java.awt.Component