Class ncsa.horizon.viewable.SimpleViewable
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.horizon.viewable.SimpleViewable

java.lang.Object
   |
   +----ncsa.horizon.viewable.SimpleViewable

public class SimpleViewable
extends Object
implements Viewable, ImageObserver
Handles display requests for a Horizon project Viewable object. This is a fairly straightforward case, using a Java generic content handler and returning data using the existing Java API. All methods that deal with the underlying data (e.g., getData()) or metadata (e.g., getMetadata()) for the image return null.

Variable Index

 o coordsys
 o defaultView
 o dimension
 o ERROR_FLAG
an error occurred during file load
 o flags
 o image
 o LOADED_FLAG
file has been loaded
 o LOADING_FLAG
file is in the process of loading
 o metadata
 o source

Constructor Index

 o SimpleViewable()
Constructs a new instance of a SimpleViewable given a URL.
 o SimpleViewable(String)
Constructs a new instance of a SimpleViewable given a filename string.
 o SimpleViewable(URL)
Constructs a new instance of a SimpleViewable given a URL.

Method Index

 o getCoordSys()
Implementation of a ncsa.horizon.viewable.Viewable interface method.
 o getData()
Implementation of a ncsa.horizon.viewable.Viewable interface method.
 o getData(Volume)
Implementation of a ncsa.horizon.viewable.Viewable interface method.
 o getMetadata()
Implementation of a ncsa.horizon.viewable.Viewable interface method.
 o getNaxes()
Returns the dimension of the data.
 o getSize()
Returns an array containing the size of each dimension/axis.
 o getView()
Implementation of an ncsa.horizon.viewable.Viewable interface method.
 o getView(Slice)
Implementation of a ncsa.horizon.viewable.Viewable interface method.
 o getView(Slice, ColorModel, boolean)
Implementation of a ncsa.horizon.viewable.Viewable interface method.
 o imageUpdate(Image, int, int, int, int, int)
Handles image loading functions.

Variables

 o source
  protected Object source
 o image
  protected Image image
 o defaultView
  protected Image defaultView
 o flags
  protected int flags
 o dimension
  protected Dimension dimension
 o metadata
  protected Metadata metadata
 o coordsys
  protected CoordinateSystem coordsys
 o LOADING_FLAG
  protected final static int LOADING_FLAG
file is in the process of loading
 o LOADED_FLAG
  protected final static int LOADED_FLAG
file has been loaded
 o ERROR_FLAG
  protected final static int ERROR_FLAG
an error occurred during file load

Constructors

 o SimpleViewable
  public SimpleViewable()
Constructs a new instance of a SimpleViewable given a URL.
 o SimpleViewable
  public SimpleViewable(URL _url)
Constructs a new instance of a SimpleViewable given a URL.
Parameters:
_url - The URL of an image from which to create the Viewable.
 o SimpleViewable
  public SimpleViewable(String _filename)
Constructs a new instance of a SimpleViewable given a filename string.
Parameters:
_filename - The complete filename of an image from which to create the Viewable. This is not a string representation of a URL, but the name of a file using the conventions of the local filesystem.

Methods

 o getCoordSys
  public CoordinateSystem getCoordSys()
Implementation of a ncsa.horizon.viewable.Viewable interface method. This implementation returns null.

Returns:
A CoordinateSystem that relates to this Viewable; null if not defined.
 o getData
  public Object getData()
Implementation of a ncsa.horizon.viewable.Viewable interface method. This generic getData() returns all the data in the image. It currently returns null.

Returns:
s java.awt.Object which is a multidimensional array
 o getData
  public Object getData(Volume volume)
Implementation of a ncsa.horizon.viewable.Viewable interface method. This specific getData() returns a subregion of the data that makes up the URL image. This implementation always returns null.

Parameters:
volume - Specifies the subset of data to return.
Returns:
s java.awt.Object which is a multidimensional array
 o getMetadata
  public Metadata getMetadata()
Implementation of a ncsa.horizon.viewable.Viewable interface method. This implementation always returns null.

Returns:
A Metadata object relating to this Viewable; null if none available.
 o getNaxes
  public int getNaxes()
Returns the dimension of the data. This currently always returns the value 2.
Returns:
The dimensionality of the data; -1 if not available.
 o getSize
  public int[] getSize()
Returns an array containing the size of each dimension/axis.
Returns:
An array of size getNaxes(); null if not available.
 o getView
  public Image getView()
Implementation of an ncsa.horizon.viewable.Viewable interface method. This generic getView() returns either a previously defined default view, or the whole image at nominal resolution if no default has been defined.

Returns:
s java.awt.Image
 o getView
  public Image getView(Slice slice)
Implementation of a ncsa.horizon.viewable.Viewable interface method. This specific getView() returns a subregion and/or resampled version of the URL image, and optionally makes this new image the default view.

Parameters:
slice - The 2-dimensional area of the image to return.
colorModel - The cooro model to use for the image.
makeDefault - True to make this slice the default view.
Returns:
s java.awt.Image
 o getView
  public Image getView(Slice slice,
                       ColorModel colorModel,
                       boolean makeDefault)
Implementation of a ncsa.horizon.viewable.Viewable interface method. This specific getView() returns a subregion and/or resampled version of the URL image, and optionally makes this new image the default view. This implementation ignores the color model parameter.

Parameters:
slice - The 2-dimensional area of the image to return.
colorModel - The cooro model to use for the image.
makeDefault - True to make this slice the default view.
Returns:
s java.awt.Image
 o imageUpdate
  public boolean imageUpdate(Image img,
                             int infoflags,
                             int x,
                             int y,
                             int width,
                             int height)
Handles image loading functions. This will update the width and height of the current view, and set provate flags regarding the state of the image preparation.
Parameters:
img - The image being observed
infoflags - The bitwise OR of the ImageObserver flags
x - An x coordinate
y - A y coordinate
width - The image width
height - The image height
Returns:
true if further calls to imageUpdate are needed by this image observer; false otherwise.

All Packages  Class Hierarchy  This Package  Previous  Next  Index