Skip to content

Commit

Permalink
Clean imports
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanue1 committed Apr 10, 2019
1 parent edd99bf commit 074f547
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 30 deletions.
14 changes: 6 additions & 8 deletions app/src/main/java/org/jd/gui/view/AboutView.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import org.jd.gui.util.swing.SwingUtil;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
import javax.swing.border.LineBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
Expand All @@ -34,22 +32,22 @@ public AboutView(JFrame mainFrame) {
aboutDialog.setResizable(false);

JPanel panel = new JPanel();
panel.setBorder(new EmptyBorder(15, 15, 15, 15));
panel.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
panel.setLayout(new BorderLayout());
aboutDialog.add(panel);

Box vbox = Box.createVerticalBox();
panel.add(vbox, BorderLayout.NORTH);
JPanel subpanel = new JPanel();
vbox.add(subpanel);
subpanel.setBorder(new LineBorder(Color.BLACK));
subpanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
subpanel.setBackground(Color.WHITE);
subpanel.setLayout(new BorderLayout());
JLabel logo = new JLabel(new ImageIcon(SwingUtil.getImage("/org/jd/gui/images/jd_icon_64.png")));
logo.setBorder(new EmptyBorder(15, 15, 15, 15));
logo.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
subpanel.add(logo, BorderLayout.WEST);
Box subvbox = Box.createVerticalBox();
subvbox.setBorder(new EmptyBorder(15,0,15,15));
subvbox.setBorder(BorderFactory.createEmptyBorder(15,0,15,15));
subpanel.add(subvbox, BorderLayout.EAST);
Box hbox = Box.createHorizontalBox();
subvbox.add(hbox);
Expand All @@ -63,7 +61,7 @@ public AboutView(JFrame mainFrame) {
hbox.add(subsubpanel);
subsubpanel.setLayout(new GridLayout(2,2));
subsubpanel.setOpaque(false);
subsubpanel.setBorder(new EmptyBorder(5,10,5,5));
subsubpanel.setBorder(BorderFactory.createEmptyBorder(5,10,5,5));

String jdGuiVersion = "SNAPSHOT";
String jdCoreVersion = "SNAPSHOT";
Expand Down Expand Up @@ -124,13 +122,13 @@ public AboutView(JFrame mainFrame) {

// Prepare to display
aboutDialog.pack();
aboutDialog.setLocationRelativeTo(mainFrame);
});
}

public void show() {
SwingUtil.invokeLater(() -> {
// Show
aboutDialog.setLocationRelativeTo(aboutDialog.getParent());
aboutDialog.setVisible(true);
aboutOkButton.requestFocus();
});
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/org/jd/gui/view/GoToView.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.jd.gui.util.swing.SwingUtil;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*;
Expand All @@ -37,7 +36,7 @@ public GoToView(Configuration configuration, JFrame mainFrame) {
goToDialog.setResizable(false);

Box vbox = Box.createVerticalBox();
vbox.setBorder(new EmptyBorder(15, 15, 15, 15));
vbox.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
goToDialog.add(vbox);

// First label "Enter line number (1..xxx):"
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/org/jd/gui/view/MainView.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.text.BadLocationException;
Expand Down Expand Up @@ -163,7 +162,7 @@ public void keyReleased(KeyEvent e) {
findPreviousButton.setBorder(border);
findCloseButton.setBorder(border);
} else {
findPanel.setBorder(new EmptyBorder(2, 10, 2, 2));
findPanel.setBorder(BorderFactory.createEmptyBorder(2, 10, 2, 2));
}

// Actions //
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/org/jd/gui/view/OpenTypeHierarchyView.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import org.jd.gui.view.renderer.TreeNodeRenderer;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
import javax.swing.event.TreeExpansionEvent;
import javax.swing.event.TreeExpansionListener;
import javax.swing.tree.DefaultMutableTreeNode;
Expand Down Expand Up @@ -51,7 +50,7 @@ public OpenTypeHierarchyView(API api, JFrame mainFrame, TriConsumer<Point, Colle
openTypeHierarchyDialog = new JDialog(mainFrame, "Hierarchy Type", false);

JPanel panel = new JPanel();
panel.setBorder(new EmptyBorder(15, 15, 15, 15));
panel.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
panel.setLayout(new BorderLayout());
openTypeHierarchyDialog.add(panel);

Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/org/jd/gui/view/OpenTypeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.jd.gui.view.renderer.OpenTypeListCellRenderer;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.BadLocationException;
Expand Down Expand Up @@ -45,7 +44,7 @@ public OpenTypeView(API api, JFrame mainFrame, Consumer<String> changedPatternCa
openTypeDialog = new JDialog(mainFrame, "Open Type", false);

JPanel panel = new JPanel();
panel.setBorder(new EmptyBorder(15, 15, 15, 15));
panel.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
panel.setLayout(new BorderLayout());
openTypeDialog.add(panel);

Expand Down
7 changes: 4 additions & 3 deletions app/src/main/java/org/jd/gui/view/PreferencesView.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.jd.gui.util.swing.SwingUtil;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
Expand All @@ -36,12 +35,14 @@ public PreferencesView(Configuration configuration, JFrame mainFrame, Collection
preferencesDialog = new JDialog(mainFrame, "Preferences", false);

JPanel panel = new JPanel();
panel.setBorder(new EmptyBorder(15, 15, 15, 15));
panel.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
panel.setLayout(new BorderLayout());
preferencesDialog.add(panel);

// Box for preferences panels
Box preferencesPanels = Box.createVerticalBox();
preferencesPanels.setBackground(panel.getBackground());
preferencesPanels.setOpaque(true);
Color errorBackgroundColor = Color.decode(configuration.getPreferences().get("JdGuiPreferences.errorBackgroundColor"));

// Group "PreferencesPanel" by group name
Expand Down Expand Up @@ -93,7 +94,7 @@ public PreferencesView(Configuration configuration, JFrame mainFrame, Collection

JScrollPane preferencesScrollPane = new JScrollPane(preferencesPanels);
preferencesScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
preferencesScrollPane.setBorder(new EmptyBorder(0, 0, 0, 0));
preferencesScrollPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
panel.add(preferencesScrollPane, BorderLayout.CENTER);

Box vbox = Box.createVerticalBox();
Expand Down
6 changes: 2 additions & 4 deletions app/src/main/java/org/jd/gui/view/SaveAllSourcesView.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
import org.jd.gui.util.swing.SwingUtil;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.util.function.IntConsumer;

public class SaveAllSourcesView {
protected JDialog saveAllSourcesDialog;
Expand All @@ -35,7 +33,7 @@ public SaveAllSourcesView(JFrame mainFrame, Runnable cancelCallback) {
});

Box vbox = Box.createVerticalBox();
vbox.setBorder(new EmptyBorder(15, 15, 15, 15));
vbox.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
saveAllSourcesDialog.add(vbox);

// First label "Saving 'file' ..."
Expand Down Expand Up @@ -72,7 +70,6 @@ public void actionPerformed(ActionEvent actionEvent) {

// Prepare to display
saveAllSourcesDialog.pack();
saveAllSourcesDialog.setLocationRelativeTo(mainFrame);
});
}

Expand All @@ -85,6 +82,7 @@ public void show(File file) {
saveAllSourcesProgressBar.setIndeterminate(true);
saveAllSourcesDialog.pack();
// Show
saveAllSourcesDialog.setLocationRelativeTo(saveAllSourcesDialog.getParent());
saveAllSourcesDialog.setVisible(true);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.jd.gui.view.renderer.TreeNodeRenderer;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.event.TreeExpansionEvent;
Expand Down Expand Up @@ -72,7 +71,7 @@ public SearchInConstantPoolsView(
searchInConstantPoolsDialog = new JDialog(mainFrame, "Search", false);

JPanel panel = new JPanel();
panel.setBorder(new EmptyBorder(15, 15, 15, 15));
panel.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
panel.setLayout(new BorderLayout());
searchInConstantPoolsDialog.add(panel);

Expand Down
8 changes: 3 additions & 5 deletions app/src/main/java/org/jd/gui/view/SelectLocationView.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import org.jd.gui.view.renderer.TreeNodeRenderer;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
import javax.swing.border.LineBorder;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;
Expand Down Expand Up @@ -56,16 +54,16 @@ public SelectLocationView(API api, JFrame mainFrame) {
Color bg = UIManager.getColor("ToolTip.background");

JPanel selectLocationPanel = new JPanel(new BorderLayout());
selectLocationPanel.setBorder(new LineBorder(bg.darker()));
selectLocationPanel.setBorder(BorderFactory.createLineBorder(bg.darker()));
selectLocationPanel.setBackground(bg);
selectLocationDialog.add(selectLocationPanel);

selectLocationLabel = new JLabel();
selectLocationLabel.setBorder(new EmptyBorder(5, 5, 0, 5));
selectLocationLabel.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5));
selectLocationPanel.add(selectLocationLabel, BorderLayout.NORTH);

selectLocationTree = new Tree();
selectLocationTree.setBorder(new EmptyBorder(5, 5, 5, 5));
selectLocationTree.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
selectLocationTree.setOpaque(false);
selectLocationTree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode()));
selectLocationTree.setCellRenderer(new TreeNodeRenderer());
Expand Down

0 comments on commit 074f547

Please sign in to comment.