Legacy plugins used GenericDialog and DialogListener from AWT to achieve GUI interactivity when an option was dependent on another option's state. In IJ2, this is achieved with callback = someMethod which updates the fields based on the method's logic. AnisotropyWrapper uses it, like this:
See also the use of the validater = someValidationMethod @Parameter option to run a check on the input Dataset prior to running the Command.
@Parameter(label = "Lines per direction",
description = "How many lines are sampled per direction",
min = "1", style = NumberWidget.SPINNER_STYLE, required = false,
callback = "applyMinimum")
private Integer lines = DEFAULT_LINES;
@Parameter(label = "Recommended minimums",
description = "Apply minimum recommended values to directions, lines, and increment",
persist = false, required = false, callback = "applyMinimum")
private boolean recommendedMin;
@SuppressWarnings("unused")
private void applyMinimum() {
if (recommendedMin) {
lines = DEFAULT_LINES;
directions = DEFAULT_DIRECTIONS;
samplingIncrement = minIncrement;
}
}
Legacy plugins used
GenericDialogandDialogListenerfrom AWT to achieve GUI interactivity when an option was dependent on another option's state. In IJ2, this is achieved withcallback = someMethodwhich updates the fields based on the method's logic.AnisotropyWrapperuses it, like this:See also the use of the
validater = someValidationMethod@Parameteroption to run a check on the inputDatasetprior to running theCommand.