You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by pb...@apache.org on 2004/05/23 12:43:24 UTC

cvs commit: xml-fop/src/java/org/apache/fop/fo FOTree.java FONode.java

pbwest      2004/05/23 03:43:24

  Modified:    src/java/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design
                        FOTree.java FONode.java
  Log:
  Flailing about with the requirements for Java 2D layout
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.11  +39 -13    xml-fop/src/java/org/apache/fop/fo/Attic/FOTree.java
  
  Index: FOTree.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/Attic/FOTree.java,v
  retrieving revision 1.1.2.10
  retrieving revision 1.1.2.11
  diff -u -r1.1.2.10 -r1.1.2.11
  --- FOTree.java	8 May 2004 13:03:54 -0000	1.1.2.10
  +++ FOTree.java	23 May 2004 10:43:24 -0000	1.1.2.11
  @@ -18,6 +18,9 @@
    */
   package org.apache.fop.fo;
   
  +import java.awt.Graphics2D;
  +import java.awt.GraphicsEnvironment;
  +import java.awt.font.FontRenderContext;
   import java.util.logging.Level;
   import java.util.logging.Logger;
   
  @@ -92,17 +95,40 @@
                   PropertyConsts.pconsts.getInitialValue(PropNames.FONT_SIZE);
           if ( ! (prop instanceof Numeric) || ! ((Numeric)prop).isLength())
               throw new PropertyException("Initial font-size is not a Length");
  +        // Set up the rendering context
  +    }
   
  -
  -        /*
  -        for (int i = 1; i <= PropNames.LAST_PROPERTY_INDEX; i++) {
  -            if (i == PropNames.FONT_SIZE) continue;
  -            // Set up the initial values for each property
  -            PropertyConsts.pconsts.getInitialValue(i);
  -            //System.out.println("....Setting initial value for " + i);
  -        }
  -        */
  -
  +    /** The graphics environment in which FOP is operating */
  +    private GraphicsEnvironment gEnv = null;
  +    /**
  +     * Gets the FOP <code>GraphicsEnvironment</code>
  +     * @return the environment
  +     */
  +    protected GraphicsEnvironment getGraphicsEnvironment() {
  +        return gEnv;
  +    }
  +    /** The object which controls drawing and text rendering in the page spread
  +     */
  +    private Graphics2D g2D = null;
  +    /**
  +     * Gets the <code>Graphics2D</code> rendering and drawing control object
  +     * for area layout
  +     * @return
  +     */
  +    public Graphics2D getGraphics2D() {
  +        return g2D;
  +    }
  +    /** The <code>FontRenderContext</code> object garnered from the
  +     * <code>Graphics2D</code> control object for area layout
  +     */
  +    private FontRenderContext frcontext = null;
  +    /**
  +     * Gets the <code>FontRenderContext</code> derived from the graphics
  +     * control object
  +     * @return
  +     */
  +    public FontRenderContext getFontRenderContext() {
  +        return frcontext;
       }
   
       /**
  
  
  
  1.2.2.28  +0 -11     xml-fop/src/java/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.2.2.27
  retrieving revision 1.2.2.28
  diff -u -r1.2.2.27 -r1.2.2.28
  --- FONode.java	18 May 2004 23:05:27 -0000	1.2.2.27
  +++ FONode.java	23 May 2004 10:43:24 -0000	1.2.2.28
  @@ -18,7 +18,6 @@
    */
   package org.apache.fop.fo;
   
  -import java.awt.GraphicsEnvironment;
   import java.awt.geom.Rectangle2D;
   import java.util.BitSet;
   import java.util.HashMap;
  @@ -191,10 +190,6 @@
       /** The number of markers on this FO. */
       protected int numMarkers = 0;
   
  -    private GraphicsEnvironment gEnv = null;
  -    protected GraphicsEnvironment getGraphicsEnvironment() {
  -        return gEnv;
  -    }
       /**
        * @param foTree an <tt>FOTree</tt> to which this node belongs
        * @param type the fo type of this FONode.
  @@ -230,12 +225,6 @@
           exprParser = foTree.exprParser;
           propertySet = new PropertyValue[PropNames.LAST_PROPERTY_INDEX + 1];
           foAttributes = new FOAttributes(event, this);
  -        if (parent == null) {
  -            // Setup the graphics environment
  -            gEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
  -        } else {
  -            gEnv = parent.getGraphicsEnvironment();
  -        }
           if ((stateFlags & MC_MARKER) == 0) {
               processAttributes();
           }
  
  
  

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