i tried what you said but i get a null.. her is a snippet.. this code is
placed on a mousePressed in an interactor:
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);
UserAgentAdapter userAgent = new UserAgentAdapter();
BridgeContext bc = new BridgeContext(userAgent);
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]