mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 16:00:46 +00:00
#390 Reload list of fonts to import
This commit is contained in:
@@ -27,6 +27,7 @@ import com.jpexs.decompiler.flash.console.CommandLineArgumentParser;
|
||||
import com.jpexs.decompiler.flash.console.ContextMenuTools;
|
||||
import com.jpexs.decompiler.flash.gui.player.FlashPlayerPanel;
|
||||
import com.jpexs.decompiler.flash.gui.proxy.ProxyFrame;
|
||||
import com.jpexs.decompiler.flash.tags.base.FontTag;
|
||||
import com.jpexs.helpers.Cache;
|
||||
import com.jpexs.helpers.CancellableWorker;
|
||||
import com.jpexs.helpers.Helper;
|
||||
@@ -401,6 +402,8 @@ public class Main {
|
||||
mainFrame.setVisible(false);
|
||||
mainFrame = null;
|
||||
}
|
||||
FontTag.reload();
|
||||
Cache.clearAll();
|
||||
initGui();
|
||||
reloadSWFs();
|
||||
}
|
||||
|
||||
@@ -366,7 +366,7 @@ public class MainFrameClassicMenu implements MainFrameMenu, ActionListener {
|
||||
switch (e.getActionCommand()) {
|
||||
case ACTION_RELOAD:
|
||||
if (View.showConfirmDialog(null, translate("message.confirm.reload"), translate("message.warning"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) {
|
||||
Main.reloadSWFs();
|
||||
Main.reloadApp();
|
||||
}
|
||||
break;
|
||||
case ACTION_ADVANCED_SETTINGS:
|
||||
|
||||
@@ -504,7 +504,7 @@ public class MainFrameRibbonMenu implements MainFrameMenu, ActionListener {
|
||||
switch (e.getActionCommand()) {
|
||||
case ACTION_RELOAD:
|
||||
if (View.showConfirmDialog(null, translate("message.confirm.reload"), translate("message.warning"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) {
|
||||
Main.reloadSWFs();
|
||||
Main.reloadApp();
|
||||
}
|
||||
break;
|
||||
case ACTION_ADVANCED_SETTINGS:
|
||||
|
||||
@@ -83,6 +83,16 @@ public abstract class FontTag extends CharacterTag implements AloneTag, Drawable
|
||||
|
||||
public abstract int getLeading();
|
||||
|
||||
public static String[] fontNamesArray;
|
||||
|
||||
public static List<String> fontNames;
|
||||
|
||||
public static String defaultFontName;
|
||||
|
||||
static {
|
||||
reload();
|
||||
}
|
||||
|
||||
public boolean hasLayout() {
|
||||
return false;
|
||||
}
|
||||
@@ -168,11 +178,9 @@ public abstract class FontTag extends CharacterTag implements AloneTag, Drawable
|
||||
return gm.getAdvanceX();
|
||||
}
|
||||
|
||||
public static final String[] fontNamesArray = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
|
||||
public static final List<String> fontNames = Arrays.asList(fontNamesArray);
|
||||
public static final String defaultFontName;
|
||||
|
||||
static {
|
||||
public static void reload() {
|
||||
fontNamesArray = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
|
||||
fontNames = Arrays.asList(fontNamesArray);
|
||||
if (fontNames.contains("Times New Roman")) {
|
||||
defaultFontName = "Times New Roman";
|
||||
} else if (fontNames.contains("Arial")) {
|
||||
|
||||
Reference in New Issue
Block a user