KickJava   Java API By Example, From Geeks To Geeks.

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


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>SetSimpleRouting</B> action.
26 */

27 public class SetNoRouting extends ActionBase {
28
29    public SetNoRouting (ProcessEditor pe) {
30       super(pe);
31    }
32
33    public void actionPerformed(ActionEvent JavaDoc e) {
34       Object JavaDoc transition=editor.getGraph().getSelectionCell();
35       if (transition instanceof Transition) {
36          // updating xml object
37
Transition tr=(Transition)transition;
38          Map propertyMap = new HashMap();
39          Map map = GraphConstants.cloneMap(tr.getAttributes());
40          GraphConstants.setRouting(map,new NoRouting());
41          propertyMap.put(tr,map);
42          String JavaDoc undoMsg=ResourceManager.getLanguageDependentString("MessageSettingTransitionTypeToNoRouting");
43          ((JaWEGraphModel)editor.getGraph().getModel()).insertAndEdit(null,propertyMap,null,null,null,undoMsg);
44       }
45    }
46 }
47
Popular Tags