Addition of SplashScreen class.

This commit is contained in:
MobiusDev 2018-04-30 21:06:40 +00:00
parent 7fb5418186
commit d92c73b8cb
80 changed files with 928 additions and 56 deletions

View File

@ -104,7 +104,6 @@
<jar destfile="${build.dist.dbinstaller}/Database_Installer_GS.jar" level="9">
<fileset dir="${build.bin}">
<include name="**/dbinstaller/**" />
<include name="**/images/**" />
<include name="**/util/**" />
<include name="**/SQLFilter**" />
<exclude name="**/LauncherLS*" />
@ -120,7 +119,6 @@
<jar destfile="${build.dist.dbinstaller}/Database_Installer_LS.jar" level="9">
<fileset dir="${build.bin}">
<include name="**/dbinstaller/**" />
<include name="**/images/**" />
<include name="**/util/**" />
<include name="**/SQLFilter**" />
<exclude name="**/LauncherGS*" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 488 B

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

View File

@ -0,0 +1,78 @@
/*
* This file is part of the L2J Mobius project.
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.commons.util;
import java.awt.Color;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JWindow;
/**
* @author Mobius
*/
public class SplashScreen extends JWindow
{
Image image;
JFrame parentFrame;
/**
* @param path of image file
* @param time in milliseconds
* @param parent frame to set visible after time ends
*/
public SplashScreen(String path, long time, JFrame parent)
{
parentFrame = parent;
setBackground(new Color(0, 255, 0, 0)); // Transparency.
image = Toolkit.getDefaultToolkit().getImage(path);
ImageIcon imageIcon = new ImageIcon(image);
setSize(imageIcon.getIconWidth(), imageIcon.getIconHeight());
setLocationRelativeTo(null);
setVisible(true);
// Schedule to dispose.
Executors.newScheduledThreadPool(1).schedule(this::dispose, imageIcon.getIconWidth() > 0 ? time : 100, TimeUnit.MILLISECONDS);
}
@Override
public void dispose()
{
setVisible(false);
if (parentFrame != null)
{
// Make parent visible.
parentFrame.setVisible(true);
// Focus parent window.
parentFrame.toFront();
parentFrame.setState(Frame.NORMAL);
}
super.dispose();
}
@Override
public void paint(Graphics g)
{
g.drawImage(image, 0, 0, null);
}
}

View File

@ -60,7 +60,6 @@ public class RunTasks extends Thread
JOptionPane.showMessageDialog(null, "Cannot close MySQL Connection: " + e.getMessage(), "Connection Error", JOptionPane.ERROR_MESSAGE);
}
_frame.setFrameVisible(false);
_frame.showMessage("Done!", "Database Installation Complete!", JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}

View File

@ -17,10 +17,14 @@
package com.l2jmobius.tools.dbinstaller.gui;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import java.util.prefs.Preferences;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
@ -30,6 +34,7 @@ import javax.swing.JTextField;
import javax.swing.SpringLayout;
import javax.swing.SwingConstants;
import com.l2jmobius.commons.util.SplashScreen;
import com.l2jmobius.tools.dbinstaller.RunTasks;
import com.l2jmobius.tools.dbinstaller.util.mysql.MySqlConnect;
import com.l2jmobius.tools.dbinstaller.util.swing.SpringUtilities;
@ -50,12 +55,25 @@ public class DBConfigGUI extends JFrame
Preferences _prop;
boolean _isVisible = true;
public DBConfigGUI(String db, String dir)
{
super("Mobius - DB Installer");
setVisible(false);
setLayout(new SpringLayout());
setDefaultLookAndFeelDecorated(true);
setIconImage(Toolkit.getDefaultToolkit().getImage("..\\images\\l2jmobius.png"));
// Set icons.
List<Image> icons = new ArrayList<>();
icons.add(new ImageIcon("..\\images\\l2jmobius_16x16.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
setIconImages(icons);
// Show SplashScreen.
new SplashScreen("..\\images\\splash.png", 5000, this);
_db = db;
_dir = dir;
@ -159,6 +177,7 @@ public class DBConfigGUI extends JFrame
System.exit(0);
}
}
_isVisible = false;
dbi.setVisible(true);
final RunTasks task = new RunTasks(dbi, _db, _dir);
@ -173,7 +192,11 @@ public class DBConfigGUI extends JFrame
add(btnConnect);
SpringUtilities.makeCompactGrid(getContentPane(), 6, 2, 5, 5, 5, 5);
setVisible(true);
}
@Override
public boolean isVisible()
{
return _isVisible;
}
}

View File

@ -18,9 +18,13 @@ package com.l2jmobius.tools.dbinstaller.gui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JProgressBar;
@ -43,7 +47,14 @@ public class DBInstallerGUI extends JFrame implements DBOutputInterface
super("Mobius - DB Installer");
setLayout(new BorderLayout());
setDefaultLookAndFeelDecorated(true);
setIconImage(Toolkit.getDefaultToolkit().getImage("..\\images\\l2jmobius.png"));
// Set icons.
List<Image> icons = new ArrayList<>();
icons.add(new ImageIcon("..\\images\\l2jmobius_16x16.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
setIconImages(icons);
_con = con;

View File

@ -104,7 +104,6 @@
<jar destfile="${build.dist.dbinstaller}/Database_Installer_GS.jar" level="9">
<fileset dir="${build.bin}">
<include name="**/dbinstaller/**" />
<include name="**/images/**" />
<include name="**/util/**" />
<include name="**/SQLFilter**" />
<exclude name="**/LauncherLS*" />
@ -120,7 +119,6 @@
<jar destfile="${build.dist.dbinstaller}/Database_Installer_LS.jar" level="9">
<fileset dir="${build.bin}">
<include name="**/dbinstaller/**" />
<include name="**/images/**" />
<include name="**/util/**" />
<include name="**/SQLFilter**" />
<exclude name="**/LauncherGS*" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 488 B

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

View File

@ -0,0 +1,78 @@
/*
* This file is part of the L2J Mobius project.
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.commons.util;
import java.awt.Color;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JWindow;
/**
* @author Mobius
*/
public class SplashScreen extends JWindow
{
Image image;
JFrame parentFrame;
/**
* @param path of image file
* @param time in milliseconds
* @param parent frame to set visible after time ends
*/
public SplashScreen(String path, long time, JFrame parent)
{
parentFrame = parent;
setBackground(new Color(0, 255, 0, 0)); // Transparency.
image = Toolkit.getDefaultToolkit().getImage(path);
ImageIcon imageIcon = new ImageIcon(image);
setSize(imageIcon.getIconWidth(), imageIcon.getIconHeight());
setLocationRelativeTo(null);
setVisible(true);
// Schedule to dispose.
Executors.newScheduledThreadPool(1).schedule(this::dispose, imageIcon.getIconWidth() > 0 ? time : 100, TimeUnit.MILLISECONDS);
}
@Override
public void dispose()
{
setVisible(false);
if (parentFrame != null)
{
// Make parent visible.
parentFrame.setVisible(true);
// Focus parent window.
parentFrame.toFront();
parentFrame.setState(Frame.NORMAL);
}
super.dispose();
}
@Override
public void paint(Graphics g)
{
g.drawImage(image, 0, 0, null);
}
}

View File

@ -60,7 +60,6 @@ public class RunTasks extends Thread
JOptionPane.showMessageDialog(null, "Cannot close MySQL Connection: " + e.getMessage(), "Connection Error", JOptionPane.ERROR_MESSAGE);
}
_frame.setFrameVisible(false);
_frame.showMessage("Done!", "Database Installation Complete!", JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}

View File

@ -17,10 +17,14 @@
package com.l2jmobius.tools.dbinstaller.gui;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import java.util.prefs.Preferences;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
@ -30,6 +34,7 @@ import javax.swing.JTextField;
import javax.swing.SpringLayout;
import javax.swing.SwingConstants;
import com.l2jmobius.commons.util.SplashScreen;
import com.l2jmobius.tools.dbinstaller.RunTasks;
import com.l2jmobius.tools.dbinstaller.util.mysql.MySqlConnect;
import com.l2jmobius.tools.dbinstaller.util.swing.SpringUtilities;
@ -50,12 +55,25 @@ public class DBConfigGUI extends JFrame
Preferences _prop;
boolean _isVisible = true;
public DBConfigGUI(String db, String dir)
{
super("Mobius - DB Installer");
setVisible(false);
setLayout(new SpringLayout());
setDefaultLookAndFeelDecorated(true);
setIconImage(Toolkit.getDefaultToolkit().getImage("..\\images\\l2jmobius.png"));
// Set icons.
List<Image> icons = new ArrayList<>();
icons.add(new ImageIcon("..\\images\\l2jmobius_16x16.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
setIconImages(icons);
// Show SplashScreen.
new SplashScreen("..\\images\\splash.png", 5000, this);
_db = db;
_dir = dir;
@ -159,6 +177,7 @@ public class DBConfigGUI extends JFrame
System.exit(0);
}
}
_isVisible = false;
dbi.setVisible(true);
final RunTasks task = new RunTasks(dbi, _db, _dir);
@ -173,7 +192,11 @@ public class DBConfigGUI extends JFrame
add(btnConnect);
SpringUtilities.makeCompactGrid(getContentPane(), 6, 2, 5, 5, 5, 5);
setVisible(true);
}
@Override
public boolean isVisible()
{
return _isVisible;
}
}

View File

@ -18,9 +18,13 @@ package com.l2jmobius.tools.dbinstaller.gui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JProgressBar;
@ -43,7 +47,14 @@ public class DBInstallerGUI extends JFrame implements DBOutputInterface
super("Mobius - DB Installer");
setLayout(new BorderLayout());
setDefaultLookAndFeelDecorated(true);
setIconImage(Toolkit.getDefaultToolkit().getImage("..\\images\\l2jmobius.png"));
// Set icons.
List<Image> icons = new ArrayList<>();
icons.add(new ImageIcon("..\\images\\l2jmobius_16x16.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
setIconImages(icons);
_con = con;

View File

@ -104,7 +104,6 @@
<jar destfile="${build.dist.dbinstaller}/Database_Installer_GS.jar" level="9">
<fileset dir="${build.bin}">
<include name="**/dbinstaller/**" />
<include name="**/images/**" />
<include name="**/util/**" />
<include name="**/SQLFilter**" />
<exclude name="**/LauncherLS*" />
@ -120,7 +119,6 @@
<jar destfile="${build.dist.dbinstaller}/Database_Installer_LS.jar" level="9">
<fileset dir="${build.bin}">
<include name="**/dbinstaller/**" />
<include name="**/images/**" />
<include name="**/util/**" />
<include name="**/SQLFilter**" />
<exclude name="**/LauncherGS*" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 488 B

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

View File

@ -0,0 +1,78 @@
/*
* This file is part of the L2J Mobius project.
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.commons.util;
import java.awt.Color;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JWindow;
/**
* @author Mobius
*/
public class SplashScreen extends JWindow
{
Image image;
JFrame parentFrame;
/**
* @param path of image file
* @param time in milliseconds
* @param parent frame to set visible after time ends
*/
public SplashScreen(String path, long time, JFrame parent)
{
parentFrame = parent;
setBackground(new Color(0, 255, 0, 0)); // Transparency.
image = Toolkit.getDefaultToolkit().getImage(path);
ImageIcon imageIcon = new ImageIcon(image);
setSize(imageIcon.getIconWidth(), imageIcon.getIconHeight());
setLocationRelativeTo(null);
setVisible(true);
// Schedule to dispose.
Executors.newScheduledThreadPool(1).schedule(this::dispose, imageIcon.getIconWidth() > 0 ? time : 100, TimeUnit.MILLISECONDS);
}
@Override
public void dispose()
{
setVisible(false);
if (parentFrame != null)
{
// Make parent visible.
parentFrame.setVisible(true);
// Focus parent window.
parentFrame.toFront();
parentFrame.setState(Frame.NORMAL);
}
super.dispose();
}
@Override
public void paint(Graphics g)
{
g.drawImage(image, 0, 0, null);
}
}

View File

@ -60,7 +60,6 @@ public class RunTasks extends Thread
JOptionPane.showMessageDialog(null, "Cannot close MySQL Connection: " + e.getMessage(), "Connection Error", JOptionPane.ERROR_MESSAGE);
}
_frame.setFrameVisible(false);
_frame.showMessage("Done!", "Database Installation Complete!", JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}

View File

@ -17,10 +17,14 @@
package com.l2jmobius.tools.dbinstaller.gui;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import java.util.prefs.Preferences;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
@ -30,6 +34,7 @@ import javax.swing.JTextField;
import javax.swing.SpringLayout;
import javax.swing.SwingConstants;
import com.l2jmobius.commons.util.SplashScreen;
import com.l2jmobius.tools.dbinstaller.RunTasks;
import com.l2jmobius.tools.dbinstaller.util.mysql.MySqlConnect;
import com.l2jmobius.tools.dbinstaller.util.swing.SpringUtilities;
@ -50,12 +55,25 @@ public class DBConfigGUI extends JFrame
Preferences _prop;
boolean _isVisible = true;
public DBConfigGUI(String db, String dir)
{
super("Mobius - DB Installer");
setVisible(false);
setLayout(new SpringLayout());
setDefaultLookAndFeelDecorated(true);
setIconImage(Toolkit.getDefaultToolkit().getImage("..\\images\\l2jmobius.png"));
// Set icons.
List<Image> icons = new ArrayList<>();
icons.add(new ImageIcon("..\\images\\l2jmobius_16x16.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
setIconImages(icons);
// Show SplashScreen.
new SplashScreen("..\\images\\splash.png", 5000, this);
_db = db;
_dir = dir;
@ -159,6 +177,7 @@ public class DBConfigGUI extends JFrame
System.exit(0);
}
}
_isVisible = false;
dbi.setVisible(true);
final RunTasks task = new RunTasks(dbi, _db, _dir);
@ -173,7 +192,11 @@ public class DBConfigGUI extends JFrame
add(btnConnect);
SpringUtilities.makeCompactGrid(getContentPane(), 6, 2, 5, 5, 5, 5);
setVisible(true);
}
@Override
public boolean isVisible()
{
return _isVisible;
}
}

View File

@ -18,9 +18,13 @@ package com.l2jmobius.tools.dbinstaller.gui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JProgressBar;
@ -43,7 +47,14 @@ public class DBInstallerGUI extends JFrame implements DBOutputInterface
super("Mobius - DB Installer");
setLayout(new BorderLayout());
setDefaultLookAndFeelDecorated(true);
setIconImage(Toolkit.getDefaultToolkit().getImage("..\\images\\l2jmobius.png"));
// Set icons.
List<Image> icons = new ArrayList<>();
icons.add(new ImageIcon("..\\images\\l2jmobius_16x16.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
setIconImages(icons);
_con = con;

View File

@ -104,7 +104,6 @@
<jar destfile="${build.dist.dbinstaller}/Database_Installer_GS.jar" level="9">
<fileset dir="${build.bin}">
<include name="**/dbinstaller/**" />
<include name="**/images/**" />
<include name="**/util/**" />
<include name="**/SQLFilter**" />
<exclude name="**/LauncherLS*" />
@ -120,7 +119,6 @@
<jar destfile="${build.dist.dbinstaller}/Database_Installer_LS.jar" level="9">
<fileset dir="${build.bin}">
<include name="**/dbinstaller/**" />
<include name="**/images/**" />
<include name="**/util/**" />
<include name="**/SQLFilter**" />
<exclude name="**/LauncherGS*" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 488 B

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

View File

@ -0,0 +1,78 @@
/*
* This file is part of the L2J Mobius project.
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.commons.util;
import java.awt.Color;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JWindow;
/**
* @author Mobius
*/
public class SplashScreen extends JWindow
{
Image image;
JFrame parentFrame;
/**
* @param path of image file
* @param time in milliseconds
* @param parent frame to set visible after time ends
*/
public SplashScreen(String path, long time, JFrame parent)
{
parentFrame = parent;
setBackground(new Color(0, 255, 0, 0)); // Transparency.
image = Toolkit.getDefaultToolkit().getImage(path);
ImageIcon imageIcon = new ImageIcon(image);
setSize(imageIcon.getIconWidth(), imageIcon.getIconHeight());
setLocationRelativeTo(null);
setVisible(true);
// Schedule to dispose.
Executors.newScheduledThreadPool(1).schedule(this::dispose, imageIcon.getIconWidth() > 0 ? time : 100, TimeUnit.MILLISECONDS);
}
@Override
public void dispose()
{
setVisible(false);
if (parentFrame != null)
{
// Make parent visible.
parentFrame.setVisible(true);
// Focus parent window.
parentFrame.toFront();
parentFrame.setState(Frame.NORMAL);
}
super.dispose();
}
@Override
public void paint(Graphics g)
{
g.drawImage(image, 0, 0, null);
}
}

View File

@ -60,7 +60,6 @@ public class RunTasks extends Thread
JOptionPane.showMessageDialog(null, "Cannot close MySQL Connection: " + e.getMessage(), "Connection Error", JOptionPane.ERROR_MESSAGE);
}
_frame.setFrameVisible(false);
_frame.showMessage("Done!", "Database Installation Complete!", JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}

View File

@ -17,10 +17,14 @@
package com.l2jmobius.tools.dbinstaller.gui;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import java.util.prefs.Preferences;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
@ -30,6 +34,7 @@ import javax.swing.JTextField;
import javax.swing.SpringLayout;
import javax.swing.SwingConstants;
import com.l2jmobius.commons.util.SplashScreen;
import com.l2jmobius.tools.dbinstaller.RunTasks;
import com.l2jmobius.tools.dbinstaller.util.mysql.MySqlConnect;
import com.l2jmobius.tools.dbinstaller.util.swing.SpringUtilities;
@ -50,12 +55,25 @@ public class DBConfigGUI extends JFrame
Preferences _prop;
boolean _isVisible = true;
public DBConfigGUI(String db, String dir)
{
super("Mobius - DB Installer");
setVisible(false);
setLayout(new SpringLayout());
setDefaultLookAndFeelDecorated(true);
setIconImage(Toolkit.getDefaultToolkit().getImage("..\\images\\l2jmobius.png"));
// Set icons.
List<Image> icons = new ArrayList<>();
icons.add(new ImageIcon("..\\images\\l2jmobius_16x16.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
setIconImages(icons);
// Show SplashScreen.
new SplashScreen("..\\images\\splash.png", 5000, this);
_db = db;
_dir = dir;
@ -159,6 +177,7 @@ public class DBConfigGUI extends JFrame
System.exit(0);
}
}
_isVisible = false;
dbi.setVisible(true);
final RunTasks task = new RunTasks(dbi, _db, _dir);
@ -173,7 +192,11 @@ public class DBConfigGUI extends JFrame
add(btnConnect);
SpringUtilities.makeCompactGrid(getContentPane(), 6, 2, 5, 5, 5, 5);
setVisible(true);
}
@Override
public boolean isVisible()
{
return _isVisible;
}
}

View File

@ -18,9 +18,13 @@ package com.l2jmobius.tools.dbinstaller.gui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JProgressBar;
@ -43,7 +47,14 @@ public class DBInstallerGUI extends JFrame implements DBOutputInterface
super("Mobius - DB Installer");
setLayout(new BorderLayout());
setDefaultLookAndFeelDecorated(true);
setIconImage(Toolkit.getDefaultToolkit().getImage("..\\images\\l2jmobius.png"));
// Set icons.
List<Image> icons = new ArrayList<>();
icons.add(new ImageIcon("..\\images\\l2jmobius_16x16.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
setIconImages(icons);
_con = con;

View File

@ -101,7 +101,6 @@
<jar destfile="${build.dist.dbinstaller}/Database_Installer_GS.jar" level="9">
<fileset dir="${build.bin}">
<include name="**/dbinstaller/**" />
<include name="**/images/**" />
<include name="**/util/**" />
<include name="**/SQLFilter**" />
<exclude name="**/LauncherLS*" />
@ -117,7 +116,6 @@
<jar destfile="${build.dist.dbinstaller}/Database_Installer_LS.jar" level="9">
<fileset dir="${build.bin}">
<include name="**/dbinstaller/**" />
<include name="**/images/**" />
<include name="**/util/**" />
<include name="**/SQLFilter**" />
<exclude name="**/LauncherGS*" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 488 B

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

View File

@ -0,0 +1,78 @@
/*
* This file is part of the L2J Mobius project.
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.commons.util;
import java.awt.Color;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JWindow;
/**
* @author Mobius
*/
public class SplashScreen extends JWindow
{
Image image;
JFrame parentFrame;
/**
* @param path of image file
* @param time in milliseconds
* @param parent frame to set visible after time ends
*/
public SplashScreen(String path, long time, JFrame parent)
{
parentFrame = parent;
setBackground(new Color(0, 255, 0, 0)); // Transparency.
image = Toolkit.getDefaultToolkit().getImage(path);
ImageIcon imageIcon = new ImageIcon(image);
setSize(imageIcon.getIconWidth(), imageIcon.getIconHeight());
setLocationRelativeTo(null);
setVisible(true);
// Schedule to dispose.
Executors.newScheduledThreadPool(1).schedule(this::dispose, imageIcon.getIconWidth() > 0 ? time : 100, TimeUnit.MILLISECONDS);
}
@Override
public void dispose()
{
setVisible(false);
if (parentFrame != null)
{
// Make parent visible.
parentFrame.setVisible(true);
// Focus parent window.
parentFrame.toFront();
parentFrame.setState(Frame.NORMAL);
}
super.dispose();
}
@Override
public void paint(Graphics g)
{
g.drawImage(image, 0, 0, null);
}
}

View File

@ -60,7 +60,6 @@ public class RunTasks extends Thread
JOptionPane.showMessageDialog(null, "Cannot close MySQL Connection: " + e.getMessage(), "Connection Error", JOptionPane.ERROR_MESSAGE);
}
_frame.setFrameVisible(false);
_frame.showMessage("Done!", "Database Installation Complete!", JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}

View File

@ -17,10 +17,14 @@
package com.l2jmobius.tools.dbinstaller.gui;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import java.util.prefs.Preferences;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
@ -30,6 +34,7 @@ import javax.swing.JTextField;
import javax.swing.SpringLayout;
import javax.swing.SwingConstants;
import com.l2jmobius.commons.util.SplashScreen;
import com.l2jmobius.tools.dbinstaller.RunTasks;
import com.l2jmobius.tools.dbinstaller.util.mysql.MySqlConnect;
import com.l2jmobius.tools.dbinstaller.util.swing.SpringUtilities;
@ -50,12 +55,25 @@ public class DBConfigGUI extends JFrame
Preferences _prop;
boolean _isVisible = true;
public DBConfigGUI(String db, String dir)
{
super("Mobius - DB Installer");
setVisible(false);
setLayout(new SpringLayout());
setDefaultLookAndFeelDecorated(true);
setIconImage(Toolkit.getDefaultToolkit().getImage("..\\images\\l2jmobius.png"));
// Set icons.
List<Image> icons = new ArrayList<>();
icons.add(new ImageIcon("..\\images\\l2jmobius_16x16.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
setIconImages(icons);
// Show SplashScreen.
new SplashScreen("..\\images\\splash.png", 5000, this);
_db = db;
_dir = dir;
@ -159,6 +177,7 @@ public class DBConfigGUI extends JFrame
System.exit(0);
}
}
_isVisible = false;
dbi.setVisible(true);
final RunTasks task = new RunTasks(dbi, _db, _dir);
@ -173,7 +192,11 @@ public class DBConfigGUI extends JFrame
add(btnConnect);
SpringUtilities.makeCompactGrid(getContentPane(), 6, 2, 5, 5, 5, 5);
setVisible(true);
}
@Override
public boolean isVisible()
{
return _isVisible;
}
}

View File

@ -18,9 +18,13 @@ package com.l2jmobius.tools.dbinstaller.gui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JProgressBar;
@ -43,7 +47,14 @@ public class DBInstallerGUI extends JFrame implements DBOutputInterface
super("Mobius - DB Installer");
setLayout(new BorderLayout());
setDefaultLookAndFeelDecorated(true);
setIconImage(Toolkit.getDefaultToolkit().getImage("..\\images\\l2jmobius.png"));
// Set icons.
List<Image> icons = new ArrayList<>();
icons.add(new ImageIcon("..\\images\\l2jmobius_16x16.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
setIconImages(icons);
_con = con;

View File

@ -104,7 +104,6 @@
<jar destfile="${build.dist.dbinstaller}/Database_Installer_GS.jar" level="9">
<fileset dir="${build.bin}">
<include name="**/dbinstaller/**" />
<include name="**/images/**" />
<include name="**/util/**" />
<include name="**/SQLFilter**" />
<exclude name="**/LauncherLS*" />
@ -120,7 +119,6 @@
<jar destfile="${build.dist.dbinstaller}/Database_Installer_LS.jar" level="9">
<fileset dir="${build.bin}">
<include name="**/dbinstaller/**" />
<include name="**/images/**" />
<include name="**/util/**" />
<include name="**/SQLFilter**" />
<exclude name="**/LauncherGS*" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 488 B

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

View File

@ -0,0 +1,78 @@
/*
* This file is part of the L2J Mobius project.
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.commons.util;
import java.awt.Color;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JWindow;
/**
* @author Mobius
*/
public class SplashScreen extends JWindow
{
Image image;
JFrame parentFrame;
/**
* @param path of image file
* @param time in milliseconds
* @param parent frame to set visible after time ends
*/
public SplashScreen(String path, long time, JFrame parent)
{
parentFrame = parent;
setBackground(new Color(0, 255, 0, 0)); // Transparency.
image = Toolkit.getDefaultToolkit().getImage(path);
ImageIcon imageIcon = new ImageIcon(image);
setSize(imageIcon.getIconWidth(), imageIcon.getIconHeight());
setLocationRelativeTo(null);
setVisible(true);
// Schedule to dispose.
Executors.newScheduledThreadPool(1).schedule(this::dispose, imageIcon.getIconWidth() > 0 ? time : 100, TimeUnit.MILLISECONDS);
}
@Override
public void dispose()
{
setVisible(false);
if (parentFrame != null)
{
// Make parent visible.
parentFrame.setVisible(true);
// Focus parent window.
parentFrame.toFront();
parentFrame.setState(Frame.NORMAL);
}
super.dispose();
}
@Override
public void paint(Graphics g)
{
g.drawImage(image, 0, 0, null);
}
}

View File

@ -60,7 +60,6 @@ public class RunTasks extends Thread
JOptionPane.showMessageDialog(null, "Cannot close MySQL Connection: " + e.getMessage(), "Connection Error", JOptionPane.ERROR_MESSAGE);
}
_frame.setFrameVisible(false);
_frame.showMessage("Done!", "Database Installation Complete!", JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}

View File

@ -17,10 +17,14 @@
package com.l2jmobius.tools.dbinstaller.gui;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import java.util.prefs.Preferences;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
@ -30,6 +34,7 @@ import javax.swing.JTextField;
import javax.swing.SpringLayout;
import javax.swing.SwingConstants;
import com.l2jmobius.commons.util.SplashScreen;
import com.l2jmobius.tools.dbinstaller.RunTasks;
import com.l2jmobius.tools.dbinstaller.util.mysql.MySqlConnect;
import com.l2jmobius.tools.dbinstaller.util.swing.SpringUtilities;
@ -50,12 +55,25 @@ public class DBConfigGUI extends JFrame
Preferences _prop;
boolean _isVisible = true;
public DBConfigGUI(String db, String dir)
{
super("Mobius - DB Installer");
setVisible(false);
setLayout(new SpringLayout());
setDefaultLookAndFeelDecorated(true);
setIconImage(Toolkit.getDefaultToolkit().getImage("..\\images\\l2jmobius.png"));
// Set icons.
List<Image> icons = new ArrayList<>();
icons.add(new ImageIcon("..\\images\\l2jmobius_16x16.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
setIconImages(icons);
// Show SplashScreen.
new SplashScreen("..\\images\\splash.png", 5000, this);
_db = db;
_dir = dir;
@ -159,6 +177,7 @@ public class DBConfigGUI extends JFrame
System.exit(0);
}
}
_isVisible = false;
dbi.setVisible(true);
final RunTasks task = new RunTasks(dbi, _db, _dir);
@ -173,7 +192,11 @@ public class DBConfigGUI extends JFrame
add(btnConnect);
SpringUtilities.makeCompactGrid(getContentPane(), 6, 2, 5, 5, 5, 5);
setVisible(true);
}
@Override
public boolean isVisible()
{
return _isVisible;
}
}

View File

@ -18,9 +18,13 @@ package com.l2jmobius.tools.dbinstaller.gui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JProgressBar;
@ -43,7 +47,14 @@ public class DBInstallerGUI extends JFrame implements DBOutputInterface
super("Mobius - DB Installer");
setLayout(new BorderLayout());
setDefaultLookAndFeelDecorated(true);
setIconImage(Toolkit.getDefaultToolkit().getImage("..\\images\\l2jmobius.png"));
// Set icons.
List<Image> icons = new ArrayList<>();
icons.add(new ImageIcon("..\\images\\l2jmobius_16x16.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
setIconImages(icons);
_con = con;

View File

@ -104,7 +104,6 @@
<jar destfile="${build.dist.dbinstaller}/Database_Installer_GS.jar" level="9">
<fileset dir="${build.bin}">
<include name="**/dbinstaller/**" />
<include name="**/images/**" />
<include name="**/util/**" />
<include name="**/SQLFilter**" />
<exclude name="**/LauncherLS*" />
@ -120,7 +119,6 @@
<jar destfile="${build.dist.dbinstaller}/Database_Installer_LS.jar" level="9">
<fileset dir="${build.bin}">
<include name="**/dbinstaller/**" />
<include name="**/images/**" />
<include name="**/util/**" />
<include name="**/SQLFilter**" />
<exclude name="**/LauncherGS*" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 488 B

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

View File

@ -0,0 +1,78 @@
/*
* This file is part of the L2J Mobius project.
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.commons.util;
import java.awt.Color;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JWindow;
/**
* @author Mobius
*/
public class SplashScreen extends JWindow
{
Image image;
JFrame parentFrame;
/**
* @param path of image file
* @param time in milliseconds
* @param parent frame to set visible after time ends
*/
public SplashScreen(String path, long time, JFrame parent)
{
parentFrame = parent;
setBackground(new Color(0, 255, 0, 0)); // Transparency.
image = Toolkit.getDefaultToolkit().getImage(path);
ImageIcon imageIcon = new ImageIcon(image);
setSize(imageIcon.getIconWidth(), imageIcon.getIconHeight());
setLocationRelativeTo(null);
setVisible(true);
// Schedule to dispose.
Executors.newScheduledThreadPool(1).schedule(this::dispose, imageIcon.getIconWidth() > 0 ? time : 100, TimeUnit.MILLISECONDS);
}
@Override
public void dispose()
{
setVisible(false);
if (parentFrame != null)
{
// Make parent visible.
parentFrame.setVisible(true);
// Focus parent window.
parentFrame.toFront();
parentFrame.setState(Frame.NORMAL);
}
super.dispose();
}
@Override
public void paint(Graphics g)
{
g.drawImage(image, 0, 0, null);
}
}

View File

@ -60,7 +60,6 @@ public class RunTasks extends Thread
JOptionPane.showMessageDialog(null, "Cannot close MySQL Connection: " + e.getMessage(), "Connection Error", JOptionPane.ERROR_MESSAGE);
}
_frame.setFrameVisible(false);
_frame.showMessage("Done!", "Database Installation Complete!", JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}

View File

@ -17,10 +17,14 @@
package com.l2jmobius.tools.dbinstaller.gui;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import java.util.prefs.Preferences;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
@ -30,6 +34,7 @@ import javax.swing.JTextField;
import javax.swing.SpringLayout;
import javax.swing.SwingConstants;
import com.l2jmobius.commons.util.SplashScreen;
import com.l2jmobius.tools.dbinstaller.RunTasks;
import com.l2jmobius.tools.dbinstaller.util.mysql.MySqlConnect;
import com.l2jmobius.tools.dbinstaller.util.swing.SpringUtilities;
@ -50,12 +55,25 @@ public class DBConfigGUI extends JFrame
Preferences _prop;
boolean _isVisible = true;
public DBConfigGUI(String db, String dir)
{
super("Mobius - DB Installer");
setVisible(false);
setLayout(new SpringLayout());
setDefaultLookAndFeelDecorated(true);
setIconImage(Toolkit.getDefaultToolkit().getImage("..\\images\\l2jmobius.png"));
// Set icons.
List<Image> icons = new ArrayList<>();
icons.add(new ImageIcon("..\\images\\l2jmobius_16x16.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
setIconImages(icons);
// Show SplashScreen.
new SplashScreen("..\\images\\splash.png", 5000, this);
_db = db;
_dir = dir;
@ -159,6 +177,7 @@ public class DBConfigGUI extends JFrame
System.exit(0);
}
}
_isVisible = false;
dbi.setVisible(true);
final RunTasks task = new RunTasks(dbi, _db, _dir);
@ -173,7 +192,11 @@ public class DBConfigGUI extends JFrame
add(btnConnect);
SpringUtilities.makeCompactGrid(getContentPane(), 6, 2, 5, 5, 5, 5);
setVisible(true);
}
@Override
public boolean isVisible()
{
return _isVisible;
}
}

View File

@ -18,9 +18,13 @@ package com.l2jmobius.tools.dbinstaller.gui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JProgressBar;
@ -43,7 +47,14 @@ public class DBInstallerGUI extends JFrame implements DBOutputInterface
super("Mobius - DB Installer");
setLayout(new BorderLayout());
setDefaultLookAndFeelDecorated(true);
setIconImage(Toolkit.getDefaultToolkit().getImage("..\\images\\l2jmobius.png"));
// Set icons.
List<Image> icons = new ArrayList<>();
icons.add(new ImageIcon("..\\images\\l2jmobius_16x16.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
setIconImages(icons);
_con = con;

View File

@ -104,7 +104,6 @@
<jar destfile="${build.dist.dbinstaller}/Database_Installer_GS.jar" level="9">
<fileset dir="${build.bin}">
<include name="**/dbinstaller/**" />
<include name="**/images/**" />
<include name="**/util/**" />
<include name="**/SQLFilter**" />
<exclude name="**/LauncherLS*" />
@ -120,7 +119,6 @@
<jar destfile="${build.dist.dbinstaller}/Database_Installer_LS.jar" level="9">
<fileset dir="${build.bin}">
<include name="**/dbinstaller/**" />
<include name="**/images/**" />
<include name="**/util/**" />
<include name="**/SQLFilter**" />
<exclude name="**/LauncherGS*" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 488 B

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

View File

@ -0,0 +1,78 @@
/*
* This file is part of the L2J Mobius project.
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.commons.util;
import java.awt.Color;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JWindow;
/**
* @author Mobius
*/
public class SplashScreen extends JWindow
{
Image image;
JFrame parentFrame;
/**
* @param path of image file
* @param time in milliseconds
* @param parent frame to set visible after time ends
*/
public SplashScreen(String path, long time, JFrame parent)
{
parentFrame = parent;
setBackground(new Color(0, 255, 0, 0)); // Transparency.
image = Toolkit.getDefaultToolkit().getImage(path);
ImageIcon imageIcon = new ImageIcon(image);
setSize(imageIcon.getIconWidth(), imageIcon.getIconHeight());
setLocationRelativeTo(null);
setVisible(true);
// Schedule to dispose.
Executors.newScheduledThreadPool(1).schedule(this::dispose, imageIcon.getIconWidth() > 0 ? time : 100, TimeUnit.MILLISECONDS);
}
@Override
public void dispose()
{
setVisible(false);
if (parentFrame != null)
{
// Make parent visible.
parentFrame.setVisible(true);
// Focus parent window.
parentFrame.toFront();
parentFrame.setState(Frame.NORMAL);
}
super.dispose();
}
@Override
public void paint(Graphics g)
{
g.drawImage(image, 0, 0, null);
}
}

View File

@ -60,7 +60,6 @@ public class RunTasks extends Thread
JOptionPane.showMessageDialog(null, "Cannot close MySQL Connection: " + e.getMessage(), "Connection Error", JOptionPane.ERROR_MESSAGE);
}
_frame.setFrameVisible(false);
_frame.showMessage("Done!", "Database Installation Complete!", JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}

View File

@ -17,10 +17,14 @@
package com.l2jmobius.tools.dbinstaller.gui;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import java.util.prefs.Preferences;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
@ -30,6 +34,7 @@ import javax.swing.JTextField;
import javax.swing.SpringLayout;
import javax.swing.SwingConstants;
import com.l2jmobius.commons.util.SplashScreen;
import com.l2jmobius.tools.dbinstaller.RunTasks;
import com.l2jmobius.tools.dbinstaller.util.mysql.MySqlConnect;
import com.l2jmobius.tools.dbinstaller.util.swing.SpringUtilities;
@ -50,12 +55,25 @@ public class DBConfigGUI extends JFrame
Preferences _prop;
boolean _isVisible = true;
public DBConfigGUI(String db, String dir)
{
super("Mobius - DB Installer");
setVisible(false);
setLayout(new SpringLayout());
setDefaultLookAndFeelDecorated(true);
setIconImage(Toolkit.getDefaultToolkit().getImage("..\\images\\l2jmobius.png"));
// Set icons.
List<Image> icons = new ArrayList<>();
icons.add(new ImageIcon("..\\images\\l2jmobius_16x16.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
setIconImages(icons);
// Show SplashScreen.
new SplashScreen("..\\images\\splash.png", 5000, this);
_db = db;
_dir = dir;
@ -159,6 +177,7 @@ public class DBConfigGUI extends JFrame
System.exit(0);
}
}
_isVisible = false;
dbi.setVisible(true);
final RunTasks task = new RunTasks(dbi, _db, _dir);
@ -173,7 +192,11 @@ public class DBConfigGUI extends JFrame
add(btnConnect);
SpringUtilities.makeCompactGrid(getContentPane(), 6, 2, 5, 5, 5, 5);
setVisible(true);
}
@Override
public boolean isVisible()
{
return _isVisible;
}
}

View File

@ -18,9 +18,13 @@ package com.l2jmobius.tools.dbinstaller.gui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JProgressBar;
@ -43,7 +47,14 @@ public class DBInstallerGUI extends JFrame implements DBOutputInterface
super("Mobius - DB Installer");
setLayout(new BorderLayout());
setDefaultLookAndFeelDecorated(true);
setIconImage(Toolkit.getDefaultToolkit().getImage("..\\images\\l2jmobius.png"));
// Set icons.
List<Image> icons = new ArrayList<>();
icons.add(new ImageIcon("..\\images\\l2jmobius_16x16.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
setIconImages(icons);
_con = con;