1 8 package com.nightlabs.editor2d.handle; 9 10 import java.util.List ; 11 12 import org.eclipse.draw2d.Polyline; 13 import org.eclipse.draw2d.geometry.PointList; 14 15 import com.nightlabs.editor2d.edit.ShapeDrawComponentEditPart; 16 import com.nightlabs.editor2d.util.J2DUtil; 17 18 19 public class ShapeEditHandleKit 20 { 21 22 public ShapeEditHandleKit() { 23 super(); 24 } 25 26 33 public static void addHandles(ShapeDrawComponentEditPart part, List handles) 34 { 35 43 Polyline polyline = J2DUtil.toPolyline(part.getGeneralShape()); 44 PointList points = polyline.getPoints(); 45 for (int i=0; i<points.size(); i++) 46 { 47 ShapeEditHandle handle = new ShapeEditHandle(part, i); 48 handles.add(handle); 49 } 50 51 } 52 53 } 54 | Popular Tags |