mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
start cleaning up GuiImportPicture
This commit is contained in:
@@ -18,7 +18,6 @@
|
||||
package forge.gui;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.GridBagLayout;
|
||||
import java.awt.Insets;
|
||||
@@ -56,7 +55,6 @@ public class GuiImportPicture extends JDialog {
|
||||
private JCheckBox jCheckBox = null;
|
||||
private JButton jButtonStart = null;
|
||||
|
||||
private final GuiImportPicture frame;
|
||||
private JLabel jLabelHDDFree = null;
|
||||
private JLabel jLabelNeedSpace = null;
|
||||
|
||||
@@ -69,29 +67,15 @@ public class GuiImportPicture extends JDialog {
|
||||
private JProgressBar jProgressBar = null;
|
||||
|
||||
public GuiImportPicture(final JFrame owner) {
|
||||
super(owner);
|
||||
this.frame = this;
|
||||
this.initialize();
|
||||
}
|
||||
super(owner, "Import Pictures", true);
|
||||
|
||||
private void initialize() {
|
||||
final Dimension screen = this.getToolkit().getScreenSize();
|
||||
final Rectangle bounds = this.getBounds();
|
||||
|
||||
bounds.width = 400;
|
||||
bounds.height = 295;
|
||||
this.setSize(new Dimension(400, 295));
|
||||
this.setResizable(false);
|
||||
bounds.x = (screen.width - bounds.width) / 2;
|
||||
bounds.y = (screen.height - bounds.height) / 2;
|
||||
this.setBounds(bounds);
|
||||
this.setModal(true);
|
||||
this.setTitle("Import Picture");
|
||||
this.setContentPane(this.getJContentPane());
|
||||
setSize(400, 295);
|
||||
setResizable(false);
|
||||
setLocationRelativeTo(null);
|
||||
setContentPane(getJContentPane());
|
||||
}
|
||||
|
||||
private JPanel getJContentPane() {
|
||||
if (this.jContentPane == null) {
|
||||
this.jLabelTotalFiles = new JLabel();
|
||||
this.jLabelTotalFiles.setBounds(new Rectangle(15, 180, 248, 16));
|
||||
this.jLabelTotalFiles.setText("Total files for copying: Unknown.");
|
||||
@@ -132,7 +116,6 @@ public class GuiImportPicture extends JDialog {
|
||||
this.jContentPane.add(this.jLabelNeedSpace, null);
|
||||
this.jContentPane.add(this.jLabelTotalFiles, null);
|
||||
this.jContentPane.add(this.getJProgressBar(), null);
|
||||
}
|
||||
return this.jContentPane;
|
||||
}
|
||||
|
||||
@@ -155,7 +138,7 @@ public class GuiImportPicture extends JDialog {
|
||||
chooser.setAcceptAllFileFilterUsed(false);
|
||||
GuiImportPicture.this.oldText = GuiImportPicture.this.jLabelSource.getText();
|
||||
GuiImportPicture.this.jLabelSource.setText("Please wait...");
|
||||
if (chooser.showOpenDialog(GuiImportPicture.this.frame) == JFileChooser.APPROVE_OPTION) {
|
||||
if (chooser.showOpenDialog(GuiImportPicture.this) == JFileChooser.APPROVE_OPTION) {
|
||||
final FileFinder ff = new FileFinder();
|
||||
try {
|
||||
GuiImportPicture.this.listFiles = ff.findFiles(chooser.getSelectedFile().toString(),
|
||||
|
||||
Reference in New Issue
Block a user