Mercurial > hg > graal-jvmci-8
annotate src/share/tools/IdealGraphVisualizer/ControlFlowEditor/src/at/ssw/visualizer/cfg/editor/CfgEditorTopComponent.java @ 4494:e55e2fca50fa
Removed SelectionCoordinator; now CFG and Graph view working in parallel.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Thu, 02 Feb 2012 17:51:39 +0100 |
parents | aae5b3773e63 |
children |
rev | line source |
---|---|
4487
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 package at.ssw.visualizer.cfg.editor; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
2 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
3 import at.ssw.visualizer.cfg.action.ShowAllAction; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
4 import at.ssw.visualizer.cfg.action.ColorAction; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
5 import at.ssw.visualizer.cfg.action.ExportAction; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
6 import at.ssw.visualizer.cfg.action.HideEdgesAction; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
7 import at.ssw.visualizer.cfg.action.HierarchicalCompoundLayoutAction; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
8 import at.ssw.visualizer.cfg.action.HierarchicalNodeLayoutAction; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
9 import at.ssw.visualizer.cfg.action.ShowEdgesAction; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
10 import at.ssw.visualizer.cfg.action.SwitchLoopClustersAction; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
11 import at.ssw.visualizer.cfg.action.UseBezierRouterAction; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
12 import at.ssw.visualizer.cfg.action.UseDirectLineRouterAction; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
13 import at.ssw.visualizer.cfg.action.ZoominAction; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
14 import at.ssw.visualizer.cfg.action.ZoomoutAction; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
15 import at.ssw.visualizer.cfg.graph.CfgEventListener; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
16 import at.ssw.visualizer.cfg.graph.CfgScene; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
17 import at.ssw.visualizer.cfg.graph.EdgeWidget; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
18 import at.ssw.visualizer.cfg.graph.NodeWidget; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
19 import at.ssw.visualizer.cfg.model.CfgEdge; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
20 import at.ssw.visualizer.cfg.model.CfgNode; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
21 import at.ssw.visualizer.cfg.preferences.CfgPreferences; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
22 import at.ssw.visualizer.cfg.preferences.FlagsSetting; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
23 import javax.swing.ScrollPaneConstants; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 import at.ssw.visualizer.model.cfg.ControlFlowGraph; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
25 import java.awt.BorderLayout; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
26 import java.awt.Color; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
27 import java.beans.PropertyChangeEvent; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
28 import java.beans.PropertyChangeListener; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
29 import javax.swing.BorderFactory; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
30 import javax.swing.ButtonGroup; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
31 import javax.swing.JComponent; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
32 import javax.swing.JScrollPane; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
33 import javax.swing.JToggleButton; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
34 import javax.swing.UIManager; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
35 import javax.swing.border.Border; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
36 import org.netbeans.api.visual.widget.Widget; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
37 import org.openide.awt.Toolbar; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
38 import org.openide.util.ImageUtilities; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
39 import org.openide.windows.CloneableTopComponent; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
40 import org.openide.windows.TopComponent; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
41 import org.openide.util.actions.SystemAction; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
42 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
43 public class CfgEditorTopComponent extends CloneableTopComponent implements PropertyChangeListener { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
44 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
45 private CfgScene scene; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
46 private JScrollPane jScrollPane; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
47 private ControlFlowGraph cfg; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
48 private JComponent myView; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
49 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
50 public CfgEditorTopComponent(ControlFlowGraph cfg) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
51 this.cfg = cfg; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
52 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
53 setIcon(ImageUtilities.loadImage("at/ssw/visualizer/cfg/icons/cfg.gif")); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
54 // setName(cfg.getParent().getShortName()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
55 // setToolTipText(cfg.getCompilation().getMethod() + " - " + cfg.getName()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
56 // TODO(tw): Add title. |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
57 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
58 //panel setup |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
59 this.jScrollPane = new JScrollPane(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
60 this.jScrollPane.setOpaque(true); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
61 this.jScrollPane.setBorder(BorderFactory.createEmptyBorder()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
62 this.jScrollPane.setViewportBorder(BorderFactory.createEmptyBorder()); |
4494
e55e2fca50fa
Removed SelectionCoordinator; now CFG and Graph view working in parallel.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4487
diff
changeset
|
63 this.scene = new CfgScene(jScrollPane, cfg); |
4487
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
64 this.myView = scene.createView(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
65 this.jScrollPane.setViewportView(myView); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
66 this.setLayout(new BorderLayout()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
67 this.add(createToolbar(), BorderLayout.NORTH); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
68 this.add(jScrollPane, BorderLayout.CENTER); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
69 jScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
70 jScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
71 jScrollPane.getVerticalScrollBar().setEnabled(true); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
72 jScrollPane.getHorizontalScrollBar().setEnabled(true); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
73 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
74 //setup enviroment,register listeners |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
75 // TODO(tw): Add to lookup. |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
76 // selection = new Selection(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
77 // selection.put(cfg); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
78 // selection.put(scene); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
79 // selection.addChangeListener(scene); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
80 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
81 scene.validate(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
82 scene.applyLayout(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
83 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
84 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
85 public ControlFlowGraph getCfg() { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
86 return cfg; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
87 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
88 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
89 public JScrollPane getJScrollPanel() { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
90 return jScrollPane; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
91 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
92 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
93 public CfgScene getCfgScene() { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
94 return scene; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
95 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
96 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
97 @Override |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
98 public int getPersistenceType() { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
99 return TopComponent.PERSISTENCE_NEVER; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
100 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
101 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
102 @Override |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
103 protected void componentOpened() { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
104 super.componentOpened(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
105 CfgPreferences.getInstance().addPropertyChangeListener(this); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
106 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
107 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
108 @Override |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
109 protected void componentActivated() { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
110 super.componentActivated(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
111 // SelectionManager.getDefault().setSelection(selection); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
112 this.getCfgScene().updateGlobalSelection(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
113 this.getCfgScene().fireSelectionChanged(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
114 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
115 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
116 @Override |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
117 protected void componentClosed() { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
118 super.componentClosed(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
119 // SelectionManager.getDefault().removeSelection(selection); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
120 CfgPreferences.getInstance().removePropertyChangeListener(this); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
121 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
122 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
123 @Override |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
124 protected CloneableTopComponent createClonedObject() { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
125 CfgEditorTopComponent component = new CfgEditorTopComponent(cfg); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
126 component.setActivatedNodes(getActivatedNodes()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
127 return component; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
128 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
129 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
130 public void propertyChange(PropertyChangeEvent evt) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
131 if (this.scene != null) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
132 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
133 String propName = evt.getPropertyName(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
134 CfgPreferences prefs = CfgPreferences.getInstance(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
135 if (propName.equals(CfgPreferences.PROP_BACKGROUND_COLOR)) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
136 scene.setBackground(prefs.getBackgroundColor()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
137 scene.revalidate(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
138 } else if (propName.equals(CfgPreferences.PROP_NODE_COLOR)) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
139 for (NodeWidget nw : scene.getNodeWidgets()) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
140 //only change the node color if its not a custom color |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
141 if (!nw.isNodeColorCustomized()) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
142 nw.setNodeColor(prefs.getNodeColor(), false); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
143 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
144 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
145 } else if (propName.equals(CfgPreferences.PROP_EDGE_COLOR)) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
146 for (CfgEdge e : scene.getEdges()) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
147 if (!e.isBackEdge() && !e.isXhandler()) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
148 EdgeWidget w = (EdgeWidget) scene.findWidget(e); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
149 w.setLineColor(prefs.getEdgeColor()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
150 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
151 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
152 } else if (propName.equals(CfgPreferences.PROP_BACK_EDGE_COLOR)) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
153 for (CfgEdge e : scene.getEdges()) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
154 if (e.isBackEdge()) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
155 EdgeWidget w = (EdgeWidget) scene.findWidget(e); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
156 w.setLineColor(prefs.getBackedgeColor()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
157 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
158 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
159 } else if (propName.equals(CfgPreferences.PROP_EXCEPTION_EDGE_COLOR)) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
160 for (CfgEdge e : scene.getEdges()) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
161 if (e.isXhandler()) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
162 EdgeWidget w = (EdgeWidget) scene.findWidget(e); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
163 w.setLineColor(prefs.getExceptionEdgeColor()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
164 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
165 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
166 } else if (propName.equals(CfgPreferences.PROP_BORDER_COLOR)) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
167 for (CfgNode n : scene.getNodes()) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
168 NodeWidget nw = (NodeWidget) scene.findWidget(n); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
169 nw.setBorderColor(prefs.getBorderColor()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
170 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
171 } else if (propName.equals(CfgPreferences.PROP_TEXT_FONT)) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
172 for (CfgNode n : scene.getNodes()) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
173 NodeWidget nw = (NodeWidget) scene.findWidget(n); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
174 nw.adjustFont(prefs.getTextFont()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
175 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
176 } else if (propName.equals(CfgPreferences.PROP_TEXT_COLOR)) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
177 for (CfgNode n : scene.getNodes()) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
178 NodeWidget nw = (NodeWidget) scene.findWidget(n); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
179 nw.setForeground(prefs.getTextColor()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
180 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
181 } else if (propName.equals(CfgPreferences.PROP_FLAGS)) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
182 FlagsSetting fs = CfgPreferences.getInstance().getFlagsSetting(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
183 for (CfgNode n : scene.getNodes()) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
184 NodeWidget nw = (NodeWidget) scene.findWidget(n); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
185 Color nodeColor = fs.getColor(n.getBasicBlock().getFlags()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
186 if (nodeColor != null) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
187 nw.setNodeColor(nodeColor, true); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
188 } else { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
189 nw.setNodeColor(CfgPreferences.getInstance().getNodeColor(), false); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
190 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
191 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
192 } else if (propName.equals(CfgPreferences.PROP_SELECTION_COLOR_BG) || propName.equals(CfgPreferences.PROP_SELECTION_COLOR_FG)) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
193 for (CfgNode n : scene.getNodes()) { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
194 Widget w = scene.findWidget(n); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
195 w.revalidate(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
196 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
197 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
198 scene.validate(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
199 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
200 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
201 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
202 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
203 private Toolbar createToolbar() { |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
204 Toolbar tb = new Toolbar("CfgToolbar"); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
205 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
206 tb.setBorder((Border) UIManager.get("Nb.Editor.Toolbar.border")); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
207 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
208 //zoomin/zoomout buttons |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
209 tb.add(SystemAction.get(ZoominAction.class).getToolbarPresenter()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
210 tb.add(SystemAction.get(ZoomoutAction.class).getToolbarPresenter()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
211 tb.addSeparator(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
212 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
213 //router buttons |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
214 ButtonGroup routerButtons = new ButtonGroup(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
215 UseDirectLineRouterAction direct = SystemAction.get(UseDirectLineRouterAction.class); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
216 UseBezierRouterAction bezier = SystemAction.get(UseBezierRouterAction.class); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
217 JToggleButton button = (JToggleButton) direct.getToolbarPresenter(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
218 button.getModel().setGroup(routerButtons); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
219 button.setSelected(true); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
220 tb.add(button); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
221 button = (JToggleButton) bezier.getToolbarPresenter(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
222 button.getModel().setGroup(routerButtons); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
223 tb.add(button); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
224 tb.addSeparator(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
225 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
226 //layout buttons |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
227 tb.add(SystemAction.get(HierarchicalNodeLayoutAction.class).getToolbarPresenter()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
228 tb.add(SystemAction.get(HierarchicalCompoundLayoutAction.class).getToolbarPresenter()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
229 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
230 tb.addSeparator(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
231 tb.add(SystemAction.get(ShowAllAction.class).getToolbarPresenter()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
232 tb.addSeparator(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
233 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
234 //cluster button |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
235 tb.add(SystemAction.get(SwitchLoopClustersAction.class).getToolbarPresenter()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
236 tb.addSeparator(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
237 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
238 //show/hide edge button |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
239 tb.add(SystemAction.get(ShowEdgesAction.class).getToolbarPresenter()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
240 tb.add(SystemAction.get(HideEdgesAction.class).getToolbarPresenter()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
241 tb.addSeparator(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
242 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
243 //color button |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
244 JComponent colorButton = SystemAction.get(ColorAction.class).getToolbarPresenter(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
245 getCfgScene().addCfgEventListener((CfgEventListener) colorButton); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
246 tb.add(colorButton); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
247 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
248 //export button |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
249 tb.add(SystemAction.get(ExportAction.class).getToolbarPresenter()); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
250 tb.doLayout(); |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
251 |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
252 return tb; |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
253 } |
aae5b3773e63
Added CFG editor from c1visualizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
254 } |