mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-01 16:04:35 +00:00
@@ -86,6 +86,8 @@ public class GenericTagTreePanel extends GenericTagPanel {
|
||||
|
||||
private Tag editedTag;
|
||||
|
||||
private static final Map<Class, List<Field>> fieldCache = new HashMap<>();
|
||||
|
||||
private class MyTree extends JTree {
|
||||
|
||||
public MyTree() {
|
||||
@@ -821,22 +823,26 @@ public class GenericTagTreePanel extends GenericTagPanel {
|
||||
}
|
||||
|
||||
private static List<Field> getAvailableFields(Class<?> cls) {
|
||||
List<Field> ret = new ArrayList<>();
|
||||
Field fields[] = cls.getFields();
|
||||
for (Field f : fields) {
|
||||
if (Modifier.isStatic(f.getModifiers())) {
|
||||
continue;
|
||||
List<Field> ret = fieldCache.get(cls);
|
||||
if (ret == null) {
|
||||
ret = new ArrayList<>();
|
||||
Field fields[] = cls.getFields();
|
||||
for (Field f : fields) {
|
||||
if (Modifier.isStatic(f.getModifiers())) {
|
||||
continue;
|
||||
}
|
||||
f.setAccessible(true);
|
||||
Internal inter = f.getAnnotation(Internal.class);
|
||||
if (inter != null) {
|
||||
continue;
|
||||
}
|
||||
HideInRawEdit hide = f.getAnnotation(HideInRawEdit.class);
|
||||
if (hide != null) {
|
||||
continue;
|
||||
}
|
||||
ret.add(f);
|
||||
}
|
||||
f.setAccessible(true);
|
||||
Internal inter = f.getAnnotation(Internal.class);
|
||||
if (inter != null) {
|
||||
continue;
|
||||
}
|
||||
HideInRawEdit hide = f.getAnnotation(HideInRawEdit.class);
|
||||
if (hide != null) {
|
||||
continue;
|
||||
}
|
||||
ret.add(f);
|
||||
fieldCache.put(cls, ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -372,9 +372,10 @@ public class TagTree extends JTree {
|
||||
ret = Arrays.asList(DefineButtonTag.ID, DefineButton2Tag.ID);
|
||||
break;
|
||||
case TagTreeModel.FOLDER_FONTS:
|
||||
ret = Arrays.asList(DefineFontTag.ID, DefineFont2Tag.ID, DefineFont3Tag.ID, DefineFont4Tag.ID);
|
||||
if (gfx) {
|
||||
ret.add(DefineCompactedFont.ID);
|
||||
ret = Arrays.asList(DefineFontTag.ID, DefineFont2Tag.ID, DefineFont3Tag.ID, DefineFont4Tag.ID, DefineCompactedFont.ID);
|
||||
} else {
|
||||
ret = Arrays.asList(DefineFontTag.ID, DefineFont2Tag.ID, DefineFont3Tag.ID, DefineFont4Tag.ID);
|
||||
}
|
||||
break;
|
||||
case TagTreeModel.FOLDER_BINARY_DATA:
|
||||
|
||||
Reference in New Issue
Block a user