vipratech.beans.standardbeans
Class ImageCanvas

java.lang.Object
  |
  +--java.awt.Component
        |
        +--vipratech.awt.VComponent
              |
              +--vipratech.beans.standardbeans.ImageCanvas

public class ImageCanvas
extends VComponent

The ImageCanvas is a graphical user interface (GUI) component for displaying a .gif or a .jpg file on a vipratech.awt.VCanvas. The class uses the class.getResource() method to set up a url to the directory in the .jar file where the image is stored. This class currently works with Microsoft Internet Explorer and Sun Applet Viewer, but not with Netscape Navigator as of version 4.6. The Netscape browser will simply display a blank canvas.

The image should be stored in the same directory as the beans: vipratech.beans.

Version:
1.02, March 11, 2001
Author:
Warwick Bailey   warwick-bailey@bigfoot.com
See Also:
Serialized Form

Fields inherited from class vipratech.awt.VComponent
fm
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
ImageCanvas()
           
 
Method Summary
 void finalize()
           
 java.lang.String getFilename()
          Returns the filename for the image (eg "myimage.gif").
 java.awt.Dimension getMinimumSize()
          Returns the minimum size of this component, which is 20 x 20 pixels.
 int getXCoord()
          Returns the horizontal position of the image.
 int getYCoord()
          Returns the vertical position of the image.
 void paint(java.awt.Graphics g)
          If the image is not null, the image is painted onto the canvas.
 void setFilename(java.lang.String filename)
          Sets the filename for the image (eg "myimage.gif").
 void setXCoord(int xCoord)
          Sets the horizontal position of the image.
 void setYCoord(int yCoord)
          Sets the vertical position of the image.
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, 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, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImageCanvas

public ImageCanvas()
Method Detail

finalize

public final void finalize()

paint

public final void paint(java.awt.Graphics g)
If the image is not null, the image is painted onto the canvas.
Overrides:
paint in class java.awt.Component

getMinimumSize

public final java.awt.Dimension getMinimumSize()
Returns the minimum size of this component, which is 20 x 20 pixels.
Overrides:
getMinimumSize in class java.awt.Component

setFilename

public final void setFilename(java.lang.String filename)
Sets the filename for the image (eg "myimage.gif").

getFilename

public final java.lang.String getFilename()
Returns the filename for the image (eg "myimage.gif").

setXCoord

public final void setXCoord(int xCoord)
Sets the horizontal position of the image.

getXCoord

public final int getXCoord()
Returns the horizontal position of the image.

setYCoord

public final void setYCoord(int yCoord)
Sets the vertical position of the image.

getYCoord

public final int getYCoord()
Returns the vertical position of the image.

dathe@chemie.uni-leipzig.de"

http://leipzig.vernetztes-studium.de