mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-26 10:07:56 +00:00
Few javadocs
This commit is contained in:
@@ -1035,6 +1035,11 @@ public final class Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get FFDec home directory
|
||||
*
|
||||
* @return FFDec home directory
|
||||
*/
|
||||
public static String getFFDecHome() {
|
||||
if (directory == unspecifiedFile) {
|
||||
directory = null;
|
||||
@@ -1118,6 +1123,10 @@ public final class Configuration {
|
||||
return FontHelper.stringToFont(sourceFontString.get());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get recent files
|
||||
* @return List of recent files
|
||||
*/
|
||||
public static List<String> getRecentFiles() {
|
||||
String files = recentFiles.get();
|
||||
if (files == null || files.isEmpty()) {
|
||||
@@ -1126,6 +1135,10 @@ public final class Configuration {
|
||||
return Arrays.asList(files.split("::"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add recent file
|
||||
* @param path Path to file
|
||||
*/
|
||||
public static void addRecentFile(String path) {
|
||||
List<String> recentFilesArray = new ArrayList<>(getRecentFiles());
|
||||
int idx = recentFilesArray.indexOf(path);
|
||||
@@ -1139,6 +1152,10 @@ public final class Configuration {
|
||||
recentFiles.set(Helper.joinStrings(recentFilesArray, "::"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove recent file
|
||||
* @param path Path to file
|
||||
*/
|
||||
public static void removeRecentFile(String path) {
|
||||
List<String> recentFilesArray = new ArrayList<>(getRecentFiles());
|
||||
int idx = recentFilesArray.indexOf(path);
|
||||
@@ -1148,6 +1165,10 @@ public final class Configuration {
|
||||
recentFiles.set(Helper.joinStrings(recentFilesArray, "::"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get font to name map
|
||||
* @return Font to name map
|
||||
*/
|
||||
public static Map<String, String> getFontToNameMap() {
|
||||
HashMap<String, String> map = fontPairingMap.get();
|
||||
if (map == null) {
|
||||
@@ -1158,6 +1179,13 @@ public final class Configuration {
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add font pair
|
||||
* @param fileName File name
|
||||
* @param fontId Font ID
|
||||
* @param fontName Font name
|
||||
* @param installedName Installed name
|
||||
*/
|
||||
public static void addFontPair(String fileName, int fontId, String fontName, String installedName) {
|
||||
Map<String, String> fontPairs = getFontToNameMap();
|
||||
fontPairs.put(fontName, installedName);
|
||||
@@ -1166,6 +1194,11 @@ public final class Configuration {
|
||||
swfConf.fontPairingMap.put(fontId + "_" + fontName, installedName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get per-swf configuration.
|
||||
* @param fileName SWF File name
|
||||
* @return SWF specific configuration, null if not found
|
||||
*/
|
||||
public static SwfSpecificConfiguration getSwfSpecificConfiguration(String fileName) {
|
||||
HashMap<String, SwfSpecificConfiguration> map = swfSpecificConfigs.get();
|
||||
if (map == null) {
|
||||
@@ -1176,6 +1209,11 @@ public final class Configuration {
|
||||
return map.get(fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get or create per-swf configuration.
|
||||
* @param fileName SWF File name
|
||||
* @return SWF specific configuration
|
||||
*/
|
||||
public static SwfSpecificConfiguration getOrCreateSwfSpecificConfiguration(String fileName) {
|
||||
SwfSpecificConfiguration swfConf = getSwfSpecificConfiguration(fileName);
|
||||
if (swfConf == null) {
|
||||
@@ -1186,6 +1224,11 @@ public final class Configuration {
|
||||
return swfConf;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get per-swf custom configuration.
|
||||
* @param fileName SWF File name
|
||||
* @return SWF specific custom configuration, null if not found
|
||||
*/
|
||||
public static SwfSpecificCustomConfiguration getSwfSpecificCustomConfiguration(String fileName) {
|
||||
HashMap<String, SwfSpecificCustomConfiguration> map = swfSpecificCustomConfigs.get();
|
||||
if (map == null) {
|
||||
@@ -1196,6 +1239,11 @@ public final class Configuration {
|
||||
return map.get(fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get or create per-swf custom configuration.
|
||||
* @param fileName SWF File name
|
||||
* @return SWF specific custom configuration
|
||||
*/
|
||||
public static SwfSpecificCustomConfiguration getOrCreateSwfSpecificCustomConfiguration(String fileName) {
|
||||
SwfSpecificCustomConfiguration swfConf = getSwfSpecificCustomConfiguration(fileName);
|
||||
if (swfConf == null) {
|
||||
@@ -1247,6 +1295,9 @@ public final class Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save configuration to file
|
||||
*/
|
||||
public static void saveConfig() {
|
||||
try {
|
||||
saveToFile(getConfigFile());
|
||||
@@ -1268,6 +1319,9 @@ public final class Configuration {
|
||||
//int processorCount = Runtime.getRuntime().availableProcessors();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set configuration fields.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void setConfigurationFields() {
|
||||
try {
|
||||
@@ -1320,6 +1374,11 @@ public final class Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get default value for field
|
||||
* @param field Field
|
||||
* @return Default value
|
||||
*/
|
||||
public static Object getDefaultValue(Field field) {
|
||||
Object defaultValue = null;
|
||||
ConfigurationDefaultBoolean aBool = field.getAnnotation(ConfigurationDefaultBoolean.class);
|
||||
@@ -1347,10 +1406,19 @@ public final class Configuration {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get configuration fields
|
||||
* @return Configuration fields
|
||||
*/
|
||||
public static Map<String, Field> getConfigurationFields() {
|
||||
return getConfigurationFields(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get configuration fields
|
||||
* @param lowerCaseNames Lower case names
|
||||
* @return Configuration fields
|
||||
*/
|
||||
public static Map<String, Field> getConfigurationFields(boolean lowerCaseNames) {
|
||||
Field[] fields = Configuration.class.getDeclaredFields();
|
||||
Map<String, Field> result = new HashMap<>();
|
||||
@@ -1367,6 +1435,10 @@ public final class Configuration {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get code formatting
|
||||
* @return Code formatting
|
||||
*/
|
||||
public static CodeFormatting getCodeFormatting() {
|
||||
CodeFormatting ret = new CodeFormatting();
|
||||
String indentString = "";
|
||||
@@ -1378,6 +1450,10 @@ public final class Configuration {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get number of parallel threads
|
||||
* @return Number of parallel threads
|
||||
*/
|
||||
public static int getParallelThreadCount() {
|
||||
int count = parallelSpeedUpThreadCount.get();
|
||||
if (count < 2) {
|
||||
@@ -1387,6 +1463,11 @@ public final class Configuration {
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get folder in FFDec home
|
||||
* @param folder Folder
|
||||
* @return Folder
|
||||
*/
|
||||
public static File getPath(String folder) {
|
||||
String home = getFFDecHome();
|
||||
File dir = new File(home + folder);
|
||||
@@ -1396,10 +1477,18 @@ public final class Configuration {
|
||||
return dir;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get flashlib path
|
||||
* @return Flashlib path
|
||||
*/
|
||||
public static File getFlashLibPath() {
|
||||
return getPath("flashlib");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get projector path
|
||||
* @return Projector path
|
||||
*/
|
||||
public static File getProjectorPath() {
|
||||
return getPath("projector");
|
||||
}
|
||||
@@ -1468,6 +1557,10 @@ public final class Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get player SWC
|
||||
* @return Player SWC
|
||||
*/
|
||||
public static File getPlayerSWC() {
|
||||
String libLocation = playerLibLocation.get("");
|
||||
File ret = null;
|
||||
@@ -1486,6 +1579,10 @@ public final class Configuration {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get AIR SWC
|
||||
* @return AIR SWC
|
||||
*/
|
||||
public static File getAirSWC() {
|
||||
String libLocation = airLibLocation.get("");
|
||||
File ret = null;
|
||||
@@ -1539,6 +1636,11 @@ public final class Configuration {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get projector file
|
||||
* @param exportMode Export mode
|
||||
* @return Projector file
|
||||
*/
|
||||
public static File getProjectorFile(ExeExportMode exportMode) {
|
||||
File projectoDir = getProjectorPath();
|
||||
if (projectoDir != null && projectoDir.exists()) {
|
||||
|
||||
@@ -31,14 +31,31 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public class CharacterRanges {
|
||||
|
||||
/**
|
||||
* Returns the number of available character ranges.
|
||||
*
|
||||
* @return Number of available character ranges
|
||||
*/
|
||||
public static int rangeCount() {
|
||||
return languages.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the character range at the specified index.
|
||||
*
|
||||
* @param index Index of the character range
|
||||
* @return Name of the character range
|
||||
*/
|
||||
public static String rangeName(int index) {
|
||||
return languages.get(index).name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of glyphs in the character range at the specified index.
|
||||
*
|
||||
* @param index Index of the character range
|
||||
* @return Number of glyphs in the character range
|
||||
*/
|
||||
public static int glyphCount(int index) {
|
||||
List<Range> ranges = languages.get(index).ranges;
|
||||
int cnt = 0;
|
||||
@@ -50,6 +67,11 @@ public class CharacterRanges {
|
||||
return cnt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the names of all available character ranges.
|
||||
*
|
||||
* @return Names of all available character ranges
|
||||
*/
|
||||
public static List<String> rangeNames() {
|
||||
List<String> ret = new ArrayList<>();
|
||||
for (int i = 0; i < rangeCount(); i++) {
|
||||
@@ -58,6 +80,12 @@ public class CharacterRanges {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the unicode codes of all glyphs in the character range at the specified index.
|
||||
*
|
||||
* @param index Index of the character range
|
||||
* @return Unicode codes of all glyphs in the character range
|
||||
*/
|
||||
public static int[] rangeCodes(int index) {
|
||||
List<Range> ranges = languages.get(index).ranges;
|
||||
List<Integer> ret = new ArrayList<>();
|
||||
|
||||
@@ -113,6 +113,13 @@ public class ConditionEvaluator {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates condition.
|
||||
* @param fields Fields
|
||||
* @param parentTagId Parent tag ID
|
||||
* @return True if condition is true
|
||||
* @throws AnnotationParseException On parse error
|
||||
*/
|
||||
public boolean eval(Map<String, Boolean> fields, int parentTagId) throws AnnotationParseException {
|
||||
boolean result;
|
||||
if (tags.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user