You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by vh...@apache.org on 2001/09/28 10:43:57 UTC

cvs commit: xml-batik/sources/org/apache/batik/svggen SVGLookupOp.java

vhardy      01/09/28 01:43:57

  Modified:    sources/org/apache/batik/svggen SVGLookupOp.java
  Log:
  Added doubleString static method.
  
  Revision  Changes    Path
  1.12      +16 -1     xml-batik/sources/org/apache/batik/svggen/SVGLookupOp.java
  
  Index: SVGLookupOp.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/svggen/SVGLookupOp.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SVGLookupOp.java	2001/04/26 14:17:26	1.11
  +++ SVGLookupOp.java	2001/09/28 08:43:57	1.12
  @@ -22,7 +22,7 @@
    * of the lookup table.
    *
    * @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
  - * @version $Id: SVGLookupOp.java,v 1.11 2001/04/26 14:17:26 cjolif Exp $
  + * @version $Id: SVGLookupOp.java,v 1.12 2001/09/28 08:43:57 vhardy Exp $
    * @see                org.apache.batik.svggen.SVGBufferedImageOp
    */
   public class SVGLookupOp extends AbstractSVGFilterConverter {
  @@ -289,5 +289,20 @@
               }*/
   
           return lookupTables;
  +    }
  +
  +
  +    /**
  +     * Utility method for subclasses.
  +     * @return the double value formated as an int if there
  +     *         is no fractional part. This avoids the extra
  +     *         ".0" that a standard convertion gives.
  +     */
  +    public static String doubleString(double value, int precision){
  +        value = Math.round(value*precision)/(double)precision;
  +        if(((int)value) == value)
  +            return Integer.toString((int)value);
  +        else
  +            return Double.toString(value);
       }
   }
  
  
  

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