Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.jimi.tools.imageviewer
Class ImageViewer

    java.lang.Object
      |
      +--com.sun.jimi.tools.imageviewer.ImageViewer

public class ImageViewer
extends java.lang.Object
implements java.awt.event.ActionListener

Image viewing class. On creation, a "control panel" frame will pop up for loading images. Any number of images can be loaded and saved through it.

Field Summary
`protected <>List` | `bufferList_` List for showing which images are loaded.
`protected static int` | `CONTROL_PANEL_WIDTH` Default width for control panel.
`protected java.awt.Panel` | `controlPanel_` Container for controls.
`protected java.lang.String` | `currentDirectory_`
`protected com.sun.component.JimiCanvas` | `displayCanvas_` Canvas that actually displays the images.
`protected java.util.Hashtable` | `imageCache_` Image cache.
`protected java.util.Hashtable` | `imageNameMap_` Mappings between filenames stored in the List, and fully-qualified names.
`protected static int` | `INITIAL_LIST_ROWS` Initial number of rows in the list.
`protected java.awt.Button` | `loadButton_` "Load" button.
`protected java.awt.Frame` | `mainFrame_` Frame for main panel.
`protected java.awt.MediaTracker` | `mediaTracker_` MediaTracker for blocking on image loading.
`protected java.awt.Button` | `saveButton_` "Save" button.
`protected java.awt.Label` | `statusMessage_` Status message.
`protected java.awt.Frame` | `viewerFrame_` Frame for viewer panel.

Constructor Summary
`ImageViewer()`

Method Summary
`void` | `actionPerformed(java.awt.event.ActionEvent e)`
`protected void` | `initPanel()`
`protected void` | `loadImage()` Pops up a file dialog prompting the user to load an image.
`protected void` | `openImage(java.lang.String filename)` Opens an image and makes sure it is fully loaded.
`protected void` | `saveImage()` Not implemented!
`protected void` | `setImage(java.awt.Image image)`
`protected void` | `setStatus(java.lang.String status)` Show a message in the status line.
`protected void` | `waitImageLoad(java.awt.Image image)` Block on image loading.
`protected void` | `writeImage(java.lang.String filename)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### INITIAL_LIST_ROWS

    protected static final int INITIAL_LIST_ROWS

  Initial number of rows in the list.

### CONTROL_PANEL_WIDTH

    protected static final int CONTROL_PANEL_WIDTH

  Default width for control panel.

### mainFrame_

    protected java.awt.Frame mainFrame_

  Frame for main panel.

### viewerFrame_

    protected java.awt.Frame viewerFrame_

  Frame for viewer panel.

### controlPanel_

    protected java.awt.Panel controlPanel_

  Container for controls.

### bufferList_

    protected <>List bufferList_

  List for showing which images are loaded.

### loadButton_

    protected java.awt.Button loadButton_

  "Load" button.

### saveButton_

    protected java.awt.Button saveButton_

  "Save" button.

### statusMessage_

    protected java.awt.Label statusMessage_

  Status message.

### imageCache_

    protected java.util.Hashtable imageCache_

  Image cache.

### imageNameMap_

    protected java.util.Hashtable imageNameMap_

  Mappings between filenames stored in the List, and fully-qualified names.

### mediaTracker_

    protected java.awt.MediaTracker mediaTracker_

  MediaTracker for blocking on image loading.

### displayCanvas_

    protected com.sun.component.JimiCanvas displayCanvas_

  Canvas that actually displays the images.

### currentDirectory_

    protected java.lang.String currentDirectory_

Constructor Detail

### ImageViewer

    public ImageViewer()

Method Detail

### initPanel

    protected void initPanel()

### saveImage

    protected void saveImage()

  Not implemented!

### writeImage

    protected void writeImage(java.lang.String filename)
                       throws java.io.IOException

### loadImage

    protected void loadImage()

  Pops up a file dialog prompting the user to load an image.

### openImage

    protected void openImage(java.lang.String filename)
                      throws java.io.IOException

  Opens an image and makes sure it is fully loaded.
  Returns:
    The image.
  Throws:
    If - something goes wrong while loading the image.

### setImage

    protected void setImage(java.awt.Image image)

### actionPerformed

    public void actionPerformed(java.awt.event.ActionEvent e)

  Specified by:
    actionPerformed in interface java.awt.event.ActionListener

### waitImageLoad

    protected void waitImageLoad(java.awt.Image image)

  Block on image loading.

### setStatus

    protected void setStatus(java.lang.String status)

  Show a message in the status line.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD