org.apache.pivot.wtk.media
Class Image

java.lang.Object
  extended by org.apache.pivot.wtk.media.Image
All Implemented Interfaces:
Visual
Direct Known Subclasses:
Drawing, ListViewColorItemRenderer.ColorBadge, Picture, TerraExpanderSkin.ButtonImage, TerraFrameSkin.ButtonImage, TerraFrameSkin.ResizeImage, TerraMenuItemSkin.CheckmarkImage, TerraPaletteSkin.CloseImage, TerraPaletteSkin.ResizeImage, TerraPanoramaSkin.ScrollButtonImage, TerraScrollBarSkin.ScrollButtonImage, TerraSheetSkin.ResizeImage, TerraSpinnerSkin.SpinButtonImage

public abstract class Image
extends Object
implements Visual

Abstract base class for images. An image is either a bitmapped "picture" or a vector "drawing".


Nested Class Summary
protected static class Image.ImageListenerList
          Image listener list.
static class Image.LoadTask
          Task that executes an image load operation.
 
Field Summary
protected  Image.ImageListenerList imageListeners
           
 
Constructor Summary
Image()
           
 
Method Summary
 int getBaseline()
          Returns the visual's baseline.
 ListenerList<ImageListener> getImageListeners()
           
 Dimensions getSize()
           
static Image load(URL location)
           
static Image.LoadTask load(URL location, TaskListener<Image> loadListener)
           
static Image loadFromCache(URL location)
           
 String toString()
           
 void update(int x, int y, int width, int height)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.pivot.wtk.Visual
getHeight, getWidth, paint
 

Field Detail

imageListeners

protected Image.ImageListenerList imageListeners
Constructor Detail

Image

public Image()
Method Detail

getBaseline

public int getBaseline()
Description copied from interface: Visual
Returns the visual's baseline.

Specified by:
getBaseline in interface Visual
Returns:
The baseline relative to the origin of the visual, or -1 if this visual does not have a baseline.

getSize

public Dimensions getSize()

update

public void update(int x,
                   int y,
                   int width,
                   int height)

getImageListeners

public ListenerList<ImageListener> getImageListeners()

toString

public String toString()
Overrides:
toString in class Object

load

public static Image load(URL location)
                  throws TaskExecutionException
Throws:
TaskExecutionException

load

public static Image.LoadTask load(URL location,
                                  TaskListener<Image> loadListener)

loadFromCache

public static Image loadFromCache(URL location)