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