|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Graphics | +--sub_arctic.output.drawable | +--sub_arctic.output.shadow_drawable
A drawable object that draws everything in a uniform color (typically a light gray) offset by a small amount. This is used to cast shadows by drawing objects once offset slightly in gray, then again over the top in normal colors. This drawable operates in two modes: expensive (but slow) or cheap (but fast). In cheap mode, images are drawn as unicolor rectangles. In expensive mode, we process images to properly account for transparency.
Field Summary | |
protected boolean |
_expensive_draw
Do we do expensive but realistic drawing of images, or do we just do their bounding rectangle? Default is to be cheap about it. |
static java.awt.Color |
default_color
Default color for drawing (Color.gray). |
static int |
default_off_x
Default for x drawing offset (10). |
static int |
default_off_y
Default for y drawing offset (10). |
protected java.awt.Color |
the_color
Color we paint everything in |
protected java.awt.image.ImageFilter |
uni_filter
Filter to turn images into our one color |
Fields inherited from class sub_arctic.output.drawable |
_ignore,
g |
Constructor Summary | |
shadow_drawable(drawable wrappee,
int off_x,
int off_y,
java.awt.Color c)
Constructor from drawable that defaults to fast drawing |
|
shadow_drawable(drawable wrappee,
int off_x,
int off_y,
java.awt.Color c,
boolean do_expensive_draw)
Full constructor from a drawable |
|
shadow_drawable(java.awt.Graphics wrappee)
Constructor with default shadow offset and color |
|
shadow_drawable(java.awt.Graphics wrappee,
int off_x,
int off_y)
Constructor with default color. |
|
shadow_drawable(java.awt.Graphics wrappee,
int off_x,
int off_y,
java.awt.Color c)
Constructor that defaults to fast drawing |
|
shadow_drawable(java.awt.Graphics wrappee,
int off_x,
int off_y,
java.awt.Color c,
boolean do_expensive_draw)
Full constructor. |
Method Summary | |
void |
clearRect(int x,
int y,
int w,
int h)
Override to turn clear into fill with our color (since clear is an opaque operation). |
void |
copyArea(int x,
int y,
int w,
int h,
int dx,
int dy)
Override to turn into a fill with our color. |
java.awt.Graphics |
create()
Override create() to create a new wrapper also. |
java.awt.Graphics |
create(int x,
int y,
int w,
int h)
Override create() to create a new wrapper also. |
boolean |
drawImage(java.awt.Image img,
int x,
int y,
java.awt.Color bgcolor,
java.awt.image.ImageObserver obs)
Override to filter images, turning all non-transparent colors to ours. |
boolean |
drawImage(java.awt.Image img,
int x,
int y,
java.awt.image.ImageObserver observer)
Override to filter images, turning all non-transparent colors to ours. |
boolean |
drawImage(java.awt.Image img,
int x,
int y,
int w,
int h,
java.awt.Color bgcolor,
java.awt.image.ImageObserver obs)
Override to filter images, turning all non-transparent colors to ours. |
boolean |
drawImage(java.awt.Image img,
int x,
int y,
int w,
int h,
java.awt.image.ImageObserver obs)
Override to filter images, turning all non-transparent colors to ours. |
boolean |
expensive_draw()
Are currently doing expensive but realistic drawing of images, or do are we just drawing their bounding rectangle? |
protected java.awt.Image |
make_shadow(java.awt.Image from_img)
Process an image to make a shadow version. |
void |
set_expensive_draw(boolean v)
Set whether we draw images realistically, but expensively (slow), or just draw their bounding rectangles (fast). |
void |
setColor(java.awt.Color c)
Override to set all colors to our color. |
boolean |
tileImage(loaded_image pattern,
int x,
int y,
int w,
int h)
Override tiled image drawing, turning all non-transparent colors to ours. |
Methods inherited from class java.awt.Graphics |
finalize,
getClipBounds,
getClipRect,
hitClip |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected java.awt.Color the_color
protected java.awt.image.ImageFilter uni_filter
protected boolean _expensive_draw
public static final int default_off_x
public static final int default_off_y
public static final java.awt.Color default_color
Constructor Detail |
public shadow_drawable(java.awt.Graphics wrappee, int off_x, int off_y, java.awt.Color c, boolean do_expensive_draw)
Graphics
- wrappee Graphics object we are a wrapper around.int
- off_x x offset we draw everything at.int
- off_y y offset we draw everything at.Color
- c color we draw everything in.boolean
- do_expensive_draw do we use expensive mode?public shadow_drawable(java.awt.Graphics wrappee, int off_x, int off_y, java.awt.Color c)
Graphics
- wrappee Graphics object we are a wrapper around.int
- off_x x offset we draw everything at.int
- off_y y offset we draw everything at.Color
- c color we draw everything in.public shadow_drawable(drawable wrappee, int off_x, int off_y, java.awt.Color c, boolean do_expensive_draw)
drawable
- wrappee drawable object we are a wrapper around.int
- off_x x offset we draw everything at.int
- off_y y offset we draw everything at.Color
- c color we draw everything in.boolean
- do_expensive_draw do we use expensive mode?public shadow_drawable(drawable wrappee, int off_x, int off_y, java.awt.Color c)
drawable
- wrappee drawable object we are a wrapper around.int
- off_x x offset we draw everything at.int
- off_y offset we draw everything at.Color
- c color we draw everything in.public shadow_drawable(java.awt.Graphics wrappee, int off_x, int off_y)
Graphics
- wrappee Graphics object we are a wrapper around.int
- off_x x offset we draw everything at.int
- off_y y offset we draw everything at.public shadow_drawable(java.awt.Graphics wrappee)
Graphics
- wrappee Graphics object we are a wrapper around.Method Detail |
public boolean expensive_draw()
public void set_expensive_draw(boolean v)
public java.awt.Graphics create()
public java.awt.Graphics create(int x, int y, int w, int h)
int
- x x origin for new drawable.int
- y y origin for new drawable.int
- w width of new drawable.int
- h height of new drawable.public void setColor(java.awt.Color c)
Color
- c color we were supposed to draw in but don't.public void copyArea(int x, int y, int w, int h, int dx, int dy)
int
- x source x position.int
- y source y position.int
- w width of copied area.int
- h height of copied area.int
- dx destination x position.int
- dy destination y position.public void clearRect(int x, int y, int w, int h)
int
- x x position of area to clear.int
- y y position of area to clear.int
- w width of area to clear.int
- h height of area to clear.protected java.awt.Image make_shadow(java.awt.Image from_img)
Image
- from_img the image that we are filtering to produce a shadow
version of.public boolean drawImage(java.awt.Image img, int x, int y, java.awt.image.ImageObserver observer)
Image
- img the image to be drawn.int
- x x position to place the image at.int
- y y position to place the image at.ImageObserver
- observer observer to notify us of progress drawing
the Imagepublic boolean drawImage(java.awt.Image img, int x, int y, int w, int h, java.awt.image.ImageObserver obs)
Image
- img the image to be drawn.int
- x x position to place the image at.int
- y y position to place the image at.int
- w width that image will be scaled to.int
- h height that image will be scaled to.ImageObserver
- observer observer to notify us of progress drawing
the Imagepublic boolean drawImage(java.awt.Image img, int x, int y, java.awt.Color bgcolor, java.awt.image.ImageObserver obs)
Image
- img the image to be drawn.int
- x x position to place the image at.int
- y y position to place the image at.Color
- bgcolor background color.ImageObserver
- observer observer to notify us of progress drawing
the Imagepublic boolean drawImage(java.awt.Image img, int x, int y, int w, int h, java.awt.Color bgcolor, java.awt.image.ImageObserver obs)
Image
- img the image to be drawn.int
- x x position to place the image at.int
- y y position to place the image at.int
- w width that image will be scaled to.int
- h height that image will be scaled to.Color
- bgcolor background color.ImageObserver
- observer observer to notify us of progress drawing
the Imagepublic boolean tileImage(loaded_image pattern, int x, int y, int w, int h)
loaded_image
- pattern the pattern we tile withint
- x x position to place the image at.int
- y y position to place the image at.int
- w width of area to tile.int
- h height of area to tile.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |