Browse Source

Pull request #13958: REPORT-111995 【NewUI】文件-选项和帮助面板翻新

Merge in DESIGN/design from ~LEVY.XIE/design:newui to newui

* commit 'db6489c34a5f24efa8b82c55c739aff000911c1d':
  REPORT-111995 【NewUI】文件-选项和帮助面板翻新
  REPORT-111995 【NewUI】文件-选项和帮助面板翻新
newui
Levy.Xie-解安森 6 months ago
parent
commit
9476314b45
  1. 507
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 5
      designer-base/src/main/java/com/fr/design/actions/help/AboutDialog.java
  3. 11
      designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java
  4. 1
      designer-base/src/main/java/com/fr/design/gui/style/TextFormatPane.java
  5. 9
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsMovePanel.java

507
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -1,5 +1,9 @@
package com.fr.design.actions.file; package com.fr.design.actions.file;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.config.Configuration; import com.fr.config.Configuration;
import com.fr.config.ServerPreferenceConfig; import com.fr.config.ServerPreferenceConfig;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
@ -31,8 +35,6 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.jdk.JdkVersion; import com.fr.design.jdk.JdkVersion;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.layout.VerticalFlowLayout; import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.mainframe.vcs.VcsConfigManager; import com.fr.design.mainframe.vcs.VcsConfigManager;
import com.fr.design.mainframe.vcs.common.VcsHelper; import com.fr.design.mainframe.vcs.common.VcsHelper;
@ -44,7 +46,6 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.log.Log4jConfig; import com.fr.general.log.Log4jConfig;
@ -52,7 +53,6 @@ import com.fr.io.attr.ImageExportAttr;
import com.fr.locale.InterProviderFactory; import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.report.ReportConfigManager; import com.fr.report.ReportConfigManager;
import com.fr.scheduler.tool.FineScheduler;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.OperatingSystem;
import com.fr.third.apache.logging.log4j.Level; import com.fr.third.apache.logging.log4j.Level;
@ -70,13 +70,10 @@ import com.fr.workspace.server.vcs.v2.scheduler.VcsAutoCleanSchedule;
import com.fr.workspace.server.vcs.v2.scheduler.VcsAutoCleanService; import com.fr.workspace.server.vcs.v2.scheduler.VcsAutoCleanService;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout; import javax.swing.BoxLayout;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
import javax.swing.JComponent;
import javax.swing.JDialog; import javax.swing.JDialog;
import javax.swing.JFileChooser; import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JProgressBar; import javax.swing.JProgressBar;
@ -86,7 +83,6 @@ import javax.swing.SwingUtilities;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
import javax.swing.Timer; import javax.swing.Timer;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.*;
@ -105,6 +101,10 @@ import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.i18n.Toolkit.i18nText; import static com.fr.design.i18n.Toolkit.i18nText;
/** /**
@ -127,6 +127,7 @@ public class PreferencePane extends BasicPane {
private static final int MEMORY_TIP_LABEL_MAX_WIDTH = 230; private static final int MEMORY_TIP_LABEL_MAX_WIDTH = 230;
private static final int PREFERENCE_LABEL_MAX_WIDTH = 460; private static final int PREFERENCE_LABEL_MAX_WIDTH = 460;
private static final int OFFSET_HEIGHT = 60; private static final int OFFSET_HEIGHT = 60;
private static final int SETTING_V_GAP = 15;
private static final int VCS_FILL_TOTAL = 5; private static final int VCS_FILL_TOTAL = 5;
private static final String TYPE = "pressed"; private static final String TYPE = "pressed";
@ -275,108 +276,116 @@ public class PreferencePane extends BasicPane {
protected void initComponents() { protected void initComponents() {
JPanel contentPane = this; JPanel contentPane = this;
contentPane.setLayout(FRGUIPaneFactory.createBorderLayout()); contentPane.setLayout(FRGUIPaneFactory.createBorderLayout());
UITabbedPane tabPane = new UITabbedPane();
UITabbedPane jtabPane = new UITabbedPane(); contentPane.add(tabPane, BorderLayout.NORTH);
JPanel generalPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); // 常用面板
JPanel generalPane = column(SETTING_V_GAP,
// 功能设置
cell(createFunctionPane()),
// 编辑器设置
cell(createEditPane()),
// 颜色设置
cell(createColorSettingPane()),
// 语言选择
cell(createLanPane()),
// 启动页配置
cell(createStartupPagePane())
).weight(1).getComponent();
UIScrollPane generalScrollPane = patchScroll(generalPane); UIScrollPane generalScrollPane = patchScroll(generalPane);
jtabPane.addTab(i18nText("Fine-Design_Basic_General"), generalScrollPane); tabPane.addTab(i18nText("Fine-Design_Basic_General"), generalScrollPane);
JPanel advancePane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); // 高级面板
JPanel advancePane = column(SETTING_V_GAP,
// log导出配置
cell(createLogPane()),
// 标尺单位设置
cell(createLengthPane()),
// 服务器设置
cell(createServerPane()),
// 插件管理设置
cell(createUpmSelectorPane()).with(it -> it.setVisible(!OperatingSystem.isLinux() && JdkVersion.LE_8.support())),
// 登录选项
cell(createLoginSelectorPane()).with(it -> it.setVisible(SupportOSImpl.DESIGNER_LOGIN.support())),
// Oracle设置
cell(createOraclePane()),
// 内存设置
cell(createMemoryPane()),
// 产品改良
cell(createImprovePane()),
// 内置服务器
cell(createEmbeddedServerPane()),
// 模板预览性能
cell(createTplPreviewPane()),
// 设计器启动选项
cell(createDesignerStartupPane())
).getComponent();
useUniverseDBMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_Universe_Database_Manager"));
UIScrollPane adviceScrollPane = patchScroll(advancePane); UIScrollPane adviceScrollPane = patchScroll(advancePane);
jtabPane.addTab(i18nText("Fine-Design_Basic_Advanced"), adviceScrollPane); tabPane.addTab(i18nText("Fine-Design_Basic_Advanced"), adviceScrollPane);
// 版本管理面板
//初始化vcs总面板 //初始化vcs总面板
JPanel vcsParentPane = new JPanel(); JPanel vcsParentPane = new JPanel();
CardLayout cardLayout = new CardLayout(); CardLayout cardLayout = new CardLayout();
vcsParentPane.setLayout(cardLayout); vcsParentPane.setLayout(cardLayout);
//vcs配置面板 //vcs配置面板
JPanel vcsPane = new JPanel(new BorderLayout()); JPanel vcsPane = new JPanel(new BorderLayout(0, SETTING_V_GAP));
// vcsPane
createVcsSettingPane(vcsPane, vcsParentPane, cardLayout);
//添加滚动条 //添加滚动条
UIScrollPane vcsScrollPane = patchScroll(vcsPane); UIScrollPane vcsScrollPane = patchScroll(vcsPane);
//配置面板作为vcs总面板的一张卡片 //配置面板作为vcs总面板的一张卡片
vcsParentPane.add(vcsScrollPane, VcsMovePanel.SETTING); vcsParentPane.add(vcsScrollPane, VcsMovePanel.SETTING);
jtabPane.addTab(i18nText("Fine-Design_Vcs_Title"), vcsParentPane); tabPane.addTab(i18nText("Fine-Design_Vcs_Title"), vcsParentPane);
}
contentPane.add(jtabPane, BorderLayout.NORTH);
createFunctionPane(generalPane);
createEditPane(generalPane);
createColorSettingPane(generalPane);
// vcsPane
createVcsSettingPane(vcsPane, vcsParentPane, cardLayout);
// ConfPane
JPanel confLocationPane = FRGUIPaneFactory.createX_AXISBoxInnerContainer_S_Pane();
advancePane.add(confLocationPane);
createLogPane(advancePane);
createLanPane(generalPane);
createStartupPagePane(generalPane);
createLengthPane(advancePane);
createServerPane(advancePane);
JPanel oraclePane = FRGUIPaneFactory.createTitledBorderPane("Oracle" + i18nText("Fine-Design_Basic_Oracle_All_Tables"));
oracleSpace = new UICheckBox(i18nText("Fine-Design_Basic_Show_All_Oracle_Tables"));
oraclePane.add(oracleSpace);
if (!OperatingSystem.isLinux() && JdkVersion.LE_8.support()) { private Component createDesignerStartupPane() {
JPanel upmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Update_Plugin_Manager")); cloudAnalyticsDelayCheckBox = new UICheckBox(i18nText("Fine-Design_Cloud_Analytics_Delay"));
useOptimizedUPMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_New_Update_Plugin_Manager")); return FineUIUtils.wrapComponentWithTitle(column(10, cell(cloudAnalyticsDelayCheckBox)).getComponent(),
upmSelectorPane.add(useOptimizedUPMCheckbox); i18nText("Fine-Design_Startup_Option"));
advancePane.add(upmSelectorPane);
} }
if (SupportOSImpl.DESIGNER_LOGIN.support()) { private Component createTplPreviewPane() {
JPanel loginSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Login_Manager")); imageCompressPanelCheckBox = new UICheckBox(i18nText("Fine-Design_Image_Compress"));
useNewVersionLoginCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_New_Login_Manager")); return FineUIUtils.wrapComponentWithTitle(column(10,
loginSelectorPane.add(useNewVersionLoginCheckbox); cell(imageCompressPanelCheckBox),
advancePane.add(loginSelectorPane); cell(createImageExportSettingPane())
).getComponent(),
i18nText("Fine-Design_Template_Preview_Performance"));
} }
JPanel dbmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Database_Manager")); private Component createEmbeddedServerPane() {
useUniverseDBMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_Universe_Database_Manager")); embedServerLazyStartupCheckBox = new UICheckBox(i18nText("Fine-Design_Startup_When_Needed"));
//dbmSelectorPane.add(useUniverseDBMCheckbox); return FineUIUtils.wrapComponentWithTitle(column(10, cell(embedServerLazyStartupCheckBox)).getComponent(),
//advancePane.add(dbmSelectorPane); i18nText("Fine-Design_Embed_Server"));
}
JPanel improvePane = FRGUIPaneFactory.createVerticalTitledBorderPane(i18nText("Fine-Design_Basic_Product_Improve")); private Component createImprovePane() {
joinProductImproveCheckBox = new UICheckBox(i18nText("Fine-Design_Basic_Join_Product_Improve")); joinProductImproveCheckBox = new UICheckBox(i18nText("Fine-Design_Basic_Join_Product_Improve"));
improvePane.add(joinProductImproveCheckBox);
if (SupportOSImpl.AUTOPUSHUPDATE.support()) {
autoPushUpdateCheckBox = new UICheckBox(i18nText("Fine-Design_Automatic_Push_Update")); autoPushUpdateCheckBox = new UICheckBox(i18nText("Fine-Design_Automatic_Push_Update"));
improvePane.add(autoPushUpdateCheckBox); JPanel improvePane = column(10,
cell(joinProductImproveCheckBox),
cell(autoPushUpdateCheckBox).with(it -> it.setVisible(SupportOSImpl.AUTOPUSHUPDATE.support()))
).getComponent();
return FineUIUtils.wrapComponentWithTitle(improvePane, i18nText("Fine-Design_Basic_Product_Improve"));
} }
/*
if (DesignerPushUpdateManager.getInstance().isAutoPushUpdateSupported()) {
autoPushUpdateCheckBox = new UICheckBox(i18nText("Fine-Design_Automatic_Push_Update"));
improvePane.add(autoPushUpdateCheckBox);
}*/
JPanel spaceUpPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
spaceUpPane.add(oraclePane, BorderLayout.NORTH);
spaceUpPane.add(createMemoryPane(), BorderLayout.CENTER);
spaceUpPane.add(improvePane, BorderLayout.SOUTH);
advancePane.add(spaceUpPane);
JPanel embedServerPanel = FRGUIPaneFactory.createVerticalTitledBorderPane(i18nText("Fine-Design_Embed_Server")); private Component createOraclePane() {
embedServerLazyStartupCheckBox = new UICheckBox(i18nText("Fine-Design_Startup_When_Needed")); oracleSpace = new UICheckBox(i18nText("Fine-Design_Basic_Show_All_Oracle_Tables"));
embedServerPanel.add(embedServerLazyStartupCheckBox); return FineUIUtils.wrapComponentWithTitle(column(10, cell(oracleSpace)).getComponent(),
advancePane.add(embedServerPanel); i18nText("Fine-Design_Basic_Oracle_All_Tables"));
}
JPanel imageCompressPanel = FRGUIPaneFactory.createVerticalTitledBorderPane(i18nText("Fine-Design_Template_Preview_Performance")); private Component createLoginSelectorPane() {
imageCompressPanelCheckBox = new UICheckBox(i18nText("Fine-Design_Image_Compress")); useNewVersionLoginCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_New_Login_Manager"));
imageCompressPanel.add(imageCompressPanelCheckBox); return FineUIUtils.wrapComponentWithTitle(column(10, cell(useNewVersionLoginCheckbox)).getComponent(),
imageCompressPanel.add(createImageExportSettingPane()); i18nText("Fine-Design_Basic_Login_Manager"));
advancePane.add(imageCompressPanel); }
JPanel designerStartupOption = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Startup_Option")); private Component createUpmSelectorPane() {
cloudAnalyticsDelayCheckBox = new UICheckBox(i18nText("Fine-Design_Cloud_Analytics_Delay")); useOptimizedUPMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_New_Update_Plugin_Manager"));
designerStartupOption.add(cloudAnalyticsDelayCheckBox); return FineUIUtils.wrapComponentWithTitle(column(10, cell(useOptimizedUPMCheckbox)).getComponent(),
advancePane.add(designerStartupOption); i18nText("Fine-Design_Basic_Update_Plugin_Manager"));
} }
private JPanel createImageExportSettingPane() { private JPanel createImageExportSettingPane() {
@ -391,42 +400,32 @@ public class PreferencePane extends BasicPane {
ButtonGroup previewRenderGroup = new ButtonGroup(); ButtonGroup previewRenderGroup = new ButtonGroup();
previewRenderGroup.add(previewRenderQuality); previewRenderGroup.add(previewRenderQuality);
previewRenderGroup.add(previewRenderSpeed); previewRenderGroup.add(previewRenderSpeed);
JPanel imageExportSettingPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); return column(10,
JComponent[][] templateComps = { row(
{new UILabel(Toolkit.i18nText("Fine-Design_Report_Engine_Enlarge_Or_Reduce") + ":"), this.previewResolutionBtnS, this.previewResolutionBtnM}, cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Engine_Enlarge_Or_Reduce") + ":")).weight(1),
{new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Rendering_Quality") + ":"), this.previewRenderQuality, this.previewRenderSpeed}, cell(this.previewResolutionBtnS).weight(1),
}; cell(this.previewResolutionBtnM).weight(1)
imageExportSettingPane.add( ),
TableLayoutHelper.createGapTableLayoutPane( row(
templateComps, cell(new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Rendering_Quality") + ":")).weight(1),
new double[]{TableLayout.FILL, TableLayout.FILL}, cell(this.previewRenderQuality).weight(1),
new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.FILL}, cell(this.previewRenderSpeed).weight(1)
20, 0), )
BorderLayout.CENTER); ).getComponent();
imageExportSettingPane.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 0));
return imageExportSettingPane;
} }
@NotNull @NotNull
private UIScrollPane patchScroll(JPanel generalPane) { private UIScrollPane patchScroll(JPanel generalPane) {
UIScrollPane generalPanelWithScroll = new UIScrollPane(generalPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); JPanel wrapperPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
generalPanelWithScroll.setBorder(new EmptyBorder(0, 0, 0, 0)); wrapperPane.add(generalPane);
generalPanelWithScroll.setPreferredSize(new Dimension(generalPane.getWidth(), 600)); wrapperPane.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
return generalPanelWithScroll; return new UIScrollPane(wrapperPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
} }
private void createVcsSettingPane(JPanel generalPane, JPanel parentPane, CardLayout cardLayout) { private void createVcsSettingPane(JPanel generalPane, JPanel parentPane, CardLayout cardLayout) {
//迁移面板 //迁移面板
movePanel = createMovePane(cardLayout, parentPane); movePanel = createMovePane(cardLayout, parentPane);
generalPane.add(movePanel, BorderLayout.NORTH); generalPane.add(movePanel, BorderLayout.NORTH);
JPanel savePane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(i18nText("Fine-Design_Vcs_Save_Setting"));
JPanel vcsPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(i18nText("Fine-Design_Vcs_Clean_Setting"));
JPanel containPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
containPane.add(savePane);
containPane.add(vcsPane);
//填充一下面板
fillPane(containPane, VCS_FILL_TOTAL);
generalPane.add(containPane, BorderLayout.CENTER);
remindVcsLabel = new UILabel(i18nText("Fine-Design_Vcs_Remind")); remindVcsLabel = new UILabel(i18nText("Fine-Design_Vcs_Remind"));
remindVcsLabel.setVisible(!VcsHelper.getInstance().needInit()); remindVcsLabel.setVisible(!VcsHelper.getInstance().needInit());
vcsEnableCheckBox = new UICheckBox(i18nText("Fine-Design_Vcs_SaveAuto")); vcsEnableCheckBox = new UICheckBox(i18nText("Fine-Design_Vcs_SaveAuto"));
@ -435,26 +434,19 @@ public class PreferencePane extends BasicPane {
saveCommitCheckBox = new UICheckBox(i18nText("Fine-Design_Vcs_No_Delete")); saveCommitCheckBox = new UICheckBox(i18nText("Fine-Design_Vcs_No_Delete"));
saveIntervalEditor = new UIPositiveIntEditor(60); saveIntervalEditor = new UIPositiveIntEditor(60);
useIntervalCheckBox = new UICheckBox(); useIntervalCheckBox = new UICheckBox();
savePane.add(vcsEnableCheckBox);
savePane.add(saveIntervalPane);
//gc面板
gcControlPane = createGcControlPane();
JPanel enableVcsPanel = new JPanel(FRGUIPaneFactory.createLeftZeroLayout());
enableVcsPanel.add(remindVcsLabel);
JPanel intervalPanel = new JPanel(FRGUIPaneFactory.createLeftZeroLayout());
final UILabel everyLabel = new UILabel(i18nText("Fine-Design_Vcs_Every")); final UILabel everyLabel = new UILabel(i18nText("Fine-Design_Vcs_Every"));
final UILabel delayLabel = new UILabel(i18nText("Fine-Design_Vcs_Delay")); final UILabel delayLabel = new UILabel(i18nText("Fine-Design_Vcs_Delay"));
intervalPanel.add(useIntervalCheckBox); JPanel intervalPanel = row(4,
intervalPanel.add(everyLabel); cell(useIntervalCheckBox),
intervalPanel.add(saveIntervalEditor); cell(everyLabel),
intervalPanel.add(delayLabel); cell(saveIntervalEditor),
cell(delayLabel)
).getComponent();
autoCleanPane = createAutoCleanPane(); autoCleanPane = createAutoCleanPane();
checkAutoScheduleStartAndUpdateStatus(); checkAutoScheduleStartAndUpdateStatus();
vcsEnableCheckBox.addChangeListener(new ChangeListener() { vcsEnableCheckBox.addChangeListener(e -> {
@Override
public void stateChanged(ChangeEvent e) {
boolean selected = vcsEnableCheckBox.isSelected(); boolean selected = vcsEnableCheckBox.isSelected();
if (selected && vcsEnableCheckBox.isEnabled()) { if (selected && vcsEnableCheckBox.isEnabled()) {
saveCommitCheckBox.setEnabled(true); saveCommitCheckBox.setEnabled(true);
@ -469,21 +461,29 @@ public class PreferencePane extends BasicPane {
everyLabel.setEnabled(false); everyLabel.setEnabled(false);
delayLabel.setEnabled(false); delayLabel.setEnabled(false);
} }
}
}); });
vcsPane.add(enableVcsPanel); //gc面板
vcsPane.add(intervalPanel); gcControlPane = createGcControlPane();
if (VcsHelper.getInstance().isLegacyMode()) {
vcsPane.add(saveCommitCheckBox); Component savePane = FineUIUtils.wrapComponentWithTitle(column(10,
} cell(vcsEnableCheckBox),
vcsPane.add(autoCleanPane); cell(saveIntervalPane).with(it -> it.setVisible(VcsHelper.getInstance().checkV2FunctionSupport()))
boolean support = VcsHelper.getInstance().checkV2FunctionSupport(); ).getComponent(), i18nText("Fine-Design_Vcs_Save_Setting"));
saveIntervalPane.setVisible(support);
autoCleanPane.setVisible(support); Component vcsPane = FineUIUtils.wrapComponentWithTitle(column(10,
if (VcsHelper.getInstance().isLegacyMode()) { cell(remindVcsLabel),
// 老版本时才显示gc选项 cell(intervalPanel),
vcsPane.add(gcControlPane); cell(saveCommitCheckBox).with(it -> it.setVisible(VcsHelper.getInstance().isLegacyMode())),
} cell(autoCleanPane),
cell(gcControlPane).with(it -> it.setVisible(VcsHelper.getInstance().isLegacyMode()))
).getComponent(), i18nText("Fine-Design_Vcs_Clean_Setting"));
JPanel containPane = column(SETTING_V_GAP,
cell(savePane),
cell(vcsPane)
).getComponent();
//填充一下面板
fillPane(containPane, VCS_FILL_TOTAL);
generalPane.add(containPane, BorderLayout.CENTER);
} }
private void fillPane(JPanel containPane, int total) { private void fillPane(JPanel containPane, int total) {
@ -557,20 +557,16 @@ public class PreferencePane extends BasicPane {
} }
private JPanel createSaveIntervalPane() { private JPanel createSaveIntervalPane() {
JPanel saveIntervalPane = new JPanel(FRGUIPaneFactory.createLeftZeroLayout());
useVcsAutoSaveScheduleCheckBox = new UICheckBox(); useVcsAutoSaveScheduleCheckBox = new UICheckBox();
autoSaveIntervalEditor = new UIPositiveIntEditor(60); autoSaveIntervalEditor = new UIPositiveIntEditor(60);
saveIntervalPane.add(useVcsAutoSaveScheduleCheckBox); return row(4,
saveIntervalPane.add(new UILabel(i18nText("Fine-Design_Vcs_Every"))); cell(useVcsAutoSaveScheduleCheckBox).with(it -> it.setEnabled(!VcsHelper.getInstance().isLegacyMode())),
saveIntervalPane.add(autoSaveIntervalEditor); cell(new UILabel(i18nText("Fine-Design_Vcs_Every"))),
saveIntervalPane.add(new UILabel(i18nText("Fine-Design_Vcs_Save_Delay"))); cell(autoSaveIntervalEditor),
useVcsAutoSaveScheduleCheckBox.setEnabled(!VcsHelper.getInstance().isLegacyMode()); cell(new UILabel(i18nText("Fine-Design_Vcs_Save_Delay")))
saveIntervalPane.setVisible(false); ).with(it -> it.setVisible(false)).getComponent();
return saveIntervalPane;
} }
/** /**
* 模创建板版本gc 配置操作面板 * 模创建板版本gc 配置操作面板
* *
@ -600,22 +596,13 @@ public class PreferencePane extends BasicPane {
return gcControlPane; return gcControlPane;
} }
private void createFunctionPane(JPanel generalPane) { private Component createFunctionPane() {
JPanel topVerticalTitledBorderPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(i18nText("Fine-Design_Basic_Preference_Function"));
JPanel supportUndoPanel = new JPanel(FRGUIPaneFactory.createLeftZeroVgapNormalHgapLayout());
topVerticalTitledBorderPane.add(supportUndoPanel);
generalPane.add(topVerticalTitledBorderPane);
//添加supportUndo选择项 //添加supportUndo选择项
supportUndoCheckBox = new UICheckBox(i18nText("Fine-Design_Basic_Preference_Support_Undo")); supportUndoCheckBox = new UICheckBox(i18nText("Fine-Design_Basic_Preference_Support_Undo"));
supportUndoPanel.add(supportUndoCheckBox);
//添加maxUndoLimit //添加maxUndoLimit
//String[] undoTimes = {"最大撤销次数","5次","10次","15次","20次","50次"};
String[] undoTimes = {i18nText("Fine-Design_Basic_Max_Undo_Limit"), MAX_UNDO_LIMIT_5 + i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_10 + i18nText("Fine-Design_Basic_Time(s)") String[] undoTimes = {i18nText("Fine-Design_Basic_Max_Undo_Limit"), MAX_UNDO_LIMIT_5 + i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_10 + i18nText("Fine-Design_Basic_Time(s)")
, MAX_UNDO_LIMIT_15 + i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_20 + i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_50 + i18nText("Fine-Design_Basic_Time(s)")}; , MAX_UNDO_LIMIT_15 + i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_20 + i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_50 + i18nText("Fine-Design_Basic_Time(s)")};
maxUndoLimit = new UIComboBox(undoTimes); maxUndoLimit = new UIComboBox(undoTimes);
supportUndoPanel.add(maxUndoLimit);
//不支持撤销则不能选择撤销可缓存,也不能设置最大撤销次数 //不支持撤销则不能选择撤销可缓存,也不能设置最大撤销次数
supportUndoCheckBox.addActionListener(new ActionListener() { supportUndoCheckBox.addActionListener(new ActionListener() {
@ -625,32 +612,31 @@ public class PreferencePane extends BasicPane {
} }
}); });
//添加supportDefaultParentCalculate选择项 //添加supportDefaultParentCalculate选择项
supportDefaultParentCalculateCheckBox = new UICheckBox( supportDefaultParentCalculateCheckBox = new UICheckBox(
i18nText("Fine-Design_Basic_Preference_Support_Default_Parent_Calculate")); i18nText("Fine-Design_Basic_Preference_Support_Default_Parent_Calculate"));
topVerticalTitledBorderPane.add(supportDefaultParentCalculateCheckBox);
//添加是否展示打开模板提示缺少插件选择项 //添加是否展示打开模板提示缺少插件选择项
showTemplateMissingPlugin = new UICheckBox( showTemplateMissingPlugin = new UICheckBox(
i18nText("Fine-Design_Basic_Preference_Show-Template-Missing-Plugin")); i18nText("Fine-Design_Basic_Preference_Show-Template-Missing-Plugin"));
topVerticalTitledBorderPane.add(showTemplateMissingPlugin);
startWithEmptyFile = new UICheckBox(i18nText("Fine-Design_Basic_Preference_Start_Empty_File")); startWithEmptyFile = new UICheckBox(i18nText("Fine-Design_Basic_Preference_Start_Empty_File"));
topVerticalTitledBorderPane.add(startWithEmptyFile);
JPanel functionPanel = column(10,
row(10,
cell(supportUndoCheckBox), cell(maxUndoLimit)
),
cell(supportDefaultParentCalculateCheckBox),
cell(showTemplateMissingPlugin),
cell(startWithEmptyFile)
).getComponent();
return FineUIUtils.wrapComponentWithTitle(functionPanel, i18nText("Fine-Design_Basic_Preference_Function"));
} }
private void createEditPane(JPanel generalPane) { private Component createEditPane() {
//samuel:编辑器设置 //samuel:编辑器设置
JPanel editPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(i18nText("Fine-Design_Basic_Editor_Preference"));
generalPane.add(editPane);
//设置是否支持将字符串编辑为公式 //设置是否支持将字符串编辑为公式
supportStringToFormulaBox = new UICheckBox(i18nText("Fine-Design_Report_Support_String_To_Formula")); supportStringToFormulaBox = new UICheckBox(i18nText("Fine-Design_Report_Support_String_To_Formula"));
editPane.add(supportStringToFormulaBox);
//是否默认转化 //是否默认转化
defaultStringToFormulaBox = new UICheckBox(i18nText("Fine-Design_Basic_Always")); defaultStringToFormulaBox = new UICheckBox(i18nText("Fine-Design_Basic_Always"));
//不支持转化则不能默认执行 //不支持转化则不能默认执行
supportStringToFormulaBox.addActionListener(new ActionListener() { supportStringToFormulaBox.addActionListener(new ActionListener() {
@Override @Override
@ -658,16 +644,8 @@ public class PreferencePane extends BasicPane {
defaultStringToFormulaBox.setEnabled(supportStringToFormulaBox.isSelected()); defaultStringToFormulaBox.setEnabled(supportStringToFormulaBox.isSelected());
} }
}); });
JPanel keyStrokePane = new JPanel(new BorderLayout()); UILabel shortCutInfoLabel = new UILabel(i18nText("Fine-Design_Basic_Support_Auto_Complete_Shortcut") + ":");
keyStrokePane.add(new UILabel(i18nText("Fine-Design_Basic_Support_Auto_Complete_Shortcut") + ":"), BorderLayout.WEST);
shortCutLabel = new UILabel(); shortCutLabel = new UILabel();
keyStrokePane.add(shortCutLabel, BorderLayout.CENTER);
keyStrokePane.setBorder(new EmptyBorder(0, 10,0,0));
JPanel defaultExecutePane = new JPanel(FRGUIPaneFactory.createLeftZeroVgapNormalHgapLayout());
defaultExecutePane.add(defaultStringToFormulaBox);
defaultExecutePane.add(keyStrokePane);
editPane.add(defaultExecutePane);
shortCutLabel.addMouseListener(new MouseAdapter() { shortCutLabel.addMouseListener(new MouseAdapter() {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
@ -683,6 +661,16 @@ public class PreferencePane extends BasicPane {
} }
} }
}); });
JPanel editPanel = column(10,
cell(supportStringToFormulaBox),
row(
cell(defaultStringToFormulaBox),
fix(10),
cell(shortCutInfoLabel),
cell(shortCutLabel)
)
).getComponent();
return FineUIUtils.wrapComponentWithTitle(editPanel, i18nText("Fine-Design_Basic_Editor_Preference"));
} }
private class KeyStrokePane extends BasicPane { private class KeyStrokePane extends BasicPane {
@ -726,39 +714,28 @@ public class PreferencePane extends BasicPane {
} }
private void createColorSettingPane(JPanel generalPane) { private Component createColorSettingPane() {
// Color Setting Pane // Color Setting Pane
JPanel colorSettingPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Preference_Setting_Colors"));
generalPane.add(colorSettingPane);
gridLineColorTBButton = new UINoThemeColorButton(IOUtils.readIcon("/com/fr/design/images/gui/color/foreground.png")); gridLineColorTBButton = new UINoThemeColorButton(IOUtils.readIcon("/com/fr/design/images/gui/color/foreground.png"));
gridLineColorTBButton.setEnabled(this.isEnabled()); gridLineColorTBButton.setEnabled(this.isEnabled());
paginationLineColorTBButton = new UINoThemeColorButton(IOUtils.readIcon("/com/fr/design/images/gui/color/foreground.png")); paginationLineColorTBButton = new UINoThemeColorButton(IOUtils.readIcon("/com/fr/design/images/gui/color/foreground.png"));
paginationLineColorTBButton.setEnabled(this.isEnabled()); paginationLineColorTBButton.setEnabled(this.isEnabled());
JPanel leftPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel colorPanel = row(10,
leftPane.add(new UILabel(i18nText("Fine-Design_Basic_Preference_Grid_Line_Color") + ":")); cell(new UILabel(i18nText("Fine-Design_Basic_Preference_Grid_Line_Color") + ":")),
leftPane.add(gridLineColorTBButton); cell(gridLineColorTBButton),
JPanel rightPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); cell(new UILabel(i18nText("Fine-Design_Basic_Preference_Pagination_Line_Color") + ":")),
rightPane.add(new UILabel(i18nText("Fine-Design_Basic_Preference_Pagination_Line_Color") + ":")); cell(paginationLineColorTBButton)
rightPane.add(paginationLineColorTBButton); ).getComponent();
colorSettingPane.add(leftPane); return FineUIUtils.wrapComponentWithTitle(colorPanel, i18nText("Fine-Design_Basic_Preference_Setting_Colors"));
colorSettingPane.add(rightPane);
} }
private void createLogPane(JPanel advancePane) { private Component createLogPane() {
//richer:选择导出log文件的目录. //richer:选择导出log文件的目录.
JPanel logPane = FRGUIPaneFactory.createX_AXISBoxInnerContainer_S_Pane();
advancePane.add(logPane);
JPanel logExportPane = FRGUIPaneFactory.createTitledBorderPane("log" + i18nText("Fine-Design_Basic_Export_Setting"));
logPane.add(logExportPane);
UILabel logLabel = new UILabel(i18nText("Fine-Design_Basic_Select_Export_Log_Directory") + ":"); UILabel logLabel = new UILabel(i18nText("Fine-Design_Basic_Select_Export_Log_Directory") + ":");
logExportPane.add(logLabel, BorderLayout.WEST);
logExportDirectoryField = new UITextField(24); logExportDirectoryField = new UITextField(24);
logExportPane.add(logExportDirectoryField, BorderLayout.CENTER);
UIButton chooseDirBtn = new UIButton("..."); UIButton chooseDirBtn = new UIButton("...");
logExportPane.add(chooseDirBtn, BorderLayout.EAST);
chooseDirBtn.setPreferredSize(new Dimension(25, 25)); chooseDirBtn.setPreferredSize(new Dimension(25, 25));
chooseDirBtn.addActionListener(new ActionListener() { chooseDirBtn.addActionListener(new ActionListener() {
@Override @Override
@ -773,27 +750,24 @@ public class PreferencePane extends BasicPane {
} }
} }
}); });
UILabel logLevelLabel = new UILabel("Log" + i18nText("Fine-Design_Basic_Level_Setting"));
JPanel logLevelPane = FRGUIPaneFactory.createTitledBorderPane("log" + i18nText("Fine-Design_Basic_Level_Setting"));
logPane.add(logLevelPane);
logLevelComboBox = new UIComboBox(LOG); logLevelComboBox = new UIComboBox(LOG);
logLevelComboBox.setEnabled(WorkContext.getCurrent().isLocal()); logLevelComboBox.setEnabled(WorkContext.getCurrent().isLocal());
logLevelPane.add(logLevelComboBox); JPanel logPanel = row(10,
cell(logLabel),
cell(logExportDirectoryField),
cell(chooseDirBtn),
cell(logLevelLabel),
cell(logLevelComboBox)
).getComponent();
return FineUIUtils.wrapComponentWithTitle(logPanel, "Log" + i18nText("Fine-Design_Basic_Export_Setting"));
} }
private void createLanPane(JPanel generalPane) { private Component createLanPane() {
// ben:选择版本语言; // ben:选择版本语言;
JPanel languageAndDashBoard_pane = FRGUIPaneFactory.createX_AXISBoxInnerContainer_S_Pane();
JPanel LanguagePane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Choose_Language"));
generalPane.add(languageAndDashBoard_pane);
languageAndDashBoard_pane.add(LanguagePane);
languageComboBox = createLanguageComboBox(); languageComboBox = createLanguageComboBox();
ActionLabel languageLabel = new ActionLabel(i18nText("Fine-Design_Basic_Designer_Language")); ActionLabel languageLabel = new ActionLabel(i18nText("Fine-Design_Basic_Designer_Language"));
languageLabel.addActionListener(new ActionListener() { languageLabel.addActionListener(e -> {
@Override
public void actionPerformed(ActionEvent e) {
final LocalePane localePane = new LocalePane(); final LocalePane localePane = new LocalePane();
BasicDialog dlg = localePane.showLargeWindow(SwingUtilities.getWindowAncestor(PreferencePane.this), new DialogActionAdapter() { BasicDialog dlg = localePane.showLargeWindow(SwingUtilities.getWindowAncestor(PreferencePane.this), new DialogActionAdapter() {
@Override @Override
@ -802,17 +776,14 @@ public class PreferencePane extends BasicPane {
} }
}); });
dlg.setVisible(true); dlg.setVisible(true);
}
}); });
UILabel noticeLabel = new UILabel(i18nText("Fine-Design_Basic_Work_After_Restart_Designer"));//sail:提示重启后生效 UILabel noticeLabel = new UILabel(i18nText("Fine-Design_Basic_Work_After_Restart_Designer"));//sail:提示重启后生效
double p = TableLayout.PREFERRED; JPanel langPanel = row(10,
double[] rowSize = {p}; cell(languageLabel),
double[] columnSize = {p, p, p}; cell(languageComboBox),
Component[][] components = { cell(noticeLabel)
{languageLabel, languageComboBox, noticeLabel}, ).getComponent();
}; return FineUIUtils.wrapComponentWithTitle(langPanel, i18nText("Fine-Design_Basic_Choose_Language"));
JPanel choosePane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
LanguagePane.add(choosePane);
} }
private UIDictionaryComboBox<Locale> createLanguageComboBox() { private UIDictionaryComboBox<Locale> createLanguageComboBox() {
@ -832,19 +803,15 @@ public class PreferencePane extends BasicPane {
return languageComboBox; return languageComboBox;
} }
private void createStartupPagePane(JPanel generalPane) { private Component createStartupPagePane() {
// ben:选择版本语言;
JPanel startupPagePaneWrapper = FRGUIPaneFactory.createX_AXISBoxInnerContainer_S_Pane();
JPanel startupPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(Toolkit.i18nText("Fine-Design_Startup_Page_Config"));
generalPane.add(startupPagePaneWrapper);
startupPagePaneWrapper.add(startupPane);
startupPageEnabledCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Startup_Page_Config_Check_Text")); startupPageEnabledCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Startup_Page_Config_Check_Text"));
startupPane.add(startupPageEnabledCheckBox);
UILabel descLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Startup_Page_Config_Desc"), PREFERENCE_LABEL_MAX_WIDTH); UILabel descLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Startup_Page_Config_Desc"), PREFERENCE_LABEL_MAX_WIDTH);
descLabel.setForeground(new Color(51, 51, 52, (int)Math.round(0.5 * 255))); FineUIStyle.setStyle(descLabel, FineUIStyle.LABEL_TIP);
startupPane.add(descLabel); JPanel startPanel = column(10,
cell(startupPageEnabledCheckBox),
cell(descLabel)
).getComponent();
return FineUIUtils.wrapComponentWithTitle(startPanel, i18nText("Fine-Design_Startup_Page_Config"));
} }
private String getDisplayShortCut(String shotrCut) { private String getDisplayShortCut(String shotrCut) {
@ -860,60 +827,44 @@ public class PreferencePane extends BasicPane {
} }
private void createLengthPane(JPanel advancePane) { private Component createLengthPane() {
double p = TableLayout.PREFERRED;
double[] rowSize = {p};
// 长度单位选择 // 长度单位选择
JPanel lengthPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Setting_Ruler_Units"));
advancePane.add(lengthPane);
pageLengthComboBox = new UIComboBox(new String[]{i18nText("Fine-Design_Basic_Page_Setup_MM"), i18nText("Fine-Design_Report_Unit_CM"), i18nText("Fine-Design_Report_Unit_INCH")}); pageLengthComboBox = new UIComboBox(new String[]{i18nText("Fine-Design_Basic_Page_Setup_MM"), i18nText("Fine-Design_Report_Unit_CM"), i18nText("Fine-Design_Report_Unit_INCH")});
pageLengthComboBox.setPreferredSize(new Dimension(80, 20));
pageLengthComboBox.setMinimumSize(new Dimension(80, 20));
reportLengthComboBox = new UIComboBox(UnitConvertUtil.getUnitItems()); reportLengthComboBox = new UIComboBox(UnitConvertUtil.getUnitItems());
reportLengthComboBox.setPreferredSize(new Dimension(80, 20)); UILabel pageLengthLabel = new UILabel(i18nText("Fine-Design_Basic_Page_Setup_Scale_Units") + ":");
reportLengthComboBox.setMinimumSize(new Dimension(80, 20));
UILabel pagelengthLabel = new UILabel(i18nText("Fine-Design_Basic_Page_Setup_Scale_Units") + ":");
UILabel reportLengthLabel = new UILabel(i18nText("Fine-Design_Basic_Report_Design_Ruler_Units") + ":"); UILabel reportLengthLabel = new UILabel(i18nText("Fine-Design_Basic_Report_Design_Ruler_Units") + ":");
Component[][] lengthComponents = { JPanel lengthPane = row(10,
{pagelengthLabel, pageLengthComboBox, reportLengthLabel, reportLengthComboBox}, cell(pageLengthLabel),
}; cell(pageLengthComboBox),
JPanel chooseLengthPane = TableLayoutHelper.createTableLayoutPane(lengthComponents, rowSize, new double[]{p, p, p, p}); cell(reportLengthLabel),
lengthPane.add(chooseLengthPane); cell(reportLengthComboBox)
).getComponent();
return FineUIUtils.wrapComponentWithTitle(lengthPane, i18nText("Fine-Design_Basic_Setting_Ruler_Units"));
} }
private void createServerPane(JPanel advancePane) { private Component createServerPane() {
double p = TableLayout.PREFERRED;
double[] rowSize = {p};
double[] columnSize = {p, p, p};
JPanel serverPortPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Web_Preview_Port_Setting"));
advancePane.add(serverPortPane);
portEditor = new IntegerEditor(); portEditor = new IntegerEditor();
portEditor.setPreferredSize(new Dimension(80, 20));
portEditor.setMinimumSize(new Dimension(80, 20));
UILabel notiJlabel = new UILabel(i18nText("Fine-Design_Basic_Work_After_Restart_Designer")); UILabel notiJlabel = new UILabel(i18nText("Fine-Design_Basic_Work_After_Restart_Designer"));
UILabel serverPortLabel = new UILabel(i18nText("Fine-Design_Basic_Web_Preview_Port") + ":"); UILabel serverPortLabel = new UILabel(i18nText("Fine-Design_Basic_Web_Preview_Port") + ":");
Component[][] portComponents = { JPanel serverPane = row(10,
{serverPortLabel, portEditor, notiJlabel}, cell(serverPortLabel),
}; cell(portEditor),
JPanel choosePortPane = TableLayoutHelper.createTableLayoutPane(portComponents, rowSize, columnSize); cell(notiJlabel)
serverPortPane.add(choosePortPane, BorderLayout.CENTER); ).getComponent();
return FineUIUtils.wrapComponentWithTitle(serverPane, i18nText("Fine-Design_Basic_Web_Preview_Port_Setting"));
} }
private JPanel createMemoryPane() { private Component createMemoryPane() {
JPanel memoryPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Preference_Caching_Template"));
UILabel memoryLabel = new UILabel(i18nText("Fine-Design_Basic_Preference_Max_Caching_Template")); UILabel memoryLabel = new UILabel(i18nText("Fine-Design_Basic_Preference_Max_Caching_Template"));
UILabel memoryTipLabel = FRWidgetFactory.createLineWrapLabel( UILabel memoryTipLabel = FRWidgetFactory.createLineWrapLabel(
i18nText("Fine-Design_Basic_Preference_Caching_Template_Tip"), MEMORY_TIP_LABEL_MAX_WIDTH); i18nText("Fine-Design_Basic_Preference_Caching_Template_Tip"), MEMORY_TIP_LABEL_MAX_WIDTH);
memoryTipLabel.setBorder(BorderFactory.createEmptyBorder(0, CACHING_GAP, 0, 0));
cachingTemplateSpinner = new UISpinner(0, CACHING_MAX, 1, CACHING_DEFAULT); cachingTemplateSpinner = new UISpinner(0, CACHING_MAX, 1, CACHING_DEFAULT);
JPanel memorySpace = new JPanel(FRGUIPaneFactory.createLeftZeroLayout()); JPanel memoryPane = row(5,
memorySpace.add(memoryLabel); cell(memoryLabel),
memorySpace.add(cachingTemplateSpinner); cell(cachingTemplateSpinner),
memorySpace.add(memoryTipLabel); cell(memoryTipLabel)
memoryPane.add(memorySpace); ).getComponent();
return memoryPane; return FineUIUtils.wrapComponentWithTitle(memoryPane, i18nText("Fine-Design_Basic_Preference_Caching_Template"));
} }
@Override @Override
@ -1286,7 +1237,7 @@ public class PreferencePane extends BasicPane {
@Override @Override
public BasicDialog showWindow(Window window, DialogActionListener l) { public BasicDialog showWindow(Window window, DialogActionListener l) {
return showWindowWithCustomSize(window, l, new Dimension(BasicDialog.DEFAULT.width, this.getPreferredSize().height + OFFSET_HEIGHT)); return showWindowWithCustomSize(window, l, new Dimension(BasicDialog.DEFAULT.width, BasicDialog.DEFAULT.height + OFFSET_HEIGHT));
} }
private void tryGc() { private void tryGc() {
@ -1482,7 +1433,7 @@ public class PreferencePane extends BasicPane {
*/ */
private UIButton initGcButton() { private UIButton initGcButton() {
UIButton gcButton = new UIButton(i18nText("Fine-Design_Vcs_Clean")); UIButton gcButton = new UIButton(i18nText("Fine-Design_Vcs_Clean"));
gcButton.setPreferredSize(new Dimension(100, 15)); gcButton.setPreferredSize(FineUIScale.scale(new Dimension(100, 15)));
gcButton.setRoundBorder(true, Constants.LEFT); gcButton.setRoundBorder(true, Constants.LEFT);
return gcButton; return gcButton;
} }

5
designer-base/src/main/java/com/fr/design/actions/help/AboutDialog.java

@ -1,5 +1,7 @@
package com.fr.design.actions.help; package com.fr.design.actions.help;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle;
import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -41,6 +43,7 @@ public class AboutDialog extends JDialog implements ActionListener {
this.setContentPane(defaultPane); this.setContentPane(defaultPane);
okButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")); okButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK"));
FineUIStyle.setStyle(okButton, FineUIStyle.STYLE_PRIMARY);
okButton.addActionListener(this); okButton.addActionListener(this);
tabbedPane = new UITabbedPane(); tabbedPane = new UITabbedPane();
@ -76,7 +79,7 @@ public class AboutDialog extends JDialog implements ActionListener {
this.getRootPane().setDefaultButton(okButton); this.getRootPane().setDefaultButton(okButton);
this.setSize(defaultPane.getPreferredSize().width, 600); this.setSize(FineUIScale.scale(new Dimension(defaultPane.getPreferredSize().width, 600)));
GUICoreUtils.centerWindow(this); GUICoreUtils.centerWindow(this);
} }

11
designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java

@ -3,6 +3,8 @@
*/ */
package com.fr.design.actions.help; package com.fr.design.actions.help;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
@ -31,6 +33,8 @@ import java.awt.event.MouseEvent;
import java.net.URI; import java.net.URI;
import java.util.Locale; import java.util.Locale;
import static com.fine.swing.ui.layout.Layouts.column;
public class AboutPane extends JPanel { public class AboutPane extends JPanel {
private static final String FINEREPORT = "FineReport"; private static final String FINEREPORT = "FineReport";
private static final int DEFAULT_GAP = 12; private static final int DEFAULT_GAP = 12;
@ -49,10 +53,11 @@ public class AboutPane extends JPanel {
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy_Build_NO") + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy_Build_NO") +
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy_Build_NO_OK")); com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy_Build_NO_OK"));
//center panel //center panel
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); JPanel contentPane = column().getComponent();
centerPane.add(contentPane, BorderLayout.NORTH); centerPane.add(contentPane, BorderLayout.NORTH);
contentPane.add(new BoxCenterAligmentPane(getBuildTitle())); contentPane.add(new BoxCenterAligmentPane(getBuildTitle()));
@ -325,7 +330,7 @@ public class AboutPane extends JPanel {
}); });
this.lastLabel = new UILabel(descriptions[0]); this.lastLabel = new UILabel(descriptions[0]);
lastLabel.setForeground(Color.lightGray); FineUIStyle.setStyle(lastLabel, FineUIStyle.LABEL_TIP);
centerPane.add(lastLabel); centerPane.add(lastLabel);
add(centerPane, BorderLayout.CENTER); add(centerPane, BorderLayout.CENTER);

1
designer-base/src/main/java/com/fr/design/gui/style/TextFormatPane.java

@ -3,7 +3,6 @@ package com.fr.design.gui.style;
import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIStyle;
import com.fine.theme.utils.FineUIUtils; import com.fine.theme.utils.FineUIUtils;
import com.fr.base.CoreDecimalFormat; import com.fr.base.CoreDecimalFormat;
import com.fr.base.GraphHelper;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.base.TextFormat; import com.fr.base.TextFormat;
import com.fr.data.core.FormatField; import com.fr.data.core.FormatField;

9
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsMovePanel.java

@ -27,7 +27,6 @@ import com.fr.stable.StringUtils;
import com.fr.workspace.server.vcs.v2.move.VcsMoveService; import com.fr.workspace.server.vcs.v2.move.VcsMoveService;
import com.fr.workspace.server.vcs.v2.move.VcsMoveStrategy; import com.fr.workspace.server.vcs.v2.move.VcsMoveStrategy;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -45,6 +44,7 @@ import java.awt.event.MouseEvent;
import java.util.List; import java.util.List;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import static com.fine.swing.ui.layout.Layouts.row;
import static javax.swing.JOptionPane.YES_OPTION; import static javax.swing.JOptionPane.YES_OPTION;
@ -61,8 +61,6 @@ public class VcsMovePanel extends BasicPane {
.applySize(14) .applySize(14)
.applyStyle(FRFont.BOLD); .applyStyle(FRFont.BOLD);
// private static final Color BACK_GROUND_COLOR = new Color(202,232,255);
//提示字体的颜色,直接模仿其他面板的写法 //提示字体的颜色,直接模仿其他面板的写法
private static final Color TIP_COLOR = new Color(51, 51, 52, (int)Math.round(0.5 * 255)); private static final Color TIP_COLOR = new Color(51, 51, 52, (int)Math.round(0.5 * 255));
@ -138,8 +136,7 @@ public class VcsMovePanel extends BasicPane {
this.callBack = callBack; this.callBack = callBack;
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.parentDialog = parentDialog; this.parentDialog = parentDialog;
updatePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); updatePane = row(10).getComponent();
updatePane.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 0));
//初始化顶部的面板 //初始化顶部的面板
initVcsLabel(updatePane); initVcsLabel(updatePane);
//initVcsChoosePane //initVcsChoosePane
@ -261,12 +258,10 @@ public class VcsMovePanel extends BasicPane {
private void initVcsLabel(JPanel parent) { private void initVcsLabel(JPanel parent) {
parent.removeAll(); parent.removeAll();
if (!VcsHelper.getInstance().isLegacyMode()) { if (!VcsHelper.getInstance().isLegacyMode()) {
// parent.setBackground(ThemeUtils.BACK_COLOR);
centerButton = new UIButton(Toolkit.i18nText("Fine-Design_Vcs_Center")); centerButton = new UIButton(Toolkit.i18nText("Fine-Design_Vcs_Center"));
parent.add(centerButton); parent.add(centerButton);
initVcsCenterListener(); initVcsCenterListener();
} else { } else {
// parent.setBackground(BACK_GROUND_COLOR);
vcsUpdateExistLabel = new UILabel(IconUtils.readIcon("/com/fr/design/vcs/vcs_move_icon.svg")); vcsUpdateExistLabel = new UILabel(IconUtils.readIcon("/com/fr/design/vcs/vcs_move_icon.svg"));
vcsUpdateExistLabel.setText(Toolkit.i18nText("Fine-Design_Vcs_Can_Update")); vcsUpdateExistLabel.setText(Toolkit.i18nText("Fine-Design_Vcs_Can_Update"));
vcsUpdateFireLabel = new UILabel(Toolkit.i18nText("Fine-Design_Vcs_Update")); vcsUpdateFireLabel = new UILabel(Toolkit.i18nText("Fine-Design_Vcs_Update"));

Loading…
Cancel
Save