|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.co.ist.mwt.ShadowDrawer
A ShadowDrawer is a class which knows how to draw shadows; a component owns one and uses it for this purpose.
Constructor Summary | |
ShadowDrawer()
Constructs a ShadowDrawer which draws shadows of the default thickness (zero) |
|
ShadowDrawer(int thickness)
Constructs a ShadowDrawer which draws shadows of a particular thickness |
Method Summary | |
void |
draw3DRect(java.awt.Component c,
java.awt.Rectangle r,
boolean in)
A routine to draw a 3D rectangle using the object's shadow colours and thickness; pass in the bounding box of the whole object, and the component on which to draw. |
void |
draw3DRect(java.awt.Graphics g,
java.awt.Component c,
java.awt.Rectangle r,
boolean in)
A routine to draw a 3D rectangle using the object's shadow colours and thickness; pass in the bounding box of the whole object, and the component on which to draw. |
void |
drawShadow(java.awt.Component c,
int x,
int y,
int length,
boolean vertical,
boolean reflect,
boolean top)
Draws a trapezium, with top right at the point passed in, with a corner cut out of the length and depth of the shadow thickness; eg. |
void |
drawShadow(java.awt.Graphics g,
java.awt.Component c,
int x,
int y,
int length,
boolean vertical,
boolean reflect,
boolean top)
Draws a trapezium, with top right at the point passed in, with a corner cut out of the length and depth of the shadow thickness; eg. |
java.awt.Color |
getBottomShadowColor(java.awt.Component c)
Gets the color for 'bottom shadows' - those which suggest an area in shadow |
int |
getShadowThickness()
Gets the thickness this drawer is using for shadows right now |
java.awt.Color |
getTopShadowColor(java.awt.Component c)
Gets the color for 'top shadows' - ie. |
void |
setBottomShadowColor(java.awt.Color c)
Sets the color for 'bottom shadows' - those which suggest an area in shadow |
void |
setShadowThickness(int shadowThickness)
Sets the thickness this drawer is using for shadows right now |
void |
setTopShadowColor(java.awt.Color c)
Sets the color for 'top shadows' - ie. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ShadowDrawer()
public ShadowDrawer(int thickness)
Method Detail |
public void setTopShadowColor(java.awt.Color c)
public java.awt.Color getTopShadowColor(java.awt.Component c)
c
- a component to use for a default value if none has been setpublic void setBottomShadowColor(java.awt.Color c)
public java.awt.Color getBottomShadowColor(java.awt.Component c)
c
- a component to use for a default value if none has been setpublic int getShadowThickness()
public void setShadowThickness(int shadowThickness)
public void drawShadow(java.awt.Component c, int x, int y, int length, boolean vertical, boolean reflect, boolean top)
/~~~~~~~~~~~\ ~~~~~~~~~~~~~where the slashes are meant to be at 45 degrees, and the height is the shadow thickness. The /length/ parameter determines the longest side's length. The above would be drawn with /vertical/ equal to false and /reflect/ = false. Setting /vertical/ to true would rotate it 90 degrees clockwise. The effect of reflect=true is to reflect the shape in its longest axis. If /top/, the top shadow colour is used; otherwise the bottom shadow is.
public void drawShadow(java.awt.Graphics g, java.awt.Component c, int x, int y, int length, boolean vertical, boolean reflect, boolean top)
/~~~~~~~~~~~\ ~~~~~~~~~~~~~where the slashes are meant to be at 45 degrees, and the height is the shadow thickness. The /length/ parameter determines the longest side's lenght. The above would be drawn with /vertical/ equal to false and /reflect/ = false. Setting /vertical/ to true would rotate it 90 degrees clockwise. The effect of reflect=true is to reflect the shape in its longest axis. If /top/, the top shadow colour is used; otherwise the bottom shadow is.
public void draw3DRect(java.awt.Component c, java.awt.Rectangle r, boolean in)
public void draw3DRect(java.awt.Graphics g, java.awt.Component c, java.awt.Rectangle r, boolean in)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |