org.apache.pivot.wtk
Class ImageView

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

public class ImageView
extends Component

Component that displays an image.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component
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.
 String getImageKey()
          Returns the image view's image key.
 ListenerList<ImageViewListener> getImageViewListeners()
          Returns the image view listener list.
 boolean isAsynchronous()
          Returns the image view's asynchronous flag.
 void load(Object context)
          Copies bound values from the bind context to the component.
 void setAsynchronous(boolean asynchronous)
          Sets the image view's asynchronous flag.
 void setImage(Image image)
          Sets the image view's current image.
 void setImage(String image)
          Sets the image view's image by resource name.
 void setImage(URL imageURL)
          Sets the image view's current image by URL.
 void setImageKey(String imageKey)
          Sets the image view's image key.
 void store(Object context)
          Copies bound values from the component to the bind context.
 
Methods inherited from class org.apache.pivot.wtk.Component
clear, clearFocus, getAncestor, getAttribute, getAutomationID, getBaseline, getBaseline, getBounds, getComponentClassListeners, getComponentDataListeners, getComponentDecoratorListeners, getComponentKeyListeners, getComponentListeners, getComponentMouseButtonListeners, getComponentMouseListeners, getComponentMouseWheelListeners, getComponentStateListeners, getCursor, getDecoratedBounds, getDecorators, getDisplay, getDragSource, getDropTarget, getFocusedComponent, getGraphics, getHeight, getLocation, getMaximumPreferredHeight, getMaximumPreferredWidth, getMenuHandler, getMinimumPreferredHeight, getMinimumPreferredWidth, getParent, getPreferredHeight, getPreferredHeight, getPreferredHeightLimits, getPreferredSize, getPreferredWidth, getPreferredWidth, getPreferredWidthLimits, getSize, getSkin, getStyles, getTooltipText, getUserData, getVisibleArea, getVisibleArea, getVisibleArea, getWidth, getWindow, getX, getY, installThemeSkin, invalidate, isBlocked, isEnabled, isFocusable, isFocused, isMouseOver, isOpaque, isPreferredHeightSet, isPreferredSizeSet, isPreferredWidthSet, isShowing, isValid, isVisible, keyPressed, keyReleased, keyTyped, layout, mapPointFromAncestor, mapPointFromAncestor, mapPointToAncestor, mapPointToAncestor, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, paint, reenterMouse, repaint, repaint, repaint, repaint, repaint, repaint, requestFocus, scrollAreaToVisible, scrollAreaToVisible, setAttribute, setAutomationID, setCursor, setCursor, setDragSource, setDropTarget, setEnabled, setHeight, setLocation, setLocation, setMaximumPreferredHeight, setMaximumPreferredWidth, setMenuHandler, setMinimumPreferredHeight, setMinimumPreferredWidth, setParent, setPreferredHeight, setPreferredHeightLimits, setPreferredHeightLimits, setPreferredSize, setPreferredSize, setPreferredWidth, setPreferredWidthLimits, setPreferredWidthLimits, setSize, setSize, setSkin, setStyles, setStyles, setStyles, setTooltipText, setVisible, setWidth, setX, setY, toString, transferFocus, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, 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 final void setImage(URL imageURL)
Sets the image view's current image by URL.

Note: Using this signature will cause an entry to be added in the application context's resource cache if one does not already exist.

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

setImage

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

Note: Using this signature will cause an entry to be added in the application context's resource cache if one does not already exist.

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

isAsynchronous

public boolean isAsynchronous()
Returns the image view's asynchronous flag.

Returns:
true if images specified via URL will be loaded in the background; false if they will be loaded synchronously.

setAsynchronous

public void setAsynchronous(boolean asynchronous)
Sets the image view's asynchronous flag.

Parameters:
asynchronous - true if images specified via URL will be loaded in the background; false if they will be loaded synchronously.

getImageKey

public String getImageKey()
Returns the image view's image key.

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

setImageKey

public void setImageKey(String imageKey)
Sets the image view's image key.

Parameters:
imageKey - The image key, or null to clear the binding.

load

public void load(Object context)
Description copied from class: Component
Copies bound values from the bind context to the component. This functionality must be provided by the subclass; the base implementation is a no-op.

Overrides:
load in class Component

store

public void store(Object context)
Description copied from class: Component
Copies bound values from the component to the bind context. This functionality must be provided by the subclass; the base implementation is a no-op.

Overrides:
store in class Component

getImageViewListeners

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

Returns:
The image view listener list.