public class FwkAppearance extends java.lang.Object implements FwkAppearanceInterface
Graphics2D
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.awt.Color |
DEFAULT_BACKGROUNDCOLOR |
static java.awt.Color |
DEFAULT_COLOR |
static boolean |
JDK1_3_TRANSPARENCY_BUG |
static java.awt.BasicStroke[] |
STROKES
The default stroke array.
|
static java.lang.String |
version |
DASH_STROKE, DOT_DASH_STROKE, DOT_DOT_DASH_STROKE, DOT_STROKE, LINE_STROKE
Constructor and Description |
---|
FwkAppearance()
Creast an appearance.
|
FwkAppearance(java.awt.Color c)
The constructor that receives the color of the appearance.
|
Modifier and Type | Method and Description |
---|---|
void |
configure(java.awt.Graphics2D g)
Configurate the graphical context with the settings of the appearance.
|
java.awt.Color |
getBackgroundColor()
Gets the background color for the Graphics2D context.
|
java.awt.Shape |
getClip()
Gets the clipping shape.
|
java.awt.Color |
getColor()
Gets this graphics context's current color to the specified color.
|
float[] |
getDashArray()
Returns the array representing the lengths of the
dash segments.
|
float |
getDashPhase()
Returns the current dash phase.
|
int |
getEndCap()
Returns the end cap style.
|
java.awt.Shape |
getFill()
Gets the filling shape.
|
java.awt.Font |
getFont()
Gets this graphics context's font to the specified font.
|
int |
getLineJoin()
Returns the line join style.
|
float |
getLineWidth()
Returns the line width.
|
float |
getMiterLimit()
Returns the limit of miter joins.
|
java.awt.Stroke |
getStroke()
Gets the Stroke for the Graphics2D context.
|
java.awt.geom.AffineTransform |
getTransform()
Retruns the transform of the appearance.
|
java.awt.geom.Point2D |
getTranslation()
Get the translation vector.
|
float |
getTransparency()
Get the transparency of the current color (range 0 .. 1.0).
|
java.lang.String |
getVersion()
Return the version string of the FWK component.
|
boolean |
getVisible()
Get the visibility.
|
boolean |
isVisible()
Returns a boolean whether the object is visible.
|
void |
release()
Release the object.
|
java.awt.BasicStroke |
scaleStroke(java.awt.geom.AffineTransform at)
Scale the line with.
|
java.awt.BasicStroke |
scaleStroke(java.awt.geom.AffineTransform at,
float lw)
Scale the line with.
|
void |
setBackgroundColor(java.awt.Color color)
Sets the background color for the Graphics2D context.
|
void |
setClip(double x,
double y,
double width,
double height)
Sets the current clip to the rectangle specified by the given coordinates.
|
void |
setClip(java.awt.Shape clip)
Sets the current clipping area to an arbitrary clip shape.
|
void |
setColor(java.awt.Color c)
Sets this graphics context's current color to the specified color.
|
void |
setDashArray(float[] arr)
Sets the array representing the lengths of the
dash segments.
|
void |
setDashPhase(float phase)
Sets the current dash phase.
|
void |
setEndCap(int cap)
Retrieves the end cap style.
|
void |
setFill(java.awt.Shape s)
Fills the interior of a Shape using the settings of the Graphics2D context.
|
void |
setFont(java.awt.Font font)
Sets this graphics context's font to the specified font.
|
void |
setLineJoin(int join)
Retrieves the line join style.
|
void |
setLineWidth(float w)
Sets the line width of the stroke.
|
void |
setMiterLimit(float limit)
Retrieves the limit of miter joins.
|
void |
setScale(double sx,
double sy)
Sets the possibly non-uniform scale component of the current transform.
|
void |
setStroke(java.awt.Stroke s)
Sets the Stroke for the Graphics2D context.
|
void |
setTransform(java.awt.geom.AffineTransform t)
Sets the transform of the appearance.
|
void |
setTranslation(double x,
double y)
Concatenates the current Graphics2D Transform with a translation transform.
|
void |
setTransparency(float t)
Set the transparency.
|
void |
setVisible(boolean flag)
Set the visibility.
|
public static final java.lang.String version
public static final java.awt.BasicStroke[] STROKES
public static boolean JDK1_3_TRANSPARENCY_BUG
public static java.awt.Color DEFAULT_COLOR
public static java.awt.Color DEFAULT_BACKGROUNDCOLOR
public FwkAppearance()
public FwkAppearance(java.awt.Color c)
c
- The color of the appearance.public java.lang.String getVersion()
FwkInterface
getVersion
in interface FwkInterface
public void release()
release
in interface FwkInterface
public void setColor(java.awt.Color c)
setColor
in interface FwkAppearanceInterface
c
- the color.Color
public java.awt.Color getColor()
getColor
in interface FwkAppearanceInterface
Color
public void setTransparency(float t)
setTransparency
in interface FwkAppearanceInterface
t
- The transparency.public float getTransparency()
getTransparency
in interface FwkAppearanceInterface
public void setFont(java.awt.Font font)
setFont
in interface FwkAppearanceInterface
font
- The font.Font
public java.awt.Font getFont()
getFont
in interface FwkAppearanceInterface
Font
public void setBackgroundColor(java.awt.Color color)
setBackgroundColor
in interface FwkAppearanceInterface
color
- The color of the backgroundGraphics2D
public java.awt.Color getBackgroundColor()
getBackgroundColor
in interface FwkAppearanceInterface
Graphics2D
public void setStroke(java.awt.Stroke s)
setStroke
in interface FwkAppearanceInterface
s
- The Stroke style.Stroke
public java.awt.Stroke getStroke()
getStroke
in interface FwkAppearanceInterface
Stroke
public void setLineWidth(float w)
setLineWidth
in interface FwkAppearanceInterface
w
- The line width.BasicStroke
public float getLineWidth()
getLineWidth
in interface FwkAppearanceInterface
BasicStroke
public void setDashArray(float[] arr)
setDashArray
in interface FwkAppearanceInterface
arr
- The segment array.BasicStroke
public float[] getDashArray()
getDashArray
in interface FwkAppearanceInterface
BasicStroke
public void setDashPhase(float phase)
setDashPhase
in interface FwkAppearanceInterface
phase
- the dash phase.BasicStroke
public float getDashPhase()
getDashPhase
in interface FwkAppearanceInterface
BasicStroke
public void setEndCap(int cap)
setEndCap
in interface FwkAppearanceInterface
BasicStroke
public int getEndCap()
getEndCap
in interface FwkAppearanceInterface
BasicStroke
public void setLineJoin(int join)
setLineJoin
in interface FwkAppearanceInterface
join
- the line join style.BasicStroke
public int getLineJoin()
getLineJoin
in interface FwkAppearanceInterface
BasicStroke
public void setMiterLimit(float limit)
setMiterLimit
in interface FwkAppearanceInterface
limit
- the limit.BasicStroke
public float getMiterLimit()
getMiterLimit
in interface FwkAppearanceInterface
BasicStroke
public void setFill(java.awt.Shape s)
setFill
in interface FwkAppearanceInterface
s
- the filling shape.Shape
public java.awt.Shape getFill()
getFill
in interface FwkAppearanceInterface
Shape
public void setTransform(java.awt.geom.AffineTransform t)
setTransform
in interface FwkAppearanceInterface
t
- the affine transformation.java.awt.AffineTransform
public java.awt.geom.AffineTransform getTransform()
getTransform
in interface FwkAppearanceInterface
java.awt.AffineTransform
public void setTranslation(double x, double y)
setTranslation
in interface FwkAppearanceInterface
x
- Translation in xy
- Translation in yGraphics2D
public java.awt.geom.Point2D getTranslation()
getTranslation
in interface FwkAppearanceInterface
setTranlation(double, double)
public void setScale(double sx, double sy)
setScale
in interface FwkAppearanceInterface
sx
- scale value in x.sy
- scale value in y.public void setClip(double x, double y, double width, double height)
setClip
in interface FwkAppearanceInterface
x,
- y, width, heigth The bounding box.public void setClip(java.awt.Shape clip)
setClip
in interface FwkAppearanceInterface
clip
- The clipping shape.Shape
public java.awt.Shape getClip()
getClip
in interface FwkAppearanceInterface
Shape
public void configure(java.awt.Graphics2D g)
configure
in interface FwkAppearanceInterface
g
- The Graphical context.public boolean isVisible()
isVisible
in interface FwkAppearanceInterface
public void setVisible(boolean flag)
setVisible
in interface FwkAppearanceInterface
flag
- true if the object should be visible.public boolean getVisible()
getVisible
in interface FwkAppearanceInterface
public java.awt.BasicStroke scaleStroke(java.awt.geom.AffineTransform at, float lw)
scaleStroke
in interface FwkAppearanceInterface
at
- the transformation to scale the stroke.lw
- The line width to be scaled.public java.awt.BasicStroke scaleStroke(java.awt.geom.AffineTransform at)
scaleStroke
in interface FwkAppearanceInterface
at
- the transformation to scale the stroke.