1 9 10 package org.enhydra.jawe.actions; 11 12 import org.jgraph.graph.*; 13 14 import org.enhydra.jawe.*; 15 import org.enhydra.jawe.graph.*; 16 import org.enhydra.jawe.xml.*; 17 import org.enhydra.jawe.xml.panels.*; 18 19 import java.awt.event.ActionEvent ; 20 import java.awt.*; 21 import javax.swing.*; 22 import java.util.*; 23 24 29 public class RemovePoint extends ActionBase { 30 31 public RemovePoint (ProcessEditor pe) { 32 super(pe); 33 } 34 35 public void actionPerformed(ActionEvent e) { 36 JaWEMarqueeHandler pemh = (JaWEMarqueeHandler)editor.getGraph().getMarqueeHandler(); 37 Point removeAt=pemh.getPopupPoint(); 38 Object transition=editor.getGraph().getSelectionCell(); 39 if (transition instanceof Transition) { 40 CellView view=editor.getGraph().getGraphLayoutCache().getMapping(transition,false); 41 TransitionView tv=(TransitionView)view; 42 tv.removePoint(removeAt); 43 Transition tr=(Transition)transition; 45 org.enhydra.jawe.xml.elements.Transition t= 46 (org.enhydra.jawe.xml.elements.Transition) 47 tr.getUserObject(); 48 int noOfPoints=tv.getPointCount(); 49 Map pnts=new Hashtable(); 50 for (int i=1; i<noOfPoints-1; i++) { 51 pnts.put(new Integer (i),new Point((int)tv.getPoint(i).getX(),(int)tv.getPoint(i).getY())); } 53 t.setBreakPoints(pnts); 54 } 55 } 56 } 57 | Popular Tags |