dog.gui
Interface DRootPane

All Known Implementing Classes:
DApplet, DWindow, DDialog, DFrame

public interface DRootPane

Interface implemented by top-level, heavyweight components that support the double-buffering of lightweight components. These components can render a background image in various ways.


Field Summary
static int CENTER
          The centre alignment.
static int CENTER_TILE
          Tiles the background image in the panel from the centre.
static int INTEGER_TILE
          Tiles the background image in the panel, resizing the image such that it its dimensions are factors of the panel dimensions.
static int MAXIMIZE
          Renders the background image to fit exactly into the panel, resizing its dimensions as necessary.
static int MAXIMIZE_ASPECT
          Renders the background image to fit into the panel, preserving the aspect ratio.
static int MAXIMIZE_HORIZONTAL
          Renders the background image to fit the width of the image into the panel.
static int MAXIMIZE_VERTICAL
          Renders the background image to fit the height of the image into the panel.
static int TILE
          Tiles the background image in the panel from the top left-hand corner.
 
Method Summary
 java.awt.Component add(java.awt.Component component)
          Adds the specified component to this pane.
 java.awt.Image getBackgroundImage()
          Returns the background image.
 DButton getCancelButton()
          Returns the cancel button in this pane.
 DButton getDefaultButton()
          Returns the default button in this pane.
 java.awt.Font getFont()
          Returns the font for this root pane.
 java.awt.FontMetrics getFontMetrics(java.awt.Font font)
          Returns the font metrics for the specified font in this root pane.
 java.awt.Frame getFrame()
          Returns the frame this root pane represents or is part of.
 java.awt.Insets getInsets()
          Returns the insets of this root pane.
 int getMode()
          Returns the rendering mode for the background image.
 java.awt.Dimension getSize()
          Returns the size of this root pane.
 java.lang.String getTitle()
          Returns the title of this pane.
 void processCancelAction(java.awt.event.ActionEvent event)
          Activates the cancel button in the pane.
 void processDefaultAction(java.awt.event.ActionEvent event)
          Activates the default button in the pane.
 void remove(java.awt.Component component)
          Removes the specified component from this pane.
 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 pane.
 void setCursor(java.awt.Cursor cursor)
          Sets the cursor on this root pane.
 void setDefaultButton(DButton button)
          Sets the default button in this pane.
 void setMode(int mode)
          Sets the rendering mode for the background image.
 void setTitle(java.lang.String title)
          Sets the title of this pane.
 

Field Detail

CENTER

public static final int CENTER
The centre alignment.

TILE

public static final int TILE
Tiles the background image in the panel from the top left-hand corner.

INTEGER_TILE

public static final int INTEGER_TILE
Tiles the background image in the panel, resizing the image such that it its dimensions are factors of the panel dimensions.

CENTER_TILE

public static final int CENTER_TILE
Tiles the background image in the panel from the centre.

MAXIMIZE

public static final int MAXIMIZE
Renders the background image to fit exactly into the panel, resizing its dimensions as necessary.

MAXIMIZE_ASPECT

public static final int MAXIMIZE_ASPECT
Renders the background image to fit into the panel, preserving the aspect ratio.

MAXIMIZE_VERTICAL

public static final int MAXIMIZE_VERTICAL
Renders the background image to fit the height of the image into the panel.

MAXIMIZE_HORIZONTAL

public static final int MAXIMIZE_HORIZONTAL
Renders the background image to fit the width of the image into the panel.
Method Detail

getMode

public int getMode()
Returns the rendering mode for the background image.
See Also:
setMode(int)

setMode

public void setMode(int mode)
Sets the rendering mode for the background image.
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.
See Also:
setBackgroundImage(java.awt.Image)

setBackgroundImage

public void setBackgroundImage(java.awt.Image image)
Sets the background image.
Parameters:
image - the background image.
See Also:
getBackgroundImage()

setBackgroundImage

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

setBackgroundImage

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

getDefaultButton

public DButton getDefaultButton()
Returns the default button in this pane.

setDefaultButton

public void setDefaultButton(DButton button)
Sets the default button in this pane.

processDefaultAction

public void processDefaultAction(java.awt.event.ActionEvent event)
Activates the default button in the pane.

getCancelButton

public DButton getCancelButton()
Returns the cancel button in this pane.

setCancelButton

public void setCancelButton(DButton button)
Sets the cancel button in this pane.

processCancelAction

public void processCancelAction(java.awt.event.ActionEvent event)
Activates the cancel button in the pane.

getTitle

public java.lang.String getTitle()
Returns the title of this pane.

setTitle

public void setTitle(java.lang.String title)
Sets the title of this pane.

getFrame

public java.awt.Frame getFrame()
Returns the frame this root pane represents or is part of.

getSize

public java.awt.Dimension getSize()
Returns the size of this root pane.

getInsets

public java.awt.Insets getInsets()
Returns the insets of this root pane.

getFontMetrics

public java.awt.FontMetrics getFontMetrics(java.awt.Font font)
Returns the font metrics for the specified font in this root pane.

getFont

public java.awt.Font getFont()
Returns the font for this root pane.

add

public java.awt.Component add(java.awt.Component component)
Adds the specified component to this pane.
Parameters:
component - the component to be added.
Returns:
the component.

remove

public void remove(java.awt.Component component)
Removes the specified component from this pane.
Parameters:
component - the component to be removed
See Also:
add(java.awt.Component)

setCursor

public void setCursor(java.awt.Cursor cursor)
Sets the cursor on this root pane.
Parameters:
cursor - the cursor