aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/flow/AbstractGraphics.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2007-12-27 10:34:15 +0000
committerJeremias Maerki <jeremias@apache.org>2007-12-27 10:34:15 +0000
commit0c87214d3a98d0836083d191b36aa7abf944d0dc (patch)
tree4a0c8a4abd081996088ad1b3f711ed61aa6ff2f6 /src/java/org/apache/fop/fo/flow/AbstractGraphics.java
parented61f771c493e86046f3d13e3d6a553d825dd8f3 (diff)
downloadxmlgraphics-fop-0c87214d3a98d0836083d191b36aa7abf944d0dc.tar.gz
xmlgraphics-fop-0c87214d3a98d0836083d191b36aa7abf944d0dc.zip
Added new extension element: fox:external-document. It allows to add whole documents such as multi-page TIFF images to be inserted as peers to a page-sequence. Each image will make up an entire page. See the documentation for details. ATM, only single pages are possible. Multi-page images will be supported with the new image package.
Some preparations for page-position="only" but the implementation is incomplete and "only" has no effect, yet. (Just uploaded some stuff I once started) Some javadoc cleanups. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@607032 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/flow/AbstractGraphics.java')
-rw-r--r--src/java/org/apache/fop/fo/flow/AbstractGraphics.java87
1 files changed, 18 insertions, 69 deletions
diff --git a/src/java/org/apache/fop/fo/flow/AbstractGraphics.java b/src/java/org/apache/fop/fo/flow/AbstractGraphics.java
index 74b91eb53..a58cc08f2 100644
--- a/src/java/org/apache/fop/fo/flow/AbstractGraphics.java
+++ b/src/java/org/apache/fop/fo/flow/AbstractGraphics.java
@@ -23,6 +23,7 @@ import org.apache.fop.apps.FOPException;
import org.apache.fop.datatypes.Length;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.GraphicsProperties;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.fo.properties.LengthRangeProperty;
@@ -32,7 +33,7 @@ import org.apache.fop.fo.properties.SpaceProperty;
* Common base class for instream-foreign-object and external-graphics
* flow formatting objects.
*/
-public abstract class AbstractGraphics extends FObj {
+public abstract class AbstractGraphics extends FObj implements GraphicsProperties {
// The value of properties relevant for fo:instream-foreign-object
// and external-graphics.
@@ -101,56 +102,6 @@ public abstract class AbstractGraphics extends FObj {
}
/**
- * Given the ipd and the content width calculates the
- * required x offset based on the text-align property
- * @param ipd the inline-progression-dimension of the object
- * @param cwidth the calculated content width of the object
- * @return the X offset
- */
- public int computeXOffset (int ipd, int cwidth) {
- int xoffset = 0;
- switch (textAlign) {
- case EN_CENTER:
- xoffset = (ipd - cwidth) / 2;
- break;
- case EN_END:
- xoffset = ipd - cwidth;
- break;
- case EN_START:
- break;
- case EN_JUSTIFY:
- default:
- break;
- }
- return xoffset;
- }
-
- /**
- * Given the bpd and the content height calculates the
- * required y offset based on the display-align property
- * @param bpd the block-progression-dimension of the object
- * @param cheight the calculated content height of the object
- * @return the Y offset
- */
- public int computeYOffset(int bpd, int cheight) {
- int yoffset = 0;
- switch (displayAlign) {
- case EN_BEFORE:
- break;
- case EN_AFTER:
- yoffset = bpd - cheight;
- break;
- case EN_CENTER:
- yoffset = (bpd - cheight) / 2;
- break;
- case EN_AUTO:
- default:
- break;
- }
- return yoffset;
- }
-
- /**
* @return the "id" property.
*/
public String getId() {
@@ -171,16 +122,12 @@ public abstract class AbstractGraphics extends FObj {
return lineHeight;
}
- /**
- * @return the "inline-progression-dimension" property.
- */
+ /** {@inheritDoc} */
public LengthRangeProperty getInlineProgressionDimension() {
return inlineProgressionDimension;
}
- /**
- * @return the "block-progression-dimension" property.
- */
+ /** {@inheritDoc} */
public LengthRangeProperty getBlockProgressionDimension() {
return blockProgressionDimension;
}
@@ -199,34 +146,36 @@ public abstract class AbstractGraphics extends FObj {
return width;
}
- /**
- * @return the "content-height" property.
- */
+ /** {@inheritDoc} */
public Length getContentHeight() {
return contentHeight;
}
- /**
- * @return the "content-width" property.
- */
+ /** {@inheritDoc} */
public Length getContentWidth() {
return contentWidth;
}
- /**
- * @return the "scaling" property.
- */
+ /** {@inheritDoc} */
public int getScaling() {
return scaling;
}
- /**
- * @return the "overflow" property.
- */
+ /** {@inheritDoc} */
public int getOverflow() {
return overflow;
}
+ /** {@inheritDoc} */
+ public int getDisplayAlign() {
+ return displayAlign;
+ }
+
+ /** {@inheritDoc} */
+ public int getTextAlign() {
+ return textAlign;
+ }
+
/**
* @return the "alignment-adjust" property
*/