From: Keiron Liddle Date: Wed, 6 Nov 2002 15:07:04 +0000 (+0000) Subject: clone and serialize area traits X-Git-Tag: Alt-Design-integration-base~349 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f86105b454926d89670e35c54c0905fd6764f5f6;p=xmlgraphics-fop.git clone and serialize area traits git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195434 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/org/apache/fop/area/Area.java b/src/org/apache/fop/area/Area.java index 5c381d2db..9c312f988 100644 --- a/src/org/apache/fop/area/Area.java +++ b/src/org/apache/fop/area/Area.java @@ -105,7 +105,11 @@ public class Area implements Serializable { private int areaClass = CLASS_NORMAL; private int ipd; - private HashMap props = null; + + /** + * Traits for this area stored in a HashMap + */ + protected HashMap props = null; /** * Get the area class of this area. diff --git a/src/org/apache/fop/area/RegionViewport.java b/src/org/apache/fop/area/RegionViewport.java index 0886b17fe..f368d8882 100644 --- a/src/org/apache/fop/area/RegionViewport.java +++ b/src/org/apache/fop/area/RegionViewport.java @@ -9,6 +9,7 @@ package org.apache.fop.area; import java.awt.geom.Rectangle2D; import java.io.IOException; +import java.util.HashMap; /** * Region Viewport reference area. @@ -72,6 +73,7 @@ public class RegionViewport extends Area implements Cloneable { out.writeFloat((float) viewArea.getWidth()); out.writeFloat((float) viewArea.getHeight()); out.writeBoolean(clip); + out.writeObject(props); out.writeObject(region); } @@ -80,6 +82,7 @@ public class RegionViewport extends Area implements Cloneable { viewArea = new Rectangle2D.Float(in.readFloat(), in.readFloat(), in.readFloat(), in.readFloat()); clip = in.readBoolean(); + props = (HashMap)in.readObject(); setRegion((RegionReference) in.readObject()); } @@ -92,6 +95,9 @@ public class RegionViewport extends Area implements Cloneable { public Object clone() { RegionViewport rv = new RegionViewport((Rectangle2D)viewArea.clone()); rv.region = (RegionReference)region.clone(); + if(props != null) { + rv.props = (HashMap)props.clone(); + } return rv; } } diff --git a/src/org/apache/fop/area/inline/Viewport.java b/src/org/apache/fop/area/inline/Viewport.java index d4a507890..c3753e7fb 100644 --- a/src/org/apache/fop/area/inline/Viewport.java +++ b/src/org/apache/fop/area/inline/Viewport.java @@ -12,6 +12,7 @@ import org.apache.fop.render.Renderer; import java.io.IOException; import java.awt.geom.Rectangle2D; +import java.util.HashMap; /** * Inline viewport area. @@ -100,6 +101,7 @@ public class Viewport extends InlineArea { out.writeFloat((float) contentPosition.getHeight()); } out.writeBoolean(clip); + //out.writeObject(props); out.writeObject(content); } @@ -112,6 +114,7 @@ public class Viewport extends InlineArea { in.readFloat()); } clip = in.readBoolean(); + //props = (HashMap) in.readObject(); content = (Area) in.readObject(); }