MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / Commands

Method Commands

ij/src/main/java/ij/plugin/frame/Commands.java:32–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30 private Button button;
31
32 public Commands() {
33 super("Commands");
34 if (instance!=null) {
35 WindowManager.toFront(instance);
36 return;
37 }
38 instance = this;
39 WindowManager.addWindow(this);
40 list = new List(MAX_COMMANDS);
41 list.addItemListener(this);
42 String cmds = Prefs.get(CMDS_KEY, null);
43 if (cmds!=null) {
44 String[] cmd = cmds.split(",");
45 int len = cmd.length<=MAX_COMMANDS?cmd.length:MAX_COMMANDS;
46 boolean isDivider = false;
47 for (int i=0; i<len; i++) {
48 if (divider.equals(cmd[i])) {
49 isDivider = true;
50 break;
51 }
52 }
53 if (isDivider) {
54 for (int i=0; i<len; i++)
55 list.add(cmd[i]);
56 } else
57 cmds = null;
58 }
59 if (cmds==null)
60 reset();
61 ImageJ ij = IJ.getInstance();
62 addKeyListener(ij);
63 Executer.addCommandListener(this);
64 GUI.scale(list);
65 list.addKeyListener(ij);
66 GridBagLayout gridbag = new GridBagLayout();
67 GridBagConstraints c = new GridBagConstraints();
68 setLayout(gridbag);
69 c.insets = new Insets(0, 0, 0, 0);
70 c.gridx = 0; c.gridy = 0; c.anchor = GridBagConstraints.WEST;
71 add(list,c);
72 button = new Button("Edit");
73 button.addActionListener(this);
74 button.addKeyListener(ij);
75 //c.insets = new Insets(2, 6, 6, 6);
76 c.gridx = 0; c.gridy = 2; c.anchor = GridBagConstraints.CENTER;
77 add(button, c);
78 pack();
79 Dimension size = getSize();
80 Point loc = Prefs.getLocation(LOC_KEY);
81 if (loc!=null)
82 setLocation(loc);
83 show();
84 }
85
86 public void actionPerformed(ActionEvent e) {
87 GenericDialog gd = new GenericDialog("Commands");

Callers

nothing calls this directly

Calls 15

toFrontMethod · 0.95
addWindowMethod · 0.95
getMethod · 0.95
resetMethod · 0.95
getInstanceMethod · 0.95
addCommandListenerMethod · 0.95
scaleMethod · 0.95
getLocationMethod · 0.95
addActionListenerMethod · 0.80
addMethod · 0.65
getSizeMethod · 0.65
splitMethod · 0.45

Tested by

no test coverage detected