|
fop 0.92beta | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.fop.render.java2d.Java2DGraphicsState
Keeps information about the current state of the Graphics2D currentGraphics. It is also used as a stack to hold a graphics context.
The graphics context is updated with the updateXXX() methods.
Field Summary |
Constructor Summary | |
Java2DGraphicsState(java.awt.Graphics2D graphics,
FontInfo fontInfo,
java.awt.geom.AffineTransform at)
State for storing graphics state. |
Method Summary | |
boolean |
checkClip(java.awt.Shape cl)
Check if the clip will change the current state. |
boolean |
checkTransform(java.awt.geom.AffineTransform tf)
Check the current transform. |
java.awt.Color |
getColor()
|
java.awt.Font |
getFont()
|
java.awt.Graphics2D |
getGraph()
|
int |
getStackLevel()
Get the current stack level. |
java.awt.BasicStroke |
getStroke()
|
java.awt.geom.AffineTransform |
getTransform()
Get the current transform. |
java.awt.Graphics2D |
pop()
Pop the state from the stack and restore the graphics context. |
void |
push()
Push the current state onto the stack. |
void |
setTransform(java.awt.geom.AffineTransform tf)
Overwrites the Transform in the Graphics2D context. |
java.awt.Color |
toColor(ColorType col)
Converts a ColorType to a java.awt.Color (sRGB). |
java.lang.String |
toString()
a verbose description of the current state |
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. |
void |
updateColor(ColorType col)
Update the current Color |
boolean |
updateColor(ColorType col,
boolean fill,
java.lang.StringBuffer pdf)
Establishes a new foreground or fill color. |
boolean |
updateFont(java.lang.String name,
int size,
java.lang.StringBuffer pdf)
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
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 transformationMethod Detail |
public java.awt.Graphics2D getGraph()
public void push()
RendererState
push
in interface RendererState
RendererState.push()
public java.awt.Graphics2D pop()
RendererState
pop
in interface RendererState
RendererState.pop()
public int getStackLevel()
RendererState
getStackLevel
in interface RendererState
RendererState.getStackLevel()
public boolean updateColor(java.awt.Color col)
col
- the new color as a java.awt.Color
public java.awt.Color toColor(ColorType col)
col
- the color as a org.apache.fop.datatypes.ColorType
public boolean updateColor(ColorType col, boolean fill, java.lang.StringBuffer pdf)
RendererState
updateColor
in interface RendererState
col
- the color to apply (null skips this operation)fill
- true to set the fill color, false for the foreground colorpdf
- only used by the PDFRenderer, is set to null.
RendererState.updateColor(org.apache.fop.datatypes.ColorType,
boolean, java.lang.StringBuffer)
public void updateColor(ColorType col)
col
- the ColorTypepublic java.awt.Color getColor()
public boolean updateFont(java.lang.String name, int size, java.lang.StringBuffer pdf)
RendererState
updateFont
in interface RendererState
name
- the new font namesize
- pdf
-
RendererState.updateFont(java.lang.String,
int, java.lang.StringBuffer)
public java.awt.Font getFont()
public boolean updateStroke(float width, int style)
RendererState
updateStroke
in interface RendererState
style
- the constant for the style of the line as an int
RendererState.updateStroke(float, int)
public java.awt.BasicStroke getStroke()
public boolean updatePaint(java.awt.Paint p)
RendererState
updatePaint
in interface RendererState
p
- the new paint
RendererState.updatePaint(java.awt.Paint)
public boolean checkClip(java.awt.Shape cl)
RendererState
checkClip
in interface RendererState
cl
- the clip shape to check
RendererState.checkClip(java.awt.Shape)
public boolean updateClip(java.awt.Shape cl)
RendererState
updateClip
in interface RendererState
cl
- the new clip in the current stateRendererState.updateClip(java.awt.Shape)
public boolean checkTransform(java.awt.geom.AffineTransform tf)
RendererState
checkTransform
in interface RendererState
tf
- the transform to check against
RendererState.checkTransform(java.awt.geom.AffineTransform)
public void setTransform(java.awt.geom.AffineTransform tf)
RendererState
transform()
if you
wish to compose with the current Affinetransform instead.
setTransform
in interface RendererState
tf
- the transform to concatonate to the current level transformRendererState.setTransform(java.awt.geom.AffineTransform)
public void transform(java.awt.geom.AffineTransform tf)
RendererState
transform
in interface RendererState
tf
- the transform to concatonate to the current level transformRendererState.transform(java.awt.geom.AffineTransform)
public java.awt.geom.AffineTransform getTransform()
RendererState
getTransform
in interface RendererState
RendererState.getTransform()
public java.lang.String toString()
|
fop 0.92beta | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |