1 27 28 package org.nightlabs.editor2d.handle; 29 30 import java.util.List ; 31 32 import org.eclipse.draw2d.Polyline; 33 import org.eclipse.draw2d.geometry.PointList; 34 35 import org.nightlabs.editor2d.edit.ShapeDrawComponentEditPart; 36 import org.nightlabs.editor2d.util.J2DUtil; 37 38 39 public class ShapeEditHandleKit 40 { 41 42 public ShapeEditHandleKit() { 43 super(); 44 } 45 46 53 public static void addHandles(ShapeDrawComponentEditPart part, List handles) 54 { 55 63 Polyline polyline = J2DUtil.toPolyline(part.getGeneralShape()); 64 PointList points = polyline.getPoints(); 65 for (int i=0; i<points.size(); i++) 66 { 67 ShapeEditHandle handle = new ShapeEditHandle(part, i); 68 handles.add(handle); 69 } 70 71 } 72 73 } 74 | Popular Tags |