public class Java2DGraphicsState extends Object
The graphics context is updated with the updateXXX() methods.
Constructor and Description |
---|
Java2DGraphicsState(Graphics2D graphics,
FontInfo fontInfo,
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.
|
Color |
getColor() |
Font |
getFont() |
Graphics2D |
getGraph() |
BasicStroke |
getStroke() |
AffineTransform |
getTransform()
Get the current transform.
|
String |
toString() |
void |
transform(AffineTransform tf)
Composes an AffineTransform object with the Transform in this Graphics2D
according to the rule last-specified-first-applied.
|
boolean |
updateClip(Shape cl)
Set the current clip.
|
boolean |
updateColor(Color col)
Set the current background color.
|
boolean |
updateFont(String name,
int size)
Set the current font name.
|
boolean |
updatePaint(Paint p)
Set the current paint.
|
boolean |
updateStroke(float width,
int style)
Sets the current Stroke.
|
public Java2DGraphicsState(Graphics2D graphics, FontInfo fontInfo, 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 Graphics2D getGraph()
public void dispose()
public boolean updateColor(Color col)
col
- the new color as a java.awt.Colorpublic Color getColor()
public boolean updateFont(String name, int size)
name
- the new font namesize
- the font sizepublic Font getFont()
public boolean updateStroke(float width, int style)
width
- the line widthstyle
- the constant for the style of the line as an intpublic BasicStroke getStroke()
public boolean updatePaint(Paint p)
p
- the new paintpublic boolean updateClip(Shape cl)
cl
- the new clip in the current statepublic void transform(AffineTransform tf)
tf
- the transform to concatenate to the current level transformGraphics2D.transform(AffineTransform)
public AffineTransform getTransform()
Copyright © 2025 Apache Software Foundation. All rights reserved.