jsky.image.graphics
Class ImageLayer

java.lang.Object
  extended by diva.canvas.CanvasLayer
      extended by jsky.image.graphics.ImageLayer
All Implemented Interfaces:
diva.canvas.CanvasComponent, diva.canvas.VisibleComponent

public class ImageLayer
extends diva.canvas.CanvasLayer
implements diva.canvas.VisibleComponent

Defines a Diva canvas layer for displaying an image.

Version:
$Revision: 1.1 $
Author:
Allan Brighton

Field Summary
protected  DivaGraphicsImageDisplay imageDisplay
          Image display canvas
protected  boolean visible
          If the flag is false, then the object will not be painted on the screen.
 
Constructor Summary
ImageLayer(DivaGraphicsImageDisplay imageDisplay)
          Construct an ImageLayer.
 
Method Summary
 boolean isVisible()
          Test the visibility flag of this object.
 void paint(java.awt.Graphics2D g2d)
          Paint this object onto a 2D graphics object.
 void paint(java.awt.Graphics2D g2D, java.awt.geom.Rectangle2D region)
          Paint this object onto a 2D graphics object, within the given region.
 void setVisible(boolean flag)
          Set the visibility flag of this object.
 
Methods inherited from class diva.canvas.CanvasLayer
getCanvasPane, getLayerBounds, getParent, getToolTipText, getTransformContext, repaint, repaint, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface diva.canvas.CanvasComponent
getParent, getTransformContext, repaint, repaint
 

Field Detail

imageDisplay

protected DivaGraphicsImageDisplay imageDisplay
Image display canvas


visible

protected boolean visible
If the flag is false, then the object will not be painted on the screen.

Constructor Detail

ImageLayer

public ImageLayer(DivaGraphicsImageDisplay imageDisplay)
Construct an ImageLayer.

Parameters:
imageDisplay - the image display window
Method Detail

isVisible

public boolean isVisible()
Test the visibility flag of this object. Note that this flag does not indicate whether the object is actually visible on the screen, as one of its ancestors may not be visible.

Specified by:
isVisible in interface diva.canvas.VisibleComponent

paint

public void paint(java.awt.Graphics2D g2d)
Paint this object onto a 2D graphics object. Implementors should first test if the visibility flag is set, and paint the object if it is.

Specified by:
paint in interface diva.canvas.VisibleComponent

paint

public void paint(java.awt.Graphics2D g2D,
                  java.awt.geom.Rectangle2D region)
Paint this object onto a 2D graphics object, within the given region. Implementors should first test if the visibility flag is set, and paint the object if it is. The provided region can be used to optimize the paint, but implementors can assume that the clip region is correctly set beforehand.

Specified by:
paint in interface diva.canvas.VisibleComponent

setVisible

public void setVisible(boolean flag)
Set the visibility flag of this object. If the flag is false, then the object will not be painted on the screen.

Specified by:
setVisible in interface diva.canvas.VisibleComponent