Restored animations
This commit is contained in:
@@ -55,6 +55,8 @@ public final class Config implements Cloneable {
|
|||||||
private boolean enableShadow;
|
private boolean enableShadow;
|
||||||
@SerializedName("enableBlur")
|
@SerializedName("enableBlur")
|
||||||
private boolean enableBlur;
|
private boolean enableBlur;
|
||||||
|
@SerializedName("enableAnimation")
|
||||||
|
private boolean enableAnimation;
|
||||||
@SerializedName("decorated")
|
@SerializedName("decorated")
|
||||||
private boolean decorated;
|
private boolean decorated;
|
||||||
@SerializedName("theme")
|
@SerializedName("theme")
|
||||||
@@ -110,6 +112,15 @@ public final class Config implements Cloneable {
|
|||||||
Settings.save();
|
Settings.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isEnableAnimation() {
|
||||||
|
return enableAnimation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnableAnimation(boolean enableAnimation) {
|
||||||
|
this.enableAnimation = enableAnimation;
|
||||||
|
Settings.save();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isEnableBlur() {
|
public boolean isEnableBlur() {
|
||||||
return enableBlur;
|
return enableBlur;
|
||||||
}
|
}
|
||||||
@@ -194,7 +205,7 @@ public final class Config implements Cloneable {
|
|||||||
public Config() {
|
public Config() {
|
||||||
clientToken = UUID.randomUUID().toString();
|
clientToken = UUID.randomUUID().toString();
|
||||||
logintype = downloadtype = 0;
|
logintype = downloadtype = 0;
|
||||||
enableBlur = enableShadow = true;
|
enableAnimation = enableBlur = enableShadow = true;
|
||||||
theme = 4;
|
theme = 4;
|
||||||
decorated = OS.os() == OS.LINUX;
|
decorated = OS.os() == OS.LINUX;
|
||||||
auth = new HashMap<>();
|
auth = new HashMap<>();
|
||||||
|
|||||||
@@ -93,8 +93,6 @@ public final class GameSettingsPanel extends RepaintPage implements DropTargetLi
|
|||||||
initComponents();
|
initComponents();
|
||||||
|
|
||||||
dropTarget = new DropTarget(this, DnDConstants.ACTION_COPY_OR_MOVE, this);
|
dropTarget = new DropTarget(this, DnDConstants.ACTION_COPY_OR_MOVE, this);
|
||||||
setBackground(GraphicsUtils.getWebColorWithAlpha("FFFFFF7F"));
|
|
||||||
setOpaque(true);
|
|
||||||
|
|
||||||
for (int i = 0; i < InstallerType.values().length; i++)
|
for (int i = 0; i < InstallerType.values().length; i++)
|
||||||
installerPanels[i] = new InstallerPanel(this, InstallerType.values()[i]);
|
installerPanels[i] = new InstallerPanel(this, InstallerType.values()[i]);
|
||||||
|
|||||||
@@ -71,6 +71,8 @@
|
|||||||
<Component id="chkEnableShadow" min="-2" max="-2" attributes="0"/>
|
<Component id="chkEnableShadow" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="chkEnableBlur" min="-2" max="-2" attributes="0"/>
|
<Component id="chkEnableBlur" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="chkEnableAnimation" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<Component id="chkDecorated" alignment="0" min="-2" max="-2" attributes="0"/>
|
<Component id="chkDecorated" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
@@ -121,6 +123,7 @@
|
|||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
<Component id="chkEnableShadow" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="chkEnableShadow" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="chkEnableBlur" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="chkEnableBlur" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="chkEnableAnimation" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="chkDecorated" min="-2" max="-2" attributes="0"/>
|
<Component id="chkDecorated" min="-2" max="-2" attributes="0"/>
|
||||||
@@ -354,5 +357,15 @@
|
|||||||
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="chkEnableBlurItemStateChanged"/>
|
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="chkEnableBlurItemStateChanged"/>
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
|
<Component class="javax.swing.JCheckBox" name="chkEnableAnimation">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="launcher.enable_animation" replaceFormat="C.i18n("{key}")"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="chkEnableAnimationItemStateChanged"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Form>
|
</Form>
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import org.jackhuang.hellominecraft.launcher.core.download.DownloadType;
|
|||||||
import org.jackhuang.hellominecraft.util.sys.IOUtils;
|
import org.jackhuang.hellominecraft.util.sys.IOUtils;
|
||||||
import org.jackhuang.hellominecraft.util.MessageBox;
|
import org.jackhuang.hellominecraft.util.MessageBox;
|
||||||
import org.jackhuang.hellominecraft.util.lang.SupportedLocales;
|
import org.jackhuang.hellominecraft.util.lang.SupportedLocales;
|
||||||
import org.jackhuang.hellominecraft.util.ui.GraphicsUtils;
|
|
||||||
import org.jackhuang.hellominecraft.util.ui.JSystemFileChooser;
|
import org.jackhuang.hellominecraft.util.ui.JSystemFileChooser;
|
||||||
import org.jackhuang.hellominecraft.util.ui.SwingUtils;
|
import org.jackhuang.hellominecraft.util.ui.SwingUtils;
|
||||||
|
|
||||||
@@ -46,8 +45,6 @@ public class LauncherSettingsPanel extends RepaintPage {
|
|||||||
|
|
||||||
void initGui() {
|
void initGui() {
|
||||||
initComponents();
|
initComponents();
|
||||||
setBackground(GraphicsUtils.getWebColorWithAlpha("FFFFFF7F"));
|
|
||||||
setOpaque(true);
|
|
||||||
|
|
||||||
DefaultComboBoxModel<String> d = new DefaultComboBoxModel<>();
|
DefaultComboBoxModel<String> d = new DefaultComboBoxModel<>();
|
||||||
for (DownloadType type : DownloadType.values())
|
for (DownloadType type : DownloadType.values())
|
||||||
@@ -73,6 +70,7 @@ public class LauncherSettingsPanel extends RepaintPage {
|
|||||||
cboTheme.setSelectedIndex(Settings.getInstance().getTheme().ordinal());
|
cboTheme.setSelectedIndex(Settings.getInstance().getTheme().ordinal());
|
||||||
chkEnableShadow.setSelected(Settings.getInstance().isEnableShadow());
|
chkEnableShadow.setSelected(Settings.getInstance().isEnableShadow());
|
||||||
chkEnableBlur.setSelected(Settings.getInstance().isEnableBlur());
|
chkEnableBlur.setSelected(Settings.getInstance().isEnableBlur());
|
||||||
|
chkEnableAnimation.setSelected(Settings.getInstance().isEnableAnimation());
|
||||||
chkDecorated.setSelected(Settings.getInstance().isDecorated());
|
chkDecorated.setSelected(Settings.getInstance().isDecorated());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,6 +115,7 @@ public class LauncherSettingsPanel extends RepaintPage {
|
|||||||
lblRestart = new javax.swing.JLabel();
|
lblRestart = new javax.swing.JLabel();
|
||||||
btnMCBBS = new javax.swing.JButton();
|
btnMCBBS = new javax.swing.JButton();
|
||||||
chkEnableBlur = new javax.swing.JCheckBox();
|
chkEnableBlur = new javax.swing.JCheckBox();
|
||||||
|
chkEnableAnimation = new javax.swing.JCheckBox();
|
||||||
|
|
||||||
cboDownloadSource.addItemListener(new java.awt.event.ItemListener() {
|
cboDownloadSource.addItemListener(new java.awt.event.ItemListener() {
|
||||||
public void itemStateChanged(java.awt.event.ItemEvent evt) {
|
public void itemStateChanged(java.awt.event.ItemEvent evt) {
|
||||||
@@ -244,6 +243,13 @@ public class LauncherSettingsPanel extends RepaintPage {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
chkEnableAnimation.setText(C.i18n("launcher.enable_animation")); // NOI18N
|
||||||
|
chkEnableAnimation.addItemListener(new java.awt.event.ItemListener() {
|
||||||
|
public void itemStateChanged(java.awt.event.ItemEvent evt) {
|
||||||
|
chkEnableAnimationItemStateChanged(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||||
this.setLayout(layout);
|
this.setLayout(layout);
|
||||||
layout.setHorizontalGroup(
|
layout.setHorizontalGroup(
|
||||||
@@ -290,13 +296,15 @@ public class LauncherSettingsPanel extends RepaintPage {
|
|||||||
.addComponent(btnCheckUpdate)
|
.addComponent(btnCheckUpdate)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(btnMCBBS))
|
.addComponent(btnMCBBS))
|
||||||
.addComponent(lblAbout)
|
.addComponent(lblAbout, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addComponent(lblModpack)
|
.addComponent(lblModpack, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addComponent(lblRestart)
|
.addComponent(lblRestart)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addComponent(chkEnableShadow)
|
.addComponent(chkEnableShadow)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(chkEnableBlur))
|
.addComponent(chkEnableBlur)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(chkEnableAnimation))
|
||||||
.addComponent(chkDecorated))
|
.addComponent(chkDecorated))
|
||||||
.addGap(0, 0, Short.MAX_VALUE)))
|
.addGap(0, 0, Short.MAX_VALUE)))
|
||||||
.addContainerGap())
|
.addContainerGap())
|
||||||
@@ -335,7 +343,8 @@ public class LauncherSettingsPanel extends RepaintPage {
|
|||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
.addComponent(chkEnableShadow)
|
.addComponent(chkEnableShadow)
|
||||||
.addComponent(chkEnableBlur))
|
.addComponent(chkEnableBlur)
|
||||||
|
.addComponent(chkEnableAnimation))
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(chkDecorated)
|
.addComponent(chkDecorated)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 6, Short.MAX_VALUE)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 6, Short.MAX_VALUE)
|
||||||
@@ -345,9 +354,9 @@ public class LauncherSettingsPanel extends RepaintPage {
|
|||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(lblRestart)
|
.addComponent(lblRestart)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(lblModpack)
|
.addComponent(lblModpack, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(lblAbout)
|
.addComponent(lblAbout, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addContainerGap())
|
.addContainerGap())
|
||||||
);
|
);
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
@@ -432,6 +441,10 @@ public class LauncherSettingsPanel extends RepaintPage {
|
|||||||
Settings.getInstance().setEnableBlur(chkEnableBlur.isSelected());
|
Settings.getInstance().setEnableBlur(chkEnableBlur.isSelected());
|
||||||
}//GEN-LAST:event_chkEnableBlurItemStateChanged
|
}//GEN-LAST:event_chkEnableBlurItemStateChanged
|
||||||
|
|
||||||
|
private void chkEnableAnimationItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_chkEnableAnimationItemStateChanged
|
||||||
|
Settings.getInstance().setEnableAnimation(chkEnableAnimation.isSelected());
|
||||||
|
}//GEN-LAST:event_chkEnableAnimationItemStateChanged
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JButton btnCheckUpdate;
|
private javax.swing.JButton btnCheckUpdate;
|
||||||
private javax.swing.JButton btnMCBBS;
|
private javax.swing.JButton btnMCBBS;
|
||||||
@@ -440,6 +453,7 @@ public class LauncherSettingsPanel extends RepaintPage {
|
|||||||
private javax.swing.JComboBox cboLang;
|
private javax.swing.JComboBox cboLang;
|
||||||
private javax.swing.JComboBox cboTheme;
|
private javax.swing.JComboBox cboTheme;
|
||||||
private javax.swing.JCheckBox chkDecorated;
|
private javax.swing.JCheckBox chkDecorated;
|
||||||
|
private javax.swing.JCheckBox chkEnableAnimation;
|
||||||
private javax.swing.JCheckBox chkEnableBlur;
|
private javax.swing.JCheckBox chkEnableBlur;
|
||||||
private javax.swing.JCheckBox chkEnableShadow;
|
private javax.swing.JCheckBox chkEnableShadow;
|
||||||
private javax.swing.JLabel lblAbout;
|
private javax.swing.JLabel lblAbout;
|
||||||
|
|||||||
@@ -330,6 +330,7 @@ public final class MainFrame extends DraggableFrame implements IRepaint {
|
|||||||
if (background != null) {
|
if (background != null) {
|
||||||
if (backgroundLabel == null) {
|
if (backgroundLabel == null) {
|
||||||
backgroundLabel = new GaussionPanel();
|
backgroundLabel = new GaussionPanel();
|
||||||
|
backgroundLabel.setDrawBackgroundLayer(true);
|
||||||
backgroundLabel.addAeroObject(backgroundLabel);
|
backgroundLabel.addAeroObject(backgroundLabel);
|
||||||
backgroundLabel.setBounds(0, 0, 800, 480);
|
backgroundLabel.setBounds(0, 0, 800, 480);
|
||||||
centralPanel.add(backgroundLabel, -1);
|
centralPanel.add(backgroundLabel, -1);
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ public class MainPagePanel extends Page {
|
|||||||
void initGui() {
|
void initGui() {
|
||||||
initComponents();
|
initComponents();
|
||||||
|
|
||||||
|
animationEnabled = false;
|
||||||
|
|
||||||
pnlButtons = new javax.swing.JPanel();
|
pnlButtons = new javax.swing.JPanel();
|
||||||
pnlButtons.setLayout(null);
|
pnlButtons.setLayout(null);
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,13 @@
|
|||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.ui;
|
package org.jackhuang.hellominecraft.launcher.ui;
|
||||||
|
|
||||||
|
import java.awt.AlphaComposite;
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import java.awt.Graphics2D;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.SwingUtilities;
|
||||||
|
import javax.swing.Timer;
|
||||||
|
import org.jackhuang.hellominecraft.launcher.setting.Settings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -34,6 +40,8 @@ public class Page extends JPanel implements Selectable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSelect() {
|
public void onSelect() {
|
||||||
|
if (!selected)
|
||||||
|
animate();
|
||||||
selected = true;
|
selected = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,4 +61,60 @@ public class Page extends JPanel implements Selectable {
|
|||||||
public boolean isCreated() {
|
public boolean isCreated() {
|
||||||
return created;
|
return created;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// -------------------
|
||||||
|
// Animation
|
||||||
|
// -------------------
|
||||||
|
private static final int ANIMATION_LENGTH = 10;
|
||||||
|
|
||||||
|
public Page() {
|
||||||
|
timer = new Timer(1, (e) -> {
|
||||||
|
SwingUtilities.invokeLater(() -> {
|
||||||
|
Page.this.repaint();
|
||||||
|
offsetX += 0.15;
|
||||||
|
if (offsetX >= ANIMATION_LENGTH) {
|
||||||
|
timer.stop();
|
||||||
|
Page.this.repaint();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paint(Graphics g) {
|
||||||
|
if (!(g instanceof Graphics2D)) {
|
||||||
|
super.paint(g);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
double pgs = 1 - Math.sin(Math.PI / 2 / ANIMATION_LENGTH * offsetX);
|
||||||
|
if (Math.abs(ANIMATION_LENGTH - offsetX) < 0.1) {
|
||||||
|
super.paint(g);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (pgs > 1)
|
||||||
|
pgs = 1;
|
||||||
|
if (pgs < 0)
|
||||||
|
pgs = 0;
|
||||||
|
Graphics2D g2 = (Graphics2D) g;
|
||||||
|
if (isOpaque()) {
|
||||||
|
g.setColor(getBackground());
|
||||||
|
g.fillRect(0, 0, getWidth(), getHeight());
|
||||||
|
} else
|
||||||
|
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, (float) (1 - pgs)));
|
||||||
|
g.translate((int) (pgs * 50), 0);
|
||||||
|
super.paint(g);
|
||||||
|
}
|
||||||
|
|
||||||
|
double offsetX = ANIMATION_LENGTH;
|
||||||
|
|
||||||
|
Timer timer;
|
||||||
|
|
||||||
|
boolean animationEnabled = true;
|
||||||
|
|
||||||
|
public void animate() {
|
||||||
|
if (Settings.getInstance().isEnableAnimation() && animationEnabled) {
|
||||||
|
offsetX = 0;
|
||||||
|
timer.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
package org.jackhuang.hellominecraft.util.ui;
|
package org.jackhuang.hellominecraft.util.ui;
|
||||||
|
|
||||||
import java.awt.AlphaComposite;
|
import java.awt.AlphaComposite;
|
||||||
|
import java.awt.Color;
|
||||||
import java.awt.Graphics;
|
import java.awt.Graphics;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
@@ -40,6 +41,15 @@ public class GaussionPanel extends JPanel {
|
|||||||
private static final int RADIUS = 10;
|
private static final int RADIUS = 10;
|
||||||
private transient final StackBlurFilter stackBlurFilter = new StackBlurFilter(RADIUS);
|
private transient final StackBlurFilter stackBlurFilter = new StackBlurFilter(RADIUS);
|
||||||
private transient BufferedImage cache = null;
|
private transient BufferedImage cache = null;
|
||||||
|
private boolean drawBackgroundLayer = false;
|
||||||
|
|
||||||
|
public boolean isDrawBackgroundLayer() {
|
||||||
|
return drawBackgroundLayer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDrawBackgroundLayer(boolean drawBackgroundLayer) {
|
||||||
|
this.drawBackgroundLayer = drawBackgroundLayer;
|
||||||
|
}
|
||||||
|
|
||||||
public void setBackgroundImage(Image backgroundImage) {
|
public void setBackgroundImage(Image backgroundImage) {
|
||||||
this.backgroundImage = backgroundImage;
|
this.backgroundImage = backgroundImage;
|
||||||
@@ -81,6 +91,12 @@ public class GaussionPanel extends JPanel {
|
|||||||
aeroGraphics.drawImage(backgroundImage, 0, 0, aeroBuffer.getWidth(), aeroBuffer.getHeight(), aeroRect.x, aeroRect.y, aeroRect.x + aeroRect.width, aeroRect.y + aeroRect.height, null);
|
aeroGraphics.drawImage(backgroundImage, 0, 0, aeroBuffer.getWidth(), aeroBuffer.getHeight(), aeroRect.x, aeroRect.y, aeroRect.x + aeroRect.width, aeroRect.y + aeroRect.height, null);
|
||||||
aeroBuffer = stackBlurFilter.filter(aeroBuffer, null);
|
aeroBuffer = stackBlurFilter.filter(aeroBuffer, null);
|
||||||
g2.drawImage(aeroBuffer, aeroRect.x, aeroRect.y, aeroRect.x + aeroRect.width, aeroRect.y + aeroRect.height, RADIUS / 2, RADIUS / 2, RADIUS / 2 + aeroRect.width, RADIUS / 2 + aeroRect.height, null);
|
g2.drawImage(aeroBuffer, aeroRect.x, aeroRect.y, aeroRect.x + aeroRect.width, aeroRect.y + aeroRect.height, RADIUS / 2, RADIUS / 2, RADIUS / 2 + aeroRect.width, RADIUS / 2 + aeroRect.height, null);
|
||||||
|
|
||||||
|
if (drawBackgroundLayer) {
|
||||||
|
g2.setColor(Color.white);
|
||||||
|
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 0.5f));
|
||||||
|
g2.fillRect(0, 0, getWidth(), getHeight());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
g2.dispose();
|
g2.dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user