|
|
|
@ -9,6 +9,7 @@ import com.fr.design.dialog.FineJOptionPane;
|
|
|
|
|
import com.fr.design.env.DesignerWorkspaceInfo; |
|
|
|
|
import com.fr.design.fun.DesignerEnvProcessor; |
|
|
|
|
import com.fr.design.gui.UILookAndFeel; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
|
import com.fr.exit.DesignerExiter; |
|
|
|
|
import com.fr.file.FileFILE; |
|
|
|
@ -23,7 +24,9 @@ import com.fr.stable.StableUtils;
|
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.stable.os.OperatingSystem; |
|
|
|
|
import com.fr.start.ServerStarter; |
|
|
|
|
import com.fr.value.NotNullLazyValue; |
|
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
|
import com.fr.workspace.connect.WorkspaceConnectionInfo; |
|
|
|
|
import com.fr.workspace.engine.channel.http.FunctionalHttpRequest; |
|
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
@ -251,6 +254,7 @@ public class DesignUtils {
|
|
|
|
|
// 刷新DesignerFrame里面的面板
|
|
|
|
|
SwingUtilities.invokeLater(new Runnable() { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void run() { |
|
|
|
|
if (DesignerContext.getDesignerFrame() == null) { |
|
|
|
|
return; |
|
|
|
@ -272,7 +276,7 @@ public class DesignUtils {
|
|
|
|
|
FineLoggerFactory.getLogger().error("Substance Raven Graphite failed to initialize"); |
|
|
|
|
} |
|
|
|
|
//获取当前系统语言下设计器用的默认字体
|
|
|
|
|
FRFont guiFRFont = getCurrentLocaleFont(); |
|
|
|
|
FRFont guiFRFont = getDefaultGUIFont(); |
|
|
|
|
//指定UIManager中字体
|
|
|
|
|
Enumeration keys = UIManager.getDefaults().keys(); |
|
|
|
|
while (keys.hasMoreElements()) { |
|
|
|
@ -289,11 +293,21 @@ public class DesignUtils {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取当前系统语言下设计器用的默认字体 |
|
|
|
|
* 获取当前系统语言下设计器界面使用的默认字体 |
|
|
|
|
* |
|
|
|
|
* @return 默认字体 |
|
|
|
|
*/ |
|
|
|
|
private static FRFont getCurrentLocaleFont() { |
|
|
|
|
public static FRFont getDefaultGUIFont() { |
|
|
|
|
return CURRENT_LOCALE_FONT.getValue(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取当前系统语言下设计器用的默认字体 |
|
|
|
|
*/ |
|
|
|
|
private static final NotNullLazyValue<FRFont> CURRENT_LOCALE_FONT = new NotNullLazyValue<FRFont>() { |
|
|
|
|
@NotNull |
|
|
|
|
@Override |
|
|
|
|
protected FRFont compute() { |
|
|
|
|
FRFont guiFRFont; |
|
|
|
|
Locale defaultLocale = Locale.getDefault(); |
|
|
|
|
// JDK9 之后宋体在计算label中字母的空间上出现问题,暂时先用雅黑兼容,以后再统一字体
|
|
|
|
@ -305,9 +319,7 @@ public class DesignUtils {
|
|
|
|
|
guiFRFont = getNamedFont("Dialog"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//先初始化的设计器locale, 后初始化lookandfeel.如果顺序改了, 这边也要调整.
|
|
|
|
|
Locale designerLocale = GeneralContext.getLocale(); |
|
|
|
|
String file = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_File"); |
|
|
|
|
String file = Toolkit.i18nText("Fine-Design_Basic_File"); |
|
|
|
|
char displayChar = file.charAt(0); |
|
|
|
|
if (!guiFRFont.canDisplay(displayChar)) { |
|
|
|
|
//如果不能用默认的语言显示字体, 比如想在英文系统里用中文设计器
|
|
|
|
@ -317,13 +329,14 @@ public class DesignUtils {
|
|
|
|
|
//比如想在中文或英文系统里用韩文设计器
|
|
|
|
|
guiFRFont = getNamedFont("Dialog"); |
|
|
|
|
if (!guiFRFont.canDisplay(displayChar)) { |
|
|
|
|
FineLoggerFactory.getLogger().error(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_SimSun_Not_Found")); |
|
|
|
|
FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Basic_Base_SimSun_Not_Found")); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return guiFRFont; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
private static FRFont getNamedFont(String name) { |
|
|
|
|
return FRFont.getInstance(name, Font.PLAIN, 12); |
|
|
|
|