symantec.itools.awt
Class ImagePanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--symantec.itools.awt.ImagePanel

public class ImagePanel
extends java.awt.Panel

The ImagePanel component is similar to a regular panel except that it displays an image within the panel. The image to use is specified with a URL.

See Also:
Serialized Form

Field Summary
static int IMAGE_CENTERED
          A constant indicating the image is to be centered in this panel.
static int IMAGE_NORMAL
          A constant indicating the image is to be drawn from the upper left corner of the panel.
static int IMAGE_SCALED_TO_FIT
          A constant indicating the image is to be scaled to fit this panel.
static int IMAGE_TILED
          A constant indicating the image is to be tiled in this panel.
protected  int imageStyle
          The style that the image will be displayed in.
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
ImagePanel()
          Constructs a default ImagePanel.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a listener for all event changes.
 void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Adds a vetoable listener for all event changes.
 java.awt.Image getImage()
          Returns the image being displayed in this panel.
 java.net.URL getImageURL()
          Returns the URL of the image being displayed in this panel.
 int getStyle()
          Gets the current panel image style.
 void paint(java.awt.Graphics g)
          Paints this component using the given graphics context.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a listener for all event changes.
 void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Removes a vetoable listener for all event changes.
 void setImageURL(java.net.URL url)
          Sets the URL of the image to display in this panel.
 void setStyle(int newStyle)
          Sets the new panel image style.
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setCursor, setFont, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, 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, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, 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, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IMAGE_TILED

public static final int IMAGE_TILED
A constant indicating the image is to be tiled in this panel.

IMAGE_CENTERED

public static final int IMAGE_CENTERED
A constant indicating the image is to be centered in this panel.

IMAGE_SCALED_TO_FIT

public static final int IMAGE_SCALED_TO_FIT
A constant indicating the image is to be scaled to fit this panel.

IMAGE_NORMAL

public static final int IMAGE_NORMAL
A constant indicating the image is to be drawn from the upper left corner of the panel.

imageStyle

protected int imageStyle
The style that the image will be displayed in.
Constructor Detail

ImagePanel

public ImagePanel()
Constructs a default ImagePanel. By default the image will be tiled.
Method Detail

paint

public void paint(java.awt.Graphics g)
Paints this component using the given graphics context. This is a standard Java AWT method which typically gets called by the AWT to handle painting this component. It paints this component using the given graphics context. The graphics context clipping region is set to the bounding rectangle of this component and its [0,0] coordinate is this component's top-left corner.
Overrides:
paint in class java.awt.Container
Parameters:
g - the graphics context used for painting
See Also:
Component.repaint(), Component.update(java.awt.Graphics)

setImageURL

public void setImageURL(java.net.URL url)
                 throws java.beans.PropertyVetoException
Sets the URL of the image to display in this panel.
Parameters:
url - the URL of the image to display
Throws:
java.beans.PropertyVetoException - if the specified property value is unacceptable
See Also:
getImageURL()

getImageURL

public java.net.URL getImageURL()
Returns the URL of the image being displayed in this panel.
See Also:
setImageURL(java.net.URL)

setStyle

public void setStyle(int newStyle)
              throws java.beans.PropertyVetoException
Sets the new panel image style.
Parameters:
newStyle - the new panel image style, one of IMAGE_TILED, IMAGE_CENTERED, or IMAGE_SCALED_TO_FIT
Throws:
java.beans.PropertyVetoException - if the specified property value is unacceptable
See Also:
getStyle(), IMAGE_TILED, IMAGE_CENTERED, IMAGE_SCALED_TO_FIT, IMAGE_NORMAL

getStyle

public int getStyle()
Gets the current panel image style.
Returns:
the current panel image style, one of IMAGE_TILED, IMAGE_CENTERED, or IMAGE_SCALED_TO_FIT
See Also:
setStyle(int), IMAGE_TILED, IMAGE_CENTERED, IMAGE_SCALED_TO_FIT, IMAGE_NORMAL

getImage

public java.awt.Image getImage()
Returns the image being displayed in this panel.

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener for all event changes.
Overrides:
addPropertyChangeListener in class java.awt.Component
Parameters:
listener - the listener to add.
See Also:
removePropertyChangeListener(java.beans.PropertyChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a listener for all event changes.
Overrides:
removePropertyChangeListener in class java.awt.Component
Parameters:
listener - the listener to remove.
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

addVetoableChangeListener

public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds a vetoable listener for all event changes.
Parameters:
listener - the listener to add.
See Also:
removeVetoableChangeListener(java.beans.VetoableChangeListener)

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes a vetoable listener for all event changes.
Parameters:
listener - the listener to remove.
See Also:
addVetoableChangeListener(java.beans.VetoableChangeListener)