    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.

##

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

##

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

##

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

##

source

      protected Object source

image

      protected Image image

defaultView

      protected Image defaultView

flags

      protected int flags

dimension

      protected Dimension dimension

metadata

      protected Metadata metadata

coordsys

      protected CoordinateSystem coordsys

LOADING_FLAG

      protected final static int LOADING_FLAG

  file is in the process of loading

LOADED_FLAG

      protected final static int LOADED_FLAG

  file has been loaded

ERROR_FLAG

      protected final static int ERROR_FLAG

  an error occurred during file load

##

SimpleViewable

      public SimpleViewable()

  Constructs a new instance of a SimpleViewable given a URL.

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.

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.

##

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.

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

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

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.

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.

getSize

      public int[] getSize()

  Returns an array containing the size of each dimension/axis.
  Returns:
    An array of size getNaxes(); null if not available.

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

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

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

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