deweese     2003/09/27 17:15:03

  Modified:    sources/org/apache/batik/bridge CursorManager.java
               sources/org/apache/batik/dom/svg SVGOMSVGElement.java
  Log:
  1) Fixed a bug in handling of the 'cursor' property.
  2) createSVGTransform now returns a transform with a type of MATRIX.
  
  Revision  Changes    Path
  1.10      +12 -13    xml-batik/sources/org/apache/batik/bridge/CursorManager.java
  
  Index: CursorManager.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/CursorManager.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- CursorManager.java        9 Aug 2003 16:58:37 -0000       1.9
  +++ CursorManager.java        28 Sep 2003 00:15:03 -0000      1.10
  @@ -68,7 +68,6 @@
   import java.util.Map;
   
   import org.apache.batik.css.engine.SVGCSSEngine;
  -import org.apache.batik.css.engine.value.ListValue;
   import org.apache.batik.css.engine.value.Value;
   import org.apache.batik.dom.svg.XMLBaseSupport;
   import org.apache.batik.dom.util.XLinkSupport;
  @@ -198,26 +197,26 @@
        * @param e the element on which the cursor property is set
        */
       public Cursor convertCursor(Element e) {
  -        Value cursorValue 
  -            = CSSUtilities.getComputedStyle(e, 
  -                                            SVGCSSEngine.CURSOR_INDEX);
  +        Value cursorValue = CSSUtilities.getComputedStyle
  +            (e, SVGCSSEngine.CURSOR_INDEX);
   
           String cursorStr = SVGConstants.SVG_AUTO_VALUE;
   
           if (cursorValue != null) {
  -            if (cursorValue.getCssValueType() ==  CSSValue.CSS_PRIMITIVE_VALUE
  +            if (cursorValue.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE
                   &&
                   cursorValue.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) {
                   // Single Value : should be one of the predefined cursors or 
                   // 'inherit'
                   cursorStr = cursorValue.getStringValue();
                   return convertBuiltInCursor(e, cursorStr);
  -            } else if (cursorValue.getCssValueType() == CSSValue.CSS_VALUE_LIST) {
  -                ListValue l = (ListValue)cursorValue;
  -                int nValues = l.getLength();
  +            } else if (cursorValue.getCssValueType() == 
  +                       CSSValue.CSS_VALUE_LIST) {
  +                int nValues = cursorValue.getLength();
                   if (nValues == 1) {
  -                    cursorValue = l.item(nValues-1);
  -                    if (cursorValue.getPrimitiveType() == 
CSSPrimitiveValue.CSS_IDENT) {
  +                    cursorValue = cursorValue.item(0);
  +                    if (cursorValue.getPrimitiveType() == 
  +                        CSSPrimitiveValue.CSS_IDENT) {
                           cursorStr = cursorValue.getStringValue();
                           return convertBuiltInCursor(e, cursorStr);
                       }
  @@ -226,7 +225,7 @@
                       // Look for the first cursor url we can handle.
                       // That would be a reference to a <cursor> element.
                       //
  -                    return convertSVGCursor(e, l);
  +                    return convertSVGCursor(e, cursorValue);
                   }
               }
           } 
  @@ -299,7 +298,7 @@
        * So the caller should check that before calling the method.
        * For example, CSSUtilities.convertCursor performs that check.
        */
  -    public Cursor convertSVGCursor(Element e, ListValue l) {
  +    public Cursor convertSVGCursor(Element e, Value l) {
           int nValues = l.getLength();
           Element cursorElement = null;
           for (int i=0; i<nValues-1; i++) {
  
  
  
  1.24      +6 -4      xml-batik/sources/org/apache/batik/dom/svg/SVGOMSVGElement.java
  
  Index: SVGOMSVGElement.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/svg/SVGOMSVGElement.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- SVGOMSVGElement.java      8 Aug 2003 11:39:00 -0000       1.23
  +++ SVGOMSVGElement.java      28 Sep 2003 00:15:03 -0000      1.24
  @@ -404,10 +404,12 @@
       public SVGRect                createSVGRect (  ) {
           return new SVGOMRect(0,0,0,0);
       }
  -    public SVGTransform           createSVGTransform (  ) {
  -        return new SVGOMTransform();
  +    public SVGTransform createSVGTransform () {
  +        SVGOMTransform ret = new SVGOMTransform();
  +        ret.setType(SVGTransform.SVG_TRANSFORM_MATRIX);
  +        return ret;
       }
  -    public SVGTransform     createSVGTransformFromMatrix ( SVGMatrix matrix ) {
  +    public SVGTransform createSVGTransformFromMatrix ( SVGMatrix matrix ) {
           SVGOMTransform tr = new SVGOMTransform();
           tr.setMatrix(matrix);
           return tr;
  
  
  

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

Reply via email to