Change default language from zh_CN to en_US
This commit is contained in:
@@ -22,8 +22,8 @@ import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipFile;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.system.IOUtils;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.sys.IOUtils;
|
||||
|
||||
/**
|
||||
* @author huangyuhui
|
||||
|
||||
@@ -17,9 +17,10 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.util;
|
||||
|
||||
import org.jackhuang.hellominecraft.util.net.NetUtils;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import java.io.IOException;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.util;
|
||||
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -19,7 +19,7 @@ package org.jackhuang.hellominecraft.util.code;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.UnsupportedCharsetException;
|
||||
import org.jackhuang.hellominecraft.util.system.IOUtils;
|
||||
import org.jackhuang.hellominecraft.util.sys.IOUtils;
|
||||
|
||||
public final class Charsets {
|
||||
|
||||
|
||||
@@ -22,8 +22,7 @@ import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.system.IOUtils;
|
||||
import org.jackhuang.hellominecraft.util.sys.IOUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -46,9 +45,9 @@ public final class Localization {
|
||||
if (is == null)
|
||||
is = getStream("_" + locale.getLanguage());
|
||||
if (is == null)
|
||||
is = getStream("");
|
||||
is = getStream("_en");
|
||||
if (is == null)
|
||||
throw new IllegalStateException("Language file missing");
|
||||
throw new InternalError("Language file missing");
|
||||
|
||||
try {
|
||||
for (String s : IOUtils.readLines(is, IOUtils.DEFAULT_CHARSET))
|
||||
@@ -59,7 +58,7 @@ public final class Localization {
|
||||
lang.put(s.substring(0, i), s.substring(i + 1));
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
HMCLog.err("LANG FILE MISSING", ex);
|
||||
throw new InternalError("Language file missing", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
* 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.util.logging;
|
||||
package org.jackhuang.hellominecraft.util.log;
|
||||
|
||||
import org.jackhuang.hellominecraft.util.logging.appender.IAppender;
|
||||
import org.jackhuang.hellominecraft.util.log.appender.IAppender;
|
||||
|
||||
public class AppenderControl {
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
* 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.util.logging;
|
||||
package org.jackhuang.hellominecraft.util.log;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import org.jackhuang.hellominecraft.util.logging.appender.ConsoleAppender;
|
||||
import org.jackhuang.hellominecraft.util.logging.appender.IAppender;
|
||||
import org.jackhuang.hellominecraft.util.logging.layout.DefaultLayout;
|
||||
import org.jackhuang.hellominecraft.util.log.appender.ConsoleAppender;
|
||||
import org.jackhuang.hellominecraft.util.log.appender.IAppender;
|
||||
import org.jackhuang.hellominecraft.util.log.layout.DefaultLayout;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,9 +15,9 @@
|
||||
* 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.util.logging;
|
||||
package org.jackhuang.hellominecraft.util.log;
|
||||
|
||||
import org.jackhuang.hellominecraft.util.logging.logger.Logger;
|
||||
import org.jackhuang.hellominecraft.util.log.logger.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.logging;
|
||||
package org.jackhuang.hellominecraft.util.log;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.regex.Matcher;
|
||||
@@ -15,9 +15,9 @@
|
||||
* 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.util.logging;
|
||||
package org.jackhuang.hellominecraft.util.log;
|
||||
|
||||
import org.jackhuang.hellominecraft.util.logging.message.IMessage;
|
||||
import org.jackhuang.hellominecraft.util.log.message.IMessage;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.logging;
|
||||
package org.jackhuang.hellominecraft.util.log;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,10 +15,10 @@
|
||||
* 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.util.logging.appender;
|
||||
package org.jackhuang.hellominecraft.util.log.appender;
|
||||
|
||||
import java.io.Serializable;
|
||||
import org.jackhuang.hellominecraft.util.logging.layout.ILayout;
|
||||
import org.jackhuang.hellominecraft.util.log.layout.ILayout;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,12 +15,12 @@
|
||||
* 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.util.logging.appender;
|
||||
package org.jackhuang.hellominecraft.util.log.appender;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import org.jackhuang.hellominecraft.util.logging.layout.ILayout;
|
||||
import org.jackhuang.hellominecraft.util.log.layout.ILayout;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,11 +15,11 @@
|
||||
* 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.util.logging.appender;
|
||||
package org.jackhuang.hellominecraft.util.log.appender;
|
||||
|
||||
import java.io.Serializable;
|
||||
import org.jackhuang.hellominecraft.util.logging.LogEvent;
|
||||
import org.jackhuang.hellominecraft.util.logging.layout.ILayout;
|
||||
import org.jackhuang.hellominecraft.util.log.LogEvent;
|
||||
import org.jackhuang.hellominecraft.util.log.layout.ILayout;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.logging.appender;
|
||||
package org.jackhuang.hellominecraft.util.log.appender;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
@@ -23,9 +23,9 @@ import java.io.PrintStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import org.jackhuang.hellominecraft.util.logging.LogEvent;
|
||||
import org.jackhuang.hellominecraft.util.logging.LoggingException;
|
||||
import org.jackhuang.hellominecraft.util.logging.layout.ILayout;
|
||||
import org.jackhuang.hellominecraft.util.log.LogEvent;
|
||||
import org.jackhuang.hellominecraft.util.log.LoggingException;
|
||||
import org.jackhuang.hellominecraft.util.log.layout.ILayout;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,9 +15,9 @@
|
||||
* 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.util.logging.layout;
|
||||
package org.jackhuang.hellominecraft.util.log.layout;
|
||||
|
||||
import org.jackhuang.hellominecraft.util.logging.LogEvent;
|
||||
import org.jackhuang.hellominecraft.util.log.LogEvent;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,11 +15,11 @@
|
||||
* 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.util.logging.layout;
|
||||
package org.jackhuang.hellominecraft.util.log.layout;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import org.jackhuang.hellominecraft.util.logging.LogEvent;
|
||||
import org.jackhuang.hellominecraft.util.log.LogEvent;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,10 +15,10 @@
|
||||
* 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.util.logging.layout;
|
||||
package org.jackhuang.hellominecraft.util.log.layout;
|
||||
|
||||
import java.io.Serializable;
|
||||
import org.jackhuang.hellominecraft.util.logging.LogEvent;
|
||||
import org.jackhuang.hellominecraft.util.log.LogEvent;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,13 +15,13 @@
|
||||
* 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.util.logging.logger;
|
||||
package org.jackhuang.hellominecraft.util.log.logger;
|
||||
|
||||
import org.jackhuang.hellominecraft.util.logging.Level;
|
||||
import org.jackhuang.hellominecraft.util.logging.message.IMessage;
|
||||
import org.jackhuang.hellominecraft.util.logging.message.IMessageFactory;
|
||||
import org.jackhuang.hellominecraft.util.logging.message.ParameterizedMessageFactory;
|
||||
import org.jackhuang.hellominecraft.util.logging.message.StringFormattedMessage;
|
||||
import org.jackhuang.hellominecraft.util.log.Level;
|
||||
import org.jackhuang.hellominecraft.util.log.message.IMessage;
|
||||
import org.jackhuang.hellominecraft.util.log.message.IMessageFactory;
|
||||
import org.jackhuang.hellominecraft.util.log.message.ParameterizedMessageFactory;
|
||||
import org.jackhuang.hellominecraft.util.log.message.StringFormattedMessage;
|
||||
|
||||
public abstract class AbstractLogger
|
||||
implements ILogger {
|
||||
@@ -15,10 +15,10 @@
|
||||
* 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.util.logging.logger;
|
||||
package org.jackhuang.hellominecraft.util.log.logger;
|
||||
|
||||
import org.jackhuang.hellominecraft.util.logging.Level;
|
||||
import org.jackhuang.hellominecraft.util.logging.message.IMessage;
|
||||
import org.jackhuang.hellominecraft.util.log.Level;
|
||||
import org.jackhuang.hellominecraft.util.log.message.IMessage;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,18 +15,18 @@
|
||||
* 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.util.logging.logger;
|
||||
package org.jackhuang.hellominecraft.util.log.logger;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import org.jackhuang.hellominecraft.util.logging.AppenderControl;
|
||||
import org.jackhuang.hellominecraft.util.logging.Configuration;
|
||||
import org.jackhuang.hellominecraft.util.logging.Level;
|
||||
import org.jackhuang.hellominecraft.util.logging.LogEvent;
|
||||
import org.jackhuang.hellominecraft.util.logging.appender.IAppender;
|
||||
import org.jackhuang.hellominecraft.util.logging.message.IMessage;
|
||||
import org.jackhuang.hellominecraft.util.logging.message.IMessageFactory;
|
||||
import org.jackhuang.hellominecraft.util.log.AppenderControl;
|
||||
import org.jackhuang.hellominecraft.util.log.Configuration;
|
||||
import org.jackhuang.hellominecraft.util.log.Level;
|
||||
import org.jackhuang.hellominecraft.util.log.LogEvent;
|
||||
import org.jackhuang.hellominecraft.util.log.appender.IAppender;
|
||||
import org.jackhuang.hellominecraft.util.log.message.IMessage;
|
||||
import org.jackhuang.hellominecraft.util.log.message.IMessageFactory;
|
||||
|
||||
public class Logger extends AbstractLogger {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.logging.message;
|
||||
package org.jackhuang.hellominecraft.util.log.message;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.logging.message;
|
||||
package org.jackhuang.hellominecraft.util.log.message;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.logging.message;
|
||||
package org.jackhuang.hellominecraft.util.log.message;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.logging.message;
|
||||
package org.jackhuang.hellominecraft.util.log.message;
|
||||
|
||||
public class ObjectMessage
|
||||
implements IMessage {
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.logging.message;
|
||||
package org.jackhuang.hellominecraft.util.log.message;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.logging.message;
|
||||
package org.jackhuang.hellominecraft.util.log.message;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.logging.message;
|
||||
package org.jackhuang.hellominecraft.util.log.message;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.logging.message;
|
||||
package org.jackhuang.hellominecraft.util.log.message;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.IllegalFormatException;
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.tasks.download;
|
||||
package org.jackhuang.hellominecraft.util.net;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -29,12 +29,12 @@ import java.util.ArrayList;
|
||||
import org.jackhuang.hellominecraft.util.C;
|
||||
import org.jackhuang.hellominecraft.util.code.DigestUtils;
|
||||
import org.jackhuang.hellominecraft.util.func.Function;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.system.FileUtils;
|
||||
import org.jackhuang.hellominecraft.util.tasks.Task;
|
||||
import org.jackhuang.hellominecraft.util.tasks.comm.PreviousResult;
|
||||
import org.jackhuang.hellominecraft.util.tasks.comm.PreviousResultRegistrar;
|
||||
import org.jackhuang.hellominecraft.util.system.IOUtils;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.sys.FileUtils;
|
||||
import org.jackhuang.hellominecraft.util.task.Task;
|
||||
import org.jackhuang.hellominecraft.util.task.comm.PreviousResult;
|
||||
import org.jackhuang.hellominecraft.util.task.comm.PreviousResultRegistrar;
|
||||
import org.jackhuang.hellominecraft.util.sys.IOUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.tasks.download;
|
||||
package org.jackhuang.hellominecraft.util.net;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
@@ -25,12 +25,11 @@ import java.net.Proxy;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
import org.jackhuang.hellominecraft.util.C;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.tasks.comm.PreviousResult;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.task.comm.PreviousResult;
|
||||
import org.jackhuang.hellominecraft.util.EventHandler;
|
||||
import org.jackhuang.hellominecraft.util.NetUtils;
|
||||
import org.jackhuang.hellominecraft.util.code.Charsets;
|
||||
import org.jackhuang.hellominecraft.util.tasks.Task;
|
||||
import org.jackhuang.hellominecraft.util.task.Task;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,9 +15,9 @@
|
||||
* 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.util;
|
||||
package org.jackhuang.hellominecraft.util.net;
|
||||
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
@@ -27,7 +27,7 @@ import java.net.Proxy;
|
||||
import java.net.URL;
|
||||
import java.util.Map;
|
||||
import org.jackhuang.hellominecraft.util.code.Charsets;
|
||||
import org.jackhuang.hellominecraft.util.system.IOUtils;
|
||||
import org.jackhuang.hellominecraft.util.sys.IOUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,13 +15,15 @@
|
||||
* 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.util.ui;
|
||||
package org.jackhuang.hellominecraft.util.net;
|
||||
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import javax.swing.JDialog;
|
||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
||||
import org.jackhuang.hellominecraft.util.logging.Level;
|
||||
import org.jackhuang.hellominecraft.util.log.Level;
|
||||
import org.jackhuang.hellominecraft.util.ui.GraphicsUtils;
|
||||
import org.jackhuang.hellominecraft.util.ui.SwingUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,11 +15,12 @@
|
||||
* 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.util.ui;
|
||||
package org.jackhuang.hellominecraft.util.net;
|
||||
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.event.HyperlinkEvent;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.ui.SwingUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.system;
|
||||
package org.jackhuang.hellominecraft.util.sys;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.system;
|
||||
package org.jackhuang.hellominecraft.util.sys;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileFilter;
|
||||
@@ -29,7 +29,7 @@ import java.nio.file.StandardCopyOption;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.system;
|
||||
package org.jackhuang.hellominecraft.util.sys;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
@@ -38,7 +38,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.jackhuang.hellominecraft.util.func.Consumer;
|
||||
import org.jackhuang.hellominecraft.util.func.Function;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.system;
|
||||
package org.jackhuang.hellominecraft.util.sys;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -25,7 +25,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.jackhuang.hellominecraft.util.C;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.system;
|
||||
package org.jackhuang.hellominecraft.util.sys;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -15,15 +15,15 @@
|
||||
* 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.util.system;
|
||||
package org.jackhuang.hellominecraft.util.sys;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import org.jackhuang.hellominecraft.util.CollectionUtils;
|
||||
import org.jackhuang.hellominecraft.util.EventHandler;
|
||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.logging.Level;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.log.Level;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,13 +15,13 @@
|
||||
* 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.util.system;
|
||||
package org.jackhuang.hellominecraft.util.sys;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
||||
|
||||
/**
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.system;
|
||||
package org.jackhuang.hellominecraft.util.sys;
|
||||
|
||||
import com.sun.management.OperatingSystemMXBean;
|
||||
import java.io.BufferedReader;
|
||||
@@ -26,7 +26,7 @@ import java.lang.management.ManagementFactory;
|
||||
import java.util.Locale;
|
||||
import java.util.StringTokenizer;
|
||||
import org.jackhuang.hellominecraft.util.code.Charsets;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
|
||||
/**
|
||||
* @author huangyuhui
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.system;
|
||||
package org.jackhuang.hellominecraft.util.sys;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.system;
|
||||
package org.jackhuang.hellominecraft.util.sys;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
* 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.util.system;
|
||||
package org.jackhuang.hellominecraft.util.sys;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.EventHandler;
|
||||
import org.jackhuang.hellominecraft.util.code.Charsets;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.system;
|
||||
package org.jackhuang.hellominecraft.util.sys;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.ByteArrayInputStream;
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.tasks;
|
||||
package org.jackhuang.hellominecraft.util.task;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.tasks;
|
||||
package org.jackhuang.hellominecraft.util.task;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.tasks;
|
||||
package org.jackhuang.hellominecraft.util.task;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.tasks;
|
||||
package org.jackhuang.hellominecraft.util.task;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.tasks;
|
||||
package org.jackhuang.hellominecraft.util.task;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.tasks;
|
||||
package org.jackhuang.hellominecraft.util.task;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.tasks;
|
||||
package org.jackhuang.hellominecraft.util.task;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.tasks;
|
||||
package org.jackhuang.hellominecraft.util.task;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.tasks;
|
||||
package org.jackhuang.hellominecraft.util.task;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@@ -30,7 +30,7 @@ import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import org.jackhuang.hellominecraft.util.EventHandler;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.tasks;
|
||||
package org.jackhuang.hellominecraft.util.task;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.tasks;
|
||||
package org.jackhuang.hellominecraft.util.task;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@@ -23,7 +23,7 @@ import java.util.LinkedList;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.table.TableColumn;
|
||||
import org.jackhuang.hellominecraft.util.C;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.MessageBox;
|
||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
||||
import org.jackhuang.hellominecraft.util.ui.SwingUtils;
|
||||
@@ -15,7 +15,7 @@
|
||||
* 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.util.tasks.comm;
|
||||
package org.jackhuang.hellominecraft.util.task.comm;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -15,9 +15,9 @@
|
||||
* 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.util.tasks.comm;
|
||||
package org.jackhuang.hellominecraft.util.task.comm;
|
||||
|
||||
import org.jackhuang.hellominecraft.util.tasks.Task;
|
||||
import org.jackhuang.hellominecraft.util.task.Task;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* 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.util.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;
|
||||
|
||||
/**
|
||||
* This component will allow some area blured to provide better UI.
|
||||
* @author huangyuhui
|
||||
*/
|
||||
public class GaussionPanel extends JPanel {
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* The background will be blured under the aero object.
|
||||
* @param aeroObject just need its bounds, keep it not opaque.
|
||||
*/
|
||||
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 we cache the processed background image, the CPU ratio will reduce 5%.
|
||||
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,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.util.ui;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Window;
|
||||
import java.util.Collection;
|
||||
import javax.swing.JComponent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author huang
|
||||
*/
|
||||
public interface IRepaint {
|
||||
|
||||
/**
|
||||
* addDirtyRegion to?
|
||||
* @return the component which needs repainting.
|
||||
*/
|
||||
JComponent getRepaintComponent();
|
||||
|
||||
/**
|
||||
* addDirtyRegion to?
|
||||
* @return the window which needs repainting.
|
||||
*/
|
||||
Window getRepaintWindow();
|
||||
|
||||
/**
|
||||
* Repaint the component/window you want.
|
||||
* @return the region where you want to repaint.
|
||||
*/
|
||||
Collection<Rectangle> getRepaintRects();
|
||||
}
|
||||
@@ -23,8 +23,8 @@ import javax.swing.text.Document;
|
||||
import javax.swing.text.SimpleAttributeSet;
|
||||
import javax.swing.text.StyleConstants;
|
||||
import org.jackhuang.hellominecraft.util.C;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.logging.Level;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.log.Level;
|
||||
import org.jackhuang.hellominecraft.util.func.NonFunction;
|
||||
import org.jackhuang.hellominecraft.util.DoubleOutputStream;
|
||||
import org.jackhuang.hellominecraft.util.Utils;
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.io.OutputStream;
|
||||
import java.util.Objects;
|
||||
import javax.swing.SwingUtilities;
|
||||
import org.jackhuang.hellominecraft.util.code.Charsets;
|
||||
import org.jackhuang.hellominecraft.util.logging.Level;
|
||||
import org.jackhuang.hellominecraft.util.log.Level;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -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.util.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,12 +43,12 @@ import javax.swing.JTable;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.table.DefaultTableModel;
|
||||
import org.jackhuang.hellominecraft.util.C;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.MessageBox;
|
||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
||||
import org.jackhuang.hellominecraft.util.Utils;
|
||||
import org.jackhuang.hellominecraft.util.func.NonFunction;
|
||||
import org.jackhuang.hellominecraft.util.system.OS;
|
||||
import org.jackhuang.hellominecraft.util.sys.OS;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -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.util.ui;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import javax.swing.JComboBox;
|
||||
|
||||
/**
|
||||
* Make the popup menu of combo boxes wider.
|
||||
* @author huangyuhui
|
||||
*/
|
||||
public class WideComboBox<E> extends JComboBox<E> {
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import javax.swing.JLabel;
|
||||
import javax.swing.JProgressBar;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import org.jackhuang.hellominecraft.util.C;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.ui.wizard.spi.ResultProgressHandle;
|
||||
import org.jackhuang.hellominecraft.util.ui.wizard.spi.Summary;
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ import javax.swing.border.Border;
|
||||
import javax.swing.border.CompoundBorder;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import org.jackhuang.hellominecraft.util.C;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.ui.wizard.api.WizardDisplayer;
|
||||
import org.jackhuang.hellominecraft.util.ui.wizard.api.WizardResultReceiver;
|
||||
import org.jackhuang.hellominecraft.util.ui.wizard.modules.InstructionsPanelImpl;
|
||||
|
||||
@@ -44,7 +44,7 @@ import javax.swing.JComponent;
|
||||
import javax.swing.JEditorPane;
|
||||
import javax.swing.UIManager;
|
||||
import org.jackhuang.hellominecraft.util.C;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
||||
import org.jackhuang.hellominecraft.util.ui.wizard.api.displayer.InstructionsPanel;
|
||||
import org.jackhuang.hellominecraft.util.ui.wizard.spi.Wizard;
|
||||
import org.jackhuang.hellominecraft.util.ui.wizard.spi.WizardObserver;
|
||||
|
||||
@@ -31,7 +31,7 @@ import javax.swing.JScrollPane;
|
||||
import javax.swing.JTextArea;
|
||||
import org.jackhuang.hellominecraft.util.ArrayUtils;
|
||||
import org.jackhuang.hellominecraft.util.code.Charsets;
|
||||
import org.jackhuang.hellominecraft.util.system.IOUtils;
|
||||
import org.jackhuang.hellominecraft.util.sys.IOUtils;
|
||||
|
||||
/**
|
||||
* Provides information about a simple wizard. Wraps a
|
||||
|
||||
@@ -233,7 +233,7 @@ modpack.enter_name=給遊戲起個你喜歡的名字
|
||||
modpack.task.save=導出懶人包
|
||||
modpack.task.install=導入懶人包
|
||||
modpack.task.install.error=安裝失敗,可能是懶人包格式不正確或操作資料失敗
|
||||
modpack.task.install.will_install=將會安裝懶人包:
|
||||
modpack.task.install.will=將會安裝懶人包:
|
||||
|
||||
modpack.wizard=導出懶人包嚮導
|
||||
modpack.wizard.step.1=基本設定
|
||||
@@ -417,4 +417,4 @@ wizard.failed=失败
|
||||
wizard.steps=步驟
|
||||
|
||||
lang=正體中文
|
||||
lang.default=跟隨系統語言
|
||||
lang.default=跟隨系統語言
|
||||
|
||||
@@ -233,7 +233,7 @@ modpack.enter_name=\u7d66\u904a\u6232\u8d77\u500b\u4f60\u559c\u6b61\u7684\u540d\
|
||||
modpack.task.save=\u5c0e\u51fa\u61f6\u4eba\u5305
|
||||
modpack.task.install=\u5c0e\u5165\u61f6\u4eba\u5305
|
||||
modpack.task.install.error=\u5b89\u88dd\u5931\u6557\uff0c\u53ef\u80fd\u662f\u61f6\u4eba\u5305\u683c\u5f0f\u4e0d\u6b63\u78ba\u6216\u64cd\u4f5c\u8cc7\u6599\u5931\u6557
|
||||
modpack.task.install.will_install=\u5c07\u6703\u5b89\u88dd\u61f6\u4eba\u5305\uff1a
|
||||
modpack.task.install.will=\u5c07\u6703\u5b89\u88dd\u61f6\u4eba\u5305\uff1a
|
||||
|
||||
modpack.wizard=\u5c0e\u51fa\u61f6\u4eba\u5305\u56ae\u5c0e
|
||||
modpack.wizard.step.1=\u57fa\u672c\u8a2d\u5b9a
|
||||
@@ -417,4 +417,4 @@ wizard.failed=\u5931\u8d25
|
||||
wizard.steps=\u6b65\u9a5f
|
||||
|
||||
lang=\u6b63\u9ad4\u4e2d\u6587
|
||||
lang.default=\u8ddf\u96a8\u7cfb\u7d71\u8a9e\u8a00
|
||||
lang.default=\u8ddf\u96a8\u7cfb\u7d71\u8a9e\u8a00
|
||||
|
||||
Reference in New Issue
Block a user