All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.hdf.jhv.JHVImageCanvas

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

public class JHVImageCanvas
extends Canvas
implements PaletteEditorAdapter, Runnable, MouseListener, MouseMotionListener
The image will be display on this canvas


Variable Index

 o colorModel
 o colorModelPalette
 o imageSource
 o imageSources
 o oldColorModel
 o paletteEditorOpen

Constructor Index

 o JHVImageCanvas(JHVImageFrame)
new constructor for image canvas
 o JHVImageCanvas(JHVImageFrame, Rectangle)
new constructor for image canvas

Method Index

 o checkMousePosition(int, int)
 o createRasterImage(byte[], int, int, byte[], int)
create the raster image by specified image data
 o delay(int)
 o dispZoomImage(int, int, Image)
prepare zoom image & display it
 o dispZoomImage(Rectangle, Image)
prepare zoom image & display it
 o drawRectangle(Rectangle)
Draw the rectangle area on the current image
 o getImage()
get the current image
 o getImage(int)
get image by specified plane number
 o getImageHeight()
return the current image height
 o getImagePixelValue(Image, int, int, int, int)
 o getImages()
 o getImageWidth()
return the current image width
 o getMinimumSize()
Set canvas size at SxS
 o getPreferredSize()
set canvas preferred size
 o getSDSImage(byte[], double, double, int, int, int, byte[], byte[])
 o getSDSImage(Object, double, double, int, int, int, byte[], byte[])
 o getSliceInfo()
 o getSubImage(Rectangle, Image)
Get subset image
 o initHDF()
Initialize HDF object based on the selected node.
 o makeSpreadsheet()
make spreadsheet for draged area of the image
 o mouseClicked(MouseEvent)
 o mouseDragged(MouseEvent)
Called if the mouse is dragged (the mouse button is down)
 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)
Called if the mouse is down.
 o mouseReleased(MouseEvent)
Called if the mouse is up.
 o openNewPalette()
 o paint(Graphics)
Paints the component.
 o readGR()
read and display the GR image
 o readRIS24()
read 24-raster image data from the HDF file
 o readRIS8()
display the 8 bit raster image
 o readSDS(int)
read and display SDS image for a given plane
 o readSDSImages()
read and display SDS images for animation
 o recoverImage()
 o run()
java.lang.Runnable stuff
 o setAction(int)
which action will be taken
 o setBounds(int, int, int, int)
Reshapes the Component to the specified bounding box.
 o setCanvasSize(int, int)
set canvas size
 o setColorModel(ColorModel)
 o setHDFObjectNode(HDFObjectNode)
set HDF Object Node
 o setImage(Image)
set the current image & repaint it with current image This saves the current image as the previous image (in a stack that is depth 1)
 o setImageFilter(ImageFilter)
 o setImageFrame(int)
 o setImageRGBFilter(ImageFilter)
 o setImageSize(int, int)
set image size
 o setNewPalette()
 o setNumberOfImage(int)
set the number of the image
 o setPaletteEditorOpen(boolean)
ncsa.hdf.palette.PaletteEditorAdapter flag
 o setScrollbar(Scrollbar, Scrollbar)
set Scrollbar
 o setShowCoordinate(boolean)
 o setSliceInfo(SDSDimInfo)
 o setSpeeds(int)
set up the image anamination speed(delay time between the image display)
 o setSubsetRange(Rectangle)
 o start()
Called to start the applet.
 o stop()
Called to stop the applet.
 o update(Graphics)
Updates the component.
 o updateColorModel(ColorModel)
 o updateImage(Image)
 o updateImage(ImageFilter)
 o updateImageFilter(ImageFilter)
 o updateImageSource()
update the current image source
 o updateSDSImage(double, double)
 o writeInfo(Graphics, int, int, String[], int)
Write the information on the top of the image

Variables

 o paletteEditorOpen
 public boolean paletteEditorOpen
 o colorModel
 public ColorModel colorModel
 o oldColorModel
 public ColorModel oldColorModel
 o colorModelPalette
 public byte colorModelPalette[]
 o imageSource
 public ImageProducer imageSource
 o imageSources
 public ImageProducer imageSources[]

Constructors

 o JHVImageCanvas
 public JHVImageCanvas(JHVImageFrame frame)
new constructor for image canvas

Parameters:
frame - the frame of this object
 o JHVImageCanvas
 public JHVImageCanvas(JHVImageFrame frame,
                       Rectangle subset)
new constructor for image canvas

Parameters:
frame - the frame of this object

Methods

 o initHDF
 public boolean initHDF()
Initialize HDF object based on the selected node.

 o setNumberOfImage
 public void setNumberOfImage(int num)
set the number of the image

Parameters:
num - the number of the image
 o createRasterImage
 public Image createRasterImage(byte imgData[],
                                int w,
                                int h,
                                byte imgPal[],
                                int index)
create the raster image by specified image data

Parameters:
imgData - the image data(pixel value)
w - the width of the image
h - the height of the image
imgPalette - the palette of the image
index - the plane number of the image
Returns:
the image , otherwise null
 o setCanvasSize
 public void setCanvasSize(int w,
                           int h)
set canvas size

Parameters:
w - the width
h - the height
 o setImageSize
 public void setImageSize(int w,
                          int h)
set image size

Parameters:
w - the image width
h - the image height
 o getImageHeight
 public int getImageHeight()
return the current image height

 o getImageWidth
 public int getImageWidth()
return the current image width

 o setImage
 public void setImage(Image img)
set the current image & repaint it with current image This saves the current image as the previous image (in a stack that is depth 1)

Parameters:
img - the image
 o updateImage
 public void updateImage(Image img)
 o getImage
 public Image getImage()
get the current image

 o updateImageSource
 public void updateImageSource()
update the current image source

 o getImagePixelValue
 public int[] getImagePixelValue(Image img,
                                 int x,
                                 int y,
                                 int w,
                                 int h)
 o setImageFilter
 public void setImageFilter(ImageFilter imageFilter)
 o updateImageFilter
 public void updateImageFilter(ImageFilter imageFilter)
 o setImageRGBFilter
 public void setImageRGBFilter(ImageFilter imageFilter)
 o updateColorModel
 public synchronized void updateColorModel(ColorModel cm)
 o setColorModel
 public void setColorModel(ColorModel cm)
 o getImage
 public synchronized Image getImage(int planeNumber)
get image by specified plane number

Parameters:
planeNumber - the image plane number
Returns:
the image
 o setAction
 public void setAction(int actFlag)
which action will be taken

Parameters:
actFlag - the action flag
 o setSpeeds
 public void setSpeeds(int sp)
set up the image anamination speed(delay time between the image display)

Parameters:
sp - the delay time
 o setBounds
 public synchronized void setBounds(int x,
                                    int y,
                                    int w,
                                    int h)
Reshapes the Component to the specified bounding box.

Overrides:
setBounds in class Component
 o setScrollbar
 public void setScrollbar(Scrollbar h,
                          Scrollbar v)
set Scrollbar

Parameters:
h - the horizontal scrollbar
v - the vertical scrollbar
 o setHDFObjectNode
 public void setHDFObjectNode(HDFObjectNode node)
set HDF Object Node

Parameters:
obj - HDF Object Node
 o start
 public void start()
Called to start the applet. You never need to call this method directly, it is called when the applet's document is visited.

See Also:
start
 o stop
 public void stop()
Called to stop the applet. It is called when the applet's document is no longer on the screen. It is guaranteed to be called before destroy() is called. You never need to call this method directly.

See Also:
stop
 o delay
 public void delay(int n)
 o run
 public void run()
java.lang.Runnable stuff

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

Parameters:
g - the graphics
x - the x coordinate
y - the y coordinate
info - the strings array
lines - the number of informations.
 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 getMinimumSize
 public Dimension getMinimumSize()
Set canvas size at SxS

Overrides:
getMinimumSize in class Component
 o getPreferredSize
 public Dimension getPreferredSize()
set canvas preferred size

Overrides:
getPreferredSize in class Component
 o mouseClicked
 public void mouseClicked(MouseEvent e)
 o mouseReleased
 public void mouseReleased(MouseEvent e)
Called if the mouse is up.

 o mousePressed
 public void mousePressed(MouseEvent e)
Called if the mouse is down.

 o mouseDragged
 public void mouseDragged(MouseEvent e)
Called if the mouse is dragged (the mouse button is down)

 o mouseEntered
 public void mouseEntered(MouseEvent e)
Called when the mouse enters the component.

 o checkMousePosition
 public void checkMousePosition(int x,
                                int y)
 o mouseMoved
 public void mouseMoved(MouseEvent e)
Called if the mouse moves (the mouse button is up)

 o mouseExited
 public void mouseExited(MouseEvent e)
Called when the mouse exits the component.

 o makeSpreadsheet
 public void makeSpreadsheet()
make spreadsheet for draged area of the image

 o drawRectangle
 public void drawRectangle(Rectangle rect)
Draw the rectangle area on the current image

 o setShowCoordinate
 public void setShowCoordinate(boolean bvalue)
 o getSubImage
 public Image getSubImage(Rectangle rect,
                          Image imageSource)
Get subset image

 o dispZoomImage
 public void dispZoomImage(int x,
                           int y,
                           Image img)
prepare zoom image & display it

 o dispZoomImage
 public void dispZoomImage(Rectangle rect,
                           Image img)
prepare zoom image & display it

 o openNewPalette
 public void openNewPalette()
 o updateImage
 public void updateImage(ImageFilter imageFilter)
 o setNewPalette
 public void setNewPalette()
 o recoverImage
 public void recoverImage()
 o getSDSImage
 public Image getSDSImage(byte data[],
                          double min,
                          double max,
                          int datatype,
                          int w,
                          int h,
                          byte imageData[],
                          byte palette[])
 o getSDSImage
 public Image getSDSImage(Object data,
                          double min,
                          double max,
                          int datatype,
                          int w,
                          int h,
                          byte imageData[],
                          byte palette[])
 o updateSDSImage
 public void updateSDSImage(double min,
                            double max)
 o setPaletteEditorOpen
 public void setPaletteEditorOpen(boolean flag)
ncsa.hdf.palette.PaletteEditorAdapter flag

 o setSubsetRange
 public void setSubsetRange(Rectangle rect)
 o setSliceInfo
 public void setSliceInfo(SDSDimInfo info)
 o getSliceInfo
 public SDSDimInfo getSliceInfo()
 o getImages
 public Image[] getImages()
 o setImageFrame
 public void setImageFrame(int frame)
 o readSDSImages
 public void readSDSImages() throws HDFException
read and display SDS images for animation

 o readRIS8
 public void readRIS8() throws HDFException
display the 8 bit raster image

 o readRIS24
 public void readRIS24() throws HDFException
read 24-raster image data from the HDF file

 o readGR
 public void readGR() throws HDFException
read and display the GR image

 o readSDS
 public void readSDS(int plane) throws HDFException
read and display SDS image for a given plane

Parameters:
plane - The plane number of the image

All Packages  Class Hierarchy  This Package  Previous  Next  Index