diff options
author | Keiron Liddle <keiron@apache.org> | 2002-07-04 14:08:20 +0000 |
---|---|---|
committer | Keiron Liddle <keiron@apache.org> | 2002-07-04 14:08:20 +0000 |
commit | 072a9d2808472eec30aa1c272ee4cb50e596a3c9 (patch) | |
tree | f82cc18789323e776b399f063b0c0ec85301bb28 /src/org/apache/fop/pdf/PDFState.java | |
parent | 15e5fd84a05a9ebd8f26096bcbe2bc9e36fb8345 (diff) | |
download | xmlgraphics-fop-072a9d2808472eec30aa1c272ee4cb50e596a3c9.tar.gz xmlgraphics-fop-072a9d2808472eec30aa1c272ee4cb50e596a3c9.zip |
improved gstate usage
now get get image if in pdf without using cache
implemented some image parameters: size,clipping...
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194961 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/pdf/PDFState.java')
-rw-r--r-- | src/org/apache/fop/pdf/PDFState.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/org/apache/fop/pdf/PDFState.java b/src/org/apache/fop/pdf/PDFState.java index 036a00fed..ef5e73885 100644 --- a/src/org/apache/fop/pdf/PDFState.java +++ b/src/org/apache/fop/pdf/PDFState.java @@ -177,10 +177,20 @@ public class PDFState { return !tf.equals(transform); } + /** + * Set a new transform. + * This transform is appended to the transform of + * the current graphic state. + */ public void setTransform(AffineTransform tf) { transform.concatenate(tf); } + /** + * Get the current transform. + * This gets the combination of all transforms in the + * current state. + */ public AffineTransform getTransform() { AffineTransform tf; AffineTransform at = new AffineTransform(); @@ -193,5 +203,32 @@ public class PDFState { return at; } + + /** + * Get the grapics state. + * This gets the combination of all graphic states for + * the current context. + * This is the graphic state set with the gs operator not + * the other graphic state changes. + */ + public PDFGState getGState() { + PDFGState defaultState = PDFGState.DEFAULT; + + PDFGState state; + PDFGState newstate = new PDFGState(0); + newstate.addValues(defaultState); + for(Iterator iter = stateStack.iterator(); iter.hasNext(); ) { + HashMap map = (HashMap)iter.next(); + state = (PDFGState)map.get(GSTATE); + if(state != null) { + newstate.addValues(state); + } + } + if(gstate != null) { + newstate.addValues(gstate); + } + + return newstate; + } } |