You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by Apache Wiki <wi...@apache.org> on 2005/06/13 15:20:42 UTC

[Xmlgraphics-batik Wiki] Update of "DragTutorial" by AndresToussaint

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Xmlgraphics-batik Wiki" for change notification.

The following page has been changed by AndresToussaint:
http://wiki.apache.org/xmlgraphics-batik/DragTutorial

------------------------------------------------------------------------------
          public void handleEvent(Event evt) {
  		//perform select, deselect operations, etc...
  		// i.e. assign or validate that you have a draggable item 
-        // in the "selectedItem" object
+                 // in the "selectedItem" object (And define "thisNode" element)
  		
+ 
+                 //For example, "thisNode" can be:
+                 SVGLocatable thisNode = (SVGLocatable)evt.getTarget();
+ 
+                 //End of example. The variable thisNode has the element
+                 // that is the draggableItem. It can be a single Element
+                 // or a G element.  If you are interested in a G element
+                 // you may need a method to locate the desired parent
+                 // of your eventTarget (like parsing the ID attr.) because
+                 // the eventTarget may only be one single element of a
+                 // complex shape, and you want to drag the full complex shape.
+ 
+ 
  		drag = DRAG_DOWN;
  
  		// Set the initial drag point