コード例 #1
0
  @Override
  public Object getValueAt(int rowIndex, int columnIndex) {

    Precondition.param(rowIndex, "rowIndex").noLessThan(0);
    Precondition.param(rowIndex, "rowIndex").lessThan(getRowCount());
    Precondition.param(columnIndex, "columnIndex").noLessThan(0);
    Precondition.param(columnIndex, "columnIndex").lessThan(getColumnCount());

    AudioFile audioFile = audioFileCollection.get(rowIndex);
    if (columnIndex < AudioFileAccess.values().length) {
      return AudioFileAccess.values()[columnIndex].get(audioFile);
    } else {
      AudioTagField audioTagField =
          AudioTagField.values()[columnIndex - AudioFileAccess.values().length];
      return audioFile.getTag().getField(audioTagField);
    }
  }
コード例 #2
0
  @Override
  public void setValueAt(Object aValue, int rowIndex, int columnIndex) {

    Precondition.param(rowIndex, "rowIndex").noLessThan(0);
    Precondition.param(rowIndex, "rowIndex").lessThan(getRowCount());
    Precondition.param(columnIndex, "columnIndex").noLessThan(0);
    Precondition.param(columnIndex, "columnIndex").lessThan(getColumnCount());
    Precondition.assertParam(
        isCellEditable(rowIndex, columnIndex),
        "Cell not editable: " + rowIndex + "," + columnIndex);

    AudioFile audioFile = audioFileCollection.get(rowIndex);
    if (columnIndex < AudioFileAccess.values().length) {
      AudioFileAccess.values()[columnIndex].set(audioFile, aValue);
    } else {
      AudioTagField audioTagField =
          AudioTagField.values()[columnIndex - AudioFileAccess.values().length];
      audioFile.getTag().setField(audioTagField, aValue);
    }
    super.fireTableRowsUpdated(rowIndex, rowIndex);
  }
コード例 #3
0
      @Override
      Object get(AudioFile audioFile) {

        return audioFile.getUpdatedTime();
      }
コード例 #4
0
      @Override
      void set(AudioFile audioFile, Object value) {

        File old = audioFile.getFile();
        audioFile.setFile(new File(old.getParent(), (String) value));
      }
コード例 #5
0
      @Override
      Object get(AudioFile audioFile) {

        return audioFile.getFile().getName();
      }