public class Java2DGraphicsState
extends java.lang.Object
The graphics context is updated with the updateXXX() methods.
| Constructor and Description |
|---|
Java2DGraphicsState(java.awt.Graphics2D graphics,
FontInfo fontInfo,
java.awt.geom.AffineTransform at)
State for storing graphics state.
|
Java2DGraphicsState(Java2DGraphicsState org)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Frees resources allocated by the current Graphics2D instance.
|
java.awt.Color |
getColor() |
java.awt.Font |
getFont() |
java.awt.Graphics2D |
getGraph() |
java.awt.BasicStroke |
getStroke() |
java.awt.geom.AffineTransform |
getTransform()
Get the current transform.
|
java.lang.String |
toString() |
void |
transform(java.awt.geom.AffineTransform tf)
Composes an AffineTransform object with the Transform in this Graphics2D
according to the rule last-specified-first-applied.
|
boolean |
updateClip(java.awt.Shape cl)
Set the current clip.
|
boolean |
updateColor(java.awt.Color col)
Set the current background color.
|
boolean |
updateFont(java.lang.String name,
int size)
Set the current font name.
|
boolean |
updatePaint(java.awt.Paint p)
Set the current paint.
|
boolean |
updateStroke(float width,
int style)
Sets the current Stroke.
|
public Java2DGraphicsState(java.awt.Graphics2D graphics,
FontInfo fontInfo,
java.awt.geom.AffineTransform at)
graphics - the graphics associated with the BufferedImagefontInfo - the FontInfo from the rendererat - the initial AffineTransform containing the scale transformationpublic Java2DGraphicsState(Java2DGraphicsState org)
org - the instance to copypublic java.awt.Graphics2D getGraph()
public void dispose()
public boolean updateColor(java.awt.Color col)
col - the new color as a java.awt.Colorpublic java.awt.Color getColor()
public boolean updateFont(java.lang.String name,
int size)
name - the new font namesize - the font sizepublic java.awt.Font getFont()
public boolean updateStroke(float width,
int style)
width - the line widthstyle - the constant for the style of the line as an intpublic java.awt.BasicStroke getStroke()
public boolean updatePaint(java.awt.Paint p)
p - the new paintpublic boolean updateClip(java.awt.Shape cl)
cl - the new clip in the current statepublic void transform(java.awt.geom.AffineTransform tf)
tf - the transform to concatenate to the current level transformGraphics2D.transform(AffineTransform)public java.awt.geom.AffineTransform getTransform()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright 1999-2022 The Apache Software Foundation. All Rights Reserved.