diff --git a/.gitattributes b/.gitattributes
index 58f86550e3a..34b6922fc24 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -14191,7 +14191,6 @@ src/main/java/forge/gui/GuiDialog.java -text
src/main/java/forge/gui/GuiDisplayUtil.java svneol=native#text/plain
src/main/java/forge/gui/GuiImportPicture.java svneol=native#text/plain
src/main/java/forge/gui/GuiInput.java svneol=native#text/plain
-src/main/java/forge/gui/GuiMigrateLocalMWSSetPicturesHQ.java svneol=native#text/plain
src/main/java/forge/gui/GuiProgressBarWindow.java svneol=native#text/plain
src/main/java/forge/gui/GuiUtils.java svneol=native#text/plain
src/main/java/forge/gui/ListChooser.java svneol=native#text/plain
@@ -14517,7 +14516,6 @@ src/test/java/forge/BoosterDraftTest.java svneol=native#text/plain
src/test/java/forge/CardColorTest.java svneol=native#text/plain
src/test/java/forge/GuiDownloadPicturesLQTest.java svneol=native#text/plain
src/test/java/forge/GuiDownloadSetPicturesLQTest.java svneol=native#text/plain
-src/test/java/forge/GuiMigrateLocalMWSSetPicturesHQTest.java svneol=native#text/plain
src/test/java/forge/GuiProgressBarWindowTest.java svneol=native#text/plain
src/test/java/forge/PanelTest.java svneol=native#text/plain
src/test/java/forge/ReadDraftRankingsTest.java -text
diff --git a/src/main/java/forge/gui/GuiMigrateLocalMWSSetPicturesHQ.java b/src/main/java/forge/gui/GuiMigrateLocalMWSSetPicturesHQ.java
deleted file mode 100644
index 4a7f81855d5..00000000000
--- a/src/main/java/forge/gui/GuiMigrateLocalMWSSetPicturesHQ.java
+++ /dev/null
@@ -1,581 +0,0 @@
-/*
- * Forge: Play Magic: the Gathering.
- * Copyright (C) 2011 Forge Team
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see
- * Gui_MigrateLocalMWSSetPictures_HQ class. - *
- * - * @author Forge - * @version $Id$ - */ -public final class GuiMigrateLocalMWSSetPicturesHQ extends DefaultBoundedRangeModel implements Runnable { - - /** ConstantserialVersionUID=-7890794857949935256L. */
- private static final long serialVersionUID = -7890794857949935256L;
-
- /** Constant types. */
- public static final Proxy.Type[] TYPES = Proxy.Type.values();
-
- // proxy
- private int type;
- private final JTextField addr, port;
-
- // progress
- private final MCard[] cards;
- private int card;
- private boolean cancel;
- private final JProgressBar bar;
-
- private final JOptionPane dlg;
- private final JButton close;
-
- private final long[] times = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
- private int tptr = 0;
- private long lTime = System.currentTimeMillis();
-
- /**
- * - * getAverageTimePerCard. - *
- * - * @return a int. - */ - private int getAverageTimePerCard() { - int aTime = 0; - int nz = 10; - - if (this.tptr > 9) { - this.tptr = 0; - } - - this.times[this.tptr] = System.currentTimeMillis() - this.lTime; - this.lTime = System.currentTimeMillis(); - - int tTime = 0; - for (int i = 0; i < 10; i++) { - tTime += this.times[i]; - if (this.times[i] == 0) { - nz--; - } - } - aTime = tTime / nz; - - this.tptr++; - - return aTime; - } - - /** - *- * Constructor for Gui_MigrateLocalMWSSetPictures_HQ. - *
- * - * @param c - * an array of - * {@link forge.gui.GuiMigrateLocalMWSSetPicturesHQ.MCard} objects. - */ - private GuiMigrateLocalMWSSetPicturesHQ(final MCard[] c) { - this.cards = c; - this.addr = new JTextField(ForgeProps.getLocalized(GuiDownloadPictures.PROXY_ADDRESS)); - this.port = new JTextField(ForgeProps.getLocalized(GuiDownloadPictures.PROXY_PORT)); - this.bar = new JProgressBar(this); - - final JPanel p0 = new JPanel(); - p0.setLayout(new BoxLayout(p0, BoxLayout.Y_AXIS)); - - // Proxy Choice - final ButtonGroup bg = new ButtonGroup(); - final String[] labels = { ForgeProps.getLocalized(GuiDownloadPictures.NO_PROXY), - ForgeProps.getLocalized(GuiDownloadPictures.HTTP_PROXY), - ForgeProps.getLocalized(GuiDownloadPictures.SOCKS_PROXY) }; - for (int i = 0; i < GuiMigrateLocalMWSSetPicturesHQ.TYPES.length; i++) { - final JRadioButton rb = new JRadioButton(labels[i]); - rb.addChangeListener(new ProxyHandler(i)); - bg.add(rb); - p0.add(rb); - if (i == 0) { - rb.setSelected(true); - } - } - - // Proxy config - p0.add(this.addr); - p0.add(this.port); - // JTextField[] tfs = {addr, port}; - // String[] labels = {"Address", "Port"}; - // for(int i = 0; i < labels.length; i++) { - // JPanel p1 = new JPanel(new BorderLayout()); - // p0.add(p1); - // // p1.add(new JLabel(labels[i]), WEST); - // p1.add(tfs[i]); - // } - - // Start - final JButton b = new JButton("Start copying"); - b.addActionListener(new ActionListener() { - - @Override - public void actionPerformed(final ActionEvent e) { - new Thread(GuiMigrateLocalMWSSetPicturesHQ.this).start(); - b.setEnabled(false); - } - }); - // p0.add(b); - - p0.add(Box.createVerticalStrut(5)); - - // Progress - p0.add(this.bar); - this.bar.setStringPainted(true); - // bar.setString(ForgeProps.getLocalized(BAR_BEFORE_START)); - this.bar.setString(this.card + "/" + this.cards.length); - // bar.setString(String.format(ForgeProps.getLocalized(card == - // cards.length? BAR_CLOSE:BAR_WAIT), this.card, cards.length)); - final Dimension d = this.bar.getPreferredSize(); - d.width = 300; - this.bar.setPreferredSize(d); - - // JOptionPane - this.close = new JButton(ForgeProps.getLocalized(NewConstants.Lang.GuiDownloadPictures.Buttons.CANCEL)); - final Object[] options = { b, this.close }; - this.dlg = new JOptionPane(p0, JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, options[1]); - } - - /** {@inheritDoc} */ - @Override - public int getMinimum() { - return 0; - } - - /** {@inheritDoc} */ - @Override - public int getValue() { - return this.card; - } - - /** {@inheritDoc} */ - @Override - public int getExtent() { - return 0; - } - - /** {@inheritDoc} */ - @Override - public int getMaximum() { - return this.cards == null ? 0 : this.cards.length; - } - - /** - *- * update. - *
- * - * @param card - * a int. - */ - private void update(final int card) { - this.card = card; - - /** - * - * TODO: Write javadoc for this type. - * - */ - final class Worker implements Runnable { - private final int card; - - /** - * - * TODO: Write javadoc for Constructor. - * - * @param card - * int - */ - Worker(final int card) { - this.card = card; - } - - /** - * - */ - @Override - public void run() { - GuiMigrateLocalMWSSetPicturesHQ.this.fireStateChanged(); - - final StringBuilder sb = new StringBuilder(); - - final int a = GuiMigrateLocalMWSSetPicturesHQ.this.getAverageTimePerCard(); - - if (this.card != GuiMigrateLocalMWSSetPicturesHQ.this.cards.length) { - sb.append(this.card + "/" + GuiMigrateLocalMWSSetPicturesHQ.this.cards.length + " - "); - - long t2Go = (GuiMigrateLocalMWSSetPicturesHQ.this.cards.length - this.card) * a; - - boolean secOnly = true; - if (t2Go > 3600000) { - sb.append(String.format("%02d:", t2Go / 3600000)); - t2Go = t2Go % 3600000; - secOnly = false; - } - if (t2Go > 60000) { - sb.append(String.format("%02d:", t2Go / 60000)); - t2Go = t2Go % 60000; - secOnly = false; - } - if (!secOnly) { - sb.append(String.format("%02d remaining.", t2Go / 1000)); - } else { - sb.append(String.format("0:%02d remaining.", t2Go / 1000)); - } - } else { - sb.append(String.format(ForgeProps.getLocalized(GuiDownloadPictures.BAR_CLOSE), this.card, - GuiMigrateLocalMWSSetPicturesHQ.this.cards.length)); - } - - GuiMigrateLocalMWSSetPicturesHQ.this.bar.setString(sb.toString()); - // bar.setString(String.format(ForgeProps.getLocalized(card == - // cards.length? BAR_CLOSE:BAR_WAIT), card, - // cards.length)); - System.out.println(this.card + "/" + GuiMigrateLocalMWSSetPicturesHQ.this.cards.length + " - " + a); - } - } - EventQueue.invokeLater(new Worker(card)); - } - - /** - *
- * Getter for the field dlg.
- *
- * Setter for the field cancel.
- *
- * run. - *
- */ - @Override - public void run() { - BufferedInputStream in; - BufferedOutputStream out; - - File base = ForgeProps.getFile(NewConstants.IMAGE_BASE); - - // Random r = MyRandom.random; - - Proxy p = null; - if (this.type == 0) { - p = Proxy.NO_PROXY; - } else { - try { - p = new Proxy(GuiMigrateLocalMWSSetPicturesHQ.TYPES[this.type], new InetSocketAddress( - this.addr.getText(), Integer.parseInt(this.port.getText()))); - } catch (final Exception ex) { - BugReporter.reportException(ex, - ForgeProps.getLocalized(NewConstants.Lang.GuiDownloadPictures.Errors.PROXY_CONNECT), - this.addr.getText(), this.port.getText()); - // throw new - // RuntimeException("Gui_DownloadPictures : error 1 - " +ex); - return; - } - } - - if (p != null) { - final byte[] buf = new byte[1024]; - int len; - System.out.println("basedir: " + base); - for (this.update(0); (this.card < this.cards.length) && !this.cancel; this.update(this.card + 1)) { - try { - final String url = this.cards[this.card].url; - String cName; - if (this.cards[this.card].name.substring(0, 3).equals("[T]")) { - base = ForgeProps.getFile(NewConstants.IMAGE_TOKEN); - cName = this.cards[this.card].name.substring(3, this.cards[this.card].name.length()); - } else { - base = ForgeProps.getFile(NewConstants.IMAGE_BASE); - cName = this.cards[this.card].name; - } - - final File f = new File(base, cName); - - // test for folder existence - final File test = new File(base, this.cards[this.card].folder); - if (!test.exists()) { - // create folder - if (!test.mkdir()) { - System.out.println("Can't create folder" + this.cards[this.card].folder); - } - } - - try { - // in = new BufferedInputStream(new - // URL(url).openConnection(p).getInputStream()); - - final File src = new File(url); - final InputStream in2 = new FileInputStream(src); - - in = new BufferedInputStream(in2); - out = new BufferedOutputStream(new FileOutputStream(f)); - - while ((len = in.read(buf)) != -1) { - // user cancelled - if (this.cancel) { - in.close(); - out.flush(); - out.close(); - - // delete what was written so far - f.delete(); - - return; - } // if - cancel - - out.write(buf, 0, len); - } // while - read and write file - - in.close(); - out.flush(); - out.close(); - } catch (final MalformedURLException mURLe) { - // System.out.println("Error - possibly missing URL for: "+cards[card].name); - // Log.error("LQ Pictures", - // "Malformed URL for: "+cards[card].name, mURLe); - } - } catch (final FileNotFoundException fnfe) { - System.out.println("Error - the HQ picture for " + this.cards[this.card].name - + " could not be found. [" + this.cards[this.card].url + "] - " + fnfe.getMessage()); - } catch (final Exception ex) { - Log.error("HQ Pictures", "Error copying pictures", ex); - } - - // pause - - try { - Thread.sleep(1); - } catch (final InterruptedException e) { - Log.error("HQ Set Pictures", "Sleep Error", e); - } - } // for - } - this.close.setText(ForgeProps.getLocalized(NewConstants.Lang.GuiDownloadPictures.Buttons.CLOSE)); - } // run - - /** - *- * startDownload. - *
- * - * @param frame - * a {@link javax.swing.JFrame} object. - */ - public static void startDownload(final JFrame frame) { - final MCard[] card = GuiMigrateLocalMWSSetPicturesHQ.getNeededCards(); - - if (card.length == 0) { - JOptionPane.showMessageDialog(frame, ForgeProps.getLocalized(GuiDownloadPictures.NO_MORE)); - return; - } - - final GuiMigrateLocalMWSSetPicturesHQ download = new GuiMigrateLocalMWSSetPicturesHQ(card); - final JDialog dlg = download.getDlg(frame); - dlg.setVisible(true); - dlg.dispose(); - download.setCancel(true); - } // startDownload() - - /** - *- * getNeededCards. - *
- * - * @return an array of {@link forge.gui.GuiMigrateLocalMWSSetPicturesHQ.MCard} - * objects. - */ - private static MCard[] getNeededCards() { - // read all card names and urls - // mCard[] cardPlay = readFile(CARD_PICTURES); - // mCard[] cardTokenLQ = readFile(CARD_PICTURES_TOKEN_LQ); - - final ArrayList