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 tk...@apache.org on 2001/12/19 13:10:09 UTC

cvs commit: xml-batik/sources/org/apache/batik/gvt AbstractGraphicsNode.java GraphicsNode.java GraphicsNodeHitDetector.java

tkormann    01/12/19 04:10:09

  Modified:    sources/org/apache/batik/bridge
                        SVGClipPathElementBridge.java
               sources/org/apache/batik/gvt AbstractGraphicsNode.java
                        GraphicsNode.java
  Removed:     sources/org/apache/batik/gvt GraphicsNodeHitDetector.java
  Log:
  - remove GraphicsNodeHitDetector (for a future development of pointer-events)
  - change ClipPath bridge so that no additional methods are required on GVT
  
  Revision  Changes    Path
  1.14      +9 -3      xml-batik/sources/org/apache/batik/bridge/SVGClipPathElementBridge.java
  
  Index: SVGClipPathElementBridge.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/SVGClipPathElementBridge.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- SVGClipPathElementBridge.java	2001/12/10 14:20:11	1.13
  +++ SVGClipPathElementBridge.java	2001/12/19 12:10:09	1.14
  @@ -27,7 +27,7 @@
    * Bridge class for the <clipPath> element.
    *
    * @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
  - * @version $Id: SVGClipPathElementBridge.java,v 1.13 2001/12/10 14:20:11 tkormann Exp $
  + * @version $Id: SVGClipPathElementBridge.java,v 1.14 2001/12/19 12:10:09 tkormann Exp $
    */
   public class SVGClipPathElementBridge extends AbstractSVGBridge
       implements ClipBridge {
  @@ -114,8 +114,14 @@
   
               // compute the outline of the current clipPath's child
               int wr = CSSUtilities.convertClipRule(child);
  -            GeneralPath path =
  -                new GeneralPath(clipNode.getTransformedOutline());
  +            GeneralPath path;
  +            Shape cno = clipNode.getOutline();
  +            AffineTransform cnt = clipNode.getTransform();
  +            if (cnt != null) {
  +                path = new GeneralPath(cnt.createTransformedShape(cno));
  +            } else {
  +                path = new GeneralPath(cno);
  +            }
               path.setWindingRule(wr);
               Shape outline = Tx.createTransformedShape(path);
   
  
  
  
  1.28      +2 -42     xml-batik/sources/org/apache/batik/gvt/AbstractGraphicsNode.java
  
  Index: AbstractGraphicsNode.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/gvt/AbstractGraphicsNode.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- AbstractGraphicsNode.java	2001/12/10 14:20:11	1.27
  +++ AbstractGraphicsNode.java	2001/12/19 12:10:09	1.28
  @@ -51,7 +51,7 @@
    * @author <a href="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a>
    * @author <a href="mailto:etissandier@ilog.fr">Emmanuel Tissandier</a>
    * @author <a href="mailto:Thomas.DeWeeese@Kodak.com">Thomas DeWeese</a>
  - * @version $Id: AbstractGraphicsNode.java,v 1.27 2001/12/10 14:20:11 tkormann Exp $
  + * @version $Id: AbstractGraphicsNode.java,v 1.28 2001/12/19 12:10:09 tkormann Exp $
    */
   public abstract class AbstractGraphicsNode implements GraphicsNode {
   
  @@ -61,11 +61,6 @@
       protected EventListenerList listeners;
   
       /**
  -     * The hit detector used to filter mouse events.
  -     */
  -    protected GraphicsNodeHitDetector hitDetector;
  -
  -    /**
        * The transform of this graphics node.
        */
       protected AffineTransform transform;
  @@ -602,22 +597,6 @@
       }
   
       /**
  -     * Sets the hit detector for this node.
  -     *
  -     * @param hitDetector the new hit detector
  -     */
  -    public void setGraphicsNodeHitDetector(GraphicsNodeHitDetector hitDetector){
  -        this.hitDetector = hitDetector;
  -    }
  -
  -    /**
  -     * Returns the hit detector for this node.
  -     */
  -    public GraphicsNodeHitDetector getGraphicsNodeHitDetector() {
  -        return hitDetector;
  -    }
  -
  -    /**
        * Dispatches a graphics node mouse event to this node or one of its child.
        *
        * @param evt the evt to dispatch
  @@ -927,31 +906,12 @@
       }
   
       /**
  -     * Returns the transformed outline of this node.
  -     */
  -    public Shape getTransformedOutline() {
  -        if (transform != null) {
  -            return transform.createTransformedShape(getOutline());
  -        } else {
  -            return getOutline();
  -        }
  -    }
  -
  -    /**
        * Returns the GraphicsNode containing point p if this node or one of its
        * children is sensitive to mouse events at p.
        *
        * @param p the specified Point2D in the user space
        */
       public GraphicsNode nodeHitAt(Point2D p) {
  -        if (hitDetector != null) {
  -            if (hitDetector.isHit(this, p)) {
  -                return this;
  -            } else {
  -                return null;
  -            }
  -        } else {
  -            return (contains(p) ? this : null);
  -        }
  +        return (contains(p) ? this : null);
       }
   }
  
  
  
  1.30      +1 -19     xml-batik/sources/org/apache/batik/gvt/GraphicsNode.java
  
  Index: GraphicsNode.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/gvt/GraphicsNode.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- GraphicsNode.java	2001/12/10 14:20:12	1.29
  +++ GraphicsNode.java	2001/12/19 12:10:09	1.30
  @@ -34,7 +34,7 @@
    *
    * @author <a href="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a>
    * @author <a href="mailto:etissandier@ilog.fr">Emmanuel Tissandier</a>
  - * @version $Id: GraphicsNode.java,v 1.29 2001/12/10 14:20:12 tkormann Exp $
  + * @version $Id: GraphicsNode.java,v 1.30 2001/12/19 12:10:09 tkormann Exp $
    */
   public interface GraphicsNode {
   
  @@ -228,18 +228,6 @@
       void removeGraphicsNodeKeyListener(GraphicsNodeKeyListener l);
   
       /**
  -     * Sets the hit detector for this node.
  -     *
  -     * @param hitDetector the new hit detector
  -     */
  -    void setGraphicsNodeHitDetector(GraphicsNodeHitDetector hitDetector);
  -
  -    /**
  -     * Returns the hit detector for this node.
  -     */
  -    GraphicsNodeHitDetector getGraphicsNodeHitDetector();
  -
  -    /**
        * Dispatches a graphics node mouse event to this node or one of its child.
        *
        * @param evt the evt to dispatch
  @@ -356,10 +344,4 @@
        * Returns the outline of this node.
        */
       Shape getOutline();
  -
  -    /**
  -     * Returns the transformed outline of this node.
  -     */
  -    Shape getTransformedOutline();
  -
   }
  
  
  

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