choosing files for modpack

This commit is contained in:
huangyuhui 2016-01-24 19:54:02 +08:00
parent 005589955c
commit 54e14a25da
35 changed files with 901 additions and 316 deletions

View File

@ -26,7 +26,7 @@ if (!hasProperty('mainClass')) {
ext.mainClass = 'org.jackhuang.hellominecraft.launcher.Main'
}
def buildnumber = System.getenv("BUILD_NUMBER") == null ? ".7" : "."+System.getenv("BUILD_NUMBER")
def buildnumber = System.getenv("BUILD_NUMBER") == null ? ".8" : "."+System.getenv("BUILD_NUMBER")
String mavenGroupId = 'HMCL'
String mavenVersion = '2.3.5' + buildnumber

View File

@ -47,7 +47,6 @@ import org.jackhuang.hellominecraft.lookandfeel.HelloMinecraftLookAndFeel;
import org.jackhuang.hellominecraft.utils.MathUtils;
import org.jackhuang.hellominecraft.utils.StrUtils;
import org.jackhuang.hellominecraft.utils.VersionNumber;
import org.jackhuang.hellominecraft.utils.system.Compressor;
import rx.concurrency.Schedulers;
/**

View File

@ -33,6 +33,7 @@ import org.jackhuang.hellominecraft.utils.tasks.download.FileDownloadTask;
import org.jackhuang.hellominecraft.utils.NetUtils;
import org.jackhuang.hellominecraft.utils.system.FileUtils;
import org.jackhuang.hellominecraft.utils.system.IOUtils;
import org.jackhuang.hellominecraft.utils.tasks.Task;
import org.jackhuang.hellominecraft.utils.version.MinecraftRemoteVersion;
import org.jackhuang.hellominecraft.utils.version.MinecraftRemoteVersions;
import rx.Observable;
@ -119,16 +120,9 @@ public class MinecraftDownloadService extends IMinecraftDownloadService {
}
@Override
public boolean downloadMinecraftJarTo(String id, File mvt) {
public Task downloadMinecraftJarTo(String id, File mvt) {
String vurl = service.getDownloadType().getProvider().getVersionsDownloadURL() + id + "/";
if (TaskWindow.getInstance()
.addTask(new FileDownloadTask(vurl + id + ".jar", IOUtils.tryGetCanonicalFile(mvt)).setTag(id + ".jar"))
.start())
return true;
else {
mvt.delete();
return false;
}
return new FileDownloadTask(vurl + id + ".jar", IOUtils.tryGetCanonicalFile(mvt)).setTag(id + ".jar");
}
@Override

View File

@ -20,10 +20,10 @@ package org.jackhuang.hellominecraft.launcher.core.mod;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.FileAlreadyExistsException;
import java.nio.file.FileSystemException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import org.jackhuang.hellominecraft.utils.C;
@ -32,10 +32,13 @@ import org.jackhuang.hellominecraft.launcher.core.GameException;
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftProvider;
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
import org.jackhuang.hellominecraft.utils.functions.BiFunction;
import org.jackhuang.hellominecraft.utils.system.Compressor;
import org.jackhuang.hellominecraft.utils.system.FileUtils;
import org.jackhuang.hellominecraft.utils.system.ZipEngine;
import org.jackhuang.hellominecraft.utils.tasks.Task;
import org.jackhuang.hellominecraft.utils.version.MinecraftVersionRequest;
import org.jackhuang.hellominecraft.utils.views.wizard.spi.ResultProgressHandle;
/**
* A mod pack(*.zip) includes these things:
@ -57,61 +60,112 @@ import org.jackhuang.hellominecraft.utils.version.MinecraftVersionRequest;
*/
public final class ModpackManager {
public static void install(File input, IMinecraftService service, String id) throws IOException, FileAlreadyExistsException {
File versions = new File(service.baseDirectory(), "versions");
File oldFile = new File(versions, "minecraft"), newFile = null;
if (oldFile.exists()) {
newFile = new File(versions, "minecraft-" + System.currentTimeMillis());
if (newFile.isDirectory())
FileUtils.deleteDirectory(newFile);
else if (newFile.isFile())
newFile.delete();
oldFile.renameTo(newFile);
}
public static Task install(File input, IMinecraftService service, String id) {
return new Task() {
Collection<Task> c = new ArrayList<>();
File preVersion = new File(versions, id), preVersionRenamed = null;
if (preVersion.exists()) {
String preId = id + "-" + System.currentTimeMillis();
preVersion.renameTo(preVersionRenamed = new File(versions, preId));
new File(preVersionRenamed, id + ".json").renameTo(new File(preVersionRenamed, preId + ".json"));
new File(preVersionRenamed, id + ".jar").renameTo(new File(preVersionRenamed, preId + ".jar"));
}
@Override
public void executeTask() throws Throwable {
File versions = new File(service.baseDirectory(), "versions");
File oldFile = new File(versions, "minecraft"), newFile = null;
if (oldFile.exists()) {
newFile = new File(versions, "minecraft-" + System.currentTimeMillis());
if (newFile.isDirectory())
FileUtils.deleteDirectory(newFile);
else if (newFile.isFile())
newFile.delete();
oldFile.renameTo(newFile);
}
try {
AtomicInteger b = new AtomicInteger(0);
HMCLog.log("Decompressing modpack");
Compressor.unzip(input, versions, t -> {
if (t.equals("minecraft/pack.json"))
b.incrementAndGet();
return true;
}, true);
if (b.get() < 1)
throw new FileNotFoundException(C.i18n("modpack.incorrect_format.no_json"));
File nowFile = new File(versions, id);
oldFile.renameTo(nowFile);
File preVersion = new File(versions, id), preVersionRenamed = null;
if (preVersion.exists()) {
HMCLog.log("Backing up the game");
String preId = id + "-" + System.currentTimeMillis();
preVersion.renameTo(preVersionRenamed = new File(versions, preId));
new File(preVersionRenamed, id + ".json").renameTo(new File(preVersionRenamed, preId + ".json"));
new File(preVersionRenamed, id + ".jar").renameTo(new File(preVersionRenamed, preId + ".jar"));
}
File json = new File(nowFile, "pack.json");
MinecraftVersion mv = C.gson.fromJson(FileUtils.readFileToString(json), MinecraftVersion.class);
if (mv.jar == null)
throw new FileNotFoundException(C.i18n("modpack.incorrect_format.no_jar"));
service.download().downloadMinecraftJarTo(mv.jar, new File(nowFile, id + ".jar"));
mv.jar = null;
FileUtils.writeStringToFile(json, C.gsonPrettyPrinting.toJson(mv));
json.renameTo(new File(nowFile, id + ".json"));
try {
AtomicInteger b = new AtomicInteger(0);
HMCLog.log("Decompressing modpack");
Compressor.unzip(input, versions, t -> {
if (t.equals("minecraft/pack.json"))
b.incrementAndGet();
return true;
}, true);
if (b.get() < 1)
throw new FileNotFoundException(C.i18n("modpack.incorrect_format.no_json"));
File nowFile = new File(versions, id);
oldFile.renameTo(nowFile);
if (preVersionRenamed != null) {
File presaves = new File(preVersionRenamed, "saves");
File saves = new File(nowFile, "saves");
if (presaves.exists()) {
FileUtils.deleteDirectory(saves);
FileUtils.copyDirectory(presaves, saves);
File json = new File(nowFile, "pack.json");
MinecraftVersion mv = C.gson.fromJson(FileUtils.readFileToString(json), MinecraftVersion.class);
if (mv.jar == null)
throw new FileNotFoundException(C.i18n("modpack.incorrect_format.no_jar"));
c.add(service.download().downloadMinecraftJarTo(mv.jar, new File(nowFile, id + ".jar")));
mv.jar = null;
FileUtils.writeStringToFile(json, C.gsonPrettyPrinting.toJson(mv));
json.renameTo(new File(nowFile, id + ".json"));
if (preVersionRenamed != null) {
HMCLog.log("Restoring saves");
File presaves = new File(preVersionRenamed, "saves");
File saves = new File(nowFile, "saves");
if (presaves.exists()) {
FileUtils.deleteDirectory(saves);
FileUtils.copyDirectory(presaves, saves);
}
}
} finally {
FileUtils.deleteDirectoryQuietly(oldFile);
if (newFile != null)
newFile.renameTo(oldFile);
}
}
} finally {
FileUtils.deleteDirectoryQuietly(oldFile);
if (newFile != null)
newFile.renameTo(oldFile);
}
@Override
public String getInfo() {
return C.i18n("modpack.install.task");
}
@Override
public Collection<Task> getAfterTasks() {
return c;
}
};
}
public static final List<String> MODPACK_BLACK_LIST = Arrays.asList(new String[] { "usernamecache.json", "asm", "logs", "backups", "versions", "assets", "usercache.json", "libraries", "crash-reports", "launcher_profiles.json", "NVIDIA", "TCNodeTracker", "screenshots", "natives", "native" });
public static final List<String> MODPACK_SUGGESTED_BLACK_LIST = Arrays.asList(new String[] { "saves", "servers.dat", "options.txt", "optionsshaders.txt", "mods/VoxelMods" });
/**
* &lt; String, Boolean, Boolean &gt;: Folder/File name, Is Directory,
* Return 0: non blocked, 1: non shown, 2: suggested, checked.
*/
public static final BiFunction<String, Boolean, Integer> MODPACK_PREDICATE = (String x, Boolean y) -> {
if (ModpackManager.MODPACK_BLACK_LIST_PREDICATE.apply(x, y))
return 1;
if (ModpackManager.MODPACK_SUGGESTED_BLACK_LIST_PREDICATE.apply(x, y))
return 2;
return 0;
};
public static final BiFunction<String, Boolean, Boolean> MODPACK_BLACK_LIST_PREDICATE = modpackPredicateMaker(MODPACK_BLACK_LIST);
public static final BiFunction<String, Boolean, Boolean> MODPACK_SUGGESTED_BLACK_LIST_PREDICATE = modpackPredicateMaker(MODPACK_SUGGESTED_BLACK_LIST);
private static BiFunction<String, Boolean, Boolean> modpackPredicateMaker(List<String> l) {
return (String x, Boolean y) -> {
for (String s : l)
if (y) {
if (x.startsWith(s + "/"))
return true;
} else if (x.equals(s))
return true;
return false;
};
}
/**
@ -125,7 +179,7 @@ public final class ModpackManager {
* @throws IOException if create tmp directory failed
*/
public static void export(File output, IMinecraftProvider provider, String version, List<String> blacklist) throws IOException, GameException {
ArrayList<String> b = new ArrayList<>(Arrays.asList(new String[] { "usernamecache.json", "asm", "logs", "backups", "versions", "assets", "usercache.json", "libraries", "crash-reports", "launcher_profiles.json", "NVIDIA", "TCNodeTracker" }));
ArrayList<String> b = new ArrayList<>(MODPACK_BLACK_LIST);
if (blacklist != null)
b.addAll(blacklist);
HMCLog.log("Compressing game files without some files in blacklist, including files or directories: usernamecache.json, asm, logs, backups, versions, assets, usercache.json, libraries, crash-reports, launcher_profiles.json, NVIDIA, TCNodeTracker");

View File

@ -22,6 +22,7 @@ import java.util.List;
import org.jackhuang.hellominecraft.launcher.core.GameException;
import org.jackhuang.hellominecraft.launcher.core.download.DownloadLibraryJob;
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
import org.jackhuang.hellominecraft.utils.tasks.Task;
import org.jackhuang.hellominecraft.utils.version.MinecraftRemoteVersion;
import rx.Observable;
@ -39,7 +40,7 @@ public abstract class IMinecraftDownloadService extends IMinecraftBasicService {
public abstract boolean downloadMinecraftJar(String id);
public abstract boolean downloadMinecraftJarTo(String id, File f);
public abstract Task downloadMinecraftJarTo(String id, File f);
public abstract boolean downloadMinecraftVersionJson(String id);

View File

@ -116,11 +116,12 @@ public final class Profile {
public String getSelectedVersion() {
String v = selectedMinecraftVersion;
if (StrUtils.isBlank(v) || service.version().getVersionById(v) == null) {
v = service.version().getOneVersion().id;
if (v != null)
if (service.version().getVersionCount() > 0)
v = service.version().getOneVersion().id;
if (StrUtils.isNotBlank(v))
setSelectedMinecraftVersion(v);
}
return v;
return StrUtils.isBlank(v) ? null : v;
}
public transient final EventHandler<String> selectedVersionChangedEvent = new EventHandler<>(this);

View File

@ -1149,31 +1149,14 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
if (fc.getSelectedFile() == null)
return;
String suggestedModpackId = JOptionPane.showInputDialog("Please enter your favourite game name", FileUtils.getBaseName(fc.getSelectedFile().getName()));
TaskWindow.getInstance().addTask(new TaskRunnable(C.i18n("modpack.install.task"), () -> {
try {
ModpackManager.install(fc.getSelectedFile(), getProfile().service(), suggestedModpackId);
} catch (IOException ex) {
MessageBox.Show(C.i18n("modpack.install_error"));
HMCLog.err("Failed to install modpack", ex);
}
})).start();
TaskWindow.getInstance().addTask(ModpackManager.install(fc.getSelectedFile(), getProfile().service(), suggestedModpackId)).start();
refreshVersions();
}//GEN-LAST:event_btnImportModpackActionPerformed
private void btnExportModpackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExportModpackActionPerformed
Map settings = (Map) WizardDisplayer.showWizard(new ModpackWizard(getProfile().service().version()).createWizard());
if (settings != null)
TaskWindow.getInstance().addTask(new TaskRunnable(C.i18n("modpack.save.task"),
() -> {
try {
ModpackManager.export(new File((String) settings.get(ModpackInitializationPanel.KEY_MODPACK_LOCATION)),
getProfile().service().version(),
(String) settings.get(ModpackInitializationPanel.KEY_GAME_VERSION),
((Boolean) settings.get(ModpackInitializationPanel.KEY_SAVE) == false) ? Arrays.asList("saves") : null);
} catch (IOException | GameException ex) {
MessageBox.Show(C.i18n("modpack.export_error"));
HMCLog.err("Failed to export modpack", ex);
}
})).start();
if (getProfile().service().version().getVersionCount() <= 0)
return;
WizardDisplayer.showWizard(new ModpackWizard(getProfile().service()).createWizard());
}//GEN-LAST:event_btnExportModpackActionPerformed
// </editor-fold>
@ -1229,7 +1212,6 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
cboJavaItemStateChanged(new ItemEvent(cboJava, 0, cboJava.getSelectedItem(), ItemEvent.SELECTED));
loadVersions();
loadMinecraftVersion();
}
void loadVersions() {
@ -1248,6 +1230,8 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
cboVersions.setSelectedIndex(index);
reloadMods();
loadMinecraftVersion();
}
void loadMinecraftVersion() {

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane1" alignment="0" pref="400" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane1" alignment="1" pref="300" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTree" name="jTree1">
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>

View File

@ -0,0 +1,121 @@
/*
* 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.views.modpack;
import java.io.File;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import javax.swing.tree.DefaultTreeModel;
import org.jackhuang.hellominecraft.utils.functions.BiFunction;
import org.jackhuang.hellominecraft.utils.system.FileUtils;
import org.jackhuang.hellominecraft.utils.views.checktree.CheckBoxTreeCellRenderer;
import org.jackhuang.hellominecraft.utils.views.checktree.CheckBoxTreeNode;
import org.jackhuang.hellominecraft.utils.views.checktree.CheckBoxTreeNodeSelectionListener;
import org.jackhuang.hellominecraft.utils.views.wizard.spi.WizardController;
/**
*
* @author huangyuhui
*/
public class ModpackFileSelectionPanel extends javax.swing.JPanel {
private final WizardController controller;
private final Map wizardData;
private final BiFunction<String, Boolean, Integer> blackList;
private final Set<String> bannedFiles = new HashSet<>();
/**
* Creates new form ModpackFileSelectionPanel
*
* @param blackList Return 0: non blocked, 1: non shown, 2: suggested,
* checked
*/
public ModpackFileSelectionPanel(WizardController controller, Map wizardData, File gameDir, BiFunction<String, Boolean, Integer> blackList) {
initComponents();
this.controller = controller;
this.wizardData = wizardData;
this.blackList = blackList;
CheckBoxTreeNode root = create(gameDir, "minecraft");
jTree1.setModel(new DefaultTreeModel(root));
jTree1.setCellRenderer(new CheckBoxTreeCellRenderer());
jTree1.addMouseListener(new CheckBoxTreeNodeSelectionListener());
wizardData.put("blackList", root);
}
CheckBoxTreeNode create(File file, String basePath) {
int state = 0;
if (basePath.length() > "minecraft/".length())
if ((state = blackList.apply(basePath.substring("minecraft/".length()) + (file.isDirectory() ? "/" : ""), file.isDirectory())) == 1)
return null;
CheckBoxTreeNode node = new CheckBoxTreeNode(FileUtils.getName(basePath));
if (state == 2)
node.setSelected(true);
if (file.isDirectory()) {
File[] f = file.listFiles();
for (File subFile : f) {
CheckBoxTreeNode subNode = create(subFile, basePath + "/" + subFile.getName());
if (subNode != null) {
subNode.setSelected(subNode.isSelected() | node.isSelected());
node.add(subNode);
}
}
if (!node.children().hasMoreElements())
return null;
}
return node;
}
/**
* This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
jTree1 = new javax.swing.JTree();
jScrollPane1.setViewportView(jTree1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTree jTree1;
// End of variables declaration//GEN-END:variables
}

View File

@ -29,7 +29,6 @@
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="lblGameVersion" min="-2" max="-2" attributes="0"/>
<Component id="chkSave" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="67" max="32767" attributes="0"/>
@ -44,7 +43,7 @@
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="92" max="32767" attributes="0"/>
<EmptySpace pref="120" max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="lblModpackLocation" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="cboModpackLocation" alignment="3" min="-2" max="-2" attributes="0"/>
@ -56,8 +55,6 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="cboGameVersion" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="chkSave" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -101,14 +98,6 @@
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JCheckBox" name="chkSave">
<Properties>
<Property name="text" type="java.lang.String" value="&#x5141;&#x8bb8;&#x5bfc;&#x51fa;&#x5b58;&#x6863;"/>
</Properties>
<Events>
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="chkSaveItemStateChanged"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">

View File

@ -32,7 +32,6 @@ public class ModpackInitializationPanel extends javax.swing.JPanel {
public static final String KEY_GAME_VERSION = "gameVersion";
public static final String KEY_MODPACK_LOCATION = "modpackLocation";
public static final String KEY_SAVE = "save";
private final WizardController controller;
private final Map wizardData;
@ -47,18 +46,15 @@ public class ModpackInitializationPanel extends javax.swing.JPanel {
this.wizardData = wizardData;
wizardData.put(KEY_GAME_VERSION, versions);
wizardData.put(KEY_SAVE, false);
configureComboContents();
controller.setProblem(C.i18n("modpack.not_a_valid_location"));
controller.setForwardNavigationMode(WizardController.MODE_CAN_FINISH);
}
private void configureComboContents() {
String[] versions = (String[]) wizardData.get(KEY_GAME_VERSION);
cboGameVersion.setModel(new DefaultComboBoxModel<>(versions));
if (versions.length > 0)
wizardData.put(KEY_GAME_VERSION, versions[0]);
}
/**
@ -76,7 +72,6 @@ public class ModpackInitializationPanel extends javax.swing.JPanel {
cboModpackLocation = new javax.swing.JButton();
lblGameVersion = new javax.swing.JLabel();
cboGameVersion = new javax.swing.JComboBox<>();
chkSave = new javax.swing.JCheckBox();
jLabel1 = new javax.swing.JLabel();
lblModpackLocation.setText(C.i18n("modpack.save")); // NOI18N
@ -102,13 +97,6 @@ public class ModpackInitializationPanel extends javax.swing.JPanel {
}
});
chkSave.setText("允许导出存档");
chkSave.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
chkSaveItemStateChanged(evt);
}
});
jLabel1.setText(C.i18n("modpack.warning")); // NOI18N
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
@ -127,7 +115,6 @@ public class ModpackInitializationPanel extends javax.swing.JPanel {
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblGameVersion)
.addComponent(chkSave)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 67, Short.MAX_VALUE)))
.addContainerGap())
@ -137,7 +124,7 @@ public class ModpackInitializationPanel extends javax.swing.JPanel {
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 92, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 120, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblModpackLocation)
.addComponent(cboModpackLocation))
@ -147,8 +134,6 @@ public class ModpackInitializationPanel extends javax.swing.JPanel {
.addComponent(lblGameVersion)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cboGameVersion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(chkSave)
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
@ -173,10 +158,6 @@ public class ModpackInitializationPanel extends javax.swing.JPanel {
controller.setProblem(null);
}//GEN-LAST:event_txtModpackLocationCaretUpdate
private void chkSaveItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_chkSaveItemStateChanged
wizardData.put(KEY_SAVE, chkSave.isSelected());
}//GEN-LAST:event_chkSaveItemStateChanged
private void cboGameVersionItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cboGameVersionItemStateChanged
wizardData.put(KEY_GAME_VERSION, cboGameVersion.getSelectedItem());
}//GEN-LAST:event_cboGameVersionItemStateChanged
@ -184,7 +165,6 @@ public class ModpackInitializationPanel extends javax.swing.JPanel {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JComboBox<String> cboGameVersion;
private javax.swing.JButton cboModpackLocation;
private javax.swing.JCheckBox chkSave;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel lblGameVersion;
private javax.swing.JLabel lblModpackLocation;

View File

@ -17,14 +17,29 @@
*/
package org.jackhuang.hellominecraft.launcher.views.modpack;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.swing.JComponent;
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftProvider;
import org.jackhuang.hellominecraft.launcher.core.GameException;
import org.jackhuang.hellominecraft.launcher.core.mod.ModpackManager;
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
import org.jackhuang.hellominecraft.utils.C;
import org.jackhuang.hellominecraft.utils.MessageBox;
import org.jackhuang.hellominecraft.utils.logging.HMCLog;
import org.jackhuang.hellominecraft.utils.views.checktree.CheckBoxTreeNode;
import org.jackhuang.hellominecraft.utils.views.wizard.spi.DeferredWizardResult;
import org.jackhuang.hellominecraft.utils.views.wizard.spi.ResultProgressHandle;
import org.jackhuang.hellominecraft.utils.views.wizard.spi.Summary;
import org.jackhuang.hellominecraft.utils.views.wizard.spi.WizardBranchController;
import org.jackhuang.hellominecraft.utils.views.wizard.spi.WizardController;
import org.jackhuang.hellominecraft.utils.views.wizard.spi.WizardException;
import org.jackhuang.hellominecraft.utils.views.wizard.spi.WizardPanelProvider;
/**
@ -33,18 +48,62 @@ import org.jackhuang.hellominecraft.utils.views.wizard.spi.WizardPanelProvider;
*/
public class ModpackWizard extends WizardBranchController {
public ModpackWizard(IMinecraftProvider provider) {
super(new WizardPanelProvider(C.i18n("modpack.wizard"), new String[] { C.i18n("modpack.wizard.step.1") }, new String[] { C.i18n("modpack.wizard.step.1.title") }) {
static void process(CheckBoxTreeNode node, String basePath, List<String> list) {
if (node.isSelected()) {
if (basePath.length() > "minecraft/".length())
list.add(basePath.substring("minecraft/".length()));
return;
}
Enumeration<CheckBoxTreeNode> e = node.children();
for (; e.hasMoreElements();) {
CheckBoxTreeNode n = e.nextElement();
process(n, basePath + "/" + n.getUserObject(), list);
}
}
public ModpackWizard(IMinecraftService service) {
super(new WizardPanelProvider(C.i18n("modpack.wizard"), new String[] { C.i18n("modpack.wizard.step.1"), C.i18n("modpack.wizard.step.2") }, new String[] { C.i18n("modpack.wizard.step.1.title"), C.i18n("modpack.wizard.step.2.title") }) {
@Override
protected Object finish(Map settings) throws WizardException {
return new DeferredWizardResult(false) {
@Override
public void start(Map settings, ResultProgressHandle progress) {
progress.setBusy("Processing modpack");
ArrayList<String> blackList = new ArrayList<>(ModpackManager.MODPACK_BLACK_LIST);
CheckBoxTreeNode root = (CheckBoxTreeNode) settings.get("blackList");
process(root, "minecraft", blackList);
try {
File loc = new File((String) settings.get(ModpackInitializationPanel.KEY_MODPACK_LOCATION));
ModpackManager.export(loc,
service.version(),
(String) settings.get(ModpackInitializationPanel.KEY_GAME_VERSION),
blackList);
progress.finished(Summary.create(C.i18n("modpack.export_finished") + ": " + loc.getAbsolutePath(), null));
} catch (IOException | GameException ex) {
HMCLog.err("Failed to export modpack", ex);
progress.failed(C.i18n("modpack.export_error") + ": " + ex.getClass().getName() + ", " + ex.getLocalizedMessage(), true);
}
}
};
}
@Override
protected JComponent createPanel(WizardController controller, String id, Map settings) {
switch (indexOfStep(id)) {
case 0:
String[] s = new String[provider.getVersionCount()];
Iterator<MinecraftVersion> it = provider.getVersions().iterator();
String[] s = new String[service.version().getVersionCount()];
Iterator<MinecraftVersion> it = service.version().getVersions().iterator();
for (int i = 0; i < s.length; i++)
s[i] = it.next().id;
controller.setForwardNavigationMode(WizardController.MODE_CAN_CONTINUE);
return new ModpackInitializationPanel(controller, settings, s);
case 1:
controller.setForwardNavigationMode(WizardController.MODE_CAN_FINISH);
return new ModpackFileSelectionPanel(controller, settings, service.baseDirectory(), ModpackManager.MODPACK_PREDICATE);
default:
throw new IllegalArgumentException(id);
}

View File

@ -25,7 +25,7 @@ import org.jackhuang.hellominecraft.utils.logging.logger.Logger;
*/
public class HMCLog {
public static Logger logger = new Logger("Hello Minecraft!");
private static final Logger logger = new Logger("Hello Minecraft!");
public static void log(String message) {
logger.info(message);

View File

@ -102,7 +102,7 @@ public class ZipEngine {
} else {
pathName = file.getPath().substring(basePath.length() + 1);
if (pathNameCallback != null)
pathName = pathNameCallback.apply(pathName, true);
pathName = pathNameCallback.apply(pathName, false);
if (pathName == null)
continue;
putFile(file, pathName);

View File

@ -110,11 +110,13 @@ public abstract class Task {
return new DoubleTask(t, this);
}
public void run() {
public boolean run() {
try {
executeTask();
return true;
} catch (Throwable t) {
HMCLog.err("Failed to execute task", t);
return false;
}
}
}

View File

@ -0,0 +1,99 @@
/*
* 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.utils.views.checktree;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import javax.swing.JCheckBox;
import javax.swing.JPanel;
import javax.swing.JTree;
import javax.swing.UIManager;
import javax.swing.plaf.ColorUIResource;
import javax.swing.tree.TreeCellRenderer;
public class CheckBoxTreeCellRenderer extends JPanel implements TreeCellRenderer {
protected JCheckBox check;
protected CheckBoxTreeLabel label;
public CheckBoxTreeCellRenderer() {
setLayout(null);
add(check = new JCheckBox());
add(label = new CheckBoxTreeLabel());
check.setBackground(UIManager.getColor("Tree.textBackground"));
label.setForeground(UIManager.getColor("Tree.textForeground"));
}
/**
* 返回的是一个<code>JPanel</code>对象该对象中包含一个<code>JCheckBox</code>对象
* 和一个<code>JLabel</code>对象并且根据每个结点是否被选中来决定<code>JCheckBox</code>
* 是否被选中
*/
@Override
public Component getTreeCellRendererComponent(JTree tree, Object value,
boolean selected, boolean expanded, boolean leaf, int row,
boolean hasFocus) {
String stringValue = tree.convertValueToText(value, selected, expanded, leaf, row, hasFocus);
setEnabled(tree.isEnabled());
check.setSelected(((CheckBoxTreeNode) value).isSelected());
label.setFont(tree.getFont());
label.setText(stringValue);
label.setSelected(selected);
label.setFocus(hasFocus);
if (leaf)
label.setIcon(UIManager.getIcon("Tree.leafIcon"));
else if (expanded)
label.setIcon(UIManager.getIcon("Tree.openIcon"));
else
label.setIcon(UIManager.getIcon("Tree.closedIcon"));
return this;
}
@Override
public Dimension getPreferredSize() {
Dimension dCheck = check.getPreferredSize();
Dimension dLabel = label.getPreferredSize();
return new Dimension(dCheck.width + dLabel.width, dCheck.height < dLabel.height ? dLabel.height : dCheck.height);
}
@Override
public void doLayout() {
Dimension dCheck = check.getPreferredSize();
Dimension dLabel = label.getPreferredSize();
int yCheck = 0;
int yLabel = 0;
if (dCheck.height < dLabel.height)
yCheck = (dLabel.height - dCheck.height) / 2;
else
yLabel = (dCheck.height - dLabel.height) / 2;
check.setLocation(0, yCheck);
check.setBounds(0, yCheck, dCheck.width, dCheck.height);
label.setLocation(dCheck.width, yLabel);
label.setBounds(dCheck.width, yLabel, dLabel.width, dLabel.height);
}
@Override
public void setBackground(Color color) {
if (color instanceof ColorUIResource)
color = null;
super.setBackground(color);
}
}

View File

@ -0,0 +1,82 @@
/*
* 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.utils.views.checktree;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import javax.swing.Icon;
import javax.swing.JLabel;
import javax.swing.UIManager;
import javax.swing.plaf.ColorUIResource;
public class CheckBoxTreeLabel extends JLabel {
private boolean isSelected;
private boolean hasFocus;
public CheckBoxTreeLabel() {
}
@Override
public void setBackground(Color color) {
if (color instanceof ColorUIResource)
color = null;
super.setBackground(color);
}
@Override
public void paint(Graphics g) {
/*String str;
if ((str = getText()) != null)
if (0 < str.length()) {
if (isSelected)
g.setColor(UIManager.getColor("Tree.selectionBackground"));
else
g.setColor(UIManager.getColor("Tree.textBackground"));
Dimension d = getPreferredSize();
int imageOffset = 0;
Icon currentIcon = getIcon();
if (currentIcon != null)
imageOffset = currentIcon.getIconWidth() + Math.max(0, getIconTextGap() - 1);
g.fillRect(imageOffset, 0, d.width - 1 - imageOffset, d.height);
if (hasFocus) {
g.setColor(UIManager.getColor("Tree.selectionBorderColor"));
g.drawRect(imageOffset, 0, d.width - 1 - imageOffset, d.height - 1);
}
}*/
super.paint(g);
}
@Override
public Dimension getPreferredSize() {
Dimension retDimension = super.getPreferredSize();
if (retDimension != null)
retDimension = new Dimension(retDimension.width + 3, retDimension.height);
return retDimension;
}
public void setSelected(boolean isSelected) {
this.isSelected = isSelected;
}
public void setFocus(boolean hasFocus) {
this.hasFocus = hasFocus;
}
}

View File

@ -0,0 +1,105 @@
/*
* 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.utils.views.checktree;
import javax.swing.tree.DefaultMutableTreeNode;
/**
*
* @author huangyuhui
*/
public class CheckBoxTreeNode extends DefaultMutableTreeNode {
protected boolean isSelected;
public CheckBoxTreeNode() {
this(null);
}
public CheckBoxTreeNode(Object userObject) {
this(userObject, true, false);
}
public CheckBoxTreeNode(Object userObject, boolean allowsChildren, boolean isSelected) {
super(userObject, allowsChildren);
this.isSelected = isSelected;
}
public boolean isSelected() {
return isSelected;
}
public void setSelected(boolean _isSelected) {
this.isSelected = _isSelected;
if (_isSelected) {
// 如果选中则将其所有的子结点都选中
if (children != null)
for (Object obj : children) {
CheckBoxTreeNode node = (CheckBoxTreeNode) obj;
if (_isSelected != node.isSelected())
node.setSelected(_isSelected);
}
// 向上检查如果父结点的所有子结点都被选中那么将父结点也选中
CheckBoxTreeNode pNode = (CheckBoxTreeNode) parent;
// 开始检查pNode的所有子节点是否都被选中
if (pNode != null) {
int index = 0;
for (; index < pNode.children.size(); ++index) {
CheckBoxTreeNode pChildNode = (CheckBoxTreeNode) pNode.children.get(index);
if (!pChildNode.isSelected())
break;
}
/*
* 表明pNode所有子结点都已经选中则选中父结点
* 该方法是一个递归方法因此在此不需要进行迭代因为
* 当选中父结点后父结点本身会向上检查的
*/
if (index == pNode.children.size())
if (pNode.isSelected() != _isSelected)
pNode.setSelected(_isSelected);
}
} else {
/*
* 如果是取消父结点导致子结点取消那么此时所有的子结点都应该是选择上的
* 否则就是子结点取消导致父结点取消然后父结点取消导致需要取消子结点
* 是这时候是不需要取消子结点的
*/
if (children != null) {
int index = 0;
for (; index < children.size(); ++index) {
CheckBoxTreeNode childNode = (CheckBoxTreeNode) children.get(index);
if (!childNode.isSelected())
break;
}
// 从上向下取消的时候
if (index == children.size())
for (int i = 0; i < children.size(); ++i) {
CheckBoxTreeNode node = (CheckBoxTreeNode) children.get(i);
if (node.isSelected() != _isSelected)
node.setSelected(_isSelected);
}
}
// 向上取消只要存在一个子节点不是选上的那么父节点就不应该被选上
CheckBoxTreeNode pNode = (CheckBoxTreeNode) parent;
if (pNode != null && pNode.isSelected() != _isSelected)
pNode.setSelected(_isSelected);
}
}
}

View File

@ -0,0 +1,45 @@
/*
* 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.utils.views.checktree;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JTree;
import javax.swing.tree.TreePath;
import javax.swing.tree.DefaultTreeModel;
public class CheckBoxTreeNodeSelectionListener extends MouseAdapter {
@Override
public void mouseClicked(MouseEvent event) {
JTree tree = (JTree) event.getSource();
int x = event.getX();
int y = event.getY();
int row = tree.getRowForLocation(x, y);
TreePath path = tree.getPathForRow(row);
if (path != null) {
CheckBoxTreeNode node = (CheckBoxTreeNode) path.getLastPathComponent();
if (node != null) {
boolean isSelected = !node.isSelected();
node.setSelected(isSelected);
((DefaultTreeModel) tree.getModel()).nodeStructureChanged(node);
}
}
}
}

View File

@ -3,11 +3,8 @@ package org.jackhuang.hellominecraft.utils.views.wizard.api.displayer;
import java.awt.Container;
import java.awt.EventQueue;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import java.util.logging.Logger;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JProgressBar;
import javax.swing.border.EmptyBorder;
@ -38,14 +35,10 @@ public class NavProgress implements ResultProgressHandle {
JLabel lbl = new JLabel();
JLabel busy = new JLabel();
WizardDisplayerImpl parent;
String failMessage = null;
boolean isUseBusy = false;
Container ipanel = null;
boolean isInitialized = false;
@ -55,18 +48,13 @@ public class NavProgress implements ResultProgressHandle {
*/
boolean isRunning = true;
NavProgress(WizardDisplayerImpl impl, boolean useBusy) {
NavProgress(WizardDisplayerImpl impl) {
this.parent = impl;
isUseBusy = useBusy;
}
public void addProgressComponents(Container panel) {
panel.add(lbl);
if (isUseBusy) {
ensureBusyInitialized();
panel.add(busy);
} else
panel.add(progressBar);
panel.add(progressBar);
isInitialized = true;
ipanel = panel;
}
@ -93,8 +81,6 @@ public class NavProgress implements ResultProgressHandle {
progressBar.setMaximum(totalSteps);
progressBar.setValue(currentStep);
}
setUseBusy(false);
});
}
@ -103,34 +89,9 @@ public class NavProgress implements ResultProgressHandle {
lbl.setText(description == null ? " " : description);
progressBar.setIndeterminate(true);
setUseBusy(true);
});
}
protected void setUseBusy(boolean useBusy) {
if (isInitialized)
if (useBusy && (!isUseBusy)) {
ipanel.remove(progressBar);
ensureBusyInitialized();
ipanel.add(busy);
ipanel.invalidate();
} else if (!useBusy && isUseBusy) {
ipanel.remove(busy);
ipanel.add(progressBar);
ipanel.invalidate();
}
isUseBusy = useBusy;
}
private void ensureBusyInitialized() {
if (busy.getIcon() == null) {
URL url = getClass().getResource("/org/jackhuang/hellominecraft/busy.gif");
Icon icon = new ImageIcon(url);
busy.setIcon(icon);
}
}
private void invoke(Runnable r) {
if (EventQueue.isDispatchThread())
r.run();

View File

@ -413,8 +413,8 @@ public class WizardDisplayerImpl extends WizardDisplayer {
}
protected ResultProgressHandle createProgressDisplay(boolean isUseBusy) {
return new NavProgress(this, isUseBusy);
protected ResultProgressHandle createProgressDisplay() {
return new NavProgress(this);
}
void handleDeferredWizardResult(final DeferredWizardResult r, final boolean inSummary) {
@ -422,7 +422,7 @@ public class WizardDisplayerImpl extends WizardDisplayer {
deferredResult = r;
}
wizardPanel.setEnabled(false);
progress = createProgressDisplay(r.isUseBusy());
progress = createProgressDisplay();
Container inst = instructions.getComponent();
progress.addProgressComponents(inst);
inst.invalidate();

View File

@ -9,7 +9,7 @@ If applicable, add the following below the CDDL Header, with the fields
enclosed by brackets [] replaced by your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]" */
/*
/*
* DeferredWizardResult.java
*
* Created on September 24, 2006, 3:42 AM
@ -17,95 +17,84 @@ enclosed by brackets [] replaced by your own identifying information:
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package org.jackhuang.hellominecraft.utils.views.wizard.spi;
import java.util.Map;
/**
* Object which can be returned from
* Object which can be returned from
* <code>WizardPage.WizardResultProducer.finish()</code>
* or <code>WizardPanelProvider.finish()</code>. A DeferredWizardResult does
* not immediately calculate its result; it is used for cases where some
* or <code>WizardPanelProvider.finish()</code>. A DeferredWizardResult does
* not immediately calculate its result; it is used for cases where some
* time consuming work needs to be performed to compute the result (such as
* creating files on disk), and a progress bar should be shown until the work
* is completed.
*
* @see org.jackhuang.hellominecraft.utils.views.wizard.spi.ResultProgressHandle
*
* @author Tim Boudreau
*/
public abstract class DeferredWizardResult {
private final boolean canAbort;
private final boolean useBusy;
/**
* Creates a new instance of DeferredWizardResult which cannot be
/**
* Creates a new instance of DeferredWizardResult which cannot be
* aborted and shows a progress bar.
*/
public DeferredWizardResult() {
useBusy = false;
canAbort = false;
}
/** Creates a new instance of DeferredWizardResult which may or may not
* be able to be aborted.
/**
* Creates a new instance of DeferredWizardResult which may or may not
* be able to be aborted.
*
* @param canAbort determine if background computation can be aborted by
* calling the <code>abort()</code> method
* calling the <code>abort()</code> method
*/
public DeferredWizardResult (boolean canAbort) {
public DeferredWizardResult(boolean canAbort) {
this.canAbort = canAbort;
this.useBusy = false;
}
/** Creates a new instance of DeferredWizardResult which may or may not
* be able to be aborted, and which may simply disable the wizard's UI
* instead of showing a progress bar while the background work runs.
*
* @param canAbort
* @param useBusy
*/
public DeferredWizardResult (boolean canAbort, boolean useBusy) {
this.canAbort = canAbort;
this.useBusy = useBusy;
}
/**
* Begin computing the result. This method is called on a background
/**
* Begin computing the result. This method is called on a background
* thread, not the AWT event thread, and computation can immediately begin.
* Use the progress handle to set progress as the work progresses.
*
* IMPORTANT: This method MUST call either progress.finished with the result,
* or progress.failed with an error message. If this method returns without
* Use the progress handle to set progress as the work progresses.
*
* IMPORTANT: This method MUST call either progress.finished with the
* result,
* or progress.failed with an error message. If this method returns without
* calling either of those methods, it will be assumed to have failed.
*
*
* @param settings The settings gathered over the course of the wizard
* @param progress A handle which can be used to affect the progress bar.
*/
public abstract void start (Map settings, ResultProgressHandle progress);
public abstract void start(Map settings, ResultProgressHandle progress);
/**
* If true, the background thread can be aborted. If it is possible to
* If true, the background thread can be aborted. If it is possible to
* abort, then the UI may allow the dialog to be closed while the result
* is being computed.
*/
*/
public final boolean canAbort() {
return canAbort;
}
/**
* Abort computation of the result. This method will usually be called on
* Abort computation of the result. This method will usually be called on
* the event thread, after <code>start()<code> has been called, and before
* <code>finished()</code> has been called on the <code>ResultProgressHandle</code>
* <code>finished()</code> has been called on the
* <code>ResultProgressHandle</code>
* that is passed to <code>start()</code>, for example, if the user clicks
* the close button on the dialog showing the wizard while the result is
* being computed.
* <p>
* <b>This method does <i>nothing</i> by default</b> - it is left empty so
* that people who do not want to support aborting background work do not
* have to override it. It is up to the implementor
* to set a flag or otherwise notify the background thread to halt
* computation. A simple method for doing so is as follows:
* have to override it. It is up to the implementor
* to set a flag or otherwise notify the background thread to halt
* computation. A simple method for doing so is as follows:
* <pre>
* volatile Thread thread;
* public void start (Map settings, ResultProgressHandle handle) {
@ -113,8 +102,8 @@ public abstract class DeferredWizardResult {
* synchronized (this) {
* thread = Thread.currentThread();
* }
*
* //do the background computation, update progress. Every so often,
*
* //do the background computation, update progress. Every so often,
* //check Thread.interrupted() and exit if true
* } finally {
* synchronized (this) {
@ -122,31 +111,17 @@ public abstract class DeferredWizardResult {
* }
* }
* }
*
*
* public synchronized void abort() {
* if (thread != null) thread.interrupt();
* }
* </pre>
* or you can use a <code>volatile boolean</code> flag that you set in
* <code>abort()</code> and periodically check in the body of <code>start()</code>.
*
*/
* <code>abort()</code> and periodically check in the body of
* <code>start()</code>.
*
*/
public void abort() {
//do nothing
}
/**
* Determine if the UI should be completely disabled while the background
* work is running (i.e. you do not want a progress bar, you just want all
* navigation disabled [note on some window managers, the user will still
* be able to click the dialog's window drag-bar close button, so you still
* should override abort() to stop computation if possible]).
*
* @return true if no progress bar should be displayed and the UI should
* just disable itself
*/
public final boolean isUseBusy()
{
return useBusy;
}
}

View File

@ -5,23 +5,22 @@ compliance with the License.
or http://www.netbeans.org/cddl.txt.
When distributing Covered Code, include this CDDL Header Notice in each file
and include the License file at http://www.netbeans.org/cddl.txt.
*/
*/
package org.jackhuang.hellominecraft.utils.views.wizard.spi;
import java.util.Map;
/**
* Result class for the methods in WizardPanel.
*
*
* For immediate action, one of the two constantants PROCEED or REMAIN_ON_PAGE
* should be returned. Otherwise an instance of a subclass should be returned
* should be returned. Otherwise an instance of a subclass should be returned
* that computes a Boolean result.
*
*
* @author stanley@stanleyknutson.com
*/
public abstract class WizardPanelNavResult extends DeferredWizardResult
{
public abstract class WizardPanelNavResult extends DeferredWizardResult {
/**
* value for procced to next step in the wizard.
*/
@ -31,59 +30,43 @@ public abstract class WizardPanelNavResult extends DeferredWizardResult
*/
public static final WizardPanelNavResult REMAIN_ON_PAGE = new WPNRimmediate(false);
public WizardPanelNavResult(boolean useBusy) {
super (false, useBusy);
private WizardPanelNavResult() {
super();
}
public WizardPanelNavResult(boolean useBusy, boolean canAbort) {
super (canAbort, useBusy);
}
public WizardPanelNavResult() {
super (false, false);
}
public boolean isDeferredComputation()
{
public boolean isDeferredComputation() {
return true;
}
/*
* internal class for the constants only
*/
private final static class WPNRimmediate extends WizardPanelNavResult
{
private final static class WPNRimmediate extends WizardPanelNavResult {
boolean value;
WPNRimmediate (boolean v)
{
WPNRimmediate(boolean v) {
value = v;
}
public boolean isDeferredComputation()
{
public boolean isDeferredComputation() {
return false;
}
public boolean equals (Object o)
{
if (o instanceof WPNRimmediate && ((WPNRimmediate)o).value == value)
{
public boolean equals(Object o) {
if (o instanceof WPNRimmediate && ((WPNRimmediate) o).value == value)
return true;
}
return false;
}
public int hashCode()
{
public int hashCode() {
return value ? 1 : 2;
}
public void start(Map settings, ResultProgressHandle progress)
{
public void start(Map settings, ResultProgressHandle progress) {
// Should never get here, this is supposed to be immediate!
throw new RuntimeException("Immediate result was called as deferral!");
}
}
}

View File

@ -215,10 +215,13 @@ modpack.install_error=\u5b89\u88c5\u5931\u8d25\uff0c\u53ef\u80fd\u662f\u6574\u54
modpack.save=\u9009\u62e9\u8981\u5bfc\u51fa\u5230\u7684\u6e38\u620f\u6574\u5408\u5305\u4f4d\u7f6e
modpack.save.task=\u5bfc\u51fa\u6574\u5408\u5305
modpack.export_error=\u5bfc\u51fa\u5931\u8d25\uff0c\u53ef\u80fd\u662f\u60a8\u7684\u6e38\u620f\u6587\u4ef6\u5939\u683c\u5f0f\u4e0d\u6b63\u786e\u6216\u64cd\u4f5c\u6587\u4ef6\u5931\u8d25
modpack.export_finished=\u6574\u5408\u5305\u5bfc\u51fa\u5b8c\u6210\uff0c\u53c2\u89c1
modpack.enter_name=\u7ed9\u6e38\u620f\u8d77\u4e2a\u4f60\u559c\u6b22\u7684\u540d\u5b57
modpack.wizard=\u5bfc\u51fa\u6574\u5408\u5305\u5411\u5bfc
modpack.wizard.step.1=\u57fa\u672c\u8bbe\u7f6e
modpack.wizard.step.1.title=\u8bbe\u7f6e\u6574\u5408\u5305\u7684\u4e3b\u8981\u4fe1\u606f
modpack.wizard.step.2=\u6587\u4ef6\u9009\u62e9
modpack.wizard.step.2.title=\u9009\u4e2d\u4f60\u4e0d\u60f3\u52a0\u5230\u6574\u5408\u5305\u4e2d\u7684\u6587\u4ef6(\u5939)
modpack.incorrect_format.no_json=\u6574\u5408\u5305\u683c\u5f0f\u9519\u8bef\uff0cpack.json\u4e22\u5931
modpack.incorrect_format.no_jar=\u6574\u5408\u5305\u683c\u5f0f\u9519\u8bef\uff0cpack.json\u4e22\u5931jar\u5b57\u6bb5
modpack.cannot_read_version=\u8bfb\u53d6\u6e38\u620f\u7248\u672c\u5931\u8d25

View File

@ -215,10 +215,13 @@ modpack.install_error=Failed to install the modpack, maybe the modpack file is i
modpack.save=Choose a location which you want to export the game files to.
modpack.save.task=Export the modpack
modpack.export_error=Failed to export the modpack, maybe the format of your game directory is incorrect or failed to manage files.
modpack.export_finished=Exporting the modpack finished. See
modpack.enter_name=Give this game a name which is your favorite.
modpack.wizard=Exporting the modpack wizard
modpack.wizard.step.1=Basic options
modpack.wizard.step.1.title=Set the basic options to the modpack.
modpack.wizard.step.2=Files selection
modpack.wizard.step.2.title=Choose the files you do not want to put in the modpack.
modpack.incorrect_format.no_json=The format of the modpack is incorrect, pack.json is missing.
modpack.incorrect_format.no_jar=The format of the modpack is incorrect, pack.json does not have attribute 'jar'
modpack.cannot_read_version=Failed to gather the game version

View File

@ -15,7 +15,7 @@
# along with this program. If not, see {http://www.gnu.org/licenses/}.
launch.failed=\u555f\u52d5\u5931\u6557
launch.failed_creating_process=\u555f\u52d5\u5931\u6557\uff0c\u5728\u5275\u5efa\u65b0\u9032\u7a0b\u6642\u767c\u751f\u932f\u8aa4\uff0c\u53ef\u80fd\u662fJava\u8def\u5f91\u932f\u8aa4\u3002
launch.failed_sh_permission=\u70ba\u555f\u52d5\u6587\u4ef6\u6dfb\u52a0\u6b0a\u9650\u6642\u767c\u751f\u932f\u8aa4
launch.failed_sh_permission=\u70ba\u555f\u52d5\u8cc7\u6599\u6dfb\u52a0\u6b0a\u9650\u6642\u767c\u751f\u932f\u8aa4
launch.failed_pa\u200b\u200bcking_jar=\u5728\u6253\u5305jar\u6642\u767c\u751f\u932f\u8aa4
launch.unsupported_launcher_version=\u5c0d\u4e0d\u8d77\uff0c\u672c\u555f\u52d5\u5668\u73fe\u5728\u53ef\u80fd\u4e0d\u80fd\u555f\u52d5\u9019\u500b\u7248\u672c\u7684Minecraft\uff0c\u4f46\u555f\u52d5\u5668\u9084\u662f\u6703\u5617\u8a66\u555f\u52d5\uff0c\u8acb\u76e1\u5feb\u5c07\u6b64\u554f\u984c\u5831\u544a\u7d66\u4f5c\u8005\u3002
launch.too_big_memory_alloc_64bit=\u60a8\u8bbe\u7f6e\u7684\u5185\u5b58\u5927\u5c0f\u8fc7\u5927\uff0c\u7531\u4e8e\u53ef\u80fd\u8d85\u8fc7\u4e8632\u4f4dJava\u7684\u5185\u5b58\u5206\u914d\u9650\u5236\uff0c\u6240\u4ee5\u53ef\u80fd\u65e0\u6cd5\u542f\u52a8\u6e38\u620f\uff0c\u8bf7\u5c06\u5185\u5b58\u8c03\u81f31024MB\u6216\u66f4\u5c0f\uff0c\u542f\u52a8\u5668\u4ecd\u4f1a\u5c1d\u8bd5\u542f\u52a8\u3002
@ -25,7 +25,7 @@ launch.circular_dependency_versions=\u767c\u73fe\u904a\u6232\u7248\u672c\u5faa\u
launch.not_finished_downloading_libraries=\u672a\u5b8c\u6210\u904a\u6232\u4f9d\u8cf4\u5eab\u7684\u4e0b\u8f09\uff0c\u9084\u8981\u7e7c\u7e8c\u555f\u52d5\u904a\u6232\u55ce\uff1f
launch.not_finished_decompressing_natives=\u672a\u80fd\u89e3\u58d3\u904a\u6232\u672c\u5730\u5eab\uff0c\u9084\u8981\u7e7c\u7e8c\u555f\u52d5\u904a\u6232\u55ce\uff1f
launch.wrong_javadir=\u932f\u8aa4\u7684Java\u8def\u5f91\uff0c\u5c07\u81ea\u52d5\u91cd\u7f6e\u70ba\u9ed8\u8a8dJava\u8def\u5f91\u3002
launch.exited_abnormally=\u904a\u6232\u975e\u6b63\u5e38\u9000\u51fa\uff0c\u8acb\u67e5\u770b\u65e5\u8a8c\u6587\u4ef6\uff0c\u6216\u806f\u7e6b\u4ed6\u4eba\u5c0b\u6c42\u5e6b\u52a9\u3002
launch.exited_abnormally=\u904a\u6232\u975e\u6b63\u5e38\u9000\u51fa\uff0c\u8acb\u67e5\u770b\u65e5\u8a8c\u8cc7\u6599\uff0c\u6216\u806f\u7e6b\u4ed6\u4eba\u5c0b\u6c42\u5e6b\u52a9\u3002
install.no_version=\u672a\u627e\u5230\u8981\u5b89\u88dd\u7684\u5c0d\u61c9MC\u7248\u672c
install.no_version_if_intall=\u672a\u627e\u5230\u8981\u5b89\u88dd\u7684\u5c0d\u61c9MC\u7248\u672c\uff0c\u662f\u5426\u81ea\u52a8\u5b89\u88c5\u9700\u8981\u7684MC\u7248\u672c\uff1f
@ -107,10 +107,10 @@ ui.more=\u66f4\u591a
crash.advice.UnsupportedClassVersionError=\u9019\u53ef\u80fd\u662f\u56e0\u70ba\u60a8\u7684Java\u7248\u672c\u904e\u65bc\u8001\u820a\uff0c\u53ef\u4ee5\u5617\u8a66\u66f4\u63db\u6700\u65b0Java\u4e26\u5728\u7248\u672c\u8a2d\u5b9a\u7684Java\u8def\u5f91\u4e2d\u8a2d\u5b9a.
crash.advice.ConcurrentModificationException=\u9019\u53ef\u80fd\u662f\u56e0\u70ba\u60a8\u7684Java\u7248\u672c\u9ad8\u65bcJava 1.8.0_11\u5c0e\u81f4\u7684,\u53ef\u4ee5\u5617\u8a66\u5378\u8f09Java8\u5b89\u88ddJava7\u3002
crash.advice.ClassNotFoundException=Minecraft\u4e0d\u5b8c\u6574\u6216Mod\u885d\u7a81\uff0c\u5982\u679c\u6709\u672a\u80fd\u4e0b\u8f7d\u7684\u6587\u4ef6\u8bf7\u4e0b\u8f7d\u6210\u529f\u540e\u91cd\u8bd5\u6216\u662f\u5ba2\u6237\u7aef\u635f\u574f\u8bf7\u91cd\u8bd5\u8bf7\u91cd\u65b0\u5236\u4f5c\u5ba2\u6237\u7aef\u6216\u4e0b\u8f09\u6574\u5408\u5305\u89e3\u6c7a\u554f\u984c\u3002
crash.advice.NoSuchFieldError=Minecraft\u4e0d\u5b8c\u6574\u6216Mod\u885d\u7a81\uff0c\u5982\u679c\u6709\u672a\u80fd\u4e0b\u8f7d\u7684\u6587\u4ef6\u8bf7\u4e0b\u8f7d\u6210\u529f\u540e\u91cd\u8bd5\u6216\u662f\u5ba2\u6237\u7aef\u635f\u574f\u8bf7\u91cd\u8bd5\u8bf7\u91cd\u65b0\u5236\u4f5c\u5ba2\u6237\u7aef\u6216\u4e0b\u8f09\u6574\u5408\u5305\u89e3\u6c7a\u554f\u984c\u3002
crash.advice.ClassNotFoundException=Minecraft\u4e0d\u5b8c\u6574\u6216Mod\u885d\u7a81\uff0c\u5982\u679c\u6709\u672a\u80fd\u4e0b\u8f7d\u7684\u8cc7\u6599\u8bf7\u4e0b\u8f7d\u6210\u529f\u540e\u91cd\u8bd5\u6216\u662f\u5ba2\u6237\u7aef\u635f\u574f\u8bf7\u91cd\u8bd5\u8bf7\u91cd\u65b0\u5236\u4f5c\u5ba2\u6237\u7aef\u6216\u4e0b\u8f09\u6574\u5408\u5305\u89e3\u6c7a\u554f\u984c\u3002
crash.advice.NoSuchFieldError=Minecraft\u4e0d\u5b8c\u6574\u6216Mod\u885d\u7a81\uff0c\u5982\u679c\u6709\u672a\u80fd\u4e0b\u8f7d\u7684\u8cc7\u6599\u8bf7\u4e0b\u8f7d\u6210\u529f\u540e\u91cd\u8bd5\u6216\u662f\u5ba2\u6237\u7aef\u635f\u574f\u8bf7\u91cd\u8bd5\u8bf7\u91cd\u65b0\u5236\u4f5c\u5ba2\u6237\u7aef\u6216\u4e0b\u8f09\u6574\u5408\u5305\u89e3\u6c7a\u554f\u984c\u3002
crash.advice.LWJGLException=\u60a8\u7684\u7535\u8111\u4e0d\u6b63\u5e38\uff0c\u53ef\u80fd\u9700\u8981\u4f7f\u7528\u9a71\u52a8\u7cbe\u7075\u6216\u5176\u4ed6\u5b89\u88c5\u5668\u66f4\u65b0\u663e\u5361\u9a71\u52a8\u3002
crash.advice.SecurityException=\u53ef\u80fd\u662f\u60a8\u4fee\u6539\u4e86minecraft.jar\u4f46\u672a\u522a\u9664META-INF\u6587\u4ef6\u593e\u7684\u539f\u56e0\u3002\u8acb\u901a\u904e\u58d3\u7e2e\u8edf\u4ef6\u522a\u9664jar\u4e2d\u7684META-INF\u6587\u4ef6\u593e\u3002
crash.advice.SecurityException=\u53ef\u80fd\u662f\u60a8\u4fee\u6539\u4e86minecraft.jar\u4f46\u672a\u522a\u9664META-INF\u8cc7\u6599\u593e\u7684\u539f\u56e0\u3002\u8acb\u901a\u904e\u58d3\u7e2e\u8edf\u4ef6\u522a\u9664jar\u4e2d\u7684META-INF\u8cc7\u6599\u593e\u3002
crash.advice.OutOfMemoryError=\u5185\u5b58\u6ea2\u51fa\uff0c\u60a8\u8bbe\u7f6e\u7684Minecraft\u6700\u5927\u5185\u5b58\u8fc7\u5c0f\uff0c\u8bf7\u8c03\u5927\uff01
crash.advice.otherwise=\u53ef\u80fd\u662fMod\u6216\u5176\u4ed6\u554f\u984c\u3002
@ -124,7 +124,7 @@ crash.headless=\u5982\u679c\u60a8\u7684\u64cd\u4f5c\u7cfb\u7d71\u662fLinux\uff0c
crash.NoClassDefFound=\u8acb\u78ba\u8a8dHMCL\u672c\u9ad4\u662f\u5426\u5b8c\u6574
crash.error=\u60a8\u7684Minecraft\u5d29\u6f70\u4e86\u3002
crash.main_class_not_found=\u627e\u4e0d\u5230\u4e3b\u985e\uff0c\u53ef\u80fd\u662f\u60a8\u7684JSON\u6587\u4ef6\u586b\u5beb\u932f\u8aa4\u3002\u7121\u6cd5\u555f\u52d5\u904a\u6232\u3002\u53ef\u4ee5\u901a\u904e\u4e0b\u8f09\u6574\u5408\u5305\u89e3\u6c7a\u554f\u984c\u3002
crash.main_class_not_found=\u627e\u4e0d\u5230\u4e3b\u985e\uff0c\u53ef\u80fd\u662f\u60a8\u7684JSON\u8cc7\u6599\u586b\u5beb\u932f\u8aa4\u3002\u7121\u6cd5\u555f\u52d5\u904a\u6232\u3002\u53ef\u4ee5\u901a\u904e\u4e0b\u8f09\u6574\u5408\u5305\u89e3\u6c7a\u554f\u984c\u3002
crash.class_path_wrong=\u89e3\u6790Class Path\u6642\u51fa\u73fe\u932f\u8aa4\uff0c\u6b64\u932f\u8aa4\u672c\u4e0d\u61c9\u8a72\u767c\u751f\u3002\u53ef\u80fd\u662f\u555f\u52d5\u8173\u672c\u932f\u8aa4\uff0c\u8acb\u4ed4\u7d30\u6aa2\u67e5\u555f\u52d5\u8173\u672c\u3002
ui.label.newProfileWindow.new_profile_name=\u65b0\u914d\u7f6e\u540d:
@ -175,17 +175,17 @@ download.failed=\u4e0b\u8f09\u5931\u6557
download.successfully=\u4e0b\u8f09\u5b8c\u6210
message.error=\u932f\u8aa4
message.cannot_open_explorer=\u7121\u6cd5\u6253\u958b\u6587\u4ef6\u7ba1\u7406\u5668:
message.cannot_open_explorer=\u7121\u6cd5\u6253\u958b\u8cc7\u6599\u7ba1\u7406\u5668:
message.cancelled=\u5df2\u53d6\u6d88
message.info=\u63d0\u793a
folder.game=\u904a\u6232\u6587\u4ef6\u593e
folder.mod=MOD\u6587\u4ef6\u593e
folder.coremod=\u6838\u5fc3MOD\u6587\u4ef6\u593e
folder.config=\u914d\u7f6e\u6587\u4ef6\u593e
folder.resourcepacks=\u8cc7\u6e90\u5305\u6587\u4ef6\u593e
folder.screenshots=\u622a\u5716\u6587\u4ef6\u593e
folder.saves=\u5b58\u6a94\u6587\u4ef6\u593e
folder.game=\u904a\u6232\u8cc7\u6599\u593e
folder.mod=MOD\u8cc7\u6599\u593e
folder.coremod=\u6838\u5fc3MOD\u8cc7\u6599\u593e
folder.config=\u914d\u7f6e\u8cc7\u6599\u593e
folder.resourcepacks=\u8cc7\u6e90\u5305\u8cc7\u6599\u593e
folder.screenshots=\u622a\u5716\u8cc7\u6599\u593e
folder.saves=\u5b58\u6a94\u8cc7\u6599\u593e
settings.tabs.game_download=\u904a\u6232\u4e0b\u8f09
settings.tabs.installers=\u81ea\u52d5\u5b89\u88dd
@ -200,25 +200,28 @@ settings.java_dir=Java\u8def\u5f91
settings.game_directory=\u904a\u6232\u8def\u5f91
settings.dimension=\u5206\u8fa8\u7387
settings.fullscreen=\u5168\u5c4f
settings.update_version=\u66f4\u65b0\u7248\u672c\u6587\u4ef6
settings.update_version=\u66f4\u65b0\u7248\u672c\u8cc7\u6599
settings.physical_memory=\u7269\u7406\u5185\u5b58\u5927\u5c0f
settings.choose_javapath=\u9009\u62e9Java\u8def\u5f84
settings.default=\u9ed8\u8a8d
settings.custom=\u81ea\u5b9a\u7fa9
settings.choose_gamedir=\u9009\u62e9\u6e38\u620f\u8def\u5f84
settings.failed_load=\u8a2d\u5b9a\u6587\u4ef6\u52a0\u8f09\u5931\u6557\uff0c\u53ef\u80fd\u662f\u5347\u7d1a\u4e86\u555f\u52d5\u5668\u6216\u88ab\u4eba\u5de5\u4fee\u6539\u9020\u6210\u932f\u8aa4\uff0c\u662f\u5426\u6e05\u9664\uff1f
settings.failed_load=\u8a2d\u5b9a\u8cc7\u6599\u52a0\u8f09\u5931\u6557\uff0c\u53ef\u80fd\u662f\u5347\u7d1a\u4e86\u555f\u52d5\u5668\u6216\u88ab\u4eba\u5de5\u4fee\u6539\u9020\u6210\u932f\u8aa4\uff0c\u662f\u5426\u6e05\u9664\uff1f
modpack=\u61f6\u4eba\u5305
modpack.choose=\u9078\u64c7\u8981\u5c0e\u5165\u7684\u904a\u6232\u61f6\u4eba\u5305\u6587\u4ef6\uff0c\u5982\u679c\u60a8\u5e0c\u671b\u66f4\u65b0\u6574\u5408\u5305\uff0c\u8bf7\u8f93\u5165\u8981\u66f4\u65b0\u7684\u7248\u672c\u540d
modpack.choose=\u9078\u64c7\u8981\u5c0e\u5165\u7684\u904a\u6232\u61f6\u4eba\u5305\u8cc7\u6599\uff0c\u5982\u679c\u60a8\u5e0c\u671b\u66f4\u65b0\u6574\u5408\u5305\uff0c\u8bf7\u8f93\u5165\u8981\u66f4\u65b0\u7684\u7248\u672c\u540d
modpack.install.task=\u5c0e\u5165\u61f6\u4eba\u5305
modpack.install_error=\u5b89\u88dd\u5931\u6557\uff0c\u53ef\u80fd\u662f\u6574\u5408\u5305\u683c\u5f0f\u4e0d\u6b63\u78ba\u6216\u64cd\u4f5c\u6587\u4ef6\u5931\u6557
modpack.install_error=\u5b89\u88dd\u5931\u6557\uff0c\u53ef\u80fd\u662f\u6574\u5408\u5305\u683c\u5f0f\u4e0d\u6b63\u78ba\u6216\u64cd\u4f5c\u8cc7\u6599\u5931\u6557
modpack.save=\u9078\u64c7\u8981\u5c0e\u51fa\u5230\u7684\u904a\u6232\u61f6\u4eba\u5305\u4f4d\u7f6e
modpack.save.task=\u5c0e\u51fa\u61f6\u4eba\u5305
modpack.export_error=\u5c0e\u51fa\u5931\u6557\uff0c\u53ef\u80fd\u662f\u60a8\u7684\u904a\u6232\u6587\u4ef6\u593e\u683c\u5f0f\u4e0d\u6b63\u78ba\u6216\u64cd\u4f5c\u6587\u4ef6\u5931\u6557
modpack.export_error=\u5c0e\u51fa\u5931\u6557\uff0c\u53ef\u80fd\u662f\u60a8\u7684\u904a\u6232\u8cc7\u6599\u593e\u683c\u5f0f\u4e0d\u6b63\u78ba\u6216\u64cd\u4f5c\u8cc7\u6599\u5931\u6557
modpack.export_finished=\u61f6\u4eba\u5305\u5c0e\u51fa\u5b8c\u6210\uff0c\u53c2\u89c1
modpack.enter_name=\u7d66\u904a\u6232\u8d77\u500b\u4f60\u559c\u6b61\u7684\u540d\u5b57
modpack.wizard=\u5c0e\u51fa\u61f6\u4eba\u5305\u56ae\u5c0e
modpack.wizard.step.1=\u57fa\u672c\u8a2d\u5b9a
modpack.wizard.step.1.title=\u8a2d\u7f6e\u61f6\u4eba\u5305\u7684\u4e3b\u8981\u4fe1\u606f
modpack.wizard.step.2=\u8cc7\u6599\u9078\u64c7
modpack.wizard.step.2.title=\u9078\u4e2d\u4f60\u4e0d\u60f3\u52a0\u5230\u6574\u5408\u5305\u4e2d\u7684\u8cc7\u6599(\u593e)
modpack.incorrect_format.no_json=\u61f6\u4eba\u5305\u683c\u5f0f\u932f\u8aa4\uff0cpack.json\u4e1f\u5931
modpack.incorrect_format.no_jar=\u61f6\u4eba\u5305\u683c\u5f0f\u932f\u8aa4\uff0cpack.json\u4e1f\u5931jar\u5b57\u6bb5
modpack.cannot_read_version=\u8b80\u53d6\u904a\u6232\u7248\u672c\u5931\u6557
@ -253,7 +256,7 @@ advancedsettings.cancel_wrapper_launcher=\u53d6\u6d88\u5305\u88f9\u555f\u52d5\u5
mainwindow.show_log=\u67e5\u770b\u65e5\u8a8c
mainwindow.make_launch_script=\u751f\u6210\u555f\u52d5\u8173\u672c
mainwindow.make_launch_script_failed=\u751f\u6210\u555f\u52d5\u8173\u672c\u5931\u6557
mainwindow.enter_script_name=\u8f38\u5165\u8981\u751f\u6210\u8173\u672c\u7684\u6587\u4ef6\u540d
mainwindow.enter_script_name=\u8f38\u5165\u8981\u751f\u6210\u8173\u672c\u7684\u8cc7\u6599\u540d
mainwindow.make_launch_succeed=\u555f\u52d5\u8173\u672c\u5df2\u751f\u6210\u5b8c\u7562:
mainwindow.no_version=\u672a\u627e\u5230\u4efb\u4f55\u7248\u672c\uff0c\u662f\u5426\u9032\u5165\u904a\u6232\u4e0b\u8f09\uff1f
@ -261,11 +264,11 @@ launcher.about=<html>\u9ed8\u8a8d\u80cc\u666f\u5716\u4f86\u81eaLiberty Dome\u670
launcher.download_source=\u4e0b\u8f09\u6e90
launcher.background_location=\u80cc\u666f\u5730\u5740
launcher.exit_failed=\u5f37\u5236\u9000\u51fa\u5931\u6557\uff0c\u53ef\u80fd\u662fForge 1.7.10\u53ca\u66f4\u9ad8\u7248\u672c\u5c0e\u81f4\u7684\uff0c\u7121\u6cd5\u89e3\u6c7a\u3002
launcher.versions_json_not_matched=\u7248\u672c%s\u683c\u5f0f\u4e0d\u898f\u7bc4\uff01\u8a72\u7248\u672c\u6587\u4ef6\u593e\u4e0b\u6709json:%s\uff0c\u662f\u5426\u66f4\u540d\u9019\u500b\u6587\u4ef6\u4f86\u898f\u7bc4\u683c\u5f0f\uff1f
launcher.versions_json_not_matched_cannot_auto_completion=\u7248\u672c%s\u7f3a\u5931\u5fc5\u8981\u7684\u7248\u672c\u4fe1\u606f\u6587\u4ef6\uff0c\u662f\u5426\u5220\u9664\u8be5\u7248\u672c\uff1f
launcher.versions_json_not_formatted=\u7248\u672c%s\u4fe1\u606f\u6587\u4ef6\u683c\u5f0f\u9519\u8bef\uff0c\u662f\u5426\u91cd\u65b0\u4e0b\u8f7d\uff1f
launcher.versions_json_not_matched=\u7248\u672c%s\u683c\u5f0f\u4e0d\u898f\u7bc4\uff01\u8a72\u7248\u672c\u8cc7\u6599\u593e\u4e0b\u6709json:%s\uff0c\u662f\u5426\u66f4\u540d\u9019\u500b\u8cc7\u6599\u4f86\u898f\u7bc4\u683c\u5f0f\uff1f
launcher.versions_json_not_matched_cannot_auto_completion=\u7248\u672c%s\u7f3a\u5931\u5fc5\u8981\u7684\u7248\u672c\u4fe1\u606f\u8cc7\u6599\uff0c\u662f\u5426\u5220\u9664\u8be5\u7248\u672c\uff1f
launcher.versions_json_not_formatted=\u7248\u672c%s\u4fe1\u606f\u8cc7\u6599\u683c\u5f0f\u9519\u8bef\uff0c\u662f\u5426\u91cd\u65b0\u4e0b\u8f7d\uff1f
launcher.choose_bgpath=\u9078\u64c7\u80cc\u666f\u8def\u5f91
launcher.background_tooltip=<html>\n<body>\n\u555f\u52d5\u5668\u9ed8\u8a8d\u4f7f\u7528\u81ea\u5e36\u7684\u80cc\u666f<br />\n\u5982\u679c\u7576\u524d\u76ee\u9304\u6709background.png\uff0c\u5247\u6703\u4f7f\u7528\u8a72\u6587\u4ef6\u4f5c\u70ba\u80cc\u666f<br />\n\u5982\u679c\u7576\u524d\u76ee\u9304\u6709bg\u5b50\u76ee\u9304\uff0c\u5247\u6703\u96a8\u6a5f\u4f7f\u7528\u88e1\u9762\u7684\u4e00\u5f35\u5716\u4f5c\u70ba\u80cc\u666f<br />\n\u5982\u679c\u8a72\u80cc\u666f\u5730\u5740\u88ab\u4fee\u6539\uff0c\u5247\u6703\u4f7f\u7528\u80cc\u666f\u5730\u5740\u88e1\u7684\u4e00\u5f35\u5716\u4f5c\u70ba\u80cc\u666f<br />\n\u80cc\u666f\u5730\u5740\u5141\u8a31\u6709\u591a\u500b\u5730\u5740\uff0c\u4f7f\u7528\u534a\u89d2\u5206\u865f";"(\u4e0d\u5305\u542b\u96d9\u5f15\u865f)\u5206\u9694\n</body>\n</html>
launcher.background_tooltip=<html>\n<body>\n\u555f\u52d5\u5668\u9ed8\u8a8d\u4f7f\u7528\u81ea\u5e36\u7684\u80cc\u666f<br />\n\u5982\u679c\u7576\u524d\u76ee\u9304\u6709background.png\uff0c\u5247\u6703\u4f7f\u7528\u8a72\u8cc7\u6599\u4f5c\u70ba\u80cc\u666f<br />\n\u5982\u679c\u7576\u524d\u76ee\u9304\u6709bg\u5b50\u76ee\u9304\uff0c\u5247\u6703\u96a8\u6a5f\u4f7f\u7528\u88e1\u9762\u7684\u4e00\u5f35\u5716\u4f5c\u70ba\u80cc\u666f<br />\n\u5982\u679c\u8a72\u80cc\u666f\u5730\u5740\u88ab\u4fee\u6539\uff0c\u5247\u6703\u4f7f\u7528\u80cc\u666f\u5730\u5740\u88e1\u7684\u4e00\u5f35\u5716\u4f5c\u70ba\u80cc\u666f<br />\n\u80cc\u666f\u5730\u5740\u5141\u8a31\u6709\u591a\u500b\u5730\u5740\uff0c\u4f7f\u7528\u534a\u89d2\u5206\u865f";"(\u4e0d\u5305\u542b\u96d9\u5f15\u865f)\u5206\u9694\n</body>\n</html>
launcher.update_launcher=\u68c0\u67e5\u66f4\u65b0
launcher.enable_shadow=\u542f\u7528\u7a97\u53e3\u9634\u5f71(\u91cd\u542f\u542f\u52a8\u5668\u751f\u6548)
launcher.theme=\u4e3b\u9898
@ -291,7 +294,7 @@ versions.manage.redownload_assets_index=\u91cd\u65b0\u4e0b\u8f09\u8cc7\u6e90\u91
advice.os64butjdk32=\u60a8\u7684\u7cfb\u7d71\u662f64\u4f4d\u7684\u4f46\u662fJava\u662f32\u4f4d\u7684\uff0c\u63a8\u85a6\u60a8\u5b89\u88dd64\u4f4dJava.
assets.download_all=\u4e0b\u8f7d\u8d44\u6e90\u6587\u4ef6
assets.download_all=\u4e0b\u8f7d\u8d44\u6e90\u8cc7\u6599
assets.not_refreshed=\u8cc7\u6e90\u5217\u8868\u672a\u5237\u65b0\uff0c\u8acb\u5237\u65b0\u4e00\u6b21\u3002
assets.failed=\u7372\u53d6\u5217\u8868\u5931\u6557\uff0c\u8acb\u5237\u65b0\u91cd\u8a66\u3002
assets.list.1_7_3_after=1.7.3\u53ca\u4ee5\u5f8c
@ -299,8 +302,8 @@ assets.list.1_6=1.6(BMCLAPI)
assets.unkown_type_select_one=\u7121\u6cd5\u89e3\u6790\u904a\u6232\u7248\u672c\uff1a%s\uff0c\u8acb\u9078\u64c7\u4e00\u7a2e\u8cc7\u6e90\u985e\u578b\u4e0b\u8f09\u3002
assets.type=\u8cc7\u6e90\u985e\u578b
assets.download=\u4e0b\u8f09\u8cc7\u6e90
assets.no_assets=\u8cc7\u6e90\u6587\u4ef6\u4e0d\u5b8c\u6574\uff0c\u662f\u5426\u88dc\u5168\uff1f
assets.failed_download=\u4e0b\u8f09\u8cc7\u6e90\u6587\u4ef6\u5931\u6557\uff0c\u53ef\u80fd\u5c0e\u81f4\u6c92\u6709\u4e2d\u6587\u548c\u8072\u97f3\u3002
assets.no_assets=\u8cc7\u6e90\u8cc7\u6599\u4e0d\u5b8c\u6574\uff0c\u662f\u5426\u88dc\u5168\uff1f
assets.failed_download=\u4e0b\u8f09\u8cc7\u6e90\u8cc7\u6599\u5931\u6557\uff0c\u53ef\u80fd\u5c0e\u81f4\u6c92\u6709\u4e2d\u6587\u548c\u8072\u97f3\u3002
gamedownload.not_refreshed=\u904a\u6232\u4e0b\u8f09\u5217\u8868\u672a\u5237\u65b0\uff0c\u8acb\u518d\u5237\u65b0\u4e00\u6b21\u3002
@ -312,12 +315,12 @@ taskwindow.no_more_instance=\u53ef\u80fd\u540c\u6642\u6253\u958b\u4e86\u591a\u50
taskwindow.file_name=\u4efb\u52d9
taskwindow.download_progress=\u9032\u5ea6
setupwindow.include_minecraft=\u5c0e\u5165\u904a\u6232\u6587\u4ef6\u593e
setupwindow.include_minecraft=\u5c0e\u5165\u904a\u6232\u8cc7\u6599\u593e
setupwindow.find_in_configurations=\u5c0e\u5165\u5b8c\u6210\uff0c\u5feb\u5230\u914d\u7f6e\u4e0b\u62c9\u6846\u4e2d\u627e\u65b0\u904a\u6232\u8def\u5f91\u5427\uff01
setupwindow.give_a_name=\u7d66\u65b0\u904a\u6232\u8def\u5f91\u8d77\u500b\u540d\u5b57\u5427
setupwindow.new=\u65b0\u5efa
setupwindow.no_empty_name=\u540d\u5b57\u4e0d\u53ef\u70ba\u7a7a
setupwindow.clean=\u6e05\u7406\u904a\u6232\u6587\u4ef6
setupwindow.clean=\u6e05\u7406\u904a\u6232\u8cc7\u6599
update.no_browser=\u7121\u6cd5\u6253\u958b\u700f\u89bd\u5668\uff0c\u7db2\u5740\u5df2\u7d93\u5fa9\u88fd\u5230\u526a\u8cbc\u677f\u4e86\uff0c\u60a8\u53ef\u4ee5\u624b\u52d5\u7c98\u8cbc\u7db2\u5740\u6253\u958b\u9801\u9762
update.should_open_link=\u662f\u5426\u524d\u5f80\u767c\u5e03\u9801\u9762\u66f4\u65b0\uff1f
@ -339,7 +342,7 @@ serverlistview.info=\u4fe1\u606f
minecraft.invalid=\u7121\u6548\u7684
minecraft.invalid_jar=\u7121\u6548\u7684jar\u5305
minecraft.not_a_file=\u4e0d\u662f\u6587\u4ef6
minecraft.not_a_file=\u4e0d\u662f\u8cc7\u6599
minecraft.not_found=\u627e\u4e0d\u5230minecraft.jar
minecraft.not_readable=minecraft.jar\u4e0d\u53ef\u8b80
minecraft.modified=(\u4fee\u6539\u7684!)

View File

@ -215,10 +215,13 @@ modpack.install_error=\u5b89\u88c5\u5931\u8d25\uff0c\u53ef\u80fd\u662f\u6574\u54
modpack.save=\u9009\u62e9\u8981\u5bfc\u51fa\u5230\u7684\u6e38\u620f\u6574\u5408\u5305\u4f4d\u7f6e
modpack.save.task=\u5bfc\u51fa\u6574\u5408\u5305
modpack.export_error=\u5bfc\u51fa\u5931\u8d25\uff0c\u53ef\u80fd\u662f\u60a8\u7684\u6e38\u620f\u6587\u4ef6\u5939\u683c\u5f0f\u4e0d\u6b63\u786e\u6216\u64cd\u4f5c\u6587\u4ef6\u5931\u8d25
modpack.export_finished=\u6574\u5408\u5305\u5bfc\u51fa\u5b8c\u6210\uff0c\u53c2\u89c1
modpack.enter_name=\u7ed9\u6e38\u620f\u8d77\u4e2a\u4f60\u559c\u6b22\u7684\u540d\u5b57
modpack.wizard=\u5bfc\u51fa\u6574\u5408\u5305\u5411\u5bfc
modpack.wizard.step.1=\u57fa\u672c\u8bbe\u7f6e
modpack.wizard.step.1.title=\u8bbe\u7f6e\u6574\u5408\u5305\u7684\u4e3b\u8981\u4fe1\u606f
modpack.wizard.step.2=\u6587\u4ef6\u9009\u62e9
modpack.wizard.step.2.title=\u9009\u4e2d\u4f60\u4e0d\u60f3\u52a0\u5230\u6574\u5408\u5305\u4e2d\u7684\u6587\u4ef6(\u5939)
modpack.incorrect_format.no_json=\u6574\u5408\u5305\u683c\u5f0f\u9519\u8bef\uff0cpack.json\u4e22\u5931
modpack.incorrect_format.no_jar=\u6574\u5408\u5305\u683c\u5f0f\u9519\u8bef\uff0cpack.json\u4e22\u5931jar\u5b57\u6bb5
modpack.cannot_read_version=\u8bfb\u53d6\u6e38\u620f\u7248\u672c\u5931\u8d25

View File

@ -22,6 +22,7 @@ import java.io.IOException;
import java.text.ParseException;
import java.util.Map;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.plaf.synth.SynthLookAndFeel;
import org.jackhuang.hellominecraft.utils.logging.HMCLog;
import org.jackhuang.hellominecraft.utils.NetUtils;

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

View File

@ -380,7 +380,8 @@
<color id="color" value="#FF0000" />
<color id="gridColor" value="#1E7B87" />
<defaultsProperty key="Table.gridColor" type="idref" value="gridColor"/>
<defaultsProperty key="Table.background" type="idref" value="gridColor"/>
<defaultsProperty key="Table.background" type="idref" value="gridColor"/>
<defaultsProperty key="TabbedPane.selectedLabelShift" type="integer" value="0"/>
</style>
<bind style="table" type="region" key="Table"/>
<style id="defaultBackground">
@ -390,4 +391,56 @@
</state>
</style>
<bind style="defaultBackground" type="region" key="Table.*"/>
<!-- TREE-->
<style id="tree">
<defaultsProperty key="Tree.leftChildIndent" type="integer" value="7"/>
<defaultsProperty key="Tree.rightChildIndent" type="integer" value="4"/>
<defaultsProperty key="Tree.rowHeight" type="integer" value="20"/>
<property key="Tree.leftChildIndent" type="integer" value="7"/>
<property key="Tree.rightChildIndent" type="integer" value="4"/>
<property key="Tree.rowHeight" type="integer" value="20"/>
<defaultsProperty key="Tree.scrollsHorizontallyAndVertically" type="boolean" value="true"/>
<defaultsProperty key="Tree.rendererUseTreeColors" type="boolean" value="true"/>
<property key="Tree.rendererUseTreeColors" type="boolean" value="true"/>
<property key="Tree.scrollsHorizontallyAndVertically" type="boolean" value="true"/>
<property key="Tree.drawHorizontalLines" type="boolean" value="false"/>
<property key="Tree.drawVerticalLines" type="boolean" value="false"/>
<property key="Tree.repaintWholeRow" type="boolean" value="true"/>
<color id="Tree.dropLineColor" value="#000000"/>
<imageIcon id="treeClosedIcon" path="images/tree_closed.gif" />
<imageIcon id="treeOpenIcon" path="images/tree_open.gif" />
<imageIcon id="treecollapsedicon" path="images/tree_collapsed.gif"/>
<imageIcon id="treeexpandedicon" path="images/tree_expanded.gif"/>
<imageIcon id="treeleaficon" path="images/tree_leaf.gif"/>
<property key="Tree.collapsedIcon" value="treecollapsedicon"/>
<property key="Tree.expandedIcon" value="treeexpandedicon"/>
<defaultsProperty key="Tree.openIcon" value="treeOpenIcon"/>
<defaultsProperty key="Tree.closedIcon" value="treeClosedIcon"/>
<defaultsProperty key="Tree.leafIcon" value="treeleaficon"/>
<insets top="3" left="8" bottom="3" right="8"/>
</style>
<bind style="tree" type="region" key="Tree"/>
<style id="treecell" >
<opaque value="false"/>
<state>
<color value="#000000" type="TEXT_FOREGROUND"/>
<color value="#FFFFFF" type="BACKGROUND"/>
</state>
<state value="SELECTED">
<color value="#EEEEEE" type="BACKGROUND"/>
<color value="#000000" type="TEXT_FOREGROUND"/>
</state>
</style>
<bind style="treecell" type="region" key="TreeCell"/>
</synth>

View File

@ -390,4 +390,48 @@
</state>
</style>
<bind style="defaultBackground" type="region" key="Table.*"/>
<int id="Tree.leftChildIndent">6</int>
<!-- TREE -->
<style id="tree">
<!-- Adding child indentation adn scrolling policy -->
<property key="Tree.rightChildIndent" type="integer" value="12"/>
<property key="Tree.scrollsHorizontallyAndVertically" type="boolean" value="true"/>
<imageIcon id="treeClosedIcon" path="images/tree_closed.gif" />
<imageIcon id="treeOpenIcon" path="images/tree_open.gif" />
<imageIcon id="treecollapsedicon" path="images/tree_collapsed.png"/>
<imageIcon id="treeexpandedicon" path="images/tree_expanded.png"/>
<imageIcon id="treeleaficon" path="images/tree_leaf.gif"/>
<property key="Tree.collapsedIcon" value="treecollapsedicon"/>
<property key="Tree.expandedIcon" value="treeexpandedicon"/>
<defaultsProperty key="Tree.openIcon" value="treeOpenIcon"/>
<defaultsProperty key="Tree.closedIcon" value="treeClosedIcon"/>
<defaultsProperty key="Tree.leafIcon" value="treeleaficon"/>
<state>
<color value="#FFFFFF" type="BACKGROUND"/>
<color value="#A0A0A0" type="FOREGROUND"/>
</state>
<insets top="3" left="8" bottom="3" right="8"/>
</style>
<bind style="tree" type="region" key="Tree"/>
<style id="treecell" >
<opaque value="true"/>
<state>
<color value="#000000" type="TEXT_FOREGROUND"/>
<color value="#FFFFFF" type="BACKGROUND"/>
</state>
<state value="SELECTED">
<color value="#EEEEEE" type="BACKGROUND"/>
<color value="#000000" type="TEXT_FOREGROUND"/>
</state>
</style>
<defaultsProperty key="TreeUI" type="string" value="javax.swing.plaf.metal.MetalTreeUI"/>
<!--bind style="treecell" type="region" key="TreeCell"/-->
</synth>