コード例 #1
0
 /** {@inheritDoc} */
 @Override
 public void loadAdditionalSettingsFrom(
     final NodeSettingsRO settings, final PortObjectSpec[] specs) throws NotConfigurableException {
   IntensityBins bins = null;
   try {
     bins = new IntensityBins(settings.getNodeSettings(IntensityBinnerNodeModel.KEY_BIN_SETTINGS));
   } catch (InvalidSettingsException e) {
     // TODO
     throw new NotConfigurableException(e.getMessage(), e);
   }
   m_intervalPanel.removeAllIntervalItems();
   for (int i = 0; i < bins.getNumBins(); i++) {
     double binValue = bins.getBinValue(i);
     boolean leftOpen = bins.isLeftOpen(i);
     double left = bins.getLeftValue(i);
     boolean rightOpen = bins.isRightOpen(i);
     double right = bins.getRightValue(i);
     IntervalItemPanel item =
         new IntervalItemPanel(
             m_intervalPanel, leftOpen, left, rightOpen, right, binValue, DoubleCell.TYPE);
     m_intervalPanel.addIntervalItem(item);
   }
   updateInfo();
   getPanel().validate();
   getPanel().repaint();
 }
コード例 #2
0
  /** {@inheritDoc} */
  @Override
  protected void loadInternals(final File internDir, final ExecutionMonitor exec)
      throws IOException, CanceledExecutionException {

    File file = new File(internDir, "muscle-internals.xml");
    FileInputStream fis = new FileInputStream(file);
    ModelContentRO modelContent = ModelContent.loadFromXML(fis);
    try {
      String[] keys = modelContent.getStringArray("internal-muscle-map-keys");
      m_muscle_map.clear();
      ModelContentRO subkey = modelContent.getModelContent("internal-muscle-map");
      for (String key : keys) {
        DataCell dc = subkey.getDataCell(key);
        if (dc instanceof MultiAlignmentCell) {
          m_muscle_map.put(key, (MultiAlignmentCell) dc);
        }
      }
      fis.close();
    } catch (InvalidSettingsException e) {
      throw new IOException(e.getMessage());
    }
  }