All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.tinymediamanager.ui.panels.MediaFileEditorPanel Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2012 - 2019 Manuel Laggner
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.tinymediamanager.ui.panels;

import static org.tinymediamanager.core.MediaFileType.NFO;
import static org.tinymediamanager.core.MediaFileType.SAMPLE;
import static org.tinymediamanager.core.MediaFileType.TRAILER;
import static org.tinymediamanager.core.MediaFileType.VIDEO;

import java.awt.Component;
import java.awt.Font;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.ResourceBundle;
import java.util.Set;
import java.util.Vector;

import javax.swing.AbstractAction;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;

import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.jdesktop.beansbinding.AutoBinding;
import org.jdesktop.beansbinding.AutoBinding.UpdateStrategy;
import org.jdesktop.beansbinding.BeanProperty;
import org.jdesktop.beansbinding.Binding;
import org.jdesktop.beansbinding.Bindings;
import org.jdesktop.observablecollections.ObservableCollections;
import org.jdesktop.swingbinding.JTableBinding;
import org.jdesktop.swingbinding.SwingBindings;
import org.tinymediamanager.core.MediaFileType;
import org.tinymediamanager.core.entities.MediaFile;
import org.tinymediamanager.core.entities.MediaFileAudioStream;
import org.tinymediamanager.core.entities.MediaFileSubtitle;
import org.tinymediamanager.ui.DoubleInputVerifier;
import org.tinymediamanager.ui.IconManager;
import org.tinymediamanager.ui.IntegerInputVerifier;
import org.tinymediamanager.ui.TmmFontHelper;
import org.tinymediamanager.ui.UTF8Control;
import org.tinymediamanager.ui.components.TmmLabel;
import org.tinymediamanager.ui.components.TmmSplitPane;
import org.tinymediamanager.ui.components.table.TmmTable;

import net.miginfocom.swing.MigLayout;

/**
 * The class MediaFileEditorPanel is used to maintain associated media files
 *
 * @author Manuel Laggner
 */
public class MediaFileEditorPanel extends JPanel {
  private static final long               serialVersionUID = -2416409052145301941L;
  /** @wbp.nls.resourceBundle messages */
  private static final ResourceBundle     BUNDLE           = ResourceBundle.getBundle("messages",              //$NON-NLS-1$
      new UTF8Control());

  private static final Map ASPECT_RATIOS    = createAspectRatios();

  private final Set              bindings         = new HashSet<>();

  private List        mediaFiles;
  private TmmTable                        tableMediaFiles;
  private JLabel                          lblFilename;
  private JTextField                      tfCodec;
  private JTextField                      tfContainerFormat;
  private JTextField                      tfWidth;
  private JTextField                      tfHeight;
  private TmmTable                        tableAudioStreams;
  private TmmTable                        tableSubtitles;
  private JButton                         btnAddAudioStream;
  private JButton                         btnRemoveAudioStream;
  private JButton                         btnAddSubtitle;
  private JButton                         btnRemoveSubtitle;
  private JComboBox               cb3dFormat;
  private JComboBox                       cbAspectRatio;
  private JTextField                      tfFrameRate;

  public MediaFileEditorPanel(List mediaFiles) {
    this.mediaFiles = ObservableCollections.observableList(new ArrayList<>());
    for (MediaFile mediaFile : mediaFiles) {
      MediaFileContainer container = new MediaFileContainer(mediaFile);
      this.mediaFiles.add(container);
    }

    Vector aspectRatios = new Vector<>(ASPECT_RATIOS.keySet());

    // predefined 3D Formats
    Vector threeDFormats = new Vector<>();
    threeDFormats.add("");
    threeDFormats.add(MediaFile.VIDEO_3D);
    threeDFormats.add(MediaFile.VIDEO_3D_SBS);
    threeDFormats.add(MediaFile.VIDEO_3D_HSBS);
    threeDFormats.add(MediaFile.VIDEO_3D_TAB);
    threeDFormats.add(MediaFile.VIDEO_3D_HTAB);
    threeDFormats.add(MediaFile.VIDEO_3D_MVC);

    setLayout(new MigLayout("", "[300lp:450lp,grow]", "[200lp:450lp,grow]"));
    {
      JSplitPane splitPane = new TmmSplitPane();
      add(splitPane, "cell 0 0,grow");
      {
        JPanel panelMediaFiles = new JPanel();
        panelMediaFiles.setLayout(new MigLayout("", "[200lp:250lp,grow]", "[200lp:300lp,grow]"));

        JScrollPane scrollPaneMediaFiles = new JScrollPane();
        panelMediaFiles.add(scrollPaneMediaFiles, "cell 0 0,grow");
        splitPane.setLeftComponent(panelMediaFiles);

        tableMediaFiles = new TmmTable();
        tableMediaFiles.configureScrollPane(scrollPaneMediaFiles);
        scrollPaneMediaFiles.setViewportView(tableMediaFiles);
      }
      {
        JPanel panelDetails = new JPanel();
        splitPane.setRightComponent(panelDetails);
        panelDetails
            .setLayout(new MigLayout("", "[][65lp:65lp][20lp:n][][65lp:65lp][20lp:n][][][50lp:n,grow]", "[][][][][100lp:150lp][100lp:150lp]"));
        {
          lblFilename = new JLabel("");
          TmmFontHelper.changeFont(lblFilename, 1.167, Font.BOLD);
          panelDetails.add(lblFilename, "cell 0 0 9 1,growx");
        }
        {
          JLabel lblCodec = new TmmLabel(BUNDLE.getString("metatag.codec"));
          panelDetails.add(lblCodec, "cell 0 1,alignx right");

          tfCodec = new JTextField();
          panelDetails.add(tfCodec, "cell 1 1,growx");
          tfCodec.setColumns(10);
        }
        {
          JLabel lblContainerFormat = new TmmLabel(BUNDLE.getString("metatag.container"));
          panelDetails.add(lblContainerFormat, "cell 3 1,alignx right");

          tfContainerFormat = new JTextField();
          panelDetails.add(tfContainerFormat, "cell 4 1,growx");
          tfContainerFormat.setColumns(10);
        }
        {
          JLabel lblWidth = new TmmLabel(BUNDLE.getString("metatag.width"));
          panelDetails.add(lblWidth, "cell 0 2,alignx right");

          tfWidth = new JTextField();
          tfWidth.setInputVerifier(new IntegerInputVerifier());
          panelDetails.add(tfWidth, "cell 1 2,growx");
          tfWidth.setColumns(10);
        }
        {
          JLabel lblHeight = new TmmLabel(BUNDLE.getString("metatag.height"));
          panelDetails.add(lblHeight, "cell 3 2,alignx right");

          tfHeight = new JTextField();
          tfHeight.setInputVerifier(new IntegerInputVerifier());
          panelDetails.add(tfHeight, "cell 4 2,growx");
          tfHeight.setColumns(10);
        }
        {
          JLabel lblAspectT = new TmmLabel(BUNDLE.getString("metatag.aspect"));
          panelDetails.add(lblAspectT, "cell 6 2,alignx right");

          cbAspectRatio = new JComboBox(aspectRatios);
          cbAspectRatio.setEditable(true);
          cbAspectRatio.setRenderer(new DefaultListCellRenderer() {
            @Override
            public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
              String text = ASPECT_RATIOS.get(value);
              if (StringUtils.isBlank(text)) {
                text = String.valueOf(text);
              }
              return super.getListCellRendererComponent(list, text, index, isSelected, cellHasFocus);
            }
          });
          panelDetails.add(cbAspectRatio, "cell 7 2,growx");
        }
        {
          JLabel lblFrameRate = new TmmLabel(BUNDLE.getString("metatag.framerate"));
          panelDetails.add(lblFrameRate, "cell 0 3,alignx trailing");

          tfFrameRate = new JTextField();
          tfFrameRate.setInputVerifier(new DoubleInputVerifier());
          panelDetails.add(tfFrameRate, "cell 1 3,growx");
          tfFrameRate.setColumns(10);
        }
        {
          JLabel lbld = new TmmLabel("3D Format");
          panelDetails.add(lbld, "cell 3 3,alignx right");

          cb3dFormat = new JComboBox(threeDFormats);
          panelDetails.add(cb3dFormat, "cell 4 3,growx,aligny top");
        }
        {
          JLabel lblAudiostreams = new TmmLabel("AudioStreams");
          panelDetails.add(lblAudiostreams, "flowy,cell 0 4,alignx right,aligny top");

          JScrollPane scrollPane = new JScrollPane();
          panelDetails.add(scrollPane, "cell 1 4 8 1,grow");

          tableAudioStreams = new TmmTable();
          tableAudioStreams.configureScrollPane(scrollPane);
          scrollPane.setViewportView(tableAudioStreams);
        }
        {
          JLabel lblSubtitles = new TmmLabel("Subtitles");
          panelDetails.add(lblSubtitles, "flowy,cell 0 5,alignx right,aligny top");

          JScrollPane scrollPane = new JScrollPane();
          panelDetails.add(scrollPane, "cell 1 5 8 1,grow");

          tableSubtitles = new TmmTable();
          tableSubtitles.configureScrollPane(scrollPane);
          scrollPane.setViewportView(tableSubtitles);
        }
        {
          btnAddAudioStream = new JButton("");
          btnAddAudioStream.setAction(new AddAudioStreamAction());
          btnAddAudioStream.setMargin(new Insets(2, 2, 2, 2));
          btnAddAudioStream.setIcon(IconManager.ADD_INV);
          panelDetails.add(btnAddAudioStream, "cell 0 4,alignx right,aligny top");
        }
        {
          btnRemoveAudioStream = new JButton("");
          btnRemoveAudioStream.setAction(new RemoveAudioStreamAction());
          btnRemoveAudioStream.setMargin(new Insets(2, 2, 2, 2));
          btnRemoveAudioStream.setIcon(IconManager.REMOVE_INV);
          panelDetails.add(btnRemoveAudioStream, "cell 0 4,alignx right,aligny top");
        }
        {
          btnAddSubtitle = new JButton("");
          btnAddSubtitle.setAction(new AddSubtitleAction());
          btnAddSubtitle.setMargin(new Insets(2, 2, 2, 2));
          btnAddSubtitle.setIcon(IconManager.ADD_INV);
          panelDetails.add(btnAddSubtitle, "cell 0 5,alignx right,aligny top");
        }
        {
          btnRemoveSubtitle = new JButton("");
          btnRemoveSubtitle.setAction(new RemoveSubtitleAction());
          btnRemoveSubtitle.setMargin(new Insets(2, 2, 2, 2));
          btnRemoveSubtitle.setIcon(IconManager.REMOVE_INV);
          panelDetails.add(btnRemoveSubtitle, "cell 0 5,alignx right,aligny top");
        }
      }
    }

    initDataBindings();

    // select first
    if (!this.mediaFiles.isEmpty()) {
      tableMediaFiles.getSelectionModel().setSelectionInterval(0, 0);
    }

    // add selection listener to disable editing when needed
    tableMediaFiles.getSelectionModel().addListSelectionListener(new ListSelectionListener() {

      private Set videoTypes = new HashSet<>(Arrays.asList(VIDEO, SAMPLE, TRAILER));

      @Override
      public void valueChanged(ListSelectionEvent arg0) {
        if (!arg0.getValueIsAdjusting()) {
          int selectedRow = tableMediaFiles.convertRowIndexToModel(tableMediaFiles.getSelectedRow());
          if (selectedRow > -1) {
            MediaFile mf = MediaFileEditorPanel.this.mediaFiles.get(selectedRow).mediaFile;
            // codec should not be enabled for NFOs
            tfCodec.setEnabled(!(mf.getType() == NFO));
            // audio streams and subtitles should not be enabled for anything except VIDEOS/TRAILER/SAMPLES
            btnAddAudioStream.setEnabled(videoTypes.contains(mf.getType()));
            btnRemoveAudioStream.setEnabled(videoTypes.contains(mf.getType()));
            btnAddSubtitle.setEnabled(videoTypes.contains(mf.getType()));
            btnRemoveSubtitle.setEnabled(videoTypes.contains(mf.getType()));
            // 3D is only available for video types
            cb3dFormat.setEnabled(videoTypes.contains(mf.getType()));
          }
        }
      }

    });
  }

  private static Map createAspectRatios() {
    LinkedHashMap predefinedValues = new LinkedHashMap<>();
    predefinedValues.put(0f, "calculated");
    predefinedValues.put(1.33f, "1.33 (4:3)");
    predefinedValues.put(1.77f, "1.755 (16:9)");
    predefinedValues.put(1.85f, "1.85 (16:9 / widescreen)");
    predefinedValues.put(2.0f, "2.00 (18:9 / Univisium)");
    predefinedValues.put(2.35f, "2.35 (21:9 / cinemascope)");
    predefinedValues.put(2.39f, "2.39 (12:5 / theatrical widescreen)");

    return predefinedValues;
  }

  private class AddAudioStreamAction extends AbstractAction {
    private static final long serialVersionUID = 2903255414523349267L;

    public AddAudioStreamAction() {
      putValue(SHORT_DESCRIPTION, BUNDLE.getString("audiostream.add")); //$NON-NLS-1$
    }

    @Override
    public void actionPerformed(ActionEvent e) {
      int mediaFileRow = tableMediaFiles.getSelectedRow();
      if (mediaFileRow > -1) {
        mediaFileRow = tableMediaFiles.convertRowIndexToModel(mediaFileRow);
        MediaFileContainer mf = mediaFiles.get(mediaFileRow);
        mf.audioStreams.add(new MediaFileAudioStream());
      }
    }
  }

  private class RemoveAudioStreamAction extends AbstractAction {
    private static final long serialVersionUID = -7079826940827356996L;

    public RemoveAudioStreamAction() {
      putValue(SHORT_DESCRIPTION, BUNDLE.getString("audiostream.remove")); //$NON-NLS-1$
    }

    @Override
    public void actionPerformed(ActionEvent e) {
      int[] audioRows = convertSelectedRowsToModelRows(tableAudioStreams);
      if (audioRows.length > 0) {
        int mediaFileRow = tableMediaFiles.getSelectedRow();
        if (mediaFileRow > -1) {
          mediaFileRow = tableMediaFiles.convertRowIndexToModel(mediaFileRow);
          MediaFileContainer mf = mediaFiles.get(mediaFileRow);

          for (int row : audioRows) {
            mf.audioStreams.remove(row);
          }
        }
      }
    }
  }

  private class AddSubtitleAction extends AbstractAction {
    private static final long serialVersionUID = 2903255414523349767L;

    public AddSubtitleAction() {
      putValue(SHORT_DESCRIPTION, BUNDLE.getString("subtitle.add")); //$NON-NLS-1$
    }

    @Override
    public void actionPerformed(ActionEvent e) {
      int mediaFileRow = tableMediaFiles.getSelectedRow();
      if (mediaFileRow > -1) {
        mediaFileRow = tableMediaFiles.convertRowIndexToModel(mediaFileRow);
        MediaFileContainer mf = mediaFiles.get(mediaFileRow);
        mf.subtitles.add(new MediaFileSubtitle());
      }
    }
  }

  private class RemoveSubtitleAction extends AbstractAction {
    private static final long serialVersionUID = -7079866940827356996L;

    public RemoveSubtitleAction() {
      putValue(SHORT_DESCRIPTION, BUNDLE.getString("subtitle.remove")); //$NON-NLS-1$
    }

    @Override
    public void actionPerformed(ActionEvent e) {
      int[] subtitleRows = convertSelectedRowsToModelRows(tableSubtitles);
      if (subtitleRows.length > 0) {
        int mediaFileRow = tableMediaFiles.getSelectedRow();
        if (mediaFileRow > -1) {
          mediaFileRow = tableMediaFiles.convertRowIndexToModel(mediaFileRow);
          MediaFileContainer mf = mediaFiles.get(mediaFileRow);

          for (int row : subtitleRows) {
            mf.subtitles.remove(row);
          }
        }
      }
    }
  }

  private int[] convertSelectedRowsToModelRows(JTable table) {
    int[] tableRows = table.getSelectedRows();
    int[] modelRows = new int[tableRows.length];
    for (int i = 0; i < tableRows.length; i++) {
      modelRows[i] = table.convertRowIndexToModel(tableRows[i]);
    }

    // sort it (descending)
    ArrayUtils.reverse(modelRows);
    return modelRows;
  }

  /*
   * Container needed to make the audio streams and subtitles editable
   */
  public class MediaFileContainer {
    private MediaFile                  mediaFile;
    private List audioStreams;
    private List    subtitles;

    private MediaFileContainer(MediaFile mediaFile) {
      this.mediaFile = mediaFile;
      this.audioStreams = ObservableCollections.observableList(mediaFile.getAudioStreams());
      this.subtitles = ObservableCollections.observableList(mediaFile.getSubtitles());
    }

    public MediaFile getMediaFile() {
      return mediaFile;
    }

    public List getAudioStreams() {
      return audioStreams;
    }

    public List getSubtitles() {
      return subtitles;
    }
  }

  /**
   * Sync media files edited from this editor with the ones from the media entity without removing/adding all of them
   * 
   * @param mfsFromEditor
   *          the edited media files
   * @param mfsFromMediaEntity
   *          the original media files
   */
  public static void syncMediaFiles(List mfsFromEditor, List mfsFromMediaEntity) {
    for (MediaFile mfEditor : mfsFromEditor) {
      for (MediaFile mfOriginal : mfsFromMediaEntity) {
        if (mfEditor.equals(mfOriginal)) {
          // here we check all field which can be edited from the editor
          if (!mfEditor.getVideoCodec().equals(mfOriginal.getVideoCodec())) {
            mfOriginal.setVideoCodec(mfEditor.getVideoCodec());
          }
          if (!mfEditor.getContainerFormat().equals(mfOriginal.getContainerFormat())) {
            mfOriginal.setContainerFormat(mfEditor.getContainerFormat());
          }
          if (mfEditor.getVideoWidth() != mfOriginal.getVideoWidth()) {
            mfOriginal.setVideoWidth(mfEditor.getVideoWidth());
          }
          if (mfEditor.getVideoHeight() != mfOriginal.getVideoHeight()) {
            mfOriginal.setVideoHeight(mfEditor.getVideoHeight());
          }
          if (mfEditor.getAspectRatio() != mfOriginal.getAspectRatio()) {
            mfOriginal.setAspectRatio(mfEditor.getAspectRatio());
          }
          if (mfEditor.getFrameRate() != mfOriginal.getFrameRate()) {
            mfOriginal.setFrameRate(mfEditor.getFrameRate());
          }
          if (!mfEditor.getVideo3DFormat().equals(mfOriginal.getVideo3DFormat())) {
            mfOriginal.setVideo3DFormat(mfEditor.getVideo3DFormat());
          }
          // audio streams and subtitles will be completely set
          mfOriginal.setAudioStreams(mfEditor.getAudioStreams());
          mfOriginal.setSubtitles(mfEditor.getSubtitles());
          break;
        }
      }
    }
  }

  public void unbindBindings() {
    for (Binding binding : bindings) {
      if (binding != null && binding.isBound()) {
        binding.unbind();
      }
    }
  }

  protected void initDataBindings() {
    JTableBinding, JTable> jTableBinding = SwingBindings.createJTableBinding(UpdateStrategy.READ_WRITE,
        mediaFiles, tableMediaFiles);
    //
    BeanProperty mediaFileContainerBeanProperty = BeanProperty.create("mediaFile.filename");
    jTableBinding.addColumnBinding(mediaFileContainerBeanProperty).setColumnName("Filename").setEditable(false);
    //
    jTableBinding.setEditable(false);
    jTableBinding.bind();
    //
    BeanProperty jTableBeanProperty = BeanProperty.create("selectedElement.mediaFile.filename");
    BeanProperty jLabelBeanProperty = BeanProperty.create("text");
    AutoBinding autoBinding = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, tableMediaFiles,
        jTableBeanProperty, lblFilename, jLabelBeanProperty);
    autoBinding.bind();
    //
    BeanProperty jTableBeanProperty_1 = BeanProperty.create("selectedElement.mediaFile.videoCodec");
    BeanProperty jTextFieldBeanProperty = BeanProperty.create("text");
    AutoBinding autoBinding_1 = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, tableMediaFiles,
        jTableBeanProperty_1, tfCodec, jTextFieldBeanProperty);
    autoBinding_1.bind();
    //
    BeanProperty jTableBeanProperty_3 = BeanProperty.create("selectedElement.mediaFile.containerFormat");
    BeanProperty jTextFieldBeanProperty_2 = BeanProperty.create("text");
    AutoBinding autoBinding_3 = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, tableMediaFiles,
        jTableBeanProperty_3, tfContainerFormat, jTextFieldBeanProperty_2);
    autoBinding_3.bind();
    //
    BeanProperty jTableBeanProperty_5 = BeanProperty.create("selectedElement.mediaFile.videoWidth");
    BeanProperty jTextFieldBeanProperty_4 = BeanProperty.create("text");
    AutoBinding autoBinding_5 = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, tableMediaFiles,
        jTableBeanProperty_5, tfWidth, jTextFieldBeanProperty_4);
    autoBinding_5.bind();
    //
    BeanProperty jTableBeanProperty_6 = BeanProperty.create("selectedElement.mediaFile.videoHeight");
    BeanProperty jTextFieldBeanProperty_5 = BeanProperty.create("text");
    AutoBinding autoBinding_6 = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, tableMediaFiles,
        jTableBeanProperty_6, tfHeight, jTextFieldBeanProperty_5);
    autoBinding_6.bind();
    //
    BeanProperty> jTableBeanProperty_2 = BeanProperty.create("selectedElement.audioStreams");
    JTableBinding jTableBinding_1 = SwingBindings.createJTableBinding(UpdateStrategy.READ_WRITE,
        tableMediaFiles, jTableBeanProperty_2, tableAudioStreams);
    //
    BeanProperty mediaFileAudioStreamBeanProperty = BeanProperty.create("language");
    jTableBinding_1.addColumnBinding(mediaFileAudioStreamBeanProperty).setColumnName("Language").setColumnClass(String.class);
    //
    BeanProperty mediaFileAudioStreamBeanProperty_1 = BeanProperty.create("codec");
    jTableBinding_1.addColumnBinding(mediaFileAudioStreamBeanProperty_1).setColumnName("Codec");
    //
    BeanProperty mediaFileAudioStreamBeanProperty_2 = BeanProperty.create("audioChannels");
    jTableBinding_1.addColumnBinding(mediaFileAudioStreamBeanProperty_2).setColumnName("Channels");
    //
    BeanProperty mediaFileAudioStreamBeanProperty_3 = BeanProperty.create("bitrate");
    jTableBinding_1.addColumnBinding(mediaFileAudioStreamBeanProperty_3).setColumnName("Bitrate").setColumnClass(Integer.class);
    //
    jTableBinding_1.bind();
    //
    BeanProperty> jTableBeanProperty_4 = BeanProperty.create("selectedElement.subtitles");
    JTableBinding jTableBinding_2 = SwingBindings.createJTableBinding(UpdateStrategy.READ_WRITE, tableMediaFiles,
        jTableBeanProperty_4, tableSubtitles);
    //
    BeanProperty mediaFileSubtitleBeanProperty = BeanProperty.create("language");
    jTableBinding_2.addColumnBinding(mediaFileSubtitleBeanProperty).setColumnName("Language").setColumnClass(String.class);
    //
    BeanProperty mediaFileSubtitleBeanProperty_1 = BeanProperty.create("forced");
    jTableBinding_2.addColumnBinding(mediaFileSubtitleBeanProperty_1).setColumnName("Forced").setColumnClass(Boolean.class);
    //
    jTableBinding_2.bind();
    //
    BeanProperty jTableBeanProperty_7 = BeanProperty.create("selectedElement.mediaFile.video3DFormat");
    BeanProperty jComboBoxBeanProperty = BeanProperty.create("selectedItem");
    AutoBinding autoBinding_2 = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, tableMediaFiles,
        jTableBeanProperty_7, cb3dFormat, jComboBoxBeanProperty);
    autoBinding_2.bind();
    //
    BeanProperty tmmTableBeanProperty = BeanProperty.create("selectedElement.mediaFile.aspectRatio");
    AutoBinding autoBinding_4 = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, tableMediaFiles,
        tmmTableBeanProperty, cbAspectRatio, jComboBoxBeanProperty);
    autoBinding_4.bind();
    //
    BeanProperty tmmTableBeanProperty_1 = BeanProperty.create("selectedElement.mediaFile.frameRate");
    BeanProperty jFormattedTextFieldBeanProperty = BeanProperty.create("text");
    AutoBinding autoBinding_7 = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, tableMediaFiles,
        tmmTableBeanProperty_1, tfFrameRate, jFormattedTextFieldBeanProperty);
    autoBinding_7.bind();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy