()
| 52 | } |
| 53 | |
| 54 | private boolean showDialog() { |
| 55 | gd = new GenericDialog("Startup Macro"); |
| 56 | String text = "Macro code contained in this text area\nexecutes when ImageJ starts up."; |
| 57 | Font font = ImageJ.SansSerif14; |
| 58 | gd.setInsets(5,15,0); |
| 59 | gd.addMessage(text, font); |
| 60 | gd.setInsets(5, 10, 0); |
| 61 | gd.addTextAreas(macro, null, 15, 50); |
| 62 | gd.addChoice("Add code:", code, code[0]); |
| 63 | Vector choices = gd.getChoices(); |
| 64 | if (choices!=null) { |
| 65 | Choice choice = (Choice)choices.elementAt(0); |
| 66 | choice.addItemListener(this); |
| 67 | } |
| 68 | gd.showDialog(); |
| 69 | macro = gd.getNextText(); |
| 70 | return !gd.wasCanceled(); |
| 71 | } |
| 72 | |
| 73 | private boolean runMacro(String macro) { |
| 74 | Interpreter interp = new Interpreter(); |
no test coverage detected