From cdcd780e7ad254ce93fd99364d40d87028501a31 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Thu, 3 May 2018 05:33:50 +0000 Subject: [PATCH] There is no need to store parent frame locally. --- .../com/l2jmobius/commons/util/SplashScreen.java | 12 +++++------- .../com/l2jmobius/commons/util/SplashScreen.java | 12 +++++------- .../com/l2jmobius/commons/util/SplashScreen.java | 12 +++++------- .../com/l2jmobius/commons/util/SplashScreen.java | 12 +++++------- .../com/l2jmobius/commons/util/SplashScreen.java | 12 +++++------- .../com/l2jmobius/commons/util/SplashScreen.java | 12 +++++------- .../com/l2jmobius/commons/util/SplashScreen.java | 12 +++++------- .../com/l2jmobius/commons/util/SplashScreen.java | 12 +++++------- 8 files changed, 40 insertions(+), 56 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/commons/util/SplashScreen.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/commons/util/SplashScreen.java index 5086e53e9c..34e9f8f674 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/commons/util/SplashScreen.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/commons/util/SplashScreen.java @@ -34,7 +34,6 @@ import javax.swing.JWindow; public class SplashScreen extends JWindow { Image image; - JFrame parentFrame; /** * @param path of image file @@ -43,7 +42,6 @@ public class SplashScreen extends JWindow */ 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); @@ -58,14 +56,14 @@ public class SplashScreen extends JWindow public void run() { setVisible(false); - if (parentFrame != null) + if (parent != null) { // Make parent visible. - parentFrame.setVisible(true); + parent.setVisible(true); // Focus parent window. - parentFrame.toFront(); - parentFrame.setState(Frame.ICONIFIED); - parentFrame.setState(Frame.NORMAL); + parent.toFront(); + parent.setState(Frame.ICONIFIED); + parent.setState(Frame.NORMAL); } dispose(); } diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/commons/util/SplashScreen.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/commons/util/SplashScreen.java index 5086e53e9c..34e9f8f674 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/commons/util/SplashScreen.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/commons/util/SplashScreen.java @@ -34,7 +34,6 @@ import javax.swing.JWindow; public class SplashScreen extends JWindow { Image image; - JFrame parentFrame; /** * @param path of image file @@ -43,7 +42,6 @@ public class SplashScreen extends JWindow */ 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); @@ -58,14 +56,14 @@ public class SplashScreen extends JWindow public void run() { setVisible(false); - if (parentFrame != null) + if (parent != null) { // Make parent visible. - parentFrame.setVisible(true); + parent.setVisible(true); // Focus parent window. - parentFrame.toFront(); - parentFrame.setState(Frame.ICONIFIED); - parentFrame.setState(Frame.NORMAL); + parent.toFront(); + parent.setState(Frame.ICONIFIED); + parent.setState(Frame.NORMAL); } dispose(); } diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/commons/util/SplashScreen.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/commons/util/SplashScreen.java index 5086e53e9c..34e9f8f674 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/commons/util/SplashScreen.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/commons/util/SplashScreen.java @@ -34,7 +34,6 @@ import javax.swing.JWindow; public class SplashScreen extends JWindow { Image image; - JFrame parentFrame; /** * @param path of image file @@ -43,7 +42,6 @@ public class SplashScreen extends JWindow */ 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); @@ -58,14 +56,14 @@ public class SplashScreen extends JWindow public void run() { setVisible(false); - if (parentFrame != null) + if (parent != null) { // Make parent visible. - parentFrame.setVisible(true); + parent.setVisible(true); // Focus parent window. - parentFrame.toFront(); - parentFrame.setState(Frame.ICONIFIED); - parentFrame.setState(Frame.NORMAL); + parent.toFront(); + parent.setState(Frame.ICONIFIED); + parent.setState(Frame.NORMAL); } dispose(); } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/commons/util/SplashScreen.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/commons/util/SplashScreen.java index 5086e53e9c..34e9f8f674 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/commons/util/SplashScreen.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/commons/util/SplashScreen.java @@ -34,7 +34,6 @@ import javax.swing.JWindow; public class SplashScreen extends JWindow { Image image; - JFrame parentFrame; /** * @param path of image file @@ -43,7 +42,6 @@ public class SplashScreen extends JWindow */ 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); @@ -58,14 +56,14 @@ public class SplashScreen extends JWindow public void run() { setVisible(false); - if (parentFrame != null) + if (parent != null) { // Make parent visible. - parentFrame.setVisible(true); + parent.setVisible(true); // Focus parent window. - parentFrame.toFront(); - parentFrame.setState(Frame.ICONIFIED); - parentFrame.setState(Frame.NORMAL); + parent.toFront(); + parent.setState(Frame.ICONIFIED); + parent.setState(Frame.NORMAL); } dispose(); } diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/commons/util/SplashScreen.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/commons/util/SplashScreen.java index 5086e53e9c..34e9f8f674 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/commons/util/SplashScreen.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/commons/util/SplashScreen.java @@ -34,7 +34,6 @@ import javax.swing.JWindow; public class SplashScreen extends JWindow { Image image; - JFrame parentFrame; /** * @param path of image file @@ -43,7 +42,6 @@ public class SplashScreen extends JWindow */ 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); @@ -58,14 +56,14 @@ public class SplashScreen extends JWindow public void run() { setVisible(false); - if (parentFrame != null) + if (parent != null) { // Make parent visible. - parentFrame.setVisible(true); + parent.setVisible(true); // Focus parent window. - parentFrame.toFront(); - parentFrame.setState(Frame.ICONIFIED); - parentFrame.setState(Frame.NORMAL); + parent.toFront(); + parent.setState(Frame.ICONIFIED); + parent.setState(Frame.NORMAL); } dispose(); } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/commons/util/SplashScreen.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/commons/util/SplashScreen.java index 5086e53e9c..34e9f8f674 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/commons/util/SplashScreen.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/commons/util/SplashScreen.java @@ -34,7 +34,6 @@ import javax.swing.JWindow; public class SplashScreen extends JWindow { Image image; - JFrame parentFrame; /** * @param path of image file @@ -43,7 +42,6 @@ public class SplashScreen extends JWindow */ 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); @@ -58,14 +56,14 @@ public class SplashScreen extends JWindow public void run() { setVisible(false); - if (parentFrame != null) + if (parent != null) { // Make parent visible. - parentFrame.setVisible(true); + parent.setVisible(true); // Focus parent window. - parentFrame.toFront(); - parentFrame.setState(Frame.ICONIFIED); - parentFrame.setState(Frame.NORMAL); + parent.toFront(); + parent.setState(Frame.ICONIFIED); + parent.setState(Frame.NORMAL); } dispose(); } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/commons/util/SplashScreen.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/commons/util/SplashScreen.java index 5086e53e9c..34e9f8f674 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/commons/util/SplashScreen.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/commons/util/SplashScreen.java @@ -34,7 +34,6 @@ import javax.swing.JWindow; public class SplashScreen extends JWindow { Image image; - JFrame parentFrame; /** * @param path of image file @@ -43,7 +42,6 @@ public class SplashScreen extends JWindow */ 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); @@ -58,14 +56,14 @@ public class SplashScreen extends JWindow public void run() { setVisible(false); - if (parentFrame != null) + if (parent != null) { // Make parent visible. - parentFrame.setVisible(true); + parent.setVisible(true); // Focus parent window. - parentFrame.toFront(); - parentFrame.setState(Frame.ICONIFIED); - parentFrame.setState(Frame.NORMAL); + parent.toFront(); + parent.setState(Frame.ICONIFIED); + parent.setState(Frame.NORMAL); } dispose(); } diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/commons/util/SplashScreen.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/commons/util/SplashScreen.java index 5086e53e9c..34e9f8f674 100644 --- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/commons/util/SplashScreen.java +++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/commons/util/SplashScreen.java @@ -34,7 +34,6 @@ import javax.swing.JWindow; public class SplashScreen extends JWindow { Image image; - JFrame parentFrame; /** * @param path of image file @@ -43,7 +42,6 @@ public class SplashScreen extends JWindow */ 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); @@ -58,14 +56,14 @@ public class SplashScreen extends JWindow public void run() { setVisible(false); - if (parentFrame != null) + if (parent != null) { // Make parent visible. - parentFrame.setVisible(true); + parent.setVisible(true); // Focus parent window. - parentFrame.toFront(); - parentFrame.setState(Frame.ICONIFIED); - parentFrame.setState(Frame.NORMAL); + parent.toFront(); + parent.setState(Frame.ICONIFIED); + parent.setState(Frame.NORMAL); } dispose(); }