1
0
mirror of https://github.com/mitb-archive/filebot synced 2025-03-09 22:09:47 -04:00

import static javax.swing.BorderFactory.*;

This commit is contained in:
Reinhard Pointner 2018-08-08 14:50:22 +07:00
parent 4af2a68376
commit c6010fc7fc
8 changed files with 20 additions and 19 deletions

View File

@ -1,5 +1,6 @@
package net.filebot.ui; package net.filebot.ui;
import static javax.swing.BorderFactory.*;
import static javax.swing.ScrollPaneConstants.*; import static javax.swing.ScrollPaneConstants.*;
import static net.filebot.Logging.*; import static net.filebot.Logging.*;
import static net.filebot.util.ui.SwingUI.*; import static net.filebot.util.ui.SwingUI.*;
@ -17,7 +18,6 @@ import java.util.TreeSet;
import java.util.logging.Level; import java.util.logging.Level;
import javax.swing.AbstractAction; import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JComponent; import javax.swing.JComponent;
@ -57,11 +57,11 @@ public abstract class AbstractSearchPanel<S, E> extends JComponent {
historyPanel.setColumnHeader(2, "Duration"); historyPanel.setColumnHeader(2, "Duration");
JScrollPane historyScrollPane = new JScrollPane(historyPanel, VERTICAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER); JScrollPane historyScrollPane = new JScrollPane(historyPanel, VERTICAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER);
historyScrollPane.setBorder(BorderFactory.createEmptyBorder()); historyScrollPane.setBorder(createEmptyBorder());
tabbedPane.addTab("History", ResourceManager.getIcon("action.find"), historyScrollPane); tabbedPane.addTab("History", ResourceManager.getIcon("action.find"), historyScrollPane);
tabbedPaneGroup.setBorder(BorderFactory.createTitledBorder("Search Results")); tabbedPaneGroup.setBorder(createTitledBorder("Search Results"));
tabbedPaneGroup.add(tabbedPane, "grow, wrap"); tabbedPaneGroup.add(tabbedPane, "grow, wrap");
setLayout(new MigLayout("nogrid, novisualpadding, fill, insets 10px 10px 15px 10px", "align 45%", "[pref!]10px[fill]")); setLayout(new MigLayout("nogrid, novisualpadding, fill, insets 10px 10px 15px 10px", "align 45%", "[pref!]10px[fill]"));

View File

@ -14,7 +14,6 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import javax.swing.AbstractAction; import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListCellRenderer;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JComboBox; import javax.swing.JComboBox;
@ -45,7 +44,7 @@ public class SelectButtonTextField<T> extends JComponent {
public SelectButtonTextField() { public SelectButtonTextField() {
selectButton.addActionListener(textFieldFocusOnClick); selectButton.addActionListener(textFieldFocusOnClick);
editor.setBorder(BorderFactory.createMatteBorder(1, 0, 1, 1, ((LineBorder) selectButton.getBorder()).getLineColor())); editor.setBorder(createMatteBorder(1, 0, 1, 1, ((LineBorder) selectButton.getBorder()).getLineColor()));
setLayout(new MigLayout("fill, nogrid, novisualpadding")); setLayout(new MigLayout("fill, nogrid, novisualpadding"));
add(selectButton, "h pref!, w pref!, sizegroupy editor"); add(selectButton, "h pref!, w pref!, sizegroupy editor");
@ -162,7 +161,7 @@ public class SelectButtonTextField<T> extends JComponent {
editor.setEnabled(comboBox.isEnabled()); editor.setEnabled(comboBox.isEnabled());
editor.setFocusable(comboBox.isFocusable()); editor.setFocusable(comboBox.isFocusable());
editor.setFont(comboBox.getFont()); editor.setFont(comboBox.getFont());
editor.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 3)); editor.setBorder(createEmptyBorder(0, 3, 0, 3));
editor.addFocusListener(createFocusListener()); editor.addFocusListener(createFocusListener());

View File

@ -1,5 +1,6 @@
package net.filebot.ui.filter; package net.filebot.ui.filter;
import static javax.swing.BorderFactory.*;
import static net.filebot.MediaTypes.*; import static net.filebot.MediaTypes.*;
import static net.filebot.media.XattrMetaInfo.*; import static net.filebot.media.XattrMetaInfo.*;
import static net.filebot.util.FileUtilities.*; import static net.filebot.util.FileUtilities.*;
@ -10,7 +11,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.CancellationException; import java.util.concurrent.CancellationException;
import javax.swing.BorderFactory;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.ListSelectionModel; import javax.swing.ListSelectionModel;
@ -42,7 +42,7 @@ class AttributeTool extends Tool<TableModel> {
table.setRowHeight(25); table.setRowHeight(25);
JScrollPane scrollPane = new JScrollPane(table); JScrollPane scrollPane = new JScrollPane(table);
scrollPane.setBorder(BorderFactory.createEmptyBorder()); scrollPane.setBorder(createEmptyBorder());
setLayout(new MigLayout("insets 0, fill")); setLayout(new MigLayout("insets 0, fill"));
add(new LoadingOverlayPane(scrollPane, this), "grow"); add(new LoadingOverlayPane(scrollPane, this), "grow");

View File

@ -1,10 +1,10 @@
package net.filebot.ui.filter; package net.filebot.ui.filter;
import static javax.swing.BorderFactory.*;
import static net.filebot.ui.transfer.BackgroundFileTransferablePolicy.*; import static net.filebot.ui.transfer.BackgroundFileTransferablePolicy.*;
import static net.filebot.util.ui.SwingUI.*; import static net.filebot.util.ui.SwingUI.*;
import javax.swing.Action; import javax.swing.Action;
import javax.swing.BorderFactory;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
@ -25,7 +25,7 @@ class FileTreePanel extends JComponent {
public FileTreePanel() { public FileTreePanel() {
fileTree.setTransferHandler(new DefaultTransferHandler(transferablePolicy, null)); fileTree.setTransferHandler(new DefaultTransferHandler(transferablePolicy, null));
setBorder(BorderFactory.createTitledBorder("File Tree")); setBorder(createTitledBorder("File Tree"));
setLayout(new MigLayout("insets 0, nogrid, fill", "align center", "[fill][pref!]")); setLayout(new MigLayout("insets 0, nogrid, fill", "align center", "[fill][pref!]"));
add(new LoadingOverlayPane(new JScrollPane(fileTree), this), "grow, wrap 1.2mm"); add(new LoadingOverlayPane(new JScrollPane(fileTree), this), "grow, wrap 1.2mm");

View File

@ -1,6 +1,7 @@
package net.filebot.ui.filter; package net.filebot.ui.filter;
import static java.util.Collections.*; import static java.util.Collections.*;
import static javax.swing.BorderFactory.*;
import static net.filebot.Logging.*; import static net.filebot.Logging.*;
import static net.filebot.MediaTypes.*; import static net.filebot.MediaTypes.*;
import static net.filebot.util.FileUtilities.*; import static net.filebot.util.FileUtilities.*;
@ -15,7 +16,6 @@ import java.util.concurrent.CancellationException;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.IntStream; import java.util.stream.IntStream;
import javax.swing.BorderFactory;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.ListSelectionModel; import javax.swing.ListSelectionModel;
@ -47,7 +47,7 @@ class MediaInfoTool extends Tool<TableModel> {
table.setRowHeight(25); table.setRowHeight(25);
JScrollPane scrollPane = new JScrollPane(table); JScrollPane scrollPane = new JScrollPane(table);
scrollPane.setBorder(BorderFactory.createEmptyBorder()); scrollPane.setBorder(createEmptyBorder());
setLayout(new MigLayout("insets 0, fill")); setLayout(new MigLayout("insets 0, fill"));
add(new LoadingOverlayPane(scrollPane, this), "grow"); add(new LoadingOverlayPane(scrollPane, this), "grow");

View File

@ -1,6 +1,7 @@
package net.filebot.ui.filter; package net.filebot.ui.filter;
import static java.util.Collections.*; import static java.util.Collections.*;
import static javax.swing.BorderFactory.*;
import static net.filebot.util.FileUtilities.*; import static net.filebot.util.FileUtilities.*;
import java.io.File; import java.io.File;
@ -10,11 +11,10 @@ import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.concurrent.CancellationException;
import java.util.SortedMap; import java.util.SortedMap;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.concurrent.CancellationException;
import javax.swing.BorderFactory;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeModel; import javax.swing.tree.TreeModel;
@ -36,7 +36,7 @@ class TypeTool extends Tool<TreeModel> {
setLayout(new MigLayout("insets 0, fill")); setLayout(new MigLayout("insets 0, fill"));
JScrollPane treeScrollPane = new JScrollPane(tree); JScrollPane treeScrollPane = new JScrollPane(tree);
treeScrollPane.setBorder(BorderFactory.createEmptyBorder()); treeScrollPane.setBorder(createEmptyBorder());
add(new LoadingOverlayPane(treeScrollPane, this), "grow"); add(new LoadingOverlayPane(treeScrollPane, this), "grow");

View File

@ -1,5 +1,7 @@
package net.filebot.util.ui; package net.filebot.util.ui;
import static javax.swing.BorderFactory.*;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
@ -18,7 +20,6 @@ import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.DefaultSingleSelectionModel; import javax.swing.DefaultSingleSelectionModel;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JButton; import javax.swing.JButton;
@ -55,7 +56,7 @@ public class SelectButton<T> extends JButton {
setHorizontalAlignment(SwingConstants.CENTER); setHorizontalAlignment(SwingConstants.CENTER);
setVerticalAlignment(SwingConstants.CENTER); setVerticalAlignment(SwingConstants.CENTER);
setBorder(BorderFactory.createLineBorder(new Color(0xA4A4A4), 1)); setBorder(createLineBorder(new Color(0xA4A4A4), 1));
setPreferredSize(new Dimension(32, 22)); setPreferredSize(new Dimension(32, 22));
addActionListener(new OpenPopupOnClick()); addActionListener(new OpenPopupOnClick());

View File

@ -4,6 +4,7 @@
package net.filebot.util.ui.notification; package net.filebot.util.ui.notification;
import static javax.swing.BorderFactory.*;
import static net.filebot.util.ui.SwingUI.*; import static net.filebot.util.ui.SwingUI.*;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -32,8 +33,8 @@ public class MessageNotification extends NotificationWindow {
} }
private int margin = 10; private int margin = 10;
private Border marginBorder = BorderFactory.createEmptyBorder(margin, margin, margin, margin); private Border marginBorder = createEmptyBorder(margin, margin, margin, margin);
private Border border = BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(new Color(245, 155, 15), Color.WHITE), marginBorder); private Border border = createCompoundBorder(createEtchedBorder(new Color(245, 155, 15), Color.WHITE), marginBorder);
private JLabel headLabel; private JLabel headLabel;
private JTextPane textArea; private JTextPane textArea;