gishur.awt
Class StaticImage

java.lang.Object
  |
  +--gishur.awt.StaticImage
Direct Known Subclasses:
DockSymbols, FancyPoint, FileSymbols, SpinSymbols, TraceSymbols, ZoomSymbols

public abstract class StaticImage
extends java.lang.Object

Base class for static images that can be produced via the ImageGrabber (see class apps.tools.ImageGrabber) tool. Static images don't need to be loaded via the file system or network - they are loaded with the class definition from the class loader. One can get the image data via the static createImage(java.awt.Component, int, int, int[]) method. To write static images one has only to write a static initializer that initializes the protected static variables.

Version:
1.0
Author:
Thomas Wolf

Constructor Summary
StaticImage()
           
 
Method Summary
static java.awt.Image createImage()
          Creates an image object of the StaticImage.
static java.awt.Image createImage(java.awt.Color color, boolean halftransparent)
          Creates an image object with substituted color and halftransparency of the StaticImage.
protected static java.awt.Image createImage(java.awt.Color color, boolean halftransparent, int width, int height, int[] pixeldata)
          Creates an image object of the StaticImage with the given base color color and that will be halftransparent if the given flag is true.
protected static java.awt.Image createImage(java.awt.Color base, java.awt.Color color, boolean halftransparent, int width, int height, int[] pixeldata)
          Creates an image object of the StaticImage with the given base color color and that will be halftransparent if the given flag is true.
protected static java.awt.Image createImage(java.awt.Component component, int width, int height, int[] pixeldata)
          Creates an image object of the given pixel array using the given Components Component.createImage(int, int) method.
protected static java.awt.Image createImage(int width, int height, int[] pixeldata)
          Creates an image object of the given pixel array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticImage

public StaticImage()
Method Detail

createImage

protected static java.awt.Image createImage(java.awt.Component component,
                                            int width,
                                            int height,
                                            int[] pixeldata)
Creates an image object of the given pixel array using the given Components Component.createImage(int, int) method.
Parameters:
component - Component to use for Image-creation
width - width of the image
height - height of the image
pixeldata - the array with pixel data
Returns:
Image object of the StaticImage.

createImage

protected static java.awt.Image createImage(int width,
                                            int height,
                                            int[] pixeldata)
Creates an image object of the given pixel array.
Parameters:
width - width of the image
height - height of the image
pixeldata - the array with pixel data
Returns:
Image object of the StaticImage.

createImage

protected static java.awt.Image createImage(java.awt.Color base,
                                            java.awt.Color color,
                                            boolean halftransparent,
                                            int width,
                                            int height,
                                            int[] pixeldata)
Creates an image object of the StaticImage with the given base color color and that will be halftransparent if the given flag is true.
Parameters:
base - base color in the picture to substitude
color - color that substitutes white
halftransparent - if true, the created image will be halftransparent
width - width of the image
height - height of the image
pixeldata - the array with pixel data
Returns:
Image object of the StaticImage.

createImage

protected static java.awt.Image createImage(java.awt.Color color,
                                            boolean halftransparent,
                                            int width,
                                            int height,
                                            int[] pixeldata)
Creates an image object of the StaticImage with the given base color color and that will be halftransparent if the given flag is true.
Parameters:
color - color that substitutes white
halftransparent - if true, the created image will be halftransparent
width - width of the image
height - height of the image
pixeldata - the array with pixel data
Returns:
Image object of the StaticImage.

createImage

public static java.awt.Image createImage()
Creates an image object of the StaticImage. This method must be overwritten in subclasses in order to call their static initializer correctly (and set the class variables). One can call one of the other protected createImage(java.awt.Component, int, int, int[]) methods from the overwritten method.
Returns:
Image object of the StaticImage.

createImage

public static java.awt.Image createImage(java.awt.Color color,
                                         boolean halftransparent)
Creates an image object with substituted color and halftransparency of the StaticImage. This method must be overwritten in subclasses in order to call their static initializer correctly (and set the class variables). One can call one of the other protected createImage(java.awt.Component, int, int, int[]) methods from the overwritten method.
Parameters:
color - color that substitutes white
halftransparent - if true, the created image will be halftransparent
Returns:
Image object of the StaticImage.