Package org.apache.flex.forks.batik.gvt

Examples of org.apache.flex.forks.batik.gvt.GraphicsNode


        }

        public void mouseExited(GraphicsNodeMouseEvent evt) {
            Point clientXY = evt.getClientPoint();
            // Get the 'new' node for the DOM event.
            GraphicsNode node = evt.getRelatedNode();
            Element targetElement = getEventTarget(node, clientXY);
            if (lastTargetElement != null) {
                dispatchMouseEvent("mouseout",
                                   lastTargetElement, // target
                                   targetElement,     // relatedTarget
View Full Code Here


            dispatchMouseEvent("mousemove", evt, false);
        }

        public void mouseMoved(GraphicsNodeMouseEvent evt) {
            Point clientXY = evt.getClientPoint();
            GraphicsNode node = evt.getGraphicsNode();
            Element targetElement = getEventTarget(node, clientXY);
            Element holdLTE = lastTargetElement;
            if (holdLTE != targetElement) {
                if (holdLTE != null) {
                    dispatchMouseEvent("mouseout",
View Full Code Here

         */
        protected void dispatchMouseEvent(String eventType,
                                          GraphicsNodeMouseEvent evt,
                                          boolean cancelable) {
            Point clientXY = evt.getClientPoint();
            GraphicsNode node = evt.getGraphicsNode();
            Element targetElement = getEventTarget
                (node, new Point2D.Float(evt.getX(), evt.getY()));
            Element relatedElement = getRelatedElement(evt);
            dispatchMouseEvent(eventType,
                               targetElement,
View Full Code Here

         * Returns the related element according to the specified event.
         *
         * @param evt the GVT GraphicsNodeMouseEvent
         */
        protected Element getRelatedElement(GraphicsNodeMouseEvent evt) {
            GraphicsNode relatedNode = evt.getRelatedNode();
            Element relatedElement = null;
            if (relatedNode != null) {
                relatedElement = context.getElement(relatedNode);
            }
            return relatedElement;
View Full Code Here

        contentElement.setAttributeNS(null, SVG_HEIGHT_ATTRIBUTE, "" + primitiveRegion.getHeight());
       
        // System.err.println(">>>>>>>>>>>> primitiveRegion : " + primitiveRegion);
        // System.err.println(">>>>>>>>>>>> at              : " + at);

        GraphicsNode node = ctx.getGVTBuilder().build(ctx, proxyElement);
        Filter filter = node.getGraphicsNodeRable(true);
       
        filter = new AffineRable8Bit(filter, at);

        // handle the 'color-interpolation-filters' property
        handleColorInterpolationFilters(filter, filterElement);
View Full Code Here

        // image (PNG, JPEG or SVG image).
        // VH & TK, 03/08/2002
        // Furthermore, for feImage referencing doc fragment, should act
        // like a <use>, i.e., CSS cascading and the whole zing bang.
        //
        GraphicsNode node = ctx.getGVTBuilder().build(ctx, refElement);
        Filter filter = node.getGraphicsNodeRable(true);

        AffineTransform at = new AffineTransform();

        if (toBBoxNeeded){
            // 'primitiveUnits' attribute - default is userSpaceOnUse
View Full Code Here

        Rectangle2D rect = new Rectangle2D.Float(svgRect.getX(),
                                                 svgRect.getY(),
                                                 svgRect.getWidth(),
                                                 svgRect.getHeight());

        GraphicsNode svgGN = ctx.getGraphicsNode(e);
        if (svgGN == null) return ret;

        Rectangle2D svgBounds = svgGN.getSensitiveBounds();
        if (svgBounds == null)
            return ret;

        // If the svg elem doesn't intersect none of the children
        // will.
        if (!rect.intersects(svgBounds))
            return ret;

        Element base = e;
        AffineTransform ati = svgGN.getGlobalTransform();
        try {
            ati = ati.createInverse();
        } catch (NoninvertibleTransformException e) {
        }
       
        Element curr;
        Node    next = base.getFirstChild();
        while (next != null) {
            if (next instanceof Element)
                break;
            next = next.getNextSibling();
        }
        if (next == null) return ret;
        curr = (Element)next;

        Set ancestors = null;
        if (end != null) {
            ancestors = getAncestors(end, base);
            if (ancestors == null)
                end = null;
        }
        while (curr != null) {
            String nsURI = curr.getNamespaceURI();
            String tag = curr.getLocalName();
            boolean isGroup;
            isGroup = (SVGConstants.SVG_NAMESPACE_URI.equals(nsURI) &&
                       ((SVGConstants.SVG_G_TAG.equals(tag)) ||
                        (SVGConstants.SVG_SVG_TAG.equals(tag)) ||
                        (SVGConstants.SVG_A_TAG.equals(tag))));

            GraphicsNode gn = ctx.getGraphicsNode(curr);
            if (gn == null) {
                // No graphics node but check if curr is an
                // ancestor of end.
                if ((ancestors != null) && (ancestors.contains(curr)))
                    break;
                curr = getNext(curr, base, end);
                continue;
            }
               

            AffineTransform at = gn.getGlobalTransform();
            Rectangle2D gnBounds = gn.getSensitiveBounds();
            at.preConcatenate(ati);
            if (gnBounds != null)
                gnBounds = at.createTransformedShape(gnBounds).getBounds2D();
               
            if ((gnBounds == null) ||
View Full Code Here

        List ret = new ArrayList();
        Rectangle2D rect = new Rectangle2D.Float(svgRect.getX(),
                                                 svgRect.getY(),
                                                 svgRect.getWidth(),
                                                 svgRect.getHeight());
        GraphicsNode svgGN     = ctx.getGraphicsNode(e);
        if (svgGN == null) return ret;

        Rectangle2D  svgBounds = svgGN.getSensitiveBounds();
        if (svgBounds == null)
            return ret;

        // If the svg elem doesn't at least intersect none of the
        // children will be enclosed.
        if (!rect.intersects(svgBounds))
            return ret;

        Element base = e;
        AffineTransform ati = svgGN.getGlobalTransform();
        try {
            ati = ati.createInverse();
        } catch (NoninvertibleTransformException e) {
        }
       
        Element curr;
        Node    next = base.getFirstChild();
        while (next != null) {
            if (next instanceof Element)
                break;
            next = next.getNextSibling();
        }

        if (next == null) return ret;
        curr = (Element)next;

        Set ancestors = null;
        if (end != null) {
            ancestors = getAncestors(end, base);
            if (ancestors == null)
                end = null;
        }

        while (curr != null) {
            String nsURI = curr.getNamespaceURI();
            String tag = curr.getLocalName();
            boolean isGroup;
            isGroup = (SVGConstants.SVG_NAMESPACE_URI.equals(nsURI) &&
                       ((SVGConstants.SVG_G_TAG.equals(tag)) ||
                        (SVGConstants.SVG_SVG_TAG.equals(tag)) ||
                        (SVGConstants.SVG_A_TAG.equals(tag))));

            GraphicsNode gn = ctx.getGraphicsNode(curr);
            if (gn == null) {
                // No graphics node but check if curr is an
                // ancestor of end.
                if ((ancestors != null) && (ancestors.contains(curr)))
                    break;
                curr = getNext(curr, base, end);
                continue;
            }
               

            AffineTransform at = gn.getGlobalTransform();
            Rectangle2D gnBounds = gn.getSensitiveBounds();
            at.preConcatenate(ati);
            if (gnBounds != null)
                gnBounds = at.createTransformedShape(gnBounds).getBounds2D();

            if ((gnBounds == null) ||
View Full Code Here

        return ret;
    }

    public boolean checkIntersection (Element element, SVGRect svgRect ) {

        GraphicsNode svgGN = ctx.getGraphicsNode(e);
        if (svgGN == null) return false; // not in tree?

        Rectangle2D rect = new Rectangle2D.Float
            (svgRect.getX(),     svgRect.getY(),
             svgRect.getWidth(), svgRect.getHeight());
        AffineTransform ati = svgGN.getGlobalTransform();

        try {
            ati = ati.createInverse();
        } catch (NoninvertibleTransformException e) {  }

        SVGContext svgctx = null;
        if (element instanceof SVGOMElement) {
            svgctx  = ((SVGOMElement)element).getSVGContext();
            if ((svgctx instanceof SVGTextElementBridge) ||
                (svgctx instanceof
                 SVGTextElementBridge.AbstractTextChildSVGContext)) {
                return SVGTextElementBridge.getTextIntersection
                    (ctx, element, ati, rect, true);
            }
        }

        Rectangle2D gnBounds = null;
        GraphicsNode gn    = ctx.getGraphicsNode(element);
        if (gn != null)
            gnBounds = gn.getSensitiveBounds();

        if (gnBounds == null) return false;


        AffineTransform at = gn.getGlobalTransform();
        at.preConcatenate(ati);

        gnBounds = at.createTransformedShape(gnBounds).getBounds2D();
        if (!rect.intersects(gnBounds))
            return false;
View Full Code Here

        return false;
    }

    public boolean checkEnclosure (Element element, SVGRect svgRect ) {
        GraphicsNode gn    = ctx.getGraphicsNode(element);
        Rectangle2D gnBounds = null;
        SVGContext svgctx = null;
        if (element instanceof SVGOMElement) {
            svgctx  = ((SVGOMElement)element).getSVGContext();
            if ((svgctx instanceof SVGTextElementBridge) ||
                (svgctx instanceof
                 SVGTextElementBridge.AbstractTextChildSVGContext)) {
                gnBounds = SVGTextElementBridge.getTextBounds
                    (ctx, element, true);
                Element p = (Element)element.getParentNode();
                // Get GN for text children so we can get transform.
                while ((p != null) && (gn == null)) {
                    gn = ctx.getGraphicsNode(p);
                    p = (Element)p.getParentNode();
                }
            } else if (gn != null)
                gnBounds = gn.getSensitiveBounds();
        } else if (gn != null)
            gnBounds = gn.getSensitiveBounds();

        if (gnBounds == null) return false;

        GraphicsNode svgGN = ctx.getGraphicsNode(e);
        if (svgGN == null) return false; // not in tree?

        Rectangle2D rect = new Rectangle2D.Float
            (svgRect.getX(),     svgRect.getY(),
             svgRect.getWidth(), svgRect.getHeight());
        AffineTransform ati = svgGN.getGlobalTransform();
        try {
            ati = ati.createInverse();
        } catch (NoninvertibleTransformException e) {  }

        AffineTransform at = gn.getGlobalTransform();
View Full Code Here

TOP

Related Classes of org.apache.flex.forks.batik.gvt.GraphicsNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.