package org.lodder.subtools.multisubdownloader.gui;

import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.Toolkit;

import javax.swing.JLabel;
import javax.swing.JProgressBar;
import javax.swing.JWindow;

import org.lodder.subtools.sublibrary.logging.Listener;
import org.lodder.subtools.sublibrary.logging.Logger;

import net.miginfocom.swing.MigLayout;

public class Splash extends JWindow implements Listener{
  /**
   * 
   */
  private static final long serialVersionUID = -7795482367449509520L;
  private JLabel label;
  private JProgressBar progressBar;

  public Splash() {
    initialize_ui();
    Logger.instance.addListener(this);
  }

  public void initialize_ui(){
    setBounds(100, 100, 501, 100);
    getContentPane().setLayout(new MigLayout("", "[][475px,center][]", "[][40px:n]"));

    label = new JLabel("MultiSubDownloader Starting ...");
    getContentPane().add(label, "cell 1 0 2 1,alignx left");

    progressBar = new JProgressBar(0, 100);
    progressBar.setIndeterminate(true);
    progressBar.setStringPainted(true);
    getContentPane().add(progressBar, "cell 1 1,grow");

    Rectangle r = getBounds();
    Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
    int x = (screen.width - r.width) / 2;
    int y = (screen.height - r.height) / 2;
    setBounds(x, y, r.width, r.height);

  }

  public void showSplash(){
    setVisible(true);
    toFront();
  }

  @Override
  public void log(String log) {
    progressBar.setString(log);
  }
  
}

@@ -219,119 +219,8 @@
 w;%0A%0A
-import org.lodder.subtools.sublibrary.logging.Listener;%0Aimport org.lodder.subtools.sublibrary.logging.Logger;%0A%0A
 impo
@@ -294,28 +294,8 @@
 ndow
- implements Listener
 %7B%0A  
@@ -486,47 +486,8 @@
 ();%0A
-    Logger.instance.addListener(this);%0A
   %7D%0A
@@ -1250,34 +1250,33 @@
 %0A%0A  
-@Override%0A  public void lo
+public void setProgressMs
 g(St
@@ -1284,13 +1284,12 @@
 ing 
-lo
+ms
 g)
- 
 %7B%0A  
@@ -1312,18 +1312,18 @@
 tString(
-lo
+ms
 g);%0A  %7D%0A

Remove old logger implementation