All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jclass.util.JCImageCreator

java.lang.Object
   |
   +----jclass.util.JCImageCreator

public class JCImageCreator
extends Object
JCImageCreate creates images from String arrays. The format is similar to XPM format files. For example:
JCImageCreator im = new JCImageCreator(this, 3, 2);
im.setColor('G', Color.green);
im.setColor('x', Color.orange);
String[] pixels = { " .G", "G x" };
im.setPixels(pixels);
Image image = im.create();
 


Variable Index

 o colorMap
 o comp
 o curRow
 o height
 o pixels
 o width

Constructor Index

 o JCImageCreator(Component)
Creates an empty instance using the specified component.
 o JCImageCreator(Component, int, int)
Creates an empty instance using the specified component.

Method Index

 o clear()
Clears the data.
 o create()
Creates an image using the data previously set using setPixels.
 o create(String[])
Creates an image using the specified string array.
 o setColor(char, Color)
Sets the color corresponding to a character.
 o setColor(char, int)
Sets the color (as an rgb int) corresponding to a character.
 o setPixels(int, String)
Sets the pixel data at the specified row.
 o setPixels(String)
Adds the pixel data to the end.
 o setPixels(String[])
Sets the pixel data for all rows.
 o setSize(int, int)
Sets the size of the image to be created.

Variables

 o curRow
  protected int curRow
 o width
  protected int width
 o height
  protected int height
 o colorMap
  protected int colorMap[]
 o pixels
  protected int pixels[]
 o comp
  protected Component comp

Constructors

 o JCImageCreator
  public JCImageCreator(Component comp,
                        int w,
                        int h)
Creates an empty instance using the specified component.

Parameters:
comp - any component
See Also:
createImage
 o JCImageCreator
  public JCImageCreator(Component comp)
Creates an empty instance using the specified component.

Parameters:
comp - any component
See Also:
createImage

Methods

 o clear
  public synchronized void clear()
Clears the data.

 o create
  public synchronized Image create()
Creates an image using the data previously set using setPixels.

See Also:
setPixels
 o create
  public synchronized Image create(String string[])
Creates an image using the specified string array.

 o setColor
  public synchronized void setColor(char ch,
                                    int rgb)
Sets the color (as an rgb int) corresponding to a character. Spaces are transparent by default.

 o setColor
  public synchronized void setColor(char ch,
                                    Color color)
Sets the color corresponding to a character. Spaces are transparent by default.

 o setSize
  public synchronized void setSize(int w,
                                   int h)
Sets the size of the image to be created.

 o setPixels
  public synchronized void setPixels(String string[])
Sets the pixel data for all rows.

 o setPixels
  public synchronized void setPixels(String string)
Adds the pixel data to the end.

 o setPixels
  public synchronized void setPixels(int row,
                                     String string)
Sets the pixel data at the specified row.


All Packages  Class Hierarchy  This Package  Previous  Next  Index