jclass
Class ImageArrayCanvas

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--jclass.ImageArrayCanvas

public class ImageArrayCanvas
extends java.awt.Canvas

Canvas used in displaying images from inside a multiimage file. The file should be as simple as putting multiple equal sized images one under the other and saving them afterwards into a single file.

Written: Radu Sion
Version: 0.14x for 1.1.1 awt
Source: ImageArrayCanvas.java

Visit Smart Software 

See Also:
Serialized Form

Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
ImageArrayCanvas()
          Constructs a new object.
ImageArrayCanvas(java.awt.Image im, float framestart, int frwidth, int frheight)
          Constructs a new object that will use the given image in drawing.
 
Method Summary
 float getFrame()
          Returns the current active displayed frame from the file.
 java.awt.Image getImage()
          Returns the internal Image object of this Canvas.
 java.awt.Dimension getPreferredSize()
           
 boolean imageUpdate(java.awt.Image img, int flags, int x, int y, int w, int h)
           
 void paint(java.awt.Graphics gr)
           
 void setFrame(float framestart)
          Sets the current displayed frame from inside the file.
 
Methods inherited from class java.awt.Canvas
addNotify
 E="methods_inherited_from_class_java.awt.Component">
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, 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, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImageArrayCanvas

public ImageArrayCanvas(java.awt.Image im,
                        float framestart,
                        int frwidth,
                        int frheight)
Constructs a new object that will use the given image in drawing. The given image should be a real ImageArray multiframe file or unpredictable results may arise ! The passed parameters should reflect the true frame atributes (height, width) or unpredictable results may occur. No parameter checkings are done.
Parameters:
im - ImageArray multiframe image to assign to this canvas
framestart - Frame number to use in displaying (may be 2.5 for expl)
frwidth - Width of any frame
frheight - Height of any frame

ImageArrayCanvas

public ImageArrayCanvas()
Constructs a new object. This constructor is merely a fake. It is useless and the objects constructed with it may NOT be used as ment to be.
Method Detail

imageUpdate

public boolean imageUpdate(java.awt.Image img,
                           int flags,
                           int x,
                           int y,
                           int w,
                           int h)
Overrides:
imageUpdate in class java.awt.Component

paint

public void paint(java.awt.Graphics gr)
Overrides:
paint in class java.awt.Canvas

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class java.awt.Component

setFrame

public void setFrame(float framestart)
Sets the current displayed frame from inside the file. The frame displayed starts here at the given offset and ends over height lines. See constructor.
Parameters:
frame - Frame number to display.

getImage

public java.awt.Image getImage()
Returns the internal Image object of this Canvas.

getFrame

public float getFrame()
Returns the current active displayed frame from the file.