/** * Helper method to create the {@link IntensityBins}-object from the IntervalPanel. * * @return */ private IntensityBins createPixelBins() { IntensityBins bins = new IntensityBins(m_intervalPanel.getNumIntervals()); for (int j = 0; j < m_intervalPanel.getNumIntervals(); j++) { IntervalItemPanel p = m_intervalPanel.getInterval(j); bins.setBinAtIndex( j, p.getBinValue(), p.isLeftOpen(), p.getLeftValue(false), p.isRightOpen(), p.getRightValue(false)); } return bins; }
/** Helper method that determines the result pixel type and updates the info label. */ private void updateInfo() { if (m_intervalPanel.getNumIntervals() > 0) { // determine the result pixel type // and update the info label m_info.setText(createPixelBins().getPixelType().getClass().getSimpleName()); } else { m_info.setText("No bins specified."); } }
/** {@inheritDoc} */ @Override public void saveAdditionalSettingsTo(final NodeSettingsWO settings) throws InvalidSettingsException { if (m_intervalPanel.getNumIntervals() == 0) { throw new InvalidSettingsException("No pixel bins have been specified."); } createPixelBins() .saveToSettings(settings.addNodeSettings(IntensityBinnerNodeModel.KEY_BIN_SETTINGS)); }