All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.hdf.jhv.JHVCanvas

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----ncsa.hdf.jhv.JHVCanvas

public class JHVCanvas
extends Canvas
implements MouseListener, MouseMotionListener
This class define the image canvas. When click the hdf node, the image can be painted on this canvas


Constructor Index

 o JHVCanvas(JHV)
use the applet to construct the HDFCanvas

Method Index

 o checkMousePosition(int, int)
 o getImage()
return the current image in the canvas
 o getImageHeight()
return the current image height
 o getImageWidth()
return the current image width
 o getMaxValue()
 o getMinimumSize()
Returns the minimum size of this component.
 o getMinValue()
 o getSliceInfo()
 o getSliceWindow()
 o mouseClicked(MouseEvent)
 o mouseDragged(MouseEvent)
 o mouseEntered(MouseEvent)
Called when the mouse enters the component.
 o mouseExited(MouseEvent)
Called when the mouse exits the component.
 o mouseMoved(MouseEvent)
Called if the mouse moves (the mouse button is up)
 o mousePressed(MouseEvent)
 o mouseReleased(MouseEvent)
Called if the mouse is up.
 o paint(Graphics)
Paints the component.
 o setCanvasSize(int, int)
reset the Canvas size
 o setDataRange(double[])
 o setImage(Image)
set the current image displayed
 o setImage(Image, Image)
set the current image displayed
 o setImageSize(int, int)
set the current image size
 o setObject(HDFObjectNode)
set the current HDF Object node
 o setOriginalImageSize(int, int)
 o setPaletteImage(Image)
set the current palette Palette image displayed
 o setSliceInfo(SDSDimInfo)
 o setSliceWindow(SliceSelection)
 o update(Graphics)
Updates the component.
 o writeInfo(Graphics, int, int, String)
Write the information on the top of the image

Constructors

 o JHVCanvas
 public JHVCanvas(JHV app)
use the applet to construct the HDFCanvas

Methods

 o setImage
 public void setImage(Image img)
set the current image displayed

Parameters:
img - the current image
 o setImage
 public void setImage(Image img,
                      Image palImage)
set the current image displayed

Parameters:
img - the current image,
palImage - the palette image
 o setPaletteImage
 public void setPaletteImage(Image img)
set the current palette Palette image displayed

Parameters:
img - the current image
 o setObject
 public void setObject(HDFObjectNode node)
set the current HDF Object node

Parameters:
node - the HDF Object Node
 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 setOriginalImageSize
 public void setOriginalImageSize(int width,
                                  int height)
 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 getMinimumSize
 public Dimension getMinimumSize()
Returns the minimum size of this component.

Overrides:
getMinimumSize 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 writeInfo
 public void writeInfo(Graphics g,
                       int x,
                       int y,
                       String info)
Write the information on the top of the image

Parameters:
g - the graphics
x - the x coordinate
y - the y coordinate
info - the string
 o setCanvasSize
 public void setCanvasSize(int w,
                           int h)
reset the Canvas size

Parameters:
w - the width of the Canvas
h - the height of the Canvas
 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
 o mouseEntered
 public void mouseEntered(MouseEvent me)
Called when the mouse enters the component.

Parameters:
evt - the event
x - the x coordinate
y - the y coordinate
See Also:
mouseEnter
 o mouseExited
 public void mouseExited(MouseEvent me)
Called when the mouse exits the component.

Parameters:
evt - the event
x - the x coordinate
y - the y coordinate
See Also:
mouseExit
 o mouseDragged
 public void mouseDragged(MouseEvent me)
 o mouseMoved
 public void mouseMoved(MouseEvent me)
Called if the mouse moves (the mouse button is up)

Parameters:
evt - the event
x - the x coordinate
y - the y coordinate
See Also:
mouseMove
 o mouseClicked
 public void mouseClicked(MouseEvent me)
 o mousePressed
 public void mousePressed(MouseEvent me)
 o mouseReleased
 public void mouseReleased(MouseEvent me)
Called if the mouse is up.

 o checkMousePosition
 public void checkMousePosition(int x,
                                int y)
 o setDataRange
 public void setDataRange(double range[])
 o getMaxValue
 public double getMaxValue()
 o getMinValue
 public double getMinValue()
 o setSliceInfo
 public void setSliceInfo(SDSDimInfo info)
 o setSliceWindow
 public void setSliceWindow(SliceSelection select)
 o getSliceInfo
 public SDSDimInfo getSliceInfo()
 o getSliceWindow
 public SliceSelection getSliceWindow()

All Packages  Class Hierarchy  This Package  Previous  Next  Index