From de60d14d39559b5b4b88bc6c9c2c37f2f06765dd Mon Sep 17 00:00:00 2001 From: "Christian F." Date: Thu, 31 Oct 2024 10:10:55 +0100 Subject: [PATCH] - remove TModel --- src/main/java/mediathek/daten/ListeProg.java | 11 +- src/main/java/mediathek/daten/ListePset.java | 11 +- .../mediathek/daten/ListePsetVorlagen.java | 12 +- .../dialogEinstellungen/PanelPsetImport.form | 2 +- .../dialogEinstellungen/PanelPsetImport.java | 325 +++++++++--------- .../dialogEinstellungen/PanelPsetLang.java | 30 +- .../gui/dialogEinstellungen/PanelPsetLang.jfd | 12 +- .../java/mediathek/tool/models/TModel.java | 12 - .../mediathek/tool/models/TModelDownload.java | 2 +- .../tool/table/MVDownloadsTable.java | 4 +- .../mediathek/tool/table/MVProgTable.java | 4 +- .../mediathek/tool/table/MVPsetTable.java | 4 +- 12 files changed, 209 insertions(+), 220 deletions(-) delete mode 100644 src/main/java/mediathek/tool/models/TModel.java diff --git a/src/main/java/mediathek/daten/ListeProg.java b/src/main/java/mediathek/daten/ListeProg.java index 8c1aad4b8f..7616d673c8 100644 --- a/src/main/java/mediathek/daten/ListeProg.java +++ b/src/main/java/mediathek/daten/ListeProg.java @@ -19,8 +19,9 @@ */ package mediathek.daten; -import mediathek.tool.models.TModel; +import mediathek.tool.models.NonEditableTableModel; +import javax.swing.table.TableModel; import java.util.ArrayList; import java.util.Iterator; @@ -54,8 +55,8 @@ public int auf(int idx, boolean auf) { return neu; } - public TModel getModel() { - TModel model; + public TableModel createModel() { + TableModel model; Object[][] object; DatenProg daten; int i = 0; @@ -67,9 +68,9 @@ public TModel getModel() { object[i] = daten.arr; ++i; } - model = new TModel(object, DatenProg.COLUMN_NAMES); + model = new NonEditableTableModel(object, DatenProg.COLUMN_NAMES); } else { - model = new TModel(new Object[0][DatenProg.MAX_ELEM], DatenProg.COLUMN_NAMES); + model = new NonEditableTableModel(new Object[0][DatenProg.MAX_ELEM], DatenProg.COLUMN_NAMES); } return model; } diff --git a/src/main/java/mediathek/daten/ListePset.java b/src/main/java/mediathek/daten/ListePset.java index 7aefadafb4..16deba122e 100644 --- a/src/main/java/mediathek/daten/ListePset.java +++ b/src/main/java/mediathek/daten/ListePset.java @@ -6,10 +6,11 @@ import mediathek.gui.dialogEinstellungen.PanelProgrammPfade; import mediathek.gui.messages.ProgramSetChangedEvent; import mediathek.tool.MessageBus; -import mediathek.tool.models.TModel; +import mediathek.tool.models.NonEditableTableModel; import org.apache.commons.lang3.StringUtils; import javax.swing.*; +import javax.swing.table.TableModel; import java.util.ArrayList; import java.util.Iterator; import java.util.regex.Matcher; @@ -202,8 +203,8 @@ public boolean addPset(ListePset liste) { return ret; } - public TModel getModel() { - TModel model; + public TableModel createModel() { + TableModel model; Object[][] object; DatenPset datenPset; int i = 0; @@ -215,9 +216,9 @@ public TModel getModel() { object[i] = datenPset.arr; ++i; } - model = new TModel(object, DatenPset.COLUMN_NAMES); + model = new NonEditableTableModel(object, DatenPset.COLUMN_NAMES); } else { - model = new TModel(new Object[0][DatenPset.MAX_ELEM], DatenPset.COLUMN_NAMES); + model = new NonEditableTableModel(new Object[0][DatenPset.MAX_ELEM], DatenPset.COLUMN_NAMES); } return model; } diff --git a/src/main/java/mediathek/daten/ListePsetVorlagen.java b/src/main/java/mediathek/daten/ListePsetVorlagen.java index 8ddf79ff59..95e7ad0945 100644 --- a/src/main/java/mediathek/daten/ListePsetVorlagen.java +++ b/src/main/java/mediathek/daten/ListePsetVorlagen.java @@ -5,7 +5,7 @@ import mediathek.file.GetFile; import mediathek.tool.NetUtils; import mediathek.tool.http.MVHttpClient; -import mediathek.tool.models.TModel; +import mediathek.tool.models.NonEditableTableModel; import okhttp3.Request; import okhttp3.Response; import okhttp3.ResponseBody; @@ -15,6 +15,7 @@ import org.jetbrains.annotations.NotNull; import javax.swing.*; +import javax.swing.table.TableModel; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamConstants; import javax.xml.stream.XMLStreamException; @@ -25,7 +26,6 @@ import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; -import java.util.stream.Collectors; public class ListePsetVorlagen extends ArrayList { private static final String BS_WIN_32 = "Windows-32Bit"; @@ -51,11 +51,11 @@ public class ListePsetVorlagen extends ArrayList { private static final Logger logger = LogManager.getLogger(ListePsetVorlagen.class); - public TModel getTModel(String bs) { + public TableModel createModel(String bs) { String[][] object; if (this.size() > 0) { if (!bs.isEmpty()) { - List tmp = this.stream().filter(aThi -> aThi[PGR_BS_NR].contains(bs)).collect(Collectors.toList()); + List tmp = this.stream().filter(aThi -> aThi[PGR_BS_NR].contains(bs)).toList(); object = new String[tmp.size()][PGR_MAX_ELEM]; for (int i = 0; i < tmp.size(); i++) { object[i] = tmp.get(i); @@ -66,9 +66,9 @@ public TModel getTModel(String bs) { object[i] = this.get(i); } } - return new TModel(object, PGR_COLUMN_NAMES); + return new NonEditableTableModel(object, PGR_COLUMN_NAMES); } else { - return new TModel(new Object[][]{}, PGR_COLUMN_NAMES); + return new NonEditableTableModel(new Object[][]{}, PGR_COLUMN_NAMES); } } diff --git a/src/main/java/mediathek/gui/dialogEinstellungen/PanelPsetImport.form b/src/main/java/mediathek/gui/dialogEinstellungen/PanelPsetImport.form index e65e6fe498..d9df3e864e 100644 --- a/src/main/java/mediathek/gui/dialogEinstellungen/PanelPsetImport.form +++ b/src/main/java/mediathek/gui/dialogEinstellungen/PanelPsetImport.form @@ -109,7 +109,7 @@ - + diff --git a/src/main/java/mediathek/gui/dialogEinstellungen/PanelPsetImport.java b/src/main/java/mediathek/gui/dialogEinstellungen/PanelPsetImport.java index 37e8a9e818..0bd8cbb3d3 100644 --- a/src/main/java/mediathek/gui/dialogEinstellungen/PanelPsetImport.java +++ b/src/main/java/mediathek/gui/dialogEinstellungen/PanelPsetImport.java @@ -9,7 +9,7 @@ import mediathek.tool.GuiFunktionenProgramme; import mediathek.tool.SVGIconUtilities; import mediathek.tool.TextCopyPasteHandler; -import mediathek.tool.models.TModel; +import mediathek.tool.models.NonEditableTableModel; import org.apache.commons.lang3.SystemUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -65,11 +65,12 @@ private void init() { tabelleLaden(); }); jTableVorlagen.getSelectionModel().addListSelectionListener(new BeobTableSelect()); - jTableVorlagen.setModel(new TModel(new Object[][]{}, ListePsetVorlagen.PGR_COLUMN_NAMES)); + jTableVorlagen.setModel(new NonEditableTableModel(new Object[][]{}, ListePsetVorlagen.PGR_COLUMN_NAMES)); if (!Config.isDebugModeEnabled()) { - jTableVorlagen.getColumnModel().getColumn(jTableVorlagen.convertColumnIndexToView(ListePsetVorlagen.PGR_VERSION_NR)).setMinWidth(0); - jTableVorlagen.getColumnModel().getColumn(jTableVorlagen.convertColumnIndexToView(ListePsetVorlagen.PGR_VERSION_NR)).setPreferredWidth(0); - jTableVorlagen.getColumnModel().getColumn(jTableVorlagen.convertColumnIndexToView(ListePsetVorlagen.PGR_VERSION_NR)).setMaxWidth(0); + final var colModel = jTableVorlagen.getColumnModel(); + colModel.getColumn(jTableVorlagen.convertColumnIndexToView(ListePsetVorlagen.PGR_VERSION_NR)).setMinWidth(0); + colModel.getColumn(jTableVorlagen.convertColumnIndexToView(ListePsetVorlagen.PGR_VERSION_NR)).setPreferredWidth(0); + colModel.getColumn(jTableVorlagen.convertColumnIndexToView(ListePsetVorlagen.PGR_VERSION_NR)).setMaxWidth(0); } jButtonImportStandard.addActionListener(e -> GuiFunktionenProgramme.addSetVorlagen(parentComponent, daten, ListePsetVorlagen.getStandarset(parentComponent, true), true)); } @@ -96,7 +97,7 @@ private void importText() { } private void tabelleLaden() { - jTableVorlagen.setModel(listePsetVorlagen.getTModel(jComboBoxBs.getSelectedItem().toString())); + jTableVorlagen.setModel(listePsetVorlagen.createModel(jComboBoxBs.getSelectedItem().toString())); if (!Config.isDebugModeEnabled()) { jTableVorlagen.getColumnModel().getColumn(jTableVorlagen.convertColumnIndexToView(ListePsetVorlagen.PGR_VERSION_NR)).setMinWidth(0); jTableVorlagen.getColumnModel().getColumn(jTableVorlagen.convertColumnIndexToView(ListePsetVorlagen.PGR_VERSION_NR)).setPreferredWidth(0); @@ -274,7 +275,7 @@ private void initComponents() { jTextAreaImport = new javax.swing.JTextArea(); jButtonImportText = new javax.swing.JButton(); - jTableVorlagen.setModel(new TModel()); + jTableVorlagen.setModel(new NonEditableTableModel()); jScrollPane2.setViewportView(jTableVorlagen); jPanel4.setBorder(javax.swing.BorderFactory.createEtchedBorder()); @@ -303,56 +304,56 @@ private void initComponents() { javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( - jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel4Layout.createSequentialGroup() - .addContainerGap() - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel4Layout.createSequentialGroup() - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel1) - .addComponent(jLabel6)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jTextFieldBs) - .addComponent(jTextFieldName))) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() - .addGap(0, 0, Short.MAX_VALUE) - .addComponent(jButtonImportVorlage)) - .addGroup(jPanel4Layout.createSequentialGroup() - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel2) - .addComponent(jLabel3)) - .addGap(26, 26, 26) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jTextFieldUrl) - .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 461, Short.MAX_VALUE)))) - .addContainerGap()) + jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel4Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel4Layout.createSequentialGroup() + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1) + .addComponent(jLabel6)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jTextFieldBs) + .addComponent(jTextFieldName))) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(jButtonImportVorlage)) + .addGroup(jPanel4Layout.createSequentialGroup() + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel2) + .addComponent(jLabel3)) + .addGap(26, 26, 26) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jTextFieldUrl) + .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 461, Short.MAX_VALUE)))) + .addContainerGap()) ); jPanel4Layout.setVerticalGroup( - jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel4Layout.createSequentialGroup() - .addContainerGap() - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel1) - .addComponent(jTextFieldName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel6) - .addComponent(jTextFieldBs, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel2) - .addComponent(jTextFieldUrl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel3) - .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jButtonImportVorlage) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel4Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(jTextFieldName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel6) + .addComponent(jTextFieldBs, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(jTextFieldUrl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel3) + .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jButtonImportVorlage) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); - jPanel4Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[]{jButtonImportVorlage, jTextFieldBs, jTextFieldName, jTextFieldUrl}); + jPanel4Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jButtonImportVorlage, jTextFieldBs, jTextFieldName, jTextFieldUrl}); jButtonAktualisieren.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mediathek/res/muster/button-aktualisieren.png"))); // NOI18N jButtonAktualisieren.setToolTipText("Neu laden"); @@ -364,36 +365,36 @@ private void initComponents() { javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( - jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel3Layout.createSequentialGroup() - .addContainerGap() - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() - .addComponent(jLabel5) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jComboBoxBs, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jLabel4) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jButtonAktualisieren))) - .addContainerGap()) + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addComponent(jLabel5) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jComboBoxBs, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButtonAktualisieren))) + .addContainerGap()) ); jPanel3Layout.setVerticalGroup( - jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel3Layout.createSequentialGroup() - .addGap(7, 7, 7) - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) - .addComponent(jLabel4) - .addComponent(jButtonAktualisieren) - .addComponent(jLabel5) - .addComponent(jComboBoxBs, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 216, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap()) + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(7, 7, 7) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) + .addComponent(jLabel4) + .addComponent(jButtonAktualisieren) + .addComponent(jLabel5) + .addComponent(jComboBoxBs, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 216, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) ); jTabbedPane1.addTab("Setvorlagen", jPanel3); @@ -411,24 +412,24 @@ private void initComponents() { javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup( - jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel5Layout.createSequentialGroup() - .addContainerGap() - .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 591, Short.MAX_VALUE) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup() - .addGap(0, 0, Short.MAX_VALUE) - .addComponent(jButtonImportStandard))) - .addContainerGap()) + jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel5Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 591, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(jButtonImportStandard))) + .addContainerGap()) ); jPanel5Layout.setVerticalGroup( - jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel5Layout.createSequentialGroup() - .addContainerGap() - .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jButtonImportStandard) - .addContainerGap(302, Short.MAX_VALUE)) + jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel5Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButtonImportStandard) + .addContainerGap(302, Short.MAX_VALUE)) ); jTabbedPane1.addTab("Standardset", jPanel5); @@ -445,33 +446,33 @@ private void initComponents() { javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout.setHorizontalGroup( - jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel6Layout.createSequentialGroup() - .addContainerGap(12, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup() - .addComponent(jLabel7) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jTextFieldDatei) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jButtonPfad)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup() - .addGap(0, 0, Short.MAX_VALUE) - .addComponent(jButtonImportDatei))) - .addContainerGap()) + jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel6Layout.createSequentialGroup() + .addContainerGap(12, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup() + .addComponent(jLabel7) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jTextFieldDatei) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButtonPfad)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(jButtonImportDatei))) + .addContainerGap()) ); jPanel6Layout.setVerticalGroup( - jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel6Layout.createSequentialGroup() - .addContainerGap() - .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jButtonPfad) - .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jTextFieldDatei, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel7))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jButtonImportDatei) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel6Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jButtonPfad) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jTextFieldDatei, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel7))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jButtonImportDatei) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel6Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jButtonPfad, jTextFieldDatei}); @@ -487,45 +488,45 @@ private void initComponents() { javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7); jPanel7.setLayout(jPanel7Layout); jPanel7Layout.setHorizontalGroup( - jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel7Layout.createSequentialGroup() - .addContainerGap() - .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jTextAreaImport, javax.swing.GroupLayout.DEFAULT_SIZE, 557, Short.MAX_VALUE) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup() - .addGap(0, 0, Short.MAX_VALUE) - .addComponent(jButtonImportText))) - .addContainerGap()) + jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel7Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jTextAreaImport, javax.swing.GroupLayout.DEFAULT_SIZE, 557, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(jButtonImportText))) + .addContainerGap()) ); jPanel7Layout.setVerticalGroup( - jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup() - .addContainerGap() - .addComponent(jTextAreaImport, javax.swing.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jButtonImportText) - .addContainerGap()) + jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jTextAreaImport, javax.swing.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jButtonImportText) + .addContainerGap()) ); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addContainerGap() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addContainerGap()) + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap()) ); jPanel1Layout.setVerticalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addContainerGap() - .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addContainerGap()) + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) ); jTabbedPane1.addTab("Set importieren", jPanel1); @@ -533,18 +534,18 @@ private void initComponents() { javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(jTabbedPane1) - .addContainerGap()) + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jTabbedPane1) + .addContainerGap()) ); layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(jTabbedPane1) - .addContainerGap()) + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jTabbedPane1) + .addContainerGap()) ); }// //GEN-END:initComponents diff --git a/src/main/java/mediathek/gui/dialogEinstellungen/PanelPsetLang.java b/src/main/java/mediathek/gui/dialogEinstellungen/PanelPsetLang.java index 0ea4893c6d..12d9a4bbcd 100644 --- a/src/main/java/mediathek/gui/dialogEinstellungen/PanelPsetLang.java +++ b/src/main/java/mediathek/gui/dialogEinstellungen/PanelPsetLang.java @@ -17,7 +17,7 @@ import mediathek.tool.*; import mediathek.tool.cellrenderer.CellRendererProgramme; import mediathek.tool.cellrenderer.CellRendererPset; -import mediathek.tool.models.TModel; +import mediathek.tool.models.NonEditableTableModel; import mediathek.tool.table.MVProgTable; import mediathek.tool.table.MVPsetTable; import mediathek.tool.table.MVTable; @@ -517,7 +517,7 @@ private void tabellePset() { private void nurtabellePset() { stopBeob = true; tabellePset.getSpalten(); - tabellePset.setModel(listePset.getModel()); + tabellePset.setModel(listePset.createModel()); tabellePset.setSpalten(); spaltenSetzen(); jLabelMeldungAbspielen.setVisible(listePset.getPsetAbspielen() == null); @@ -588,7 +588,7 @@ private void tabelleProgramme() { case FilmResolution.LOW -> jRadioButtonAufloesungKlein.setSelected(true); default -> jRadioButtonAufloesungNormal.setSelected(true); } - tabelleProgramme.setModel(pSet.getListeProg().getModel()); + tabelleProgramme.setModel(pSet.getListeProg().createModel()); if (tabelleProgramme.getRowCount() > 0) { spaltenSetzenProgramme(); tabelleProgramme.setRowSelectionInterval(0, 0); @@ -609,7 +609,7 @@ private void tabelleProgramme() { tfGruppeZielName.setText(""); tfGruppeZielPfad.setText(""); jTextAreaSetBeschreibung.setText(""); - tabelleProgramme.setModel(new TModel(new Object[0][DatenProg.MAX_ELEM], DatenProg.COLUMN_NAMES)); + tabelleProgramme.setModel(new NonEditableTableModel(new Object[0][DatenProg.MAX_ELEM], DatenProg.COLUMN_NAMES)); } stopBeob = false; fillTextProgramme(); @@ -726,7 +726,7 @@ private void setLoeschen() { if (ret == JOptionPane.OK_OPTION) { for (int i = rows.length - 1; i >= 0; --i) { int delRow = tabellePset.convertRowIndexToModel(rows[i]); - ((TModel) tabellePset.getModel()).removeRow(delRow); + ((NonEditableTableModel) tabellePset.getModel()).removeRow(delRow); listePset.remove(delRow); } tabellePset(); @@ -1088,7 +1088,7 @@ private void initComponents() { .addComponent(jCheckBoxButton) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jCheckBoxAbo) - .addContainerGap(71, Short.MAX_VALUE)) + .addContainerGap(81, Short.MAX_VALUE)) ); jPanel6Layout.setVerticalGroup( jPanel6Layout.createParallelGroup() @@ -1201,9 +1201,9 @@ private void initComponents() { .addComponent(jButtonGruppeStandardfarbe)) .addComponent(jLabel11) .addComponent(jLabel13)) - .addContainerGap(317, Short.MAX_VALUE)) + .addContainerGap(325, Short.MAX_VALUE)) ); - jPanel5Layout.linkSize(SwingConstants.HORIZONTAL, jButtonGruppeFarbe, jButtonGruppeStandardfarbe); + jPanel5Layout.linkSize(SwingConstants.HORIZONTAL, new Component[] {jButtonGruppeFarbe, jButtonGruppeStandardfarbe}); jPanel5Layout.setVerticalGroup( jPanel5Layout.createParallelGroup() .addGroup(jPanel5Layout.createSequentialGroup() @@ -1302,7 +1302,7 @@ private void initComponents() { .addComponent(jButtonGruppePfad)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jCheckBoxThema) - .addGap(0, 205, Short.MAX_VALUE))) + .addGap(0, 215, Short.MAX_VALUE))) .addGap(16, 16, 16)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel8) @@ -1354,7 +1354,7 @@ private void initComponents() { .addComponent(jLabel16)) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); - jPanel1Layout.linkSize(SwingConstants.VERTICAL, jButtonGruppePfad, tfGruppeZielName, tfGruppeZielPfad); + jPanel1Layout.linkSize(SwingConstants.VERTICAL, new Component[] {jButtonGruppePfad, tfGruppeZielName, tfGruppeZielPfad}); } GroupLayout jPanel9Layout = new GroupLayout(jPanel9); @@ -1419,7 +1419,7 @@ private void initComponents() { //---- jTextArea1 ---- jTextArea1.setEditable(false); - jTextArea1.setBackground(new Color(238, 238, 238)); + jTextArea1.setBackground(new Color(0xeeeeee)); jTextArea1.setColumns(20); jTextArea1.setRows(4); jTextArea1.setText("Filme, deren URL mit \"Pr\u00e4fix\" beginnt und mit \"Suffix\" endet, werden nicht\nmit einem Hilfsprogramm gespeichert, sondern direkt geladen.\n\nEine geringere Aufl\u00f6sung ist nicht bei jedem Sender m\u00f6glich, es wird dann in der gleichen\nAufl\u00f6sung geladen."); //NON-NLS @@ -1544,7 +1544,7 @@ private void initComponents() { jScrollPane1.setBorder(new TitledBorder(null, "Titel", TitledBorder.LEFT, TitledBorder.TOP)); //NON-NLS //---- jTableProgramme ---- - jTableProgramme.setModel(new TModel()); + jTableProgramme.setModel(new NonEditableTableModel()); jTableProgramme.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); jScrollPane1.setViewportView(jTableProgramme); } @@ -1669,12 +1669,12 @@ private void initComponents() { .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel4) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jTextFieldProgSuffix, GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)) + .addComponent(jTextFieldProgSuffix, GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE)) .addGroup(jPanelProgrammDetailsLayout.createSequentialGroup() .addGroup(jPanelProgrammDetailsLayout.createParallelGroup() .addComponent(jCheckBoxRemoteDownload) .addComponent(jCheckBoxRestart)) - .addGap(0, 194, Short.MAX_VALUE))))) + .addGap(0, 206, Short.MAX_VALUE))))) .addContainerGap()) ); jPanelProgrammDetailsLayout.setVerticalGroup( @@ -1709,7 +1709,7 @@ private void initComponents() { .addComponent(jCheckBoxRemoteDownload) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); - jPanelProgrammDetailsLayout.linkSize(SwingConstants.VERTICAL, jButtonProgPfad, jTextFieldProgName, jTextFieldProgPfad, jTextFieldProgPraefix, jTextFieldProgSchalter, jTextFieldProgSuffix, jTextFieldProgZielDateiName); + jPanelProgrammDetailsLayout.linkSize(SwingConstants.VERTICAL, new Component[] {jButtonProgPfad, jTextFieldProgName, jTextFieldProgPfad, jTextFieldProgPraefix, jTextFieldProgSchalter, jTextFieldProgSuffix, jTextFieldProgZielDateiName}); } GroupLayout jPanelProgrammeLayout = new GroupLayout(jPanelProgramme); diff --git a/src/main/java/mediathek/gui/dialogEinstellungen/PanelPsetLang.jfd b/src/main/java/mediathek/gui/dialogEinstellungen/PanelPsetLang.jfd index 2c32f992be..ed0084ec69 100644 --- a/src/main/java/mediathek/gui/dialogEinstellungen/PanelPsetLang.jfd +++ b/src/main/java/mediathek/gui/dialogEinstellungen/PanelPsetLang.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.5.1.409" Java: "11.0.14.1" encoding: "UTF-8" +JFDML JFormDesigner: "8.2.4.0.393" Java: "21.0.4" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -78,7 +78,7 @@ new FormModel { } ) } ) add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class org.jdesktop.layout.GroupLayout ) { - "$horizontalGroup": "par l {seq {space :::p, comp jButtonAbspielen:::p::p, space u:::p, comp jCheckBoxSpeichern:::p::p, space u:::p, comp jCheckBoxButton:::p::p, space u:::p, comp jCheckBoxAbo:::p::p, space ::71:x}}" + "$horizontalGroup": "par l {seq {space :::p, comp jButtonAbspielen:::p::p, space u:::p, comp jCheckBoxSpeichern:::p::p, space u:::p, comp jCheckBoxButton:::p::p, space u:::p, comp jCheckBoxAbo:::p::p, space ::81:x}}" "$verticalGroup": "par l {seq l {space :::p, par b {comp jCheckBoxSpeichern::b:p::p, comp jCheckBoxButton::b:p::p, comp jCheckBoxAbo::b:p::p, comp jButtonAbspielen::b:p::p}, space :::x}}" } ) { name: "jPanel6" @@ -124,7 +124,7 @@ new FormModel { "JavaCodeGenerator.variableLocal": true } add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class org.jdesktop.layout.GroupLayout ) { - "$horizontalGroup": "par l {seq {space :::p, par l {seq l {comp jButtonGruppeFarbe:5::p::p, space :::p, comp jButtonGruppeStandardfarbe:5::p::p}, comp jLabel11::l:p::p, comp jLabel13::l:p::p}, space ::317:x}}" + "$horizontalGroup": "par l {seq {space :::p, par l {seq l {comp jButtonGruppeFarbe:5::p::p, space :::p, comp jButtonGruppeStandardfarbe:5::p::p}, comp jLabel11::l:p::p, comp jLabel13::l:p::p}, space ::325:x}}" "$verticalGroup": "par l {seq l {space :::p, comp jLabel11:::p::p, space :::p, comp jLabel13:::p::p, space u:::p, par b {comp jButtonGruppeFarbe::b:p::p, comp jButtonGruppeStandardfarbe:6:b:p::p}, space :::x}}" } ) { name: "jPanel5" @@ -169,7 +169,7 @@ new FormModel { "JavaCodeGenerator.variableLocal": true } add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class org.jdesktop.layout.GroupLayout ) { - "$horizontalGroup": "par l {seq l {space :::p, par l {seq {space :21:21:p, comp jLabel15:::p::p, space :0:0:x}, seq l {par l {seq l {comp jLabel7:::p::p, space :p:56:p, comp tfGruppeZielPfad:::::x, space :::p, comp jButtonGruppePfad:::p::p:1}, seq l {comp jCheckBoxThema:::p::p, space :0:205:x}}, space :p:16:p}, seq l {comp jLabel8:::p::p, space :::p, par l {comp tfGruppeZielName::l:::x, seq {par l:::p {seq {comp jCheckBoxLaenge:::p::p, space :p::p, comp jSpinnerLaenge:::p::p, space :::p, comp jLabel12:::p::p}, seq {comp jCheckBoxField:::p::p, space :::x, comp jSpinnerField:::p::p, space :::p, comp jLabel16:::p::p}}, space :0:0:x}}, space :::p}}}}" + "$horizontalGroup": "par l {seq l {space :::p, par l {seq {space :21:21:p, comp jLabel15:::p::p, space :0:0:x}, seq l {par l {seq l {comp jLabel7:::p::p, space :p:56:p, comp tfGruppeZielPfad:::::x, space :::p, comp jButtonGruppePfad:::p::p:1}, seq l {comp jCheckBoxThema:::p::p, space :0:215:x}}, space :p:16:p}, seq l {comp jLabel8:::p::p, space :::p, par l {comp tfGruppeZielName::l:::x, seq {par l:::p {seq {comp jCheckBoxLaenge:::p::p, space :p::p, comp jSpinnerLaenge:::p::p, space :::p, comp jLabel12:::p::p}, seq {comp jCheckBoxField:::p::p, space :::x, comp jSpinnerField:::p::p, space :::p, comp jLabel16:::p::p}}, space :0:0:x}}, space :::p}}}}" "$verticalGroup": "par l {seq l {space :::p, comp jCheckBoxThema:::p::p, space :::p, comp jLabel15:::p::p, space s:p::p, par c {comp jLabel7::c:p::p, comp tfGruppeZielPfad:3:c:p::p, comp jButtonGruppePfad:3:c:p::p}, space u:::p, par b {comp jLabel8::b:p::p, comp tfGruppeZielName:3:b:p::p}, space u:::p, par b {comp jCheckBoxLaenge::b:p::p, comp jSpinnerLaenge::b:p::p, comp jLabel12::b:p::p}, space :::p, par b {comp jCheckBoxField::b:p::p, comp jSpinnerField::b:p::p, comp jLabel16::b:p::p}, space :::x}}" } ) { name: "jPanel1" @@ -372,7 +372,7 @@ new FormModel { name: "jTableProgramme" "autoResizeMode": 0 auxiliary() { - "JavaCodeGenerator.preInitCode": "${field}.setModel(new TModel());" + "JavaCodeGenerator.preInitCode": "${field}.setModel(new NonEditableTableModel());" "JavaCodeGenerator.variableLocal": true } } ) @@ -413,7 +413,7 @@ new FormModel { } ) } ) add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class org.jdesktop.layout.GroupLayout ) { - "$horizontalGroup": "par l {seq l {space :::p, par l {seq l {par l {comp jLabel2::l:p::p, comp jLabel9::l:p::p}, space :p:24:p, par l {comp jTextFieldProgZielDateiName:::::x, comp jTextFieldProgName:::::x}}, seq l {par l {comp jLabel3::l:p::p, comp jLabel1::l:p::p, comp jLabel::l:p::p}, space :p::p, par l {comp jTextFieldProgSchalter::l:::x, seq t {comp jTextFieldProgPfad:::::x, space :::p, comp jButtonProgPfad:::p::p:1}, seq l {comp jTextFieldProgPraefix:::p:146:p:2, space :::p, comp jLabel4:::p::p, space :::p, comp jTextFieldProgSuffix::::183:x:2}, seq {par l {comp jCheckBoxRemoteDownload:::p::p, comp jCheckBoxRestart:::p::p}, space :0:194:x}}}}, space :::p}}" + "$horizontalGroup": "par l {seq l {space :::p, par l {seq l {par l {comp jLabel2::l:p::p, comp jLabel9::l:p::p}, space :p:24:p, par l {comp jTextFieldProgZielDateiName:::::x, comp jTextFieldProgName:::::x}}, seq l {par l {comp jLabel3::l:p::p, comp jLabel1::l:p::p, comp jLabel::l:p::p}, space :p::p, par l {comp jTextFieldProgSchalter::l:::x, seq t {comp jTextFieldProgPfad:::::x, space :::p, comp jButtonProgPfad:::p::p:1}, seq l {comp jTextFieldProgPraefix:::p:146:p:2, space :::p, comp jLabel4:::p::p, space :::p, comp jTextFieldProgSuffix::::191:x:2}, seq {par l {comp jCheckBoxRemoteDownload:::p::p, comp jCheckBoxRestart:::p::p}, space :0:206:x}}}}, space :::p}}" "$verticalGroup": "par l {seq l {space :p::p, par b {comp jLabel2::b:p::p, comp jTextFieldProgName:4:b:p::p}, space :::p, par b {comp jLabel9::b:p::p, comp jTextFieldProgZielDateiName:4:b:p::p}, space :::p, par c {comp jLabel::c:p::p, comp jTextFieldProgPfad:4:c:p:12:p, comp jButtonProgPfad:4:c:p::p}, space :p::p, par b {comp jLabel1::b:p::p, comp jTextFieldProgSchalter:4:b:p:15:p}, space :p::p, par b:::p {comp jTextFieldProgPraefix:4:b:p::p, comp jLabel3::b:p::p, comp jTextFieldProgSuffix:4:b:p::p, comp jLabel4::b:p::p}, space u:::p, comp jCheckBoxRestart:::p::p, space u:::p, comp jCheckBoxRemoteDownload:::p::p, space :::x}}" } ) { name: "jPanelProgrammDetails" diff --git a/src/main/java/mediathek/tool/models/TModel.java b/src/main/java/mediathek/tool/models/TModel.java deleted file mode 100644 index fbfc2e88be..0000000000 --- a/src/main/java/mediathek/tool/models/TModel.java +++ /dev/null @@ -1,12 +0,0 @@ -package mediathek.tool.models; - -@Deprecated -public class TModel extends NonEditableTableModel { - public TModel() { - super(); - } - - public TModel(Object[][] data, Object[] columnNames) { - super(data, columnNames); - } -} diff --git a/src/main/java/mediathek/tool/models/TModelDownload.java b/src/main/java/mediathek/tool/models/TModelDownload.java index fd73fd7a03..444f6b6ebc 100644 --- a/src/main/java/mediathek/tool/models/TModelDownload.java +++ b/src/main/java/mediathek/tool/models/TModelDownload.java @@ -4,7 +4,7 @@ import mediathek.tool.MVFilmSize; import mediathek.tool.datum.Datum; -public class TModelDownload extends TModel { +public class TModelDownload extends NonEditableTableModel { @Override public Class getColumnClass(int columnIndex) { return switch (columnIndex) { diff --git a/src/main/java/mediathek/tool/table/MVDownloadsTable.java b/src/main/java/mediathek/tool/table/MVDownloadsTable.java index a1c77a14e0..3616642379 100644 --- a/src/main/java/mediathek/tool/table/MVDownloadsTable.java +++ b/src/main/java/mediathek/tool/table/MVDownloadsTable.java @@ -5,7 +5,6 @@ import mediathek.daten.DatenDownload; import mediathek.gui.messages.DownloadQueueRankChangedEvent; import mediathek.tool.MessageBus; -import mediathek.tool.models.TModel; import mediathek.tool.models.TModelDownload; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -175,8 +174,7 @@ public boolean importData(TransferHandler.TransferSupport info) { JTable target = (JTable) info.getComponent(); JTable.DropLocation dl = (JTable.DropLocation) info.getDropLocation(); int index = dl.getRow(); - TModel tModel = (TModel) table.getModel(); - int max = tModel.getRowCount(); + int max = table.getModel().getRowCount(); if (index < 0 || index > max) { index = max; } diff --git a/src/main/java/mediathek/tool/table/MVProgTable.java b/src/main/java/mediathek/tool/table/MVProgTable.java index 54a7f53da5..8d3d7c7bb3 100644 --- a/src/main/java/mediathek/tool/table/MVProgTable.java +++ b/src/main/java/mediathek/tool/table/MVProgTable.java @@ -1,7 +1,7 @@ package mediathek.tool.table; import mediathek.daten.DatenProg; -import mediathek.tool.models.TModel; +import mediathek.tool.models.NonEditableTableModel; import java.util.Optional; @@ -12,7 +12,7 @@ public MVProgTable() { Optional.empty(), Optional.empty()); - setModel(new TModel(new Object[][]{}, DatenProg.COLUMN_NAMES)); + setModel(new NonEditableTableModel(new Object[][]{}, DatenProg.COLUMN_NAMES)); } @Override diff --git a/src/main/java/mediathek/tool/table/MVPsetTable.java b/src/main/java/mediathek/tool/table/MVPsetTable.java index 8928098719..9114fc1b72 100644 --- a/src/main/java/mediathek/tool/table/MVPsetTable.java +++ b/src/main/java/mediathek/tool/table/MVPsetTable.java @@ -1,7 +1,7 @@ package mediathek.tool.table; import mediathek.daten.DatenPset; -import mediathek.tool.models.TModel; +import mediathek.tool.models.NonEditableTableModel; import java.util.Optional; @@ -12,7 +12,7 @@ public MVPsetTable() { Optional.empty(), Optional.empty()); - setModel(new TModel(new Object[][]{}, DatenPset.COLUMN_NAMES)); + setModel(new NonEditableTableModel(new Object[][]{}, DatenPset.COLUMN_NAMES)); setRowSorter(null); setAutoCreateRowSorter(false); // Reihenfolge ist die Anzeige der Button! }