Class ncsa.horizon.awt.ScrollerImageCanvas
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.horizon.awt.ScrollerImageCanvas

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----ncsa.horizon.awt.ScrollerImageCanvas

public class ScrollerImageCanvas
extends Canvas
Handle scrolling image display.

Variable Index

 o currentImage
the currently displayed image
 o hScroll
scrollbar of the image canvas
 o imageHeight
 o imageWidth
image size
 o infoStr
display string
 o offGraphics
 o offScreenImage
variables for double buffering
 o tx
image offset on panel
 o ty
 o vScroll
scrollbar of the image canvas

Constructor Index

 o ScrollerImageCanvas()
new constructor
 o ScrollerImageCanvas(Image)
Constructor with image
 o ScrollerImageCanvas(Image, Scrollbar, Scrollbar)
Constructor with image

Method Index

 o getImage()
return the current image in the canvas
 o getImageHeight()
return the current image height
 o getImageWidth()
return the current image width
 o minimumSize()
Returns the minimum size of this component.
 o paint(Graphics)
Paints the component.
 o reshape(int, int, int, int)
Reshapes the Component to the specified bounding box.
 o setImage(Image)
set the current displayed image
 o setImageHeight(int)
set the current image height
 o setImageSize(int, int)
set the current image size
 o setImageWidth(int)
set the current image width
 o setScrollbars(Scrollbar, Scrollbar)
Set scrollbars for the canvas
 o setTx(int)
 o setTy(int)
 o update(Graphics)
Updates the component.

Variables

 o currentImage
  protected Image currentImage
the currently displayed image
 o imageWidth
  protected int imageWidth
image size
 o imageHeight
  protected int imageHeight
 o offScreenImage
  protected Image offScreenImage
variables for double buffering
 o offGraphics
  protected Graphics offGraphics
 o infoStr
  protected String infoStr
display string
 o tx
  protected int tx
image offset on panel
 o ty
  protected int ty
 o hScroll
  protected Scrollbar hScroll
scrollbar of the image canvas
 o vScroll
  protected Scrollbar vScroll
scrollbar of the image canvas

Constructors

 o ScrollerImageCanvas
  public ScrollerImageCanvas()
new constructor
 o ScrollerImageCanvas
  public ScrollerImageCanvas(Image image)
Constructor with image
Parameters:
image - the image
 o ScrollerImageCanvas
  public ScrollerImageCanvas(Image image,
                             Scrollbar v,
                             Scrollbar h)
Constructor with image
Parameters:
image - the image
v - the vertical scrollbar
h - the horizontal scrollbar

Methods

 o setImage
  public void setImage(Image img)
set the current displayed image
Parameters:
img - the current image
 o setImageSize
  public void setImageSize(int width,
                           int height)
set the current image size
Parameters:
width - the width of the image
height - the height of the image
 o setImageWidth
  public void setImageWidth(int width)
set the current image width
Parameters:
width - the width of the image
 o setImageHeight
  public void setImageHeight(int height)
set the current image height
Parameters:
height - the height of the image
 o reshape
  public synchronized void reshape(int x,
                                   int y,
                                   int w,
                                   int h)
Reshapes the Component to the specified bounding box.
Overrides:
reshape in class Component
 o setScrollbars
  public void setScrollbars(Scrollbar h,
                            Scrollbar v)
Set scrollbars for the canvas
Parameters:
h - the horizontal scrollbar
v - the vertical scrollbar
 o getImage
  public Image getImage()
return the current image in the canvas
 o getImageWidth
  public int getImageWidth()
return the current image width
 o getImageHeight
  public int getImageHeight()
return the current image height
 o minimumSize
  public Dimension minimumSize()
Returns the minimum size of this component.
Overrides:
minimumSize in class Component
See Also:
preferredSize, LayoutManager
 o paint
  public void paint(Graphics g)
Paints the component.
Parameters:
g - the specified Graphics window
Overrides:
paint in class Canvas
See Also:
paint
 o setTx
  public void setTx(int tx)
 o setTy
  public void setTy(int ty)
 o update
  public void update(Graphics g)
Updates the component. This method is called in response to a call to repaint. You can assume that the background is not cleared.
Parameters:
g - the specified Graphics window
Overrides:
update in class Component
See Also:
update

All Packages  Class Hierarchy  This Package  Previous  Next  Index