Added game files descriptions in modpack file selection ui

This commit is contained in:
huangyuhui
2016-02-14 13:03:22 +08:00
parent a567ab1984
commit 814d137084
17 changed files with 218 additions and 25 deletions

View File

@@ -48,7 +48,11 @@ public final class Utils {
}
}
public static String[] getURL() {
public static URL[] getURL() {
return ((URLClassLoader) Utils.class.getClassLoader()).getURLs();
}
public static String[] getURLString() {
URL[] urls = ((URLClassLoader) Utils.class.getClassLoader()).getURLs();
String[] urlStrings = new String[urls.length];
for (int i = 0; i < urlStrings.length; i++)

View File

@@ -27,6 +27,7 @@ import javax.swing.JTree;
import javax.swing.UIManager;
import javax.swing.plaf.ColorUIResource;
import javax.swing.tree.TreeCellRenderer;
import org.jackhuang.hellominecraft.util.Pair;
public class CheckBoxTreeCellRenderer extends JPanel implements TreeCellRenderer {

View File

@@ -18,6 +18,7 @@
package org.jackhuang.hellominecraft.util.ui.checktree;
import javax.swing.tree.DefaultMutableTreeNode;
import org.jackhuang.hellominecraft.util.Pair;
/**
*
@@ -40,6 +41,14 @@ public class CheckBoxTreeNode extends DefaultMutableTreeNode {
this.isSelected = isSelected;
}
@Override
public String toString() {
if (userObject instanceof Pair)
return "<html>" + ((Pair) userObject).key + "<font color=gray>&nbsp;-&nbsp;" + ((Pair) userObject).value + "</font></html>";
else
return userObject.toString();
}
public boolean isSelected() {
return isSelected;
}