diff options
author | Peter Bernard West <pbwest@apache.org> | 2004-06-01 06:27:05 +0000 |
---|---|---|
committer | Peter Bernard West <pbwest@apache.org> | 2004-06-01 06:27:05 +0000 |
commit | 38254cae5ed21d94f92b729463f929405ce040c3 (patch) | |
tree | a5b3b5aea8adb3b10e82fc67ef058c63b5e70676 | |
parent | 1dee2bdc3802f3c7a301c3c7a00f3bd526a3da7f (diff) | |
download | xmlgraphics-fop-38254cae5ed21d94f92b729463f929405ce040c3.tar.gz xmlgraphics-fop-38254cae5ed21d94f92b729463f929405ce040c3.zip |
W.I.P. Removed constructors with Rectangle2D.
Changed Rectangle2D area to space, added Rectangle2Ds
border, padding and content to Area.
Made content the reference for IPD and BPD calculations.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197680 13f79535-47bb-0310-9956-ffa450edef68
17 files changed, 132 insertions, 377 deletions
diff --git a/src/java/org/apache/fop/area/AbstractReferenceArea.java b/src/java/org/apache/fop/area/AbstractReferenceArea.java index 9ec2e5da4..08fca5a47 100644 --- a/src/java/org/apache/fop/area/AbstractReferenceArea.java +++ b/src/java/org/apache/fop/area/AbstractReferenceArea.java @@ -19,8 +19,6 @@ package org.apache.fop.area; import java.awt.geom.AffineTransform; -import java.awt.geom.Rectangle2D; - import org.apache.fop.datastructs.Node; import org.apache.fop.fo.FONode; import org.apache.fop.fo.flow.FoPageSequence; @@ -52,22 +50,6 @@ public abstract class AbstractReferenceArea } /** - * @param pageSeq through which this area was generated - * @param generatedBy the given <code>FONode</code> generated this - * @param parent area of this - * @param sync object on which operations in this are synchronized - */ - public AbstractReferenceArea( - Rectangle2D area, - FoPageSequence pageSeq, - FONode generatedBy, - Node parent, - Object sync) { - super(area, pageSeq, generatedBy, parent, sync); - // TODO Auto-generated constructor stub - } - - /** * Set the Coordinate Transformation Matrix which transforms content * coordinates in this reference area which are specified in * terms of "start" and "before" into coordinates in a system which diff --git a/src/java/org/apache/fop/area/AbstractViewport.java b/src/java/org/apache/fop/area/AbstractViewport.java index 3f6f9a155..778f8dc38 100644 --- a/src/java/org/apache/fop/area/AbstractViewport.java +++ b/src/java/org/apache/fop/area/AbstractViewport.java @@ -19,8 +19,6 @@ */ package org.apache.fop.area; -import java.awt.geom.Rectangle2D; - import org.apache.fop.datastructs.Node; import org.apache.fop.fo.FONode; import org.apache.fop.fo.flow.FoPageSequence; @@ -38,49 +36,27 @@ implements Viewport { /** The reference-area of the viewport/reference pair */ protected ReferenceArea refArea; - - /** - * @param pageSeq - * @param generatedBy - * @param parent - * @param sync - */ - public AbstractViewport(FoPageSequence pageSeq, FONode generatedBy, - Node parent, Object sync) { - super(pageSeq, generatedBy, parent, sync); - } /** * @param pageSeq * @param generatedBy - */ - public AbstractViewport(FoPageSequence pageSeq, FONode generatedBy) { - super(pageSeq, generatedBy); - } - /** - * @param pageSeq - * @param generatedBy - * @param area the viewport rectangle * @param parent * @param sync */ public AbstractViewport( - Rectangle2D area, FoPageSequence pageSeq, FONode generatedBy, Node parent, Object sync) { - super(area, pageSeq, generatedBy, parent, sync); + super(pageSeq, generatedBy, parent, sync); } /** * @param pageSeq * @param generatedBy - * @param area the viewport rectangle */ public AbstractViewport( - Rectangle2D area, FoPageSequence pageSeq, FONode generatedBy) { - super(area, pageSeq, generatedBy); + super(pageSeq, generatedBy); } /* (non-Javadoc) * @see org.apache.fop.area.Viewport#setReferenceArea(org.apache.fop.area.ReferenceArea) diff --git a/src/java/org/apache/fop/area/Area.java b/src/java/org/apache/fop/area/Area.java index e4c553d31..a4f86fc13 100644 --- a/src/java/org/apache/fop/area/Area.java +++ b/src/java/org/apache/fop/area/Area.java @@ -43,12 +43,15 @@ import org.apache.fop.fo.properties.WritingMode; */ public class Area extends AreaNode implements Cloneable { - /** The geometrical area. The <code>width</code> of this - * <code>Rectangle</code> is the <code>inline-progression-dimension</code> - * of the area, and the <code>height</code> is the + /** The total geometrical area covered by this <code>Area</code>, including + * content rectangle, padding, borders and spaces. The <code>width</code> + * of this <code>Rectangle</code> is the <code>inline-progression-dimension + * </code> of the area, and the <code>height</code> is the * <code>block-progression-dimension</code>. */ - - protected Rectangle2D area = null; + protected Rectangle2D space = new Rectangle2D.Float(); + protected Rectangle2D border = null; + protected Rectangle2D padding = null; + protected Rectangle2D content = new Rectangle2D.Float(); /** True if the the <code>writing-mode</code> of the content area is * horizontal */ protected boolean contentIsHorizontal = true; @@ -56,6 +59,55 @@ public class Area extends AreaNode implements Cloneable { * left-to-right */ protected boolean contentLeftToRight = true; + /** + * @return the border + */ + public Rectangle2D getBorder() { + return border; + } + /** + * @param border to set + */ + public void setBorder(Rectangle2D border) { + this.border = border; + } + /** + * @return the content + */ + public Rectangle2D getContent() { + return content; + } + /** + * @param content to set + */ + public void setContent(Rectangle2D content) { + this.content = content; + } + /** + * @return the padding + */ + public Rectangle2D getPadding() { + return padding; + } + /** + * @param padding to set + */ + public void setPadding(Rectangle2D padding) { + this.padding = padding; + } + /** + * @return the space + */ + public Rectangle2D getSpace() { + return space; + } + /** + * @param space to set + */ + public void setSpace(Rectangle2D space) { + this.space = space; + } + private void setup() { try { contentIsHorizontal = @@ -66,25 +118,6 @@ public class Area extends AreaNode implements Cloneable { throw new RuntimeException(e.getMessage()); } } - /** - * Constructs an <code>Area</code> which is based on the given - * <code>Rectangle2D</code> - * @param area the rectangular area - * @param pageSeq through which this area was generated - * @param generatedBy the given <code>FONode</code> generated this - * @param parent <code>Node</code> of this - * @param sync the object on which this area is synchronized <code>for tree - * operations</code>. - */ - public Area( - Rectangle2D area, - FoPageSequence pageSeq, - FONode generatedBy, - Node parent, - Object sync) { - this(pageSeq, generatedBy, parent, sync); - this.area = area; - } /** * Constructs an <code>Area</code> with a null rectangular area @@ -105,21 +138,6 @@ public class Area extends AreaNode implements Cloneable { } /** - * Constructs an <code>Area</code> with the given rectangular area, - * which is the root of a tree, and is synchronized on itself. - * @param area the rectangular area - * @param pageSeq through which this area was generated - * @param generatedBy the given <code>FONode</code> generated this - */ - public Area( - Rectangle2D area, - FoPageSequence pageSeq, - FONode generatedBy) { - this(pageSeq, generatedBy); - this.area = area; - } - - /** * Construct an <code>Area</code> which is the root of a tree, and is * synchronized on itself * @param pageSeq through which this area was generated @@ -155,13 +173,15 @@ public class Area extends AreaNode implements Cloneable { */ public double getBPDimPts() { synchronized (this) { - if (area == null) { - return 0; - } + // TODO - check this. Should the rectangle just be rotated as + // required? This is incompatible with transform in space + // requests at block reference-areas. OK if the transform is + // only for area rotations. This depnds on how Java handles the + // layout of text in horizontal locales. if (contentIsHorizontal) { - return area.getHeight(); + return content.getHeight(); } else { - return area.getWidth(); + return content.getWidth(); } } } @@ -192,15 +212,13 @@ public class Area extends AreaNode implements Cloneable { */ public void setBPDimPts(float pts) { synchronized (this) { - if (area == null) { - area = new Rectangle2D.Float(); - } + // TODO - check this if (contentIsHorizontal) { - area.setRect( - area.getX(),area.getY(), area.getWidth(), pts); + content.setRect( + content.getX(),content.getY(), content.getWidth(), pts); } else { - area.setRect( - area.getX(),area.getY(), pts, area.getHeight()); + content.setRect( + content.getX(),content.getY(), pts, content.getHeight()); } } } @@ -229,13 +247,11 @@ public class Area extends AreaNode implements Cloneable { */ public double getIPDimPts() { synchronized (this) { - if (area == null) { - area = new Rectangle2D.Float(); - } + // TODO - check this if (contentIsHorizontal){ - return area.getWidth(); + return content.getWidth(); } else { - return area.getHeight(); + return content.getHeight(); } } } @@ -264,13 +280,13 @@ public class Area extends AreaNode implements Cloneable { */ public void setIPDimPts(double pts) { synchronized (this) { - if (area == null) { - area = new Rectangle2D.Float(); - } + // Check this if (contentIsHorizontal){ - area.setRect(area.getX(), area.getY(), pts, area.getHeight()); + content.setRect( + content.getX(), content.getY(), pts, content.getHeight()); } else { - area.setRect(area.getX(), area.getY(), area.getWidth(), pts); + content.setRect( + content.getX(), content.getY(), content.getWidth(), pts); } } } @@ -299,7 +315,7 @@ public class Area extends AreaNode implements Cloneable { private ArrayList listeners = null; /** * Registers a listener to be notified on any change of dimension in the - * <code>Rectangle2D</code> area + * <code>Rectangle2D</code> content * @param listener to be notified */ public void registerAreaListener(AreaListener listener) { @@ -313,12 +329,12 @@ public class Area extends AreaNode implements Cloneable { /** * Notifies any registered listener of a change of dimensions in the - * <code>Rectangle2D</code> area + * <code>Rectangle2D</code> content */ protected void notifyListeners() { for (int i = 0; i < listeners.size(); i++) { synchronized (this) { - ((AreaListener)(listeners.get(i))).setDimensions(area); + ((AreaListener)(listeners.get(i))).setDimensions(content); } } } diff --git a/src/java/org/apache/fop/area/BlockArea.java b/src/java/org/apache/fop/area/BlockArea.java index b01a86b25..3b6d506c0 100644 --- a/src/java/org/apache/fop/area/BlockArea.java +++ b/src/java/org/apache/fop/area/BlockArea.java @@ -44,7 +44,7 @@ public class BlockArea extends Area { } /** The page space allocation for layout of the block */ - private Rectangle2D pageSpace; + private Rectangle2D pageSpace = new Rectangle2D.Float(); // /** // * Receives an allocation of page space from area parent @@ -63,9 +63,30 @@ public class BlockArea extends Area { */ public Rectangle2D pageSpaceRequest(AreaRange spaceRange) { AreaRange request = adjustedRequest(spaceRange); + // Is there a sufficient allocation already available? + if (spaceContains(spaceRange.minima)) { + if (spaceContains(spaceRange.maxima)) { + // Reduce available space and OK the request + // N.B. the space request must take into account the + // space required for footnotes + // If all of the text fits into the available space, then the + // siblings of the line area must be tested to discover whether + // they contain inline items which will go into the same + // line-area. At this point, e.g., footnotes will be found. + } else { + // Negotiate available space with the requester + + } + } else { // Need more space from above. Page may be full + // Negotiate with parent for more space + } return null; } + private boolean spaceContains(Rectangle2D rect) { + return pageSpace.contains( + rect.getMinX(), rect.getMinY(), rect.getWidth(), rect.getHeight()); + } private AreaRange adjustedRequest(AreaRange request) { // TODO Adjust the request for padding, borders and margins on this // block @@ -80,4 +101,32 @@ public class BlockArea extends Area { } + protected float getStartSpace() { + return getStartIndent() + getStartIntrusion(); + } + + protected float getEndSpace() { + return getEndIndent() + getEndIntrusion(); + } + + protected float getStartIndent() { + // Dummy start-indent + return 10.0f; + } + + protected float getEndIndent() { + // Dummy end-indent + return 10.0f; + } + + protected float getStartIntrusion() { + // dummy intrusion + return 0.0f; + } + + protected float getEndIntrusion() { + // dummy intrusion + return 0.0f; + } + } diff --git a/src/java/org/apache/fop/area/PageViewport.java b/src/java/org/apache/fop/area/PageViewport.java index 79fe3cc4f..9641fa66e 100644 --- a/src/java/org/apache/fop/area/PageViewport.java +++ b/src/java/org/apache/fop/area/PageViewport.java @@ -17,8 +17,6 @@ */ package org.apache.fop.area; -import java.awt.geom.Rectangle2D; - import org.apache.fop.datastructs.Node; import org.apache.fop.fo.flow.FoPageSequence; @@ -48,23 +46,6 @@ implements Viewport { } /** - * Creates a page viewport, with a null page reference area and the given - * rectangular area - * @param area the rectangular area - * @param pageSeq the page-sequence which generated this area - * @param parent - * @param sync - */ - public PageViewport( - Rectangle2D area, - FoPageSequence pageSeq, - Node parent, - Object sync) { - // The pageSeq is also the generating node - super(area, pageSeq, pageSeq, parent, sync); - } - - /** * Creates a page viewport with a null page ref area and rectangular area, * and the given parent node and sync object * @param pageSeq the page-sequence which generated this viewport. This is diff --git a/src/java/org/apache/fop/area/RegionAfterRefArea.java b/src/java/org/apache/fop/area/RegionAfterRefArea.java index e8069b753..ac6929b6a 100644 --- a/src/java/org/apache/fop/area/RegionAfterRefArea.java +++ b/src/java/org/apache/fop/area/RegionAfterRefArea.java @@ -19,8 +19,6 @@ */ package org.apache.fop.area; -import java.awt.geom.Rectangle2D; - import org.apache.fop.datastructs.Node; import org.apache.fop.fo.flow.FoPageSequence; @@ -47,22 +45,6 @@ public class RegionAfterRefArea } /** - * Creates a new region-after area with the given rectangular area - * @param area the rectangular area - * @param pageSeq the generating <code>page-sequence</code> - * @param parent the page-reference-area - * @param sync - */ - public RegionAfterRefArea( - Rectangle2D area, - FoPageSequence pageSeq, - Node parent, - Object sync) { - // the page-sequence is the generated-by node - super(area, pageSeq, pageSeq, parent, sync); - } - - /** * Creates and returns a <code>RegionAfterRefArea</code> with no * rectangular area. * <b>N.B.</b> this is a <code>static</code> method. diff --git a/src/java/org/apache/fop/area/RegionAfterVport.java b/src/java/org/apache/fop/area/RegionAfterVport.java index e8248f46f..5e732b2cf 100644 --- a/src/java/org/apache/fop/area/RegionAfterVport.java +++ b/src/java/org/apache/fop/area/RegionAfterVport.java @@ -19,8 +19,6 @@ */ package org.apache.fop.area; -import java.awt.geom.Rectangle2D; - import org.apache.fop.datastructs.Node; import org.apache.fop.fo.flow.FoPageSequence; @@ -45,21 +43,6 @@ public class RegionAfterVport extends RegionViewport { } /** - * Creates a new region-after area with the defined rectangular area - * @param area the rectangular area - * @param pageSeq the generating <code>page-sequence</code> - * @param parent the page-reference-area - * @param sync - */ - public RegionAfterVport( - Rectangle2D area, - FoPageSequence pageSeq, - Node parent, - Object sync) { - super(area, pageSeq, pageSeq, parent, sync); - } - - /** * Creates and returns a <code>RegionAfterVport</code> with no * rectangular area. * <b>N.B.</b> this is a <code>static</code> method. diff --git a/src/java/org/apache/fop/area/RegionBeforeRefArea.java b/src/java/org/apache/fop/area/RegionBeforeRefArea.java index 0e08587de..588b12711 100644 --- a/src/java/org/apache/fop/area/RegionBeforeRefArea.java +++ b/src/java/org/apache/fop/area/RegionBeforeRefArea.java @@ -19,8 +19,6 @@ */ package org.apache.fop.area; -import java.awt.geom.Rectangle2D; - import org.apache.fop.datastructs.Node; import org.apache.fop.fo.flow.FoPageSequence; @@ -47,22 +45,6 @@ public class RegionBeforeRefArea } /** - * Creates a new region-before area with the given rectangular area - * @param area the rectangular area - * @param pageSeq the generating <code>page-sequence</code> - * @param parent the page-reference-area - * @param sync - */ - public RegionBeforeRefArea( - Rectangle2D area, - FoPageSequence pageSeq, - Node parent, - Object sync) { - // the page-sequence is the generated-by node - super(area, pageSeq, pageSeq, parent, sync); - } - - /** * Creates and returns a <code>RegionBeforeRefArea</code> with no * rectangular area. * <b>N.B.</b> this is a <code>static</code> method. diff --git a/src/java/org/apache/fop/area/RegionBeforeVport.java b/src/java/org/apache/fop/area/RegionBeforeVport.java index f9f44bc0d..95a7530f0 100644 --- a/src/java/org/apache/fop/area/RegionBeforeVport.java +++ b/src/java/org/apache/fop/area/RegionBeforeVport.java @@ -19,8 +19,6 @@ */ package org.apache.fop.area; -import java.awt.geom.Rectangle2D; - import org.apache.fop.datastructs.Node; import org.apache.fop.fo.flow.FoPageSequence; @@ -45,22 +43,6 @@ public class RegionBeforeVport extends RegionViewport { } /** - * Creates a new region-before area with the defined rectangular area - * @param area the rectangular area - * @param pageSeq the generating <code>page-sequence</code> - * @param parent the page-reference-area - * @param sync - */ - public RegionBeforeVport( - Rectangle2D area, - FoPageSequence pageSeq, - Node parent, - Object sync) { - // the page-sequence is the generated-by node - super(area, pageSeq, pageSeq, parent, sync); - } - - /** * Creates and returns a <code>RegionBeforeVport</code> with no * rectangular area. * <b>N.B.</b> this is a <code>static</code> method. diff --git a/src/java/org/apache/fop/area/RegionBodyRefArea.java b/src/java/org/apache/fop/area/RegionBodyRefArea.java index dad2a3862..efd9e66f3 100644 --- a/src/java/org/apache/fop/area/RegionBodyRefArea.java +++ b/src/java/org/apache/fop/area/RegionBodyRefArea.java @@ -17,8 +17,6 @@ */ package org.apache.fop.area; -import java.awt.geom.Rectangle2D; - import org.apache.fop.datastructs.Node; import org.apache.fop.fo.flow.FoPageSequence; @@ -56,30 +54,6 @@ implements ReferenceArea { } /** - * Creates a new body region area with the given rectangular area, column - * count and gap - * This sets the region reference area class to BODY. - * @param columnCount - * @param columnGap - * @param area the rectangular area - * @param pageSeq the generating <code>page-sequence</code> - * @param parent the page-reference-area - * @param sync - */ - public RegionBodyRefArea( - int columnCount, - int columnGap, - Rectangle2D area, - FoPageSequence pageSeq, - Node parent, - Object sync) { - // the page-sequence is the generated-by node - super(area, pageSeq, pageSeq, parent, sync); - this.columnCount = columnCount; - this.columnGap = columnGap; - } - - /** * Creates and returns a <code>RegionBodyRefArea</code> with no rectangular * area. The area created references a null <code>MainReferenceArea</code>. * <b>N.B.</b> this is a <code>static</code> method. diff --git a/src/java/org/apache/fop/area/RegionBodyVport.java b/src/java/org/apache/fop/area/RegionBodyVport.java index 8530cfd6a..16bc0885b 100644 --- a/src/java/org/apache/fop/area/RegionBodyVport.java +++ b/src/java/org/apache/fop/area/RegionBodyVport.java @@ -19,8 +19,6 @@ */ package org.apache.fop.area; -import java.awt.geom.Rectangle2D; - import org.apache.fop.datastructs.Node; import org.apache.fop.fo.flow.FoPageSequence; @@ -31,23 +29,6 @@ import org.apache.fop.fo.flow.FoPageSequence; public class RegionBodyVport extends RegionViewport { /** - * Creates a <code>region-body-viewport</code> with the given rectangular - * area - * @param area the rectangular area - * @param pageSeq the generating <code>page-sequence</code> - * @param parent - * @param sync - */ - public RegionBodyVport( - Rectangle2D area, - FoPageSequence pageSeq, - Node parent, - Object sync) { - // the page-sequence is the generated-by node - super(area, pageSeq, pageSeq, parent, sync); - } - - /** * Creates a <code>region-body-viewport</code> with no rectangular area * @param pageSeq the generating <code>page-sequence</code> * @param parent diff --git a/src/java/org/apache/fop/area/RegionEndRefArea.java b/src/java/org/apache/fop/area/RegionEndRefArea.java index e1864f7d7..13f6d17ae 100644 --- a/src/java/org/apache/fop/area/RegionEndRefArea.java +++ b/src/java/org/apache/fop/area/RegionEndRefArea.java @@ -19,8 +19,6 @@ */ package org.apache.fop.area; -import java.awt.geom.Rectangle2D; - import org.apache.fop.datastructs.Node; import org.apache.fop.fo.flow.FoPageSequence; @@ -47,22 +45,6 @@ implements ReferenceArea { } /** - * Creates a new region-end area with the given rectangular area - * @param area the rectangular area - * @param pageSeq the generating <code>page-sequence</code> - * @param parent the page-reference-area - * @param sync - */ - public RegionEndRefArea( - Rectangle2D area, - FoPageSequence pageSeq, - Node parent, - Object sync) { - // the page-sequence is the generated-by node - super(area, pageSeq, pageSeq, parent, sync); - } - - /** * Creates and returns a <code>RegionEndRefArea</code> with no * rectangular area. * <b>N.B.</b> this is a <code>static</code> method. diff --git a/src/java/org/apache/fop/area/RegionEndVport.java b/src/java/org/apache/fop/area/RegionEndVport.java index c5c1bb3da..e00e29757 100644 --- a/src/java/org/apache/fop/area/RegionEndVport.java +++ b/src/java/org/apache/fop/area/RegionEndVport.java @@ -19,8 +19,6 @@ */ package org.apache.fop.area; -import java.awt.geom.Rectangle2D; - import org.apache.fop.datastructs.Node; import org.apache.fop.fo.flow.FoPageSequence; @@ -45,22 +43,6 @@ public class RegionEndVport extends RegionViewport { } /** - * Creates a new region-end area with the defined rectangular area - * @param area the rectangular area - * @param pageSeq the generating <code>page-sequence</code> - * @param parent the page-reference-area - * @param sync - */ - public RegionEndVport( - Rectangle2D area, - FoPageSequence pageSeq, - Node parent, - Object sync) { - // the page-sequence is the generated-by node - super(area, pageSeq, pageSeq, parent, sync); - } - - /** * Creates and returns a <code>RegionEndVport</code> with no * rectangular area. * <b>N.B.</b> this is a <code>static</code> method. diff --git a/src/java/org/apache/fop/area/RegionRefArea.java b/src/java/org/apache/fop/area/RegionRefArea.java index f2e0180fc..ca4a54d84 100644 --- a/src/java/org/apache/fop/area/RegionRefArea.java +++ b/src/java/org/apache/fop/area/RegionRefArea.java @@ -17,7 +17,6 @@ */ package org.apache.fop.area; -import java.awt.geom.Rectangle2D; import java.util.ArrayList; import java.util.List; @@ -53,23 +52,6 @@ implements ReferenceArea { } /** - * Creates a new region reference area, with a defined rectangular area - * @param area the geometry of this area - * @param pageSeq the generating page sequence - * @param generatedBy the generating node; in this case, the page sequence - * @param parent the associated viewport area - * @param sync - */ - public RegionRefArea( - Rectangle2D area, - FoPageSequence pageSeq, - FONode generatedBy, - Node parent, - Object sync) { - super(area, pageSeq, generatedBy, parent, sync); - } - - /** * Get the block in this region. * * @return the list of blocks in this region diff --git a/src/java/org/apache/fop/area/RegionStartRefArea.java b/src/java/org/apache/fop/area/RegionStartRefArea.java index a7dffdd6d..481c88517 100644 --- a/src/java/org/apache/fop/area/RegionStartRefArea.java +++ b/src/java/org/apache/fop/area/RegionStartRefArea.java @@ -19,8 +19,6 @@ */ package org.apache.fop.area; -import java.awt.geom.Rectangle2D; - import org.apache.fop.datastructs.Node; import org.apache.fop.fo.flow.FoPageSequence; @@ -47,22 +45,6 @@ public class RegionStartRefArea } /** - * Creates a new region-start area with the given rectangular area - * @param area the rectangular area - * @param pageSeq the generating <code>page-sequence</code> - * @param parent the page-reference-area - * @param sync - */ - public RegionStartRefArea( - Rectangle2D area, - FoPageSequence pageSeq, - Node parent, - Object sync) { - // the page-sequence is the generated-by node - super(area, pageSeq, pageSeq, parent, sync); - } - - /** * Creates and returns a <code>RegionStartRefArea</code> with no * rectangular area. * <b>N.B.</b> this is a <code>static</code> method. diff --git a/src/java/org/apache/fop/area/RegionStartVport.java b/src/java/org/apache/fop/area/RegionStartVport.java index bec3c2246..07df9a371 100644 --- a/src/java/org/apache/fop/area/RegionStartVport.java +++ b/src/java/org/apache/fop/area/RegionStartVport.java @@ -19,8 +19,6 @@ */ package org.apache.fop.area; -import java.awt.geom.Rectangle2D; - import org.apache.fop.datastructs.Node; import org.apache.fop.fo.flow.FoPageSequence; @@ -45,22 +43,6 @@ public class RegionStartVport extends RegionViewport { } /** - * Creates a new region-start area with the defined rectangular area - * @param area the rectangular area - * @param pageSeq the generating <code>page-sequence</code> - * @param parent the page-reference-area - * @param sync - */ - public RegionStartVport( - Rectangle2D area, - FoPageSequence pageSeq, - Node parent, - Object sync) { - // the page-sequence is the generated-by node - super(area, pageSeq, pageSeq, parent, sync); - } - - /** * Creates and returns a <code>RegionStartVport</code> with no * rectangular area. * <b>N.B.</b> this is a <code>static</code> method. diff --git a/src/java/org/apache/fop/area/RegionViewport.java b/src/java/org/apache/fop/area/RegionViewport.java index 8fc915d5e..4381c23ba 100644 --- a/src/java/org/apache/fop/area/RegionViewport.java +++ b/src/java/org/apache/fop/area/RegionViewport.java @@ -17,8 +17,6 @@ */ package org.apache.fop.area; -import java.awt.geom.Rectangle2D; -import java.io.IOException; import org.apache.fop.datastructs.Node; import org.apache.fop.fo.FONode; import org.apache.fop.fo.flow.FoPageSequence; @@ -30,22 +28,6 @@ import org.apache.fop.fo.flow.FoPageSequence; public class RegionViewport extends AbstractViewport implements Viewport, Cloneable { - /** - * Creates a new region viewport with the given rectangular area - * @param area the rectangular area - * @param pageSeq the generating <code>page-sequence</code> - * @param generatedBy the generating node; in this case, the page sequence - * @param parent the <code>main-reference-area</code> - * @param sync - */ - public RegionViewport( - Rectangle2D area, - FoPageSequence pageSeq, - FONode generatedBy, - Node parent, - Object sync) { - super(area, pageSeq, generatedBy, parent, sync); - } /** * Creates a new region viewport with a null rectangular area @@ -162,30 +144,6 @@ implements Viewport, Cloneable { // } /** - * @param out - * @throws IOException - */ - private void writeObject(java.io.ObjectOutputStream out) - throws IOException { - out.writeFloat((float) area.getX()); - out.writeFloat((float) area.getY()); - out.writeFloat((float) area.getWidth()); - out.writeFloat((float) area.getHeight()); - out.writeBoolean(clip); - //out.writeObject(props); - out.writeObject(refArea); - } - - private void readObject(java.io.ObjectInputStream in) - throws IOException, ClassNotFoundException { - area = new Rectangle2D.Float(in.readFloat(), in.readFloat(), - in.readFloat(), in.readFloat()); - clip = in.readBoolean(); - //props = (HashMap)in.readObject(); - setRegionRefArea((RegionRefArea) in.readObject()); - } - - /** * Clone this region viewport. * Used when creating a copy from the page master. * @@ -199,7 +157,6 @@ implements Viewport, Cloneable { } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } - rv.area = (Rectangle2D)(area.clone()); rv.refArea = (PageRefArea)(refArea.clone()); return rv; } |