ThreeB 1.1
|
Control panel which basically presents the .cfg file in a large edit box along with additional necessary things (frame range and pixel size). More...
Public Member Functions | |
boolean | dialogItemChanged (GenericDialog gd, java.awt.AWTEvent e) |
double | parseDouble (String s) |
Package Functions | |
AdvancedDialog (String cfg, int nframes_) | |
int | parseInt (String s) |
TextField | getPixelSizeField () |
TextField | getFirstFrameField () |
TextField | getLastFrameField () |
double | getPixelSize () |
int | getFirstFrame () |
int | getLastFrame () |
Package Attributes | |
boolean | ok = true |
int | nframes |
Control panel which basically presents the .cfg file in a large edit box along with additional necessary things (frame range and pixel size).
Also make the user acknowledge that they might be getting into trouble. This is uglier than I would like.
Definition at line 307 of file three_B.java.
AdvancedDialog::AdvancedDialog | ( | String | cfg, |
int | nframes_ | ||
) | [inline, package] |
Definition at line 311 of file three_B.java.
References dialogItemChanged(), and nframes.
{ super("3B Analysis"); nframes=nframes_; addMessage("Advanced configuration"); addMessage(" "); addCheckbox("I understand 3B enough to be editing the text below", false); addTextAreas(cfg, null, 40, 100); addNumericField("Pixel size (nm / pixel)", 100., 1, 10, "nm"); addNumericField("First frame", 0., 0, 10, ""); addNumericField("Last frame", nframes-1., 0, 10, ""); addDialogListener(this); dialogItemChanged(null, null); showDialog(); }
boolean AdvancedDialog::dialogItemChanged | ( | GenericDialog | gd, |
java.awt.AWTEvent | e | ||
) | [inline] |
Definition at line 331 of file three_B.java.
References getFirstFrame(), getFirstFrameField(), getLastFrame(), getLastFrameField(), getPixelSizeField(), nframes, and ok.
Referenced by AdvancedDialog().
{ boolean v = ((Checkbox)(getCheckboxes().get(0))).getState(); if(v != ok) { ok=v; if(ok) { getTextArea1().setEditable(true); ((Label)getMessage()).setText("Warning: strange behaviour may result!"); getPixelSizeField().setEditable(true); getFirstFrameField().setEditable(true); getLastFrameField().setEditable(true); } else { getTextArea1().setEditable(false); ((Label)getMessage()).setText(" "); getPixelSizeField().setEditable(false); getFirstFrameField().setEditable(false); getLastFrameField().setEditable(false); } } //Clamp the frames int first = getFirstFrame(); int last = getLastFrame(); int nfirst = Math.max(0, Math.min(nframes-1, first)); int nlast = Math.max(nfirst, Math.min(nframes-1, last)); if(first != nfirst) getFirstFrameField().setText(Integer.toString(nfirst)); if(last != nlast) getLastFrameField().setText(Integer.toString(nlast)); return ok; }
int AdvancedDialog::parseInt | ( | String | s | ) | [inline, package] |
Definition at line 373 of file three_B.java.
Referenced by getFirstFrame(), and getLastFrame().
{ try { return Integer.parseInt(s); } catch(Exception e) { return 0; } }
double AdvancedDialog::parseDouble | ( | String | s | ) | [inline] |
Definition at line 385 of file three_B.java.
Referenced by getPixelSize().
{ try { return Double.parseDouble(s); } catch(Exception e) { return 0; } }
TextField AdvancedDialog::getPixelSizeField | ( | ) | [inline, package] |
Definition at line 397 of file three_B.java.
Referenced by dialogItemChanged(), and getPixelSize().
{
return (TextField)(getNumericFields().get(0));
}
TextField AdvancedDialog::getFirstFrameField | ( | ) | [inline, package] |
Definition at line 402 of file three_B.java.
Referenced by dialogItemChanged(), and getFirstFrame().
{
return (TextField)(getNumericFields().get(1));
}
TextField AdvancedDialog::getLastFrameField | ( | ) | [inline, package] |
Definition at line 408 of file three_B.java.
Referenced by dialogItemChanged(), and getLastFrame().
{
return (TextField)(getNumericFields().get(2));
}
double AdvancedDialog::getPixelSize | ( | ) | [inline, package] |
Definition at line 413 of file three_B.java.
References getPixelSizeField(), and parseDouble().
{ return parseDouble(getPixelSizeField().getText()); }
int AdvancedDialog::getFirstFrame | ( | ) | [inline, package] |
Definition at line 417 of file three_B.java.
References getFirstFrameField(), and parseInt().
Referenced by dialogItemChanged().
{ return parseInt(getFirstFrameField().getText()); }
int AdvancedDialog::getLastFrame | ( | ) | [inline, package] |
Definition at line 422 of file three_B.java.
References getLastFrameField(), and parseInt().
Referenced by dialogItemChanged().
{ return parseInt(getLastFrameField().getText()); }
boolean AdvancedDialog::ok = true [package] |
Definition at line 309 of file three_B.java.
Referenced by dialogItemChanged().
int AdvancedDialog::nframes [package] |
Definition at line 310 of file three_B.java.
Referenced by AdvancedDialog(), and dialogItemChanged().