Addition of SplashScreen class.
@ -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*" />
|
||||
|
BIN
L2J_Mobius_1.0_Ertheia/dist/images/l2jmobius_128x128.png
vendored
Normal file
After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 488 B After Width: | Height: | Size: 488 B |
BIN
L2J_Mobius_1.0_Ertheia/dist/images/l2jmobius_32x32.png
vendored
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
L2J_Mobius_1.0_Ertheia/dist/images/l2jmobius_64x64.png
vendored
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
L2J_Mobius_1.0_Ertheia/dist/images/splash.png
vendored
Normal file
After Width: | Height: | Size: 206 KiB |
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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*" />
|
||||
|
BIN
L2J_Mobius_2.5_Underground/dist/images/l2jmobius_128x128.png
vendored
Normal file
After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 488 B After Width: | Height: | Size: 488 B |
BIN
L2J_Mobius_2.5_Underground/dist/images/l2jmobius_32x32.png
vendored
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
L2J_Mobius_2.5_Underground/dist/images/l2jmobius_64x64.png
vendored
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
L2J_Mobius_2.5_Underground/dist/images/splash.png
vendored
Normal file
After Width: | Height: | Size: 206 KiB |
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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*" />
|
||||
|
BIN
L2J_Mobius_3.0_Helios/dist/images/l2jmobius_128x128.png
vendored
Normal file
After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 488 B After Width: | Height: | Size: 488 B |
BIN
L2J_Mobius_3.0_Helios/dist/images/l2jmobius_32x32.png
vendored
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
L2J_Mobius_3.0_Helios/dist/images/l2jmobius_64x64.png
vendored
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
L2J_Mobius_3.0_Helios/dist/images/splash.png
vendored
Normal file
After Width: | Height: | Size: 206 KiB |
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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*" />
|
||||
|
BIN
L2J_Mobius_4.0_GrandCrusade/dist/images/l2jmobius_128x128.png
vendored
Normal file
After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 488 B After Width: | Height: | Size: 488 B |
BIN
L2J_Mobius_4.0_GrandCrusade/dist/images/l2jmobius_32x32.png
vendored
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
L2J_Mobius_4.0_GrandCrusade/dist/images/l2jmobius_64x64.png
vendored
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
L2J_Mobius_4.0_GrandCrusade/dist/images/splash.png
vendored
Normal file
After Width: | Height: | Size: 206 KiB |
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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*" />
|
||||
|
BIN
L2J_Mobius_C6_Interlude/dist/images/l2jmobius_128x128.png
vendored
Normal file
After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 488 B After Width: | Height: | Size: 488 B |
BIN
L2J_Mobius_C6_Interlude/dist/images/l2jmobius_32x32.png
vendored
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
L2J_Mobius_C6_Interlude/dist/images/l2jmobius_64x64.png
vendored
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
L2J_Mobius_C6_Interlude/dist/images/splash.png
vendored
Normal file
After Width: | Height: | Size: 206 KiB |
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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*" />
|
||||
|
BIN
L2J_Mobius_CT_2.6_HighFive/dist/images/l2jmobius_128x128.png
vendored
Normal file
After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 488 B After Width: | Height: | Size: 488 B |
BIN
L2J_Mobius_CT_2.6_HighFive/dist/images/l2jmobius_32x32.png
vendored
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
L2J_Mobius_CT_2.6_HighFive/dist/images/l2jmobius_64x64.png
vendored
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
L2J_Mobius_CT_2.6_HighFive/dist/images/splash.png
vendored
Normal file
After Width: | Height: | Size: 206 KiB |
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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*" />
|
||||
|
BIN
L2J_Mobius_Classic_2.0_Saviors/dist/images/l2jmobius_128x128.png
vendored
Normal file
After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 488 B After Width: | Height: | Size: 488 B |
BIN
L2J_Mobius_Classic_2.0_Saviors/dist/images/l2jmobius_32x32.png
vendored
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
L2J_Mobius_Classic_2.0_Saviors/dist/images/l2jmobius_64x64.png
vendored
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
L2J_Mobius_Classic_2.0_Saviors/dist/images/splash.png
vendored
Normal file
After Width: | Height: | Size: 206 KiB |
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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*" />
|
||||
|
BIN
L2J_Mobius_Classic_2.0_Zaken/dist/images/l2jmobius_128x128.png
vendored
Normal file
After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 488 B After Width: | Height: | Size: 488 B |
BIN
L2J_Mobius_Classic_2.0_Zaken/dist/images/l2jmobius_32x32.png
vendored
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
L2J_Mobius_Classic_2.0_Zaken/dist/images/l2jmobius_64x64.png
vendored
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
L2J_Mobius_Classic_2.0_Zaken/dist/images/splash.png
vendored
Normal file
After Width: | Height: | Size: 206 KiB |
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|