()
| 39 | static final int USER_DEFINED = -1; |
| 40 | |
| 41 | public Fitter() { |
| 42 | super("Curve Fitter"); |
| 43 | WindowManager.addWindow(this); |
| 44 | addKeyListener(this); |
| 45 | Panel panel = new Panel(); |
| 46 | fit = new Choice(); |
| 47 | for (int i=0; i<CurveFitter.fitList.length; i++) |
| 48 | fit.addItem(CurveFitter.fitList[CurveFitter.sortedTypes[i]]); |
| 49 | fit.addItem("*User-defined*"); |
| 50 | fit.addItemListener(this); |
| 51 | panel.add(fit); |
| 52 | doIt = new Button(" Fit "); |
| 53 | doIt.addActionListener(this); |
| 54 | doIt.addKeyListener(this); |
| 55 | panel.add(doIt); |
| 56 | open = new Button("Open"); |
| 57 | open.addActionListener(this); |
| 58 | panel.add(open); |
| 59 | apply = new Button("Apply"); |
| 60 | apply.addActionListener(this); |
| 61 | panel.add(apply); |
| 62 | settings = new Checkbox("Show settings", false); |
| 63 | panel.add(settings); |
| 64 | add("North", panel); |
| 65 | String text = ""; |
| 66 | for (int i=0; i<dx.length; i++) |
| 67 | text += IJ.d2s(dx[i],2)+" "+IJ.d2s(dy[i],2)+"\n"; |
| 68 | textArea = new TextArea("",15,30,TextArea.SCROLLBARS_VERTICAL_ONLY); |
| 69 | textArea.setFont(new Font("Monospaced", Font.PLAIN, 12)); |
| 70 | if (IJ.isLinux()) textArea.setBackground(Color.white); |
| 71 | textArea.append(text); |
| 72 | add("Center", textArea); |
| 73 | GUI.scale(this); |
| 74 | pack(); |
| 75 | GUI.centerOnImageJScreen(this); |
| 76 | show(); |
| 77 | IJ.register(Fitter.class); |
| 78 | } |
| 79 | |
| 80 | /** Fit data in the textArea, show result in log and create plot. |
| 81 | * @param fitType as defined in CurveFitter constants |
nothing calls this directly
no test coverage detected