pivot.wtk
Class ImageView

java.lang.Object
  extended by pivot.wtk.Component
      extended by pivot.wtk.ImageView
All Implemented Interfaces:
ConstrainedVisual, Visual
Direct Known Subclasses:
ListButtonColorRenderer, TableViewImageCellRenderer

public class ImageView
extends Component

Component that displays an image.

TODO Load images asynchronously in setImage()?

Author:
gbrown

Nested Class Summary
 
Nested classes/interfaces inherited from class pivot.wtk.Component
Component.Attributes, Component.ComponentDictionary, Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary
 
Constructor Summary
ImageView()
          Creates an empty image view.
ImageView(Image image)
          Creates an image view with the given image.
 
Method Summary
 Image getImage()
          Returns the image view's current image.
 ListenerList<ImageViewListener> getImageViewListeners()
          Returns the image view listener list.
 void setImage(Image image)
          Sets the image view's current image.
 void setImage(String image)
          Sets the image view's current image by resource name.
 void setImage(URL image)
          Sets the image view's current image by URL.
 
Methods inherited from class pivot.wtk.Component
clearFocus, clearFocus, finalize, getAttributes, getBounds, getComponentClassListeners, getComponentDataListeners, getComponentDecoratorListeners, getComponentDragDropListeners, getComponentKeyListeners, getComponentLayoutListeners, getComponentListeners, getComponentMouseButtonListeners, getComponentMouseListeners, getComponentMouseWheelListeners, getComponents, getComponentStateListeners, getCursor, getDecoratedBounds, getDecorators, getDisplay, getDragSource, getDropTarget, getFocusedComponent, getGraphics, getHandle, getHeight, getLocation, getParent, getPreferredHeight, getPreferredHeight, getPreferredSize, getPreferredWidth, getPreferredWidth, getSize, getSkin, getStyles, getTooltipText, getUserData, getVisibleArea, getVisibleArea, getVisibleArea, getWidth, getWindow, getX, getY, installSkin, invalidate, isBlocked, isDisplayable, isEnabled, isFocusable, isFocused, isMouseOver, isOpaque, isPreferredHeightSet, isPreferredSizeSet, isPreferredWidthSet, isShowing, isValid, isVisible, keyPressed, keyReleased, keyTyped, load, load, mapPointFromAncestor, mapPointToAncestor, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, paint, repaint, repaint, repaint, repaint, repaint, repaint, requestFocus, requestFocus, scrollAreaToVisible, scrollAreaToVisible, setAttributes, setCursor, setCursor, setDisplayable, setDragSource, setDropTarget, setEnabled, setFocused, setHeight, setLocation, setLocation, setParent, setPreferredHeight, setPreferredSize, setPreferredSize, setPreferredWidth, setSize, setSize, setSkin, setStyles, setStyles, setStyles, setTooltipText, setVisible, setWidth, setX, setY, store, store, toString, transferFocus, validate
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImageView

public ImageView()
Creates an empty image view.


ImageView

public ImageView(Image image)
Creates an image view with the given image.

Parameters:
image - The initial image to set, or null for no image.
Method Detail

getImage

public Image getImage()
Returns the image view's current image.

Returns:
The current image, or null if no image is set.

setImage

public void setImage(Image image)
Sets the image view's current image.

Parameters:
image - The image to set, or null for no image.

setImage

public void setImage(URL image)
Sets the image view's current image by URL.

Parameters:
image - The location of the image to set.

setImage

public void setImage(String image)
Sets the image view's current image by resource name.

Parameters:
image - The resource name of the image to set.

getImageViewListeners

public ListenerList<ImageViewListener> getImageViewListeners()
Returns the image view listener list.

Returns:
The image view listener list.