|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.tools.icon.BasicIconPart
public class BasicIconPart
The BasicIconPart is an implementation of the IconPart. In addition to the geometry and DrawingAttributes adjustments that can be done on an IconPart, the BasicIconPart also lets you use an AffineTransform to rotate, translate or scale the geometrym and will create GradientPaints for the Colors from the DrawingAttribtues if desired.
Field Summary | |
---|---|
protected java.awt.geom.AffineTransform |
baseTransform
AffineTransform to adjust geometry if needed. |
protected java.awt.Shape |
clip
Shape clipping area for this IconPart. |
protected java.awt.Shape |
geometry
Shape geometry for this IconPart. |
protected boolean |
gradient
Flag to modifying DrawingAttributes Colors into GradientPaints, for that 3D lighting look. |
protected DrawingAttributes |
renderingAttributes
DrawingAttributes for this IconPart. |
Constructor Summary | |
---|---|
BasicIconPart(java.awt.Shape shape)
Create a BasicIconPart with a java.awt.Shape object for a geometry. |
|
BasicIconPart(java.awt.Shape shape,
java.awt.geom.AffineTransform transform)
Create a BasicIconPart with a java.awt.Shape object for a geometry, along with an AffineTransform that may be applied to the geometry at rendertime. |
|
BasicIconPart(java.awt.Shape shape,
java.awt.geom.AffineTransform transform,
DrawingAttributes da)
Create a BasicIconPart with a java.awt.Shape object for a geometry, along with an AffineTransform that may be applied to the geometry at rendertime. |
|
BasicIconPart(java.awt.Shape shape,
DrawingAttributes da)
Create a BasicIconPart with a java.awt.Shape object for a geometry. |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
protected DrawingAttributes |
getAttributesForRendering(DrawingAttributes da)
Get the DrawingAttributes that should be used for rendering. |
java.awt.Shape |
getClip()
Get a clip area for the IconPart. |
java.awt.Shape |
getGeometry()
Get the geometry for this IconPart. |
DrawingAttributes |
getRenderingAttributes()
Get the rendering attributes for this IconPart. |
java.awt.geom.AffineTransform |
getTransform()
|
boolean |
isGradient()
Get whether colors should be replaced by GradientPaints. |
void |
render(java.awt.Graphics g,
int width,
int height)
Have the IconPart render itself into the Graphic object for a given height and width. |
void |
render(java.awt.Graphics g,
int width,
int height,
DrawingAttributes appDA)
Have the IconPart render itself into the Graphic object for a given height and width. |
void |
setClip(java.awt.Shape clipArea)
Set a clip area for the IconPart to draw only certain parts of the geometry. |
void |
setGeometry(java.awt.Shape shape)
Set the geometry for this IconPart. |
void |
setGradient(boolean value)
Set whether colors should be replaced by GradientPaints. |
void |
setRenderingAttributes(DrawingAttributes da)
Set the rendering attributes for this IconPart. |
void |
setTransform(java.awt.geom.AffineTransform af)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.awt.geom.AffineTransform baseTransform
protected java.awt.Shape geometry
protected java.awt.Shape clip
protected DrawingAttributes renderingAttributes
protected boolean gradient
Constructor Detail |
---|
public BasicIconPart(java.awt.Shape shape)
public BasicIconPart(java.awt.Shape shape, java.awt.geom.AffineTransform transform)
public BasicIconPart(java.awt.Shape shape, DrawingAttributes da)
public BasicIconPart(java.awt.Shape shape, java.awt.geom.AffineTransform transform, DrawingAttributes da)
Method Detail |
---|
protected DrawingAttributes getAttributesForRendering(DrawingAttributes da)
da
- DrawingAttributes passed in that may affect rendering
choices. Can be null, and the IconPart may decide to
ignore it.
public void render(java.awt.Graphics g, int width, int height)
IconPart
render
in interface IconPart
g
- a java.awt.Graphics object to render into.width
- pixel width of icon, used to scale geometry.height
- pixel height of icon, used to scale geometry.public void render(java.awt.Graphics g, int width, int height, DrawingAttributes appDA)
IconPart
render
in interface IconPart
g
- a java.awt.Graphics object to render into.width
- pixel width of icon, used to scale geometry.height
- pixel height of icon, used to scale geometry.appDA
- drawing attributes to use under certain
conditions. Certain IconParts on this list may use these
drawing attributes if they want/should. May be null.public void setGradient(boolean value)
public boolean isGradient()
public void setClip(java.awt.Shape clipArea)
IconPart
setClip
in interface IconPart
public java.awt.Shape getClip()
IconPart
getClip
in interface IconPart
public void setGeometry(java.awt.Shape shape)
IconPart
setGeometry
in interface IconPart
public java.awt.Shape getGeometry()
IconPart
getGeometry
in interface IconPart
public void setTransform(java.awt.geom.AffineTransform af)
public java.awt.geom.AffineTransform getTransform()
public void setRenderingAttributes(DrawingAttributes da)
IconPart
setRenderingAttributes
in interface IconPart
public DrawingAttributes getRenderingAttributes()
IconPart
getRenderingAttributes
in interface IconPart
public java.lang.Object clone()
clone
in interface IconPart
clone
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |