1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.dishevelled.venn.cytoscape;
25
26 import static javax.swing.SwingUtilities.windowForComponent;
27 import static org.dishevelled.venn.cytoscape.VennDiagramsUtils.installCloseKeyBinding;
28
29 import java.awt.Component;
30 import java.awt.event.ActionEvent;
31
32 import javax.swing.AbstractAction;
33 import javax.swing.Action;
34 import javax.swing.JDialog;
35 import javax.swing.JFrame;
36
37 import cytoscape.Cytoscape;
38
39 import cytoscape.plugin.CytoscapePlugin;
40
41
42
43
44
45
46
47 public final class VennDiagrams
48 extends CytoscapePlugin
49 {
50
51 private final Action vennDiagrams = new AbstractAction("Venn Diagrams...")
52 {
53
54 public void actionPerformed(final ActionEvent event)
55 {
56 JFrame frame = (JFrame) windowForComponent((Component) event.getSource());
57 JDialog dialog = new JDialog(frame, "Venn/Euler Diagrams");
58 dialog.setContentPane(new GroupsView());
59 dialog.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
60 installCloseKeyBinding(dialog);
61 dialog.setBounds(200, 200, 400, 400);
62 dialog.setVisible(true);
63 }
64 };
65
66
67
68
69
70 public VennDiagrams()
71 {
72
73 Cytoscape.getDesktop().getCyMenus().getOperationsMenu().add(vennDiagrams);
74 }
75 }