Class ViewPlots.AnImage

java.lang.Object
  extended byjava.awt.Component
      extended byViewPlots.AnImage
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Enclosing class:
ViewPlots

class ViewPlots.AnImage
extends java.awt.Component

AnImage supporting class for ViewPlots This class extends the java.awt.Component class to provide a image component. It replaces the original code's use of javax.swing.ImageIcon. This was to accomidate the re-write from swing code to 1.1 for browser support.

Author:
Daniel J. Adams

Nested Class Summary
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  int itsHeight
          Height of the component
private  java.awt.image.ImageObserver itsObserver
          Viewport for image display calculations
private  java.awt.Image itsScreenImage
          Actual image being displayed
private  int itsWidth
          Width of the component
 
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
ViewPlots.AnImage(java.awt.image.ImageObserver theOb)
          Default constructor for AnImage Initialized AnImage, setting viewport as well.
 
Method Summary
 void finalize()
           
 java.awt.Dimension getMaximumSize()
          Override of underlaying components method.
 java.awt.Dimension getMinimumSize()
          Override of underlaying components method.
 java.awt.Dimension getPreferredSize()
          Override of underlaying components method.
 void paint(java.awt.Graphics theGraphic)
          Override of Component paint method to draw image.
 void setImage(java.awt.Image theImage)
          Sets a new image for the component Allows the displayed image to be changed dynamically.
 
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, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, 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, getMouseListeners, getMouseMotionListeners, 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, isOpaque, 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, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

itsScreenImage

private java.awt.Image itsScreenImage
Actual image being displayed


itsObserver

private java.awt.image.ImageObserver itsObserver
Viewport for image display calculations


itsWidth

private int itsWidth
Width of the component


itsHeight

private int itsHeight
Height of the component

Constructor Detail

ViewPlots.AnImage

public ViewPlots.AnImage(java.awt.image.ImageObserver theOb)
Default constructor for AnImage Initialized AnImage, setting viewport as well.

Parameters:
theOb - Valid ViewPort used for image calculations 2
Method Detail

setImage

public void setImage(java.awt.Image theImage)
Sets a new image for the component Allows the displayed image to be changed dynamically.

Parameters:
theImage - New image to display for the component

paint

public void paint(java.awt.Graphics theGraphic)
Override of Component paint method to draw image. This method overrides the superclasses paint method to draw the image when the underlaying component is updated.

Parameters:
theGraphic - The screen graphic to be drawn to.

getPreferredSize

public java.awt.Dimension getPreferredSize()
Override of underlaying components method. This ensures that the component will be rendered in the proper size.

Returns:
Dimension The preferred size of this component

getMinimumSize

public java.awt.Dimension getMinimumSize()
Override of underlaying components method. This ensures that the component will be rendered in the proper size.

Returns:
Dimension The minimum size of this component

getMaximumSize

public java.awt.Dimension getMaximumSize()
Override of underlaying components method. This ensures that the component will be rendered in the proper size.

Returns:
Dimension The maximum size of this component

finalize

public void finalize()
              throws java.lang.Throwable
Throws:
java.lang.Throwable