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();
-
colorMap
-
-
comp
-
-
curRow
-
-
height
-
-
pixels
-
-
width
-
-
JCImageCreator(Component)
- Creates an empty instance using the specified component.
-
JCImageCreator(Component, int, int)
- Creates an empty instance using the specified component.
-
clear()
- Clears the data.
-
create()
- Creates an image using the data previously set using setPixels.
-
create(String[])
- Creates an image using the specified string array.
-
setColor(char, Color)
- Sets the color corresponding to a character.
-
setColor(char, int)
- Sets the color (as an rgb int) corresponding to a character.
-
setPixels(int, String)
- Sets the pixel data at the specified row.
-
setPixels(String)
- Adds the pixel data to the end.
-
setPixels(String[])
- Sets the pixel data for all rows.
-
setSize(int, int)
- Sets the size of the image to be created.
curRow
protected int curRow
width
protected int width
height
protected int height
colorMap
protected int colorMap[]
pixels
protected int pixels[]
comp
protected Component comp
JCImageCreator
public JCImageCreator(Component comp,
int w,
int h)
- Creates an empty instance using the specified component.
- Parameters:
- comp - any component
- See Also:
- createImage
JCImageCreator
public JCImageCreator(Component comp)
- Creates an empty instance using the specified component.
- Parameters:
- comp - any component
- See Also:
- createImage
clear
public synchronized void clear()
- Clears the data.
create
public synchronized Image create()
- Creates an image using the data previously set using setPixels.
- See Also:
- setPixels
create
public synchronized Image create(String string[])
- Creates an image using the specified string array.
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.
setColor
public synchronized void setColor(char ch,
Color color)
- Sets the color corresponding to a character.
Spaces are transparent by default.
setSize
public synchronized void setSize(int w,
int h)
- Sets the size of the image to be created.
setPixels
public synchronized void setPixels(String string[])
- Sets the pixel data for all rows.
setPixels
public synchronized void setPixels(String string)
- Adds the pixel data to the end.
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