pbwest      2002/11/11 18:29:19

  Modified:    src/org/apache/fop/datatypes Tag: FOP_0-20-0_Alt-Design
                        Ems.java
  Log:
  Added FONode arg to constructor and to makeEms method.
  Expand EMs on creation in makeEms method.  If node argument is null,
  assume an initial value environment, and use font-size initial value
  for expansion.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.4   +22 -7     xml-fop/src/org/apache/fop/datatypes/Attic/Ems.java
  
  Index: Ems.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/datatypes/Attic/Ems.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- Ems.java  19 Oct 2002 03:27:07 -0000      1.1.2.3
  +++ Ems.java  12 Nov 2002 02:29:19 -0000      1.1.2.4
  @@ -3,6 +3,7 @@
   
   import org.apache.fop.fo.expr.PropertyException;
   import org.apache.fop.fo.PropNames;
  +import org.apache.fop.fo.FONode;
   import org.apache.fop.fo.PropertyConsts;
   
   /*
  @@ -33,29 +34,43 @@
       /**
        * Construct a <tt>Numeric</tt> with a given unit and quantity.
        * The unit power is assumed as 1.  The base unit is millipoints.
  +     * @param node - the <tt>FONode</tt> with reference to which this
  +     * <i>EM</i> value is being consructed.  A null value imples the
  +     * construction of an <i>initial value</i>.
        * @param property the index of the property with which this value
        * is associated.
        * @param value the number of units.
        * @return a <tt>Numeric</tt> representing this <i>Ems</i>.
        */
  -    public static Numeric makeEms(int property, double value)
  +    public static Numeric makeEms(FONode node, int property, double value)
           throws PropertyException
       {
  -        return new Numeric(property, value, Numeric.EMS, 0, 0);
  +        Numeric numeric = new Numeric(property, value, Numeric.EMS, 0, 0);
  +        if (node == null)
  +            numeric.expandEms((Numeric)
  +            (PropertyConsts.pconsts.getInitialValue(PropNames.FONT_SIZE)));
  +        else
  +            numeric.expandEms(node.currentFontSize());
  +        return numeric;
       }
   
       /**
        * Construct a <tt>Numeric</tt> with a given unit and quantity.
        * The unit power is assumed as 1.  The base unit is millipoints.
  +     * @param node - the <tt>FONode</tt> with reference to which this
  +     * <i>EM</i> value is being consructed.  A null value imples the
  +     * construction of an <i>initial value</i>.
  +     * @param property the index of the property with which this value
        * @param propertyName the name of the property with which this value
        * is associated.
        * @param value the number of units.
        * @return a <tt>Numeric</tt> representing this <i>Ems</i>.
        */
  -    public static Numeric makeEms (String propertyName, double value)
  +    public static Numeric makeEms
  +                            (FONode node, String propertyName, double value)
           throws PropertyException
       {
  -        return makeEms(PropNames.getPropertyIndex(propertyName), value);
  +        return makeEms(node, PropNames.getPropertyIndex(propertyName), value);
       }
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to