xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sudhakar S <yessudha...@hotmail.com>
Subject Multiple Group Elements Selection and Moving
Date Fri, 16 Jun 2006 15:44:10 GMT

Hi All,

I am trying to implement multiple group elements moving feature based on the
mouse selection. But after selected the multiple group elements, if I tried
to move all the selected group elements using translate, it is not moving
properly. The Element, which is selected last, is moving properly along with
mouse cursor, but others are not. 

In MouseDownAction, I am storing the all the selected group elements in
Object array. Also storing the final selection position using following

startPt = localPt((Element)grpElement, elEvt.getClientX(),

In MouseMoveAction, I am trying to move all the selected elements using
following code.

SVGPoint pt = localPt((Element)selElement.getParentNode(),
elEvt.getClientX(), elEvt.getClientY());

float dx = pt .getX() - startPt.getX();
float dy = pt.getY() - startPt.getY();

Element elements[] = getSelectedElements();
for (int i = 0; i < elements.length; i++) {
elements[i].setAttribute("transform", "translate(" + dx + ", " + dy + ")");

Can anyone please explain, why its not moving properly?


View this message in context: http://www.nabble.com/Multiple-Group-Elements-Selection-and-Moving-t1799038.html#a4902855
Sent from the Batik - Users forum at Nabble.com.

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

View raw message