xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adelme...@apache.org
Subject svn commit: r674269 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop: area/AreaTreeParser.java area/inline/Character.java render/AbstractRenderer.java
Date Sun, 06 Jul 2008 08:15:50 GMT
Author: adelmelle
Date: Sun Jul  6 01:15:50 2008
New Revision: 674269

URL: http://svn.apache.org/viewvc?rev=674269&view=rev
Log:
Remove deprecated Character area class

Removed:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/area/inline/Character.java
Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/area/AreaTreeParser.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/AbstractRenderer.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/AreaTreeParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/AreaTreeParser.java?rev=674269&r1=674268&r2=674269&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/AreaTreeParser.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/AreaTreeParser.java Sun Jul  6 01:15:50
2008
@@ -57,7 +57,6 @@
 import org.apache.fop.area.Trait.Background;
 import org.apache.fop.area.Trait.InternalLink;
 import org.apache.fop.area.inline.AbstractTextArea;
-import org.apache.fop.area.inline.Character;
 import org.apache.fop.area.inline.ForeignObject;
 import org.apache.fop.area.inline.Image;
 import org.apache.fop.area.inline.InlineArea;
@@ -179,7 +178,6 @@
             makers.put("text", new TextMaker());
             makers.put("word", new WordMaker());
             makers.put("space", new SpaceMaker());
-            makers.put("char", new CharMaker());
             makers.put("leader", new LeaderMaker());
             makers.put("viewport", new ViewportMaker());
             makers.put("image", new ImageMaker());
@@ -812,28 +810,6 @@
             }
         }
 
-        private class CharMaker extends AbstractMaker {
-            
-            public void endElement() {
-                content.flip();
-                Character ch = new Character(content.charAt(0));
-                transferForeignObjects(lastAttributes, ch);
-                setAreaAttributes(lastAttributes, ch);
-                setTraits(lastAttributes, ch, SUBSET_COMMON);
-                setTraits(lastAttributes, ch, SUBSET_BOX);
-                setTraits(lastAttributes, ch, SUBSET_COLOR);
-                setTraits(lastAttributes, ch, SUBSET_FONT);
-                ch.setOffset(getAttributeAsInteger(lastAttributes, "offset", 0));
-                ch.setBaselineOffset(getAttributeAsInteger(lastAttributes, "baseline", 0));
-                Area parent = (Area)areaStack.peek();
-                parent.addChildArea(ch);
-            }
-            
-            public boolean ignoreCharacters() {
-                return false;
-            }
-        }
-
         private class LeaderMaker extends AbstractMaker {
 
             public void startElement(Attributes attributes) {

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/AbstractRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/AbstractRenderer.java?rev=674269&r1=674268&r2=674269&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/AbstractRenderer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/AbstractRenderer.java Sun Jul  6
01:15:50 2008
@@ -54,7 +54,6 @@
 import org.apache.fop.area.RegionViewport;
 import org.apache.fop.area.Span;
 import org.apache.fop.area.Trait;
-import org.apache.fop.area.inline.Character;
 import org.apache.fop.area.inline.Container;
 import org.apache.fop.area.inline.ForeignObject;
 import org.apache.fop.area.inline.Image;
@@ -246,25 +245,15 @@
         last here. */
         RegionViewport viewport;
         viewport = page.getRegionViewport(FO_REGION_BEFORE);
-        if (viewport != null) {
-            renderRegionViewport(viewport);
-        }
+        renderRegionViewport(viewport);
         viewport = page.getRegionViewport(FO_REGION_START);
-        if (viewport != null) {
-            renderRegionViewport(viewport);
-        }
+        renderRegionViewport(viewport);
         viewport = page.getRegionViewport(FO_REGION_END);
-        if (viewport != null) {
-            renderRegionViewport(viewport);
-        }
+        renderRegionViewport(viewport);
         viewport = page.getRegionViewport(FO_REGION_AFTER);
-        if (viewport != null) {
-            renderRegionViewport(viewport);
-        }
+        renderRegionViewport(viewport);
         viewport = page.getRegionViewport(FO_REGION_BODY);
-        if (viewport != null) {
-            renderRegionViewport(viewport);
-        }
+        renderRegionViewport(viewport);
     }
 
     /**
@@ -276,25 +265,27 @@
      * @param port  The region viewport to be rendered
      */
     protected void renderRegionViewport(RegionViewport port) {
-        Rectangle2D view = port.getViewArea();
-        // The CTM will transform coordinates relative to
-        // this region-reference area into page coords, so
-        // set origin for the region to 0,0.
-        currentBPPosition = 0;
-        currentIPPosition = 0;
-
-        RegionReference regionReference = port.getRegionReference();
-        handleRegionTraits(port);
-
-        //  shouldn't the viewport have the CTM
-        startVParea(regionReference.getCTM(), port.isClip() ? view : null);
-        // do after starting viewport area
-        if (regionReference.getRegionClass() == FO_REGION_BODY) {
-            renderBodyRegion((BodyRegion) regionReference);
-        } else {
-            renderRegion(regionReference);
+        if (port != null) {
+            Rectangle2D view = port.getViewArea();
+            // The CTM will transform coordinates relative to
+            // this region-reference area into page coords, so
+            // set origin for the region to 0,0.
+            currentBPPosition = 0;
+            currentIPPosition = 0;
+
+            RegionReference regionReference = port.getRegionReference();
+            handleRegionTraits(port);
+
+            //  shouldn't the viewport have the CTM
+            startVParea(regionReference.getCTM(), port.isClip() ? view : null);
+            // do after starting viewport area
+            if (regionReference.getRegionClass() == FO_REGION_BODY) {
+                renderBodyRegion((BodyRegion) regionReference);
+            } else {
+                renderRegion(regionReference);
+            }
+            endVParea();
         }
-        endVParea();
     }
 
     /**
@@ -405,7 +396,7 @@
         for (int count = 0; count < spans.size(); count++) {
             span = (Span) spans.get(count);
             for (int c = 0; c < span.getColumnCount(); c++) {
-                NormalFlow flow = (NormalFlow) span.getNormalFlow(c);
+                NormalFlow flow = span.getNormalFlow(c);
 
                 if (flow != null) {
                     currentBPPosition = saveSpanBPPos;
@@ -509,7 +500,7 @@
         int saveBP = currentBPPosition;
 
         // Calculate the position of the content rectangle.
-        if (parent != null && !parent.getTraitAsBoolean(Trait.IS_VIEWPORT_AREA))
{
+        if (parent != null && !Boolean.TRUE.equals(parent.getTrait(Trait.IS_VIEWPORT_AREA)))
{
             currentBPPosition += parent.getBorderAndPaddingWidthBefore();
             /* This is unnecessary now as we're going to use the *-indent traits
             currentIPPosition += parent.getBorderAndPaddingWidthStart();
@@ -565,7 +556,7 @@
                 // simply move position
                 currentBPPosition += block.getAllocBPD();
             }
-        } else if (block.getTraitAsBoolean(Trait.IS_REFERENCE_AREA)) {
+        } else if (Boolean.TRUE.equals(block.getTrait(Trait.IS_REFERENCE_AREA))) {
             renderReferenceArea(block);
         } else {
             // save position and offset
@@ -638,15 +629,6 @@
         }
     }
 
-    /**
-     * Render the given Character.
-     * @param ch the character to render
-     * @deprecated Only TextArea should be used. This method will be removed eventually.
-     */
-    protected void renderCharacter(Character ch) {
-        currentIPPosition += ch.getAllocIPD();
-    }
-
     /** 
      * Common method to render the background and borders for any inline area.
      * The all borders and padding are drawn outside the specified area.
@@ -754,6 +736,8 @@
             renderContainer((Container) content);
         } else if (content instanceof ForeignObject) {
             renderForeignObject((ForeignObject) content, contpos);
+        } else if (content instanceof InlineBlockParent) {
+            renderInlineBlockParent((InlineBlockParent) content);
         }
         currentIPPosition += viewport.getAllocIPD();
         currentBPPosition = saveBP;
@@ -792,7 +776,7 @@
      * @param pos  The target position of the foreign object
      * (todo) Make renderForeignObject() protected
      */
-    public void renderForeignObject(ForeignObject fo, Rectangle2D pos) {
+    protected void renderForeignObject(ForeignObject fo, Rectangle2D pos) {
         // Default: do nothing.
         // Some renderers (ex. Text) don't support foreign objects.
     }
@@ -817,8 +801,9 @@
                 handler.handleXML(ctx, doc, namespace);
             } catch (Exception e) {
                 // could not handle document
-                ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
-                        ctx.getUserAgent().getEventBroadcaster());
+                ResourceEventProducer eventProducer 
+                        = ResourceEventProducer.Provider.get(
+                            ctx.getUserAgent().getEventBroadcaster());
                 eventProducer.foreignXMLProcessingError(this, doc, namespace, e);
             }
         } else {
@@ -871,5 +856,4 @@
         matrix[5] = matrix[5] * 1000;
         return new AffineTransform(matrix);
     }
-    
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message