org.geotools.renderer.lite
Class ImageLoader

Object
  extended by ImageLoader
All Implemented Interfaces:
Runnable

public final class ImageLoader
extends Object
implements Runnable

$Id: ImageLoader.java 30649 2008-06-12 19:44:08Z acuster $

Author:
Ian Turton
Module:
modules/library/render (gt-render.jar)

Constructor Summary
ImageLoader()
           
 
Method Summary
 BufferedImage get(URL location, boolean interactive)
          Fetch a buffered image from the loader, if interactive is false then the loader will wait for the image to be available before returning, used by printers and file output renderers.
static long getTimeout()
          Returns the timeout for aborting an image loading sequence
 void reset()
          Resets the image cache
 void run()
          Runs the loading thread
static void setTimeout(long newTimeout)
          Sets the maximum time to wait for getting an external image.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageLoader

public ImageLoader()
Method Detail

getTimeout

public static long getTimeout()
Returns the timeout for aborting an image loading sequence

Returns:
the timeout in milliseconds

setTimeout

public static void setTimeout(long newTimeout)
Sets the maximum time to wait for getting an external image. Set it to -1 to wait undefinitely

Parameters:
newTimeout - the new timeout value in milliseconds

get

public BufferedImage get(URL location,
                         boolean interactive)
Fetch a buffered image from the loader, if interactive is false then the loader will wait for the image to be available before returning, used by printers and file output renderers. If interactive is true and the image is ready then return, if image is not ready start loading it and return null. The renderer is responsible for finding an alternative to use.

Parameters:
location - the url of the image to be fetched
interactive - boolean to signal if the loader should wait for the image to be ready.
Returns:
the buffered image or null

run

public void run()
Runs the loading thread

Specified by:
run in interface Runnable

reset

public void reset()
Resets the image cache



Copyright © 1996-2009 Geotools. All Rights Reserved.