dog.gui
Class DPicture

java.lang.Object
  |
  +--java.awt.Component
        |
        +--dog.gui.DComponent
              |
              +--dog.gui.DPicture
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, Referential, java.io.Serializable

public class DPicture
extends DComponent

A component that can render an image in various ways.

See Also:
Serialized Form

Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
protected  java.awt.Image image
          The image.
protected  int mode
          The rendering mode for the image.
 
Fields inherited from class dog.gui.DComponent
CENTER, CENTER_TILE, changes, EAST, INTEGER_TILE, MAXIMIZE, MAXIMIZE_ASPECT, MAXIMIZE_HORIZONTAL, MAXIMIZE_VERTICAL, NORTH, NORTHEAST, NORTHWEST, reference, SOUTH, SOUTHEAST, SOUTHWEST, TILE, tooltip, WEST
 
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
DPicture()
          Constructs a picture with no image.
DPicture(java.awt.Image image)
          Constructs a picture with the specified image.
DPicture(java.awt.Image image, int mode)
          Constructs a picture with the specified image and rendering mode.
DPicture(java.lang.String image)
          Constructs a picture with the specified image.
DPicture(java.lang.String image, int mode)
          Constructs a picture with the specified image and rendering mode.
DPicture(java.net.URL image)
          Constructs a picture with the specified image.
DPicture(java.net.URL image, int mode)
          Constructs a picture with the specified image and rendering mode.
 
Method Summary
 java.awt.Image getImage()
          Returns the image.
 java.awt.Dimension getMinimumSize()
          Returns the minimum size for this component (the image size).
 int getMode()
          Returns the rendering mode for the background image.
 java.awt.Dimension getPreferredSize()
          Returns the preferred size for this component (the image size).
 boolean imageUpdate(java.awt.Image image, int flags, int x, int y, int w, int h)
          The image has arrived...
 void paint(java.awt.Graphics g)
          Paints this component.
 void setImage(java.awt.Image image)
          Sets the image.
 void setImage(java.lang.String file)
          Sets the image from a file.
 void setImage(java.net.URL url)
          Sets the image from a URL.
 void setMode(int mode)
          Sets the rendering mode for the background image.
 
Methods inherited from class dog.gui.DComponent
addPropertyChangeListener, alignParamString, drawActiveButtonBorder, drawActiveOptionBorder, drawArrow, drawBackgroundImage, drawBorder, drawButtonBorder, drawCheckbox, drawDarkBorder, drawDefaultButtonBorder, drawDisabledBorder, drawDisabledCheckbox, drawDisabledOption, drawExpander, drawFocusBorder, drawImage, drawLabel, drawOption, drawOptionBorder, drawPressedBorder, drawTick, getDefaultToolkit, getImage, getImage, getImage, getReference, getRootPane, getRows, getTooltip, isPreloadImages, paramString, parseColor, parseFont, processCancelAction, processDefaultAction, processEvent, processMouseEvent, processMouseMotionEvent, removePropertyChangeListener, setEnabled, setPreloadImages, setReference, setTooltip, toString
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

image

protected java.awt.Image image
The image.

mode

protected int mode
The rendering mode for the image.
Constructor Detail

DPicture

public DPicture()
Constructs a picture with no image.

DPicture

public DPicture(java.awt.Image image)
Constructs a picture with the specified image.

DPicture

public DPicture(java.lang.String image)
Constructs a picture with the specified image.

DPicture

public DPicture(java.net.URL image)
Constructs a picture with the specified image.

DPicture

public DPicture(java.awt.Image image,
                int mode)
Constructs a picture with the specified image and rendering mode.

DPicture

public DPicture(java.lang.String image,
                int mode)
Constructs a picture with the specified image and rendering mode.

DPicture

public DPicture(java.net.URL image,
                int mode)
Constructs a picture with the specified image and rendering mode.
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()

getImage

public java.awt.Image getImage()
Returns the image.
See Also:
setImage(java.awt.Image)

setImage

public void setImage(java.awt.Image image)
Sets the image.
Parameters:
image - the image.
See Also:
getImage()

setImage

public void setImage(java.lang.String file)
Sets the image from a file.
Parameters:
file - the image file.
See Also:
getImage()

setImage

public void setImage(java.net.URL url)
Sets the image from a URL.
Parameters:
url - the image URL.
See Also:
getImage()

imageUpdate

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

getMinimumSize

public java.awt.Dimension getMinimumSize()
Returns the minimum size for this component (the image size).
Overrides:
getMinimumSize in class java.awt.Component

getPreferredSize

public java.awt.Dimension getPreferredSize()
Returns the preferred size for this component (the image size).
Overrides:
getPreferredSize in class java.awt.Component

paint

public void paint(java.awt.Graphics g)
Paints this component.
Overrides:
paint in class java.awt.Component