|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectyopsx.VirtualImagePainter
public class VirtualImagePainter
Set up an image to be painted with a given color and brush width.
| Field Summary | |
|---|---|
protected int |
brush
|
protected java.awt.Color |
color
|
| Constructor Summary | |
|---|---|
VirtualImagePainter(Image image,
java.awt.Color color,
int brush)
|
|
| Method Summary | |
|---|---|
void |
addPixelObserver(PixelObserver po)
Add a PixelObserver to be notified when a pixel changes. |
protected void |
affectPixel(Point p,
java.awt.Color newColor,
java.awt.Color oldColor)
Instead of changing the pixel directly, allow observers to do that. |
protected Image |
getImage()
Allow subclasses to get the image, but nobody else. |
protected java.awt.Color |
getPixel(Point p)
Allow subclasses to inspect the image's pixels. |
boolean |
paint(Point pixel)
Paint the specified pixel with the default color, using brushwidth pixels on all sides. |
void |
repaint()
Request repaint of the contained image. |
boolean |
setPixel(Point pixel)
Set a pixel to the default color. |
boolean |
setPixel(Point pixel,
java.awt.Color color)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final java.awt.Color color
protected final int brush
| Constructor Detail |
|---|
public VirtualImagePainter(Image image,
java.awt.Color color,
int brush)
image - The yops image to be paintedcolor - The default color to be usedbrush - The brush width| Method Detail |
|---|
protected Image getImage()
public void addPixelObserver(PixelObserver po)
po - the PixelObserver to be addedpublic void repaint()
protected java.awt.Color getPixel(Point p)
p - Location to be examined
public boolean paint(Point pixel)
pixel - Point to be painted
public boolean setPixel(Point pixel)
pixel -
public final boolean setPixel(Point pixel,
java.awt.Color color)
protected void affectPixel(Point p,
java.awt.Color newColor,
java.awt.Color oldColor)
p - color -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||