aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/util
diff options
context:
space:
mode:
authorAdrian Cumiskey <acumiskey@apache.org>2008-11-20 16:38:44 +0000
committerAdrian Cumiskey <acumiskey@apache.org>2008-11-20 16:38:44 +0000
commit8a08b69ee6049677c1578a9c0791140caf6a1d6a (patch)
treedd944704ebf88860345226a0e1ff7c82cf774cae /src/java/org/apache/fop/util
parent13992fd89fac85aa890b253468a405c3609c322c (diff)
downloadxmlgraphics-fop-8a08b69ee6049677c1578a9c0791140caf6a1d6a.tar.gz
xmlgraphics-fop-8a08b69ee6049677c1578a9c0791140caf6a1d6a.zip
SetCurrentPosition fix for line drawing.
AbstractPaintingState push(), pushAll(), pop(), popAll() renamed to save(), saveAll() and restore(), restoreAll(). Some Javadoc improvements/updates. Added Completable, Startable object writing interfaces. StructuredDataObject interface renamed to StructuredData. High level DataStream class moved from afp.modca to afp package. Graphics*Relative objects removed and feature provided by absolute implementation. GraphicsArea broken into GraphicsAreaBegin and GraphicsAreaEnd since areas are able to span more than one segment. Improvement in SetLineWidth thickness precision. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@719274 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/util')
-rw-r--r--src/java/org/apache/fop/util/AbstractPaintingState.java29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/java/org/apache/fop/util/AbstractPaintingState.java b/src/java/org/apache/fop/util/AbstractPaintingState.java
index e712ce74f..4fb6b173c 100644
--- a/src/java/org/apache/fop/util/AbstractPaintingState.java
+++ b/src/java/org/apache/fop/util/AbstractPaintingState.java
@@ -28,9 +28,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.Stack;
-
/**
- * A base class which holds information about the current rendering state.
+ * A base class which holds information about the current painting state.
*/
public abstract class AbstractPaintingState implements Cloneable, Serializable {
@@ -278,23 +277,23 @@ public abstract class AbstractPaintingState implements Cloneable, Serializable {
/**
- * Push the current painting state onto the stack.
+ * Save the current painting state.
+ * This pushes the current painting state onto the stack.
* This call should be used when the Q operator is used
* so that the state is known when popped.
*/
- public void push() {
+ public void save() {
AbstractData copy = (AbstractData)getData().clone();
stateStack.push(copy);
}
/**
- * Pop the painting state from the stack and set current values to popped state.
- * This should be called when a Q operator is used so
- * the state is restored to the correct values.
+ * Restore the current painting state.
+ * This pops the painting state from the stack and sets current values to popped state.
*
* @return the restored state, null if the stack is empty
*/
- public AbstractData pop() {
+ public AbstractData restore() {
if (!stateStack.isEmpty()) {
setData((AbstractData)stateStack.pop());
return this.data;
@@ -304,30 +303,32 @@ public abstract class AbstractPaintingState implements Cloneable, Serializable {
}
/**
- * Pushes all painting state data in the given list to the stack
+ * Save all painting state data.
+ * This pushes all painting state data in the given list to the stack
*
* @param dataList a state data list
*/
- public void pushAll(List/*<AbstractData>*/ dataList) {
+ public void saveAll(List/*<AbstractData>*/ dataList) {
Iterator it = dataList.iterator();
while (it.hasNext()) {
// save current data on stack
- push();
+ save();
setData((AbstractData)it.next());
}
}
/**
- * Pops all painting state data from the stack
+ * Restore all painting state data.
+ * This pops all painting state data from the stack
*
* @return a list of state data popped from the stack
*/
- public List/*<AbstractData>*/ popAll() {
+ public List/*<AbstractData>*/ restoreAll() {
List/*<AbstractData>*/ dataList = new java.util.ArrayList/*<AbstractData>*/();
AbstractData data;
while (true) {
data = getData();
- if (pop() == null) {
+ if (restore() == null) {
break;
}
// insert because of stack-popping