Package net.sf.mzmine.data

Examples of net.sf.mzmine.data.PeakIdentity


      }
    }

    if (value instanceof PeakIdentity) {

      PeakIdentity identity = (PeakIdentity) value;

      newLabel.setText(identity.getName());

      String toolTipText = identity.getDescription();

      newLabel.setToolTipText(toolTipText);

    }
View Full Code Here


    if (commonColumn == CommonColumnType.IDENTITY) {

      row = this.convertRowIndexToModel(row);
      peakListRow = peakList.getRow(row);

      PeakIdentity identities[] = peakListRow.getPeakIdentities();
      PeakIdentity preferredIdentity = peakListRow
          .getPreferredPeakIdentity();
      JComboBox combo;

      if ((identities != null) && (identities.length > 0)) {
        combo = new JComboBox(identities);
        combo.addItem("-------------------------");
        combo.addItem(REMOVE_IDENTITY);
        combo.addItem(EDIT_IDENTITY);
      } else {
        combo = new JComboBox();
      }

      combo.setFont(comboFont);
      combo.addItem(NEW_IDENTITY);
      if (preferredIdentity != null) {
        combo.setSelectedItem(preferredIdentity);
      }

      combo.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
          JComboBox combo = (JComboBox) e.getSource();
          Object item = combo.getSelectedItem();
          if (item != null) {
            if (item.toString() == NEW_IDENTITY) {
              PeakIdentitySetupDialog dialog = new PeakIdentitySetupDialog(
                  peakListRow);
              dialog.setVisible(true);
              return;
            }
            if (item.toString() == EDIT_IDENTITY) {
              PeakIdentitySetupDialog dialog = new PeakIdentitySetupDialog(
                  peakListRow, peakListRow
                      .getPreferredPeakIdentity());
              dialog.setVisible(true);
              return;
            }
            if (item.toString() == REMOVE_IDENTITY) {
              PeakIdentity identity = peakListRow
                  .getPreferredPeakIdentity();
              if (identity != null) {
                peakListRow.removePeakIdentity(identity);
                DefaultComboBoxModel comboModel = (DefaultComboBoxModel) combo
                    .getModel();
View Full Code Here

      peakData[0] = new RealTuple(heightTupleType, new double[]{peaks[i]
          .getRawDataPointsIntensityRange().getMax()
          + maxIntensity
          * PEAK_LABEL_OFFSET});

      final PeakIdentity id = peakList.getPeakRow(peaks[i])
          .getPreferredPeakIdentity();
      final String peakText = showCompoundName && id != null ? id
          .getName() : mzFormat.format(peaks[i].getMZ());
      peakData[1] = new Text(annotationType, peakText);
      peakValues[i] = new Tuple(annotationTupleType, peakData, false);
    }

View Full Code Here

    if (selectedRow == null) {
      itemNameLabel.setText("");
      return;
    }

    PeakIdentity identity = selectedRow.getPreferredPeakIdentity();
    String itemName;
    if (identity != null) {
      itemName = identity.getName();
    } else {
      itemName = selectedRow.toString();
    }

    itemNameLabel.setText(itemName);
View Full Code Here

  public String generateLabel(XYDataset dataSet, int series, int item) {

    ScatterPlotDataSet scatterDataSet = (ScatterPlotDataSet) dataSet;

    PeakListRow row = scatterDataSet.getRow(series, item);
    PeakIdentity identity = row.getPreferredPeakIdentity();
    if (identity != null) {
      return identity.getName();
    } else {
      return row.toString();
    }

  }
View Full Code Here

    if ((row1 == null) || (row2 == null))
      return false;

    // If both have preferred identity available, then compare only those
    PeakIdentity row1PreferredIdentity = row1.getPreferredPeakIdentity();
    PeakIdentity row2PreferredIdentity = row2.getPreferredPeakIdentity();
    if ((row1PreferredIdentity != null) && (row2PreferredIdentity != null)) {
      if (row1PreferredIdentity.getName().equals(
          row2PreferredIdentity.getName()))
        return true;
      else
        return false;
    }
View Full Code Here

        }
      }

      // Label best peak with preferred identity.
      final ChromatographicPeak bestPeak = selectedRow.getBestPeak();
      final PeakIdentity peakIdentity = selectedRow
          .getPreferredPeakIdentity();
      final Map<ChromatographicPeak, String> labelMap = new HashMap<ChromatographicPeak, String>(
          1);
      if (bestPeak != null && peakIdentity != null) {

        labelMap.put(bestPeak, peakIdentity.getName());
      }

      TICVisualizerModule.showNewTICVisualizerWindow(
          peakList.getRawDataFiles(), peaks, labelMap, 1,
          PlotType.BASEPEAK, rtRange, mzRange);
View Full Code Here

   * Checks whether given peak list row conforms to this search condition.
   */
  public boolean conforms(PeakListRow row) {
    switch (type) {
      case NAME :
        PeakIdentity identity = row.getPreferredPeakIdentity();
        if (identity == null)
          return false;
        String name = identity.getName();

        if (isEmpty(nameRegex.toString()) || isEmpty(name)) {
          return false;
        }

View Full Code Here

          break;
        case COMMENT :
          statement.setString(i + 1, row.getComment());
          break;
        case IDENTITY :
          PeakIdentity id = row.getPreferredPeakIdentity();
          if (id != null) {
            statement.setString(i + 1, id.getName());
          } else {
            statement.setNull(i + 1, Types.VARCHAR);
          }
          break;
        case ISOTOPEPATTERN :
View Full Code Here

    }

    for (PeakList peakList : peakLists) {
      for (PeakListRow peakListRow : peakList.getRows()) {

        PeakIdentity peakIdentity = peakListRow
            .getPreferredPeakIdentity();
        if (peakIdentity != null) {

          Map<String, String> properties = peakIdentity
              .getAllProperties();
          Iterator<String> subItr = properties.keySet().iterator();

          while (subItr.hasNext()) {
View Full Code Here

TOP

Related Classes of net.sf.mzmine.data.PeakIdentity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.