KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > jawe > actions > AddPoint


1 /*
2  * Authors:
3  * Stefanovic Nenad chupo@iis.ns.ac.yu
4  * Bojanic Sasa sasaboy@neobee.net
5  * Puskas Vladimir vpuskas@eunet.yu
6  * Pilipovic Goran zboniek@uns.ac.yu
7  *
8  */

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 JavaDoc;
20 import javax.swing.*;
21 import java.util.*;
22 import java.awt.*;
23
24 /**
25 * Class that realizes <B>AddPoint</B> action.
26 * "Breaking point" is added on transition at the popup position.
27 */

28 public class AddPoint extends ActionBase {
29
30    public AddPoint (ProcessEditor pe) {
31       super(pe);
32    }
33
34    public void actionPerformed(ActionEvent JavaDoc e) {
35       JaWEMarqueeHandler pemh = (JaWEMarqueeHandler)editor.getGraph().getMarqueeHandler();
36       Point addAt=pemh.getPopupPoint();
37       Object JavaDoc transition=editor.getGraph().getSelectionCell();
38       if (transition instanceof Transition) {
39          CellView view=editor.getGraph().getGraphLayoutCache().getMapping(transition,false);
40          TransitionView tv=(TransitionView)view;
41          tv.addPoint(addAt);
42       }
43    }
44 }
45
Popular Tags