private void setNormalizerChoices() { final List<String> choices = (twoD) ? NORM2D_CHOICES : NORM3D_CHOICES; final MutableModuleItem<String> mItem = getInfo().getMutableInput("normalizerDescription", String.class); mItem.setChoices((twoD) ? NORM2D_CHOICES : NORM3D_CHOICES); mItem.setValue(this, choices.get(0)); }
private void adjustRadiiInputs(final boolean startUpAdjust) { maxPossibleRadius = parser.maxPossibleRadius(); final List<String> names = Arrays.asList("startRadius", "stepSize", "endRadius"); final List<String> labels = Arrays.asList("Start radius", "Step size", "End radius"); final String unit = cal.getUnit(); for (int i = 0; i < names.size(); i++) { final MutableModuleItem<Double> mItem = getInfo().getMutableInput(names.get(i), Double.class); mItem.setMaximumValue(maxPossibleRadius); if (startUpAdjust) { mItem.setStepSize(voxelSize); mItem.setLabel(labels.get(i) + " (" + unit + ")"); } } }
private void adjustFittingOptions() { final MutableModuleItem<Integer> polynomialDegreeInput = getInfo() .getMutableInput("polynomialDegree", Integer.class); polynomialDegreeInput.setMinimumValue(minDegree); polynomialDegreeInput.setMaximumValue(maxDegree); }
protected void initLookAndFeel() { final String lafClass = UIManager.getLookAndFeel().getClass().getName(); final LookAndFeelInfo[] lookAndFeels = UIManager.getInstalledLookAndFeels(); final ArrayList<String> lookAndFeelChoices = new ArrayList<>(); for (final LookAndFeelInfo lafInfo : lookAndFeels) { final String lafName = lafInfo.getName(); lookAndFeelChoices.add(lafInfo.getName()); if (lafClass.equals(lafInfo.getClassName())) { lookAndFeel = lafName; } } final MutableModuleItem<String> lookAndFeelItem = getInfo().getMutableInput(LOOK_AND_FEEL, String.class); lookAndFeelItem.setChoices(lookAndFeelChoices); }
} else label = analysisAction; aButton.setLabel( String.format("<html><font color='%s'><b>%s</b></font></html>", disable ? "#555555" : "#000", label));
protected void init() { // map = new HashMap<>(); // final List<ImageDisplay> list = imgDisplayService.getImageDisplays(); // if (list == null || list.size() < 2) { // cancel("No other images are open."); // } // for (final ImageDisplay imgDisplay : list) { // map.put(imgDisplay.getName(), imgDisplay); // } final List<String> choices = new ArrayList<>(); prefService.put(ChooseDataset.class, "choice", ""); // reset pref final List<Dataset> list = datasetService.getDatasets(); if (list == null || list.size() < 2) { cancel("No other images are open."); } for (final Dataset dataset : list) { if (dataset.equals(datasetToIgnore)) continue; choices.add(dataset.getName()); } Collections.sort(choices); final MutableModuleItem<String> mItem = getInfo().getMutableInput("choice", String.class); mItem.setChoices(choices); // mItem.setValue(this, choices.get(0)); }
protected void init() { luts = lutService.findLUTs(); final ArrayList<String> choices = new ArrayList<>(); for (final Map.Entry<String, URL> entry : luts.entrySet()) { choices.add(entry.getKey()); } Collections.sort(choices); final MutableModuleItem<String> input = getInfo().getMutableInput("choice", String.class); input.setChoices(choices); input.setValue(this, choices.get(0)); nameChanged(); }
private void setLUTs() { // see net.imagej.lut.LUTSelector luts = lutService.findLUTs(); final ArrayList<String> choices = new ArrayList<>(); for (final Map.Entry<String, URL> entry : luts.entrySet()) { choices.add(entry.getKey()); } Collections.sort(choices); choices.add(0, "No LUT. Use active ROI color"); final MutableModuleItem<String> input = getInfo().getMutableInput("lutChoice", String.class); input.setChoices(choices); input.setValue(this, lutChoice); lutChoiceChanged(); }
protected void initInputChoice() { MutableModuleItem<String> choiceInput = getInfo().getMutableInput("inputChoice", String.class); // Get compatible inputs for moduleInfo List<ModuleItem<?>> compatibleInputs = batchService .batchableInputs(moduleInfo); if (compatibleInputs.size() == 1) { choiceInput.setValue(this, compatibleInputs.get(0).getName()); resolveInput("inputChoice"); } else if (compatibleInputs.size() > 1) { choiceInput.setChoices(compatibleInputs.stream() .map(ModuleItem::getName).collect(Collectors.toList())); } else { log.error("No compatible inputs found. Unable to initialize input choice."); } }