xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Javid Alimohideen" <javid...@gmail.com>
Subject RE: ZoomIn Problem
Date Sat, 11 Mar 2006 21:40:56 GMT
Yasmin,
Is the red circle a SVG element, in which case you can add event listeners
to the element and change it's attributes.

Sample Snippet code:

Element element = doc.getElementBydId("red_cicle");
element.addEventListener("click", new CircleAction(), false);

public class CircleAction implements EventListener
{
	public void handleEvent(Event evt)
	{
		Element elt = (Element) evt.getCurrentTarget();
		if (evt.getType() == "click")
		{
			elt.setAttributeNS(SVG_NS, "fill", "<color code");
		}
	}
}

Hope it helps,
You wouldn't have to implement MouseListener or MouseMotionListener and
implements those mouse events.


Thanks,
Javid

-----Original Message-----
From: rafiqy@blueyonder.co.uk [mailto:rafiqy@blueyonder.co.uk]
Sent: Saturday, March 11, 2006 3:18 PM
To: batik-users@xmlgraphics.apache.org
Subject: ZoomIn Problem


Hi there,

I'm having problems with zoomIn to my JSVGCanvas, What I'm trying to
achieve is when a user clicks on red circls on the map the circls changes
colour to yellow, well that is fine before I zoomIn - afterwards when I
click on the red circle it does not change colour, I think I know where
the problem is, I've coded my mouseClick event, so that when the user
clicks the code checks the distance between the click and the circles, the
Point2D of the circles are stored in an array But when I zoomIn the
location of the circles have changed but how to I update the new locations
in my array????

Many Tx inadvance,

Yasmin


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


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


Mime
View raw message