forked from Qortal/qortal
Update splash screen image.
This commit is contained in:
parent
7153ed022c
commit
e32a486493
@ -1,15 +1,11 @@
|
|||||||
package org.qortal.gui;
|
package org.qortal.gui;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.*;
|
||||||
import java.awt.Image;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.awt.Dimension;
|
|
||||||
import java.awt.Graphics;
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
|
|
||||||
import javax.swing.JDialog;
|
import javax.swing.*;
|
||||||
import javax.swing.JPanel;
|
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
@ -19,27 +15,35 @@ public class SplashFrame {
|
|||||||
protected static final Logger LOGGER = LogManager.getLogger(SplashFrame.class);
|
protected static final Logger LOGGER = LogManager.getLogger(SplashFrame.class);
|
||||||
|
|
||||||
private static SplashFrame instance;
|
private static SplashFrame instance;
|
||||||
private JDialog splashDialog;
|
private JFrame splashDialog;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public static class SplashPanel extends JPanel {
|
public static class SplashPanel extends JPanel {
|
||||||
private BufferedImage image;
|
private BufferedImage image;
|
||||||
|
|
||||||
|
private String defaultSplash = "Qlogo_512.png";
|
||||||
|
|
||||||
public SplashPanel() {
|
public SplashPanel() {
|
||||||
image = Gui.loadImage("splash.png");
|
image = Gui.loadImage(defaultSplash);
|
||||||
this.setPreferredSize(new Dimension(image.getWidth(), image.getHeight()));
|
|
||||||
this.setLayout(new BorderLayout());
|
setOpaque(false);
|
||||||
|
setLayout(new GridBagLayout());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void paintComponent(Graphics g) {
|
protected void paintComponent(Graphics g) {
|
||||||
super.paintComponent(g);
|
super.paintComponent(g);
|
||||||
g.drawImage(image, 0, 0, null);
|
g.drawImage(image, 0, 0, getWidth(), getHeight(), this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Dimension getPreferredSize() {
|
||||||
|
return new Dimension(500, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private SplashFrame() {
|
private SplashFrame() {
|
||||||
this.splashDialog = new JDialog();
|
this.splashDialog = new JFrame();
|
||||||
|
|
||||||
List<Image> icons = new ArrayList<>();
|
List<Image> icons = new ArrayList<>();
|
||||||
icons.add(Gui.loadImage("icons/icon16.png"));
|
icons.add(Gui.loadImage("icons/icon16.png"));
|
||||||
@ -48,17 +52,13 @@ public class SplashFrame {
|
|||||||
icons.add(Gui.loadImage("icons/icon128.png"));
|
icons.add(Gui.loadImage("icons/icon128.png"));
|
||||||
this.splashDialog.setIconImages(icons);
|
this.splashDialog.setIconImages(icons);
|
||||||
|
|
||||||
this.splashDialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
|
this.splashDialog.getContentPane().add(new SplashPanel());
|
||||||
this.splashDialog.setTitle("qortal");
|
this.splashDialog.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
|
||||||
this.splashDialog.setContentPane(new SplashPanel());
|
|
||||||
|
|
||||||
this.splashDialog.setUndecorated(true);
|
this.splashDialog.setUndecorated(true);
|
||||||
this.splashDialog.setModal(false);
|
|
||||||
this.splashDialog.pack();
|
this.splashDialog.pack();
|
||||||
this.splashDialog.setLocationRelativeTo(null);
|
this.splashDialog.setLocationRelativeTo(null);
|
||||||
this.splashDialog.toFront();
|
this.splashDialog.setBackground(new Color(0,0,0,0));
|
||||||
this.splashDialog.setVisible(true);
|
this.splashDialog.setVisible(true);
|
||||||
this.splashDialog.repaint();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SplashFrame getInstance() {
|
public static SplashFrame getInstance() {
|
||||||
|
BIN
src/main/resources/images/Qlogo_512.png
Normal file
BIN
src/main/resources/images/Qlogo_512.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 62 KiB |
0
src/main/resources/images/splash.png
Executable file → Normal file
0
src/main/resources/images/splash.png
Executable file → Normal file
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
Loading…
Reference in New Issue
Block a user