* work around JDK 8u20 compilation issues

This commit is contained in:
Reinhard Pointner 2014-08-21 11:45:59 +00:00
parent b6358fa466
commit 2544100ef3
2 changed files with 95 additions and 117 deletions

View File

@ -230,7 +230,7 @@ class HistoryDialog extends JDialog {
// use filter on both tables
for (JTable table : Arrays.asList(sequenceTable, elementTable)) {
TableRowSorter<?> sorter = (TableRowSorter<?>) table.getRowSorter();
TableRowSorter sorter = (TableRowSorter) table.getRowSorter();
sorter.setRowFilter(RowFilter.andFilter(filterList));
}

View File

@ -1,7 +1,5 @@
package net.filebot.ui.subtitle;
import static java.awt.Font.*;
import static java.util.Collections.*;
import static java.util.regex.Pattern.*;
@ -52,7 +50,6 @@ import net.filebot.util.ui.notification.SeparatorBorder;
import net.filebot.util.ui.notification.SeparatorBorder.Position;
import net.miginfocom.swing.MigLayout;
public class SubtitleViewer extends JFrame {
private final JLabel titleLabel = new JLabel();
@ -66,7 +63,6 @@ public class SubtitleViewer extends JFrame {
private Color defaultFilterForeground = filterEditor.getForeground();
private Color disabledFilterForeground = Color.lightGray;
public SubtitleViewer(String title) {
super(title);
@ -102,7 +98,6 @@ public class SubtitleViewer extends JFrame {
pack();
}
private JTable createTable(TableModel model) {
final JTable table = new JTable(model);
table.setBackground(Color.white);
@ -168,7 +163,6 @@ public class SubtitleViewer extends JFrame {
return table;
}
private JTextField createFilterEditor() {
final JTextField editor = new JTextField() {
@ -205,13 +199,11 @@ public class SubtitleViewer extends JFrame {
return editor;
}
private RowFilter<?, ?> getTableFilter() {
TableRowSorter<?> sorter = (TableRowSorter<?>) subtitleTable.getRowSorter();
return sorter.getRowFilter();
}
private void setTableFilter(String filter) {
// filter by words
List<SubtitleFilter> filterList = new ArrayList<SubtitleFilter>();
@ -224,23 +216,20 @@ public class SubtitleViewer extends JFrame {
}
}
TableRowSorter<?> sorter = (TableRowSorter<?>) subtitleTable.getRowSorter();
TableRowSorter sorter = (TableRowSorter) subtitleTable.getRowSorter();
sorter.setRowFilter(filterList.isEmpty() ? null : RowFilter.andFilter(filterList));
filterEditor.setForeground(filterList.isEmpty() ? disabledFilterForeground : defaultFilterForeground);
}
public void setData(List<SubtitleElement> data) {
model.setData(data);
}
public JLabel getTitleLabel() {
return titleLabel;
}
public JLabel getInfoLabel() {
return infoLabel;
}
@ -253,17 +242,14 @@ public class SubtitleViewer extends JFrame {
}
};
private static class SubtitleFilter extends RowFilter<Object, Integer> {
private final Pattern filter;
public SubtitleFilter(String filter) {
this.filter = compile(quote(filter), CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS | CANON_EQ);
}
@Override
public boolean include(Entry<?, ? extends Integer> entry) {
SubtitleTableModel model = (SubtitleTableModel) entry.getModel();
@ -274,12 +260,10 @@ public class SubtitleViewer extends JFrame {
}
private static class SubtitleTableModel extends AbstractTableModel {
private List<SubtitleElement> data = emptyList();
public void setData(List<SubtitleElement> data) {
this.data = new ArrayList<SubtitleElement>(data);
@ -287,12 +271,10 @@ public class SubtitleViewer extends JFrame {
fireTableDataChanged();
}
public SubtitleElement getRow(int row) {
return data.get(row);
}
@Override
public String getColumnName(int column) {
switch (column) {
@ -309,19 +291,16 @@ public class SubtitleViewer extends JFrame {
}
}
@Override
public int getColumnCount() {
return 4;
}
@Override
public int getRowCount() {
return data.size();
}
@Override
public Class<?> getColumnClass(int column) {
switch (column) {
@ -338,7 +317,6 @@ public class SubtitleViewer extends JFrame {
}
}
@Override
public Object getValueAt(int row, int column) {
switch (column) {