Hi Hardcod3r,
hardc0d3r <[EMAIL PROTECTED]> wrote on 07/13/2008 09:44:24 PM:
> JGVTComponent c = (JGVTComponent) e.getSource();
> Point2D p = new Point2D.Float(e.getX(), e.getY());
> try {
> AffineTransform bt =
c.getRenderingTransform().createInverse();
> p = bt.transform(p, null);
> } catch(Exception ex) {
> }
> GraphicsNode gn = c.getGraphicsNode().nodeHitAt(p);
This is the problem:
> UserAgentAdapter userAgent = new UserAgentAdapter();
> BridgeContext bc = new BridgeContext(userAgent);
You need to get the BridgeContext from the Canvas. The
simplest way to get it is with:
BridgeContext bc = c.getUpdateManager().getBridgeContext();
> SVGElement domE = (SVGElement) bc.getElement(gn);
> System.out.println(domE == null);
>
> what am i doing wrong here?
>
>
> thomas.deweese wrote:
> >
> > Hi Hardc0d3r,
> >
> > hardc0d3r <[EMAIL PROTECTED]> wrote on 07/12/2008 09:27:51 PM:
> >
> >> is this possible? i can paint on the overlay just fine.. i just need
to
> > know
> >> if it is possible 2 get the element under the clicked point in the
> > overlay..
> >
> > MouseEvent evt;
> >
> > Point2D p = new Point2D.Float(evt.getX(), evt.getY());
> > AffineTransform bt =
canvas.getRenderingTransform().createInverse();
> > p = bt.transform(p);
> > GraphicsNode gn = canvas.getGraphicsNode().nodeHitAt(gnp);
> > Element domE = bridgeCtx.getElement(gn);
> >
> > Note that the RenderingTransform can be null so you should
> > check for that (and in that case you can simply use 'p' as is.
> >
> >> hardc0d3r wrote:
> >> >
> >> > ok.. let me rephrase the question.. how can i get an element in the
> > svg if
> >> > there is an overlay? for example, when i clicked on an element but
> > there's
> >> > an overlay, how can i get the element below the point where i
clicked?
> >> >
> >>
> >> --
> >> View this message in context: http://www.nabble.com/getting-the-
> >> element-in-svg-from-an-overlay-tp18301441p18425405.html
> >> Sent from the Batik - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
[EMAIL PROTECTED]
> >> For additional commands, e-mail:
[EMAIL PROTECTED]
> >>
> >
> >
>
> --
> View this message in context: http://www.nabble.com/getting-the-
> element-in-svg-from-an-overlay-tp18301441p18436175.html
> Sent from the Batik - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>