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

## com.mindprod.common11
Class ImageViewer

    java.lang.Object
      java.awt.Component
          com.mindprod.common11.ImageViewer

All Implemented Interfaces:
  java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

    public final class ImageViewer

extends java.awt.Component

Component to display an Image.

Simplified version of Symantec ImageViewer. Does not resize the image, though may crop it. Thus always maintains original magnification and aspect ratio. Used by com.mindprod.bio.Bio

Since:
  2003
Version:
  1.1 2006-03-04
Author:
  Roedy Green, Canadian Mind Products
See Also:
  `ResizingImageViewer`, Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class java.awt.Component
`java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy`

Field Summary

Fields inherited from class java.awt.Component
`BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT`

Fields inherited from interface java.awt.image.ImageObserver
`ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

Constructor Summary
`ImageViewer()` default Constructor
`ImageViewer(java.awt.Image image)` Constructor with Image.

Method Summary
`java.awt.Image` | `getImage()` Get the Image currently being displayed.
`java.awt.Dimension` | `getMinimumSize()` Minimum layout size.
`java.awt.Dimension` | `getPreferredSize()` Preferred Layout size.
`void` | `paint(java.awt.Graphics g)` Paints this component using the given graphics context.
`void` | `setImage(java.awt.Image image)` Set or change the current Image to display.

Methods inherited from class java.awt.Component
`action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate`

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

Constructor Detail

### ImageViewer

    public ImageViewer()

  default Constructor

### ImageViewer

    public ImageViewer(java.awt.Image image)

  Constructor with Image.

  Parameters:
    `image` - the Image to be displayed . See the Java glossary under Image for ways to create an Image from a file.

Method Detail

### getImage

    public java.awt.Image getImage()

  Get the Image currently being displayed.

  Returns:
    the Image currently displayed or null if no Image

### getMinimumSize

    public java.awt.Dimension getMinimumSize()

  Minimum layout size.

  Overrides:
    `getMinimumSize` in class `java.awt.Component`
  Returns:
    he minimum dimensions to properly display the Image

### getPreferredSize

    public java.awt.Dimension getPreferredSize()

  Preferred Layout size.

  Overrides:
    `getPreferredSize` in class `java.awt.Component`
  Returns:
    the recommended dimensions to display the Image.

### paint

    public void paint(java.awt.Graphics g)

  Paints this component using the given graphics context.

  Overrides:
    `paint` in class `java.awt.Component`
  Parameters:
    `g` - Graphics context where to paint, e.g. to screen, printer, RAM.

### setImage

    public void setImage(java.awt.Image image)

  Set or change the current Image to display. setImage does a MediaTracker to ensure the Image is loaded. You don't have to. If you don't plan to use the old image again you should do a getImage().flush();

  Parameters:
    `image` - the new Image to be displayed. If the image jpg may have recently changed, don't use getImage to create it, use URL.openConnection() URLConnection.setUseCaches( false ) Connection.getContent Component.createImage

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