missing files
This commit is contained in:
@@ -46,7 +46,7 @@ def buildnumber = System.getenv("TRAVIS_BUILD_NUMBER")
|
||||
if (buildnumber == null)
|
||||
buildnumber = System.getenv("BUILD_NUMBER")
|
||||
if (buildnumber == null)
|
||||
buildnumber = "1"
|
||||
buildnumber = "2"
|
||||
|
||||
def versionroot = System.getenv("VERSION_ROOT")
|
||||
if (versionroot == null)
|
||||
|
||||
@@ -77,21 +77,6 @@ public final class Main implements Runnable {
|
||||
};
|
||||
private static final HostnameVerifier HNV = (hostname, session) -> true;
|
||||
|
||||
static {
|
||||
SSLContext sslContext = null;
|
||||
|
||||
try {
|
||||
sslContext = SSLContext.getInstance("TLS");
|
||||
X509TrustManager[] xtmArray = new X509TrustManager[] { XTM };
|
||||
sslContext.init(null, xtmArray, new java.security.SecureRandom());
|
||||
} catch (GeneralSecurityException gse) {
|
||||
}
|
||||
if (sslContext != null)
|
||||
HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());
|
||||
|
||||
HttpsURLConnection.setDefaultHostnameVerifier(HNV);
|
||||
}
|
||||
|
||||
public static final String LAUNCHER_NAME = "Hello Minecraft! Launcher";
|
||||
public static final String LAUNCHER_VERSION = "@HELLO_MINECRAFT_LAUNCHER_VERSION_FOR_GRADLE_REPLACING@";
|
||||
public static final int MINIMUM_LAUNCHER_VERSION = 16;
|
||||
@@ -129,6 +114,16 @@ public final class Main implements Runnable {
|
||||
System.setProperty("swing.aatext", "true");
|
||||
System.setProperty("sun.java2d.noddraw", "true");
|
||||
System.setProperty("sun.java2d.dpiaware", "false");
|
||||
System.setProperty("https.protocols", "SSLv3,TLSv1");
|
||||
|
||||
try {
|
||||
SSLContext c = SSLContext.getInstance("SSL");
|
||||
c.init(null, new X509TrustManager[] { XTM }, new java.security.SecureRandom());
|
||||
HttpsURLConnection.setDefaultSSLSocketFactory(c.getSocketFactory());
|
||||
} catch (GeneralSecurityException ignore) {
|
||||
}
|
||||
HttpsURLConnection.setDefaultHostnameVerifier(HNV);
|
||||
|
||||
Thread.setDefaultUncaughtExceptionHandler(new CrashReporter(true));
|
||||
|
||||
try {
|
||||
|
||||
@@ -53,6 +53,8 @@ public final class Config implements Cloneable {
|
||||
private String proxyPassword;
|
||||
@SerializedName("enableShadow")
|
||||
private boolean enableShadow;
|
||||
@SerializedName("enableBlur")
|
||||
private boolean enableBlur;
|
||||
@SerializedName("decorated")
|
||||
private boolean decorated;
|
||||
@SerializedName("theme")
|
||||
@@ -108,6 +110,15 @@ public final class Config implements Cloneable {
|
||||
Settings.save();
|
||||
}
|
||||
|
||||
public boolean isEnableBlur() {
|
||||
return enableBlur;
|
||||
}
|
||||
|
||||
public void setEnableBlur(boolean enableBlur) {
|
||||
this.enableBlur = enableBlur;
|
||||
Settings.save();
|
||||
}
|
||||
|
||||
public String getLast() {
|
||||
if (last == null)
|
||||
last = Settings.DEFAULT_PROFILE;
|
||||
@@ -183,7 +194,7 @@ public final class Config implements Cloneable {
|
||||
public Config() {
|
||||
clientToken = UUID.randomUUID().toString();
|
||||
logintype = downloadtype = 0;
|
||||
enableShadow = false;
|
||||
enableBlur = enableShadow = true;
|
||||
theme = 4;
|
||||
decorated = OS.os() == OS.LINUX;
|
||||
auth = new HashMap<>();
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Hello Minecraft! Launcher.
|
||||
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
|
||||
*
|
||||
* 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 org.jackhuang.hellominecraft.launcher.ui;
|
||||
|
||||
import java.awt.AlphaComposite;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Image;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.swing.JPanel;
|
||||
import org.jackhuang.hellominecraft.util.ui.StackBlurFilter;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author huangyuhui
|
||||
*/
|
||||
public class GaussionPage extends Page {
|
||||
|
||||
private transient BufferedImage aeroBuffer; // 模糊缓存
|
||||
private transient Image backgroundImage;
|
||||
private final List<JPanel> aeroObject = new ArrayList<>();
|
||||
private transient Graphics2D aeroGraphics; // 模糊对象
|
||||
private static final int RADIUS = 10; // 模糊半径
|
||||
private transient final StackBlurFilter stackBlurFilter = new StackBlurFilter(RADIUS);
|
||||
private transient BufferedImage cache = null;
|
||||
|
||||
public void setBackgroundImage(Image backgroundImage) {
|
||||
this.backgroundImage = backgroundImage;
|
||||
}
|
||||
|
||||
public void addAeroObject(JPanel aeroObject) {
|
||||
this.aeroObject.add(aeroObject);
|
||||
cache = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
|
||||
if (backgroundImage == null)
|
||||
return;
|
||||
|
||||
if (cache == null || getWidth() != cache.getWidth() || getHeight() != cache.getHeight()) {
|
||||
cache = new BufferedImage(getWidth(), getHeight(), 2);
|
||||
Graphics2D g2 = cache.createGraphics();
|
||||
g2.drawImage(backgroundImage, 0, 0, getWidth(), getHeight(), null);
|
||||
for (JPanel panel : aeroObject) {
|
||||
Rectangle aeroRect = panel.getBounds();
|
||||
if (aeroBuffer == null || aeroBuffer.getWidth() != aeroRect.width + RADIUS || aeroBuffer.getHeight() != aeroRect.height + RADIUS) {
|
||||
if (aeroBuffer != null && aeroGraphics != null) {
|
||||
aeroBuffer.flush();
|
||||
aeroGraphics.dispose();
|
||||
}
|
||||
aeroBuffer = new BufferedImage(aeroRect.width + RADIUS, aeroRect.height + RADIUS, BufferedImage.TRANSLUCENT);
|
||||
}
|
||||
|
||||
aeroGraphics = aeroBuffer.createGraphics();
|
||||
aeroGraphics.setComposite(AlphaComposite.Src);
|
||||
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);
|
||||
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.dispose();
|
||||
}
|
||||
g.drawImage(cache, 0, 0, getWidth(), getHeight(), null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Hello Minecraft! Launcher.
|
||||
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
|
||||
*
|
||||
* 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 org.jackhuang.hellominecraft.launcher.ui;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Window;
|
||||
import java.util.Collection;
|
||||
import javax.swing.JComponent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author huang
|
||||
*/
|
||||
public interface IRepaint {
|
||||
JComponent getRepaintComponent();
|
||||
Window getRepaintWindow();
|
||||
|
||||
Collection<Rectangle> getRepaintRects();
|
||||
}
|
||||
@@ -72,6 +72,8 @@
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="chkEnableShadow" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="chkEnableBlur" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="chkDecorated" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@@ -120,6 +122,7 @@
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="chkEnableShadow" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="chkDecorated" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="chkEnableBlur" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="unrelated" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
@@ -341,5 +344,15 @@
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnMCBBSActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="chkEnableBlur">
|
||||
<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_blur" replaceFormat="java.util.ResourceBundle.getBundle("{bundleNameSlashes}").getString("{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="chkEnableBlurItemStateChanged"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
|
||||
@@ -72,6 +72,7 @@ public class LauncherSettingsPanel extends RepaintPage {
|
||||
cboDownloadSource.setSelectedIndex(Settings.getInstance().getDownloadType());
|
||||
cboTheme.setSelectedIndex(Settings.getInstance().getTheme().ordinal());
|
||||
chkEnableShadow.setSelected(Settings.getInstance().isEnableShadow());
|
||||
chkEnableBlur.setSelected(Settings.getInstance().isEnableBlur());
|
||||
chkDecorated.setSelected(Settings.getInstance().isDecorated());
|
||||
}
|
||||
|
||||
@@ -115,6 +116,7 @@ public class LauncherSettingsPanel extends RepaintPage {
|
||||
lblLang = new javax.swing.JLabel();
|
||||
lblRestart = new javax.swing.JLabel();
|
||||
btnMCBBS = new javax.swing.JButton();
|
||||
chkEnableBlur = new javax.swing.JCheckBox();
|
||||
|
||||
cboDownloadSource.addItemListener(new java.awt.event.ItemListener() {
|
||||
public void itemStateChanged(java.awt.event.ItemEvent evt) {
|
||||
@@ -235,6 +237,14 @@ public class LauncherSettingsPanel extends RepaintPage {
|
||||
}
|
||||
});
|
||||
|
||||
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/jackhuang/hellominecraft/lang/I18N"); // NOI18N
|
||||
chkEnableBlur.setText(bundle.getString("launcher.enable_blur")); // NOI18N
|
||||
chkEnableBlur.addItemListener(new java.awt.event.ItemListener() {
|
||||
public void itemStateChanged(java.awt.event.ItemEvent evt) {
|
||||
chkEnableBlurItemStateChanged(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
@@ -287,6 +297,8 @@ public class LauncherSettingsPanel extends RepaintPage {
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(chkEnableShadow)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(chkEnableBlur)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(chkDecorated)))
|
||||
.addContainerGap())
|
||||
@@ -325,7 +337,8 @@ public class LauncherSettingsPanel extends RepaintPage {
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(chkEnableShadow)
|
||||
.addComponent(chkDecorated))
|
||||
.addComponent(chkDecorated)
|
||||
.addComponent(chkEnableBlur))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(btnCheckUpdate, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
@@ -416,6 +429,10 @@ public class LauncherSettingsPanel extends RepaintPage {
|
||||
SwingUtils.openLink(C.URL_PUBLISH);
|
||||
}//GEN-LAST:event_btnMCBBSActionPerformed
|
||||
|
||||
private void chkEnableBlurItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_chkEnableBlurItemStateChanged
|
||||
Settings.getInstance().setEnableBlur(chkEnableBlur.isSelected());
|
||||
}//GEN-LAST:event_chkEnableBlurItemStateChanged
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton btnCheckUpdate;
|
||||
private javax.swing.JButton btnMCBBS;
|
||||
@@ -424,6 +441,7 @@ public class LauncherSettingsPanel extends RepaintPage {
|
||||
private javax.swing.JComboBox cboLang;
|
||||
private javax.swing.JComboBox cboTheme;
|
||||
private javax.swing.JCheckBox chkDecorated;
|
||||
private javax.swing.JCheckBox chkEnableBlur;
|
||||
private javax.swing.JCheckBox chkEnableShadow;
|
||||
private javax.swing.JLabel lblAbout;
|
||||
private javax.swing.JLabel lblBackground;
|
||||
|
||||
@@ -285,4 +285,4 @@
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
</Form>
|
||||
|
||||
@@ -90,7 +90,8 @@ public class MainPagePanel extends GaussionPage {
|
||||
|
||||
prepareAuths();
|
||||
|
||||
addAeroObject(pnlMore);
|
||||
if (Settings.getInstance().isEnableBlur())
|
||||
addAeroObject(pnlMore);
|
||||
setBackgroundImage(MainFrame.INSTANCE.background.getImage());
|
||||
|
||||
((RepaintPage) pnlMore).setRepainter(this);
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Hello Minecraft! Launcher.
|
||||
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
|
||||
*
|
||||
* 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 org.jackhuang.hellominecraft.launcher.ui;
|
||||
|
||||
import java.awt.Container;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Window;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.RepaintManager;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author huangyuhui
|
||||
*/
|
||||
public class MyRepaintManager extends RepaintManager {
|
||||
|
||||
@Override
|
||||
public void addDirtyRegion(JComponent c, int x, int y, int w, int h) {
|
||||
super.addDirtyRegion(c, x, y, w, h);
|
||||
|
||||
for (Container parent = c.getParent(); (parent instanceof JComponent || parent instanceof Window) && parent.isVisible(); parent = parent.getParent()) {
|
||||
if (parent instanceof IRepaint) {
|
||||
IRepaint d = (IRepaint) parent;
|
||||
for (Rectangle r : d.getRepaintRects()) {
|
||||
if (d.getRepaintComponent() != null)
|
||||
super.addDirtyRegion(d.getRepaintComponent(), r.x, r.y, r.width, r.height);
|
||||
if (d.getRepaintWindow() != null)
|
||||
super.addDirtyRegion(d.getRepaintWindow(), r.x, r.y, r.width, r.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Hello Minecraft! Launcher.
|
||||
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
|
||||
*
|
||||
* 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 org.jackhuang.hellominecraft.launcher.ui;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Window;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import javax.swing.JComponent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author huang
|
||||
*/
|
||||
public class RepaintPage extends Page implements IRepaint {
|
||||
|
||||
public RepaintPage() {
|
||||
super();
|
||||
}
|
||||
|
||||
JComponent repainter;
|
||||
|
||||
@Override
|
||||
public JComponent getRepaintComponent() {
|
||||
return repainter;
|
||||
}
|
||||
|
||||
public void setRepainter(JComponent repainter) {
|
||||
this.repainter = repainter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Rectangle> getRepaintRects() {
|
||||
return Arrays.asList(this.getBounds());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Window getRepaintWindow() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Hello Minecraft! Launcher.
|
||||
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
|
||||
*
|
||||
* 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 org.jackhuang.hellominecraft.launcher.ui;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import javax.swing.JComboBox;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author huang
|
||||
*/
|
||||
public class WideComboBox extends JComboBox {
|
||||
|
||||
public WideComboBox() {
|
||||
}
|
||||
|
||||
private boolean layingOut = false;
|
||||
public int customzedMinimumWidth = 300;
|
||||
|
||||
@Override
|
||||
public void doLayout() {
|
||||
try {
|
||||
layingOut = true;
|
||||
super.doLayout();
|
||||
} finally {
|
||||
layingOut = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getSize() {
|
||||
Dimension dim = super.getSize();
|
||||
if (!layingOut)
|
||||
dim.width = Math.max(dim.width, customzedMinimumWidth);
|
||||
return dim;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user