Package org.apache.pivot.wtk.media
Class Image
- java.lang.Object
- 
- 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 java.lang.Object implements Visual Abstract base class for images. An image is either a bitmapped "picture" or a vector "drawing".
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classImage.LoadTaskBackgroundTaskthat executes an image load operation.
 - 
Field SummaryFields Modifier and Type Field Description protected ImageListener.ListenersimageListeners
 - 
Constructor SummaryConstructors Constructor Description Image()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBaseline()Returns the visual's baseline.ListenerList<ImageListener>getImageListeners()static Imageload(java.net.URL location)Load an image from the given URL location, but without any listener.static Image.LoadTaskload(java.net.URL location, TaskListener<Image> loadListener)Load an image from the given URL location, in the background, and return a reference to the background task.static ImageloadFromCache(java.net.URL location)Load an image.java.lang.StringtoString()voidupdate(int x, int y, int width, int height)
 
- 
- 
- 
Field Detail- 
imageListenersprotected ImageListener.Listeners imageListeners 
 
- 
 - 
Method Detail- 
getBaselinepublic int getBaseline() Description copied from interface:VisualReturns the visual's baseline.- Specified by:
- getBaselinein interface- Visual
- Returns:
- The baseline relative to the origin of the visual, or -1if this visual does not have a baseline.
 
 - 
updatepublic void update(int x, int y, int width, int height)
 - 
getImageListenerspublic ListenerList<ImageListener> getImageListeners() 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
loadpublic static Image load(java.net.URL location) throws TaskExecutionException Load an image from the given URL location, but without any listener. The load will be done synchronously, on the current thread. Any errors will be wrapped in theTaskExecutionExceptionthat is thrown.- Parameters:
- location- The URL where the image can be found.
- Returns:
- The loaded image.
- Throws:
- TaskExecutionException- if there were problems loading the image.
- See Also:
- Image.LoadTask
 
 - 
loadpublic static Image.LoadTask load(java.net.URL location, TaskListener<Image> loadListener) Load an image from the given URL location, in the background, and return a reference to the background task.- Parameters:
- location- The URL where the image can be found.
- loadListener- A listener for completion of the background task.
- Returns:
- A reference to the background task.
 
 - 
loadFromCachepublic static Image loadFromCache(java.net.URL location) Load an image. First try to find it in the resource cached kept by theApplicationContext. If not found, load it in the foreground and cache the result.- Parameters:
- location- The URL where the image can be found.
- Returns:
- The loaded image.
- Throws:
- java.lang.IllegalArgumentException- wrapping the TaskExecutionException, which in turn will wrap the underlying problem.
 
 
- 
 
-