From a74ef15eb8ae1c24921076db96888d554cbebf2d Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 6 Dec 2021 09:49:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?CHART-21584=20feat:fvs.chart.font=20?= =?UTF-8?q?=E5=8D=95=E4=BD=8Dpx=20=E8=8C=83=E5=9B=B46-200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/style/ChartTextAttrPane.java | 10 ++++++++-- .../chart/gui/style/ChartTextAttrPaneWithAuto.java | 13 +++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index 9a906cc7c0..956a28e142 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -13,6 +13,7 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; import com.fr.general.GeneralUtils; @@ -29,16 +30,21 @@ public class ChartTextAttrPane extends BasicPane { private static final long serialVersionUID = 6731679928019436869L; public static final int FONT_START = 6; public static final int FONT_END = 72; + public static final int FONT_END_4_DUCHAMP = 200; private UIComboBox fontNameComboBox; private UIComboBox fontSizeComboBox; private UIToggleButton bold; private UIToggleButton italic; private UIColorButton fontColor; - public static Integer[] FONT_SIZES = new Integer[FONT_END - FONT_START + 1]; + private static Integer[] FONT_SIZES = new Integer[FONT_END - FONT_START + 1]; + private static Integer[] FONT_SIZES_4_DUCHAMP = new Integer[FONT_END_4_DUCHAMP - FONT_START + 1]; static { for (int i = FONT_START; i <= FONT_END; i++) { FONT_SIZES[i - FONT_START] = i; } + for (int i = FONT_START; i <= FONT_END_4_DUCHAMP; i++) { + FONT_SIZES_4_DUCHAMP[i - FONT_START] = i; + } } public ChartTextAttrPane() { @@ -176,7 +182,7 @@ public class ChartTextAttrPane extends BasicPane { } protected Object[] getFontSizeComboBoxModel() { - return FONT_SIZES; + return ChartEditContext.duchampMode() ? FONT_SIZES_4_DUCHAMP : FONT_SIZES; } protected void initState() { diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java index 292d83c9e7..af157afca2 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java @@ -4,23 +4,30 @@ import com.fr.chart.base.ChartConstants; import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIColorButtonWithAuto; import com.fr.design.i18n.Toolkit; -import com.fr.plugin.chart.type.FontAutoType; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; import com.fr.general.GeneralUtils; +import com.fr.plugin.chart.type.FontAutoType; public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { private static final String AUTO = Toolkit.i18nText("Fine-Design_Basic_ChartF_Auto"); private FontAutoType type; public static String[] FONT_SIZES_WITH_AUTO = new String[FONT_END - FONT_START + 2]; + private static String[] FONT_SIZES_WITH_AUTO_4_DUCHAMP = new String[FONT_END_4_DUCHAMP - FONT_START + 2]; static { FONT_SIZES_WITH_AUTO[0] = AUTO; + FONT_SIZES_WITH_AUTO_4_DUCHAMP[0] = AUTO; for (int i = 1; i < FONT_SIZES_WITH_AUTO.length; i++) { FONT_SIZES_WITH_AUTO[i] = FONT_START + i - 1 + ""; } + + for (int i = 1; i < FONT_SIZES_WITH_AUTO_4_DUCHAMP.length; i++) { + FONT_SIZES_WITH_AUTO_4_DUCHAMP[i] = FONT_START + i - 1 + ""; + } } public ChartTextAttrPaneWithAuto(FontAutoType type) { @@ -42,7 +49,9 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { } protected Object[] getFontSizeComboBoxModel() { - return isFontSizeAuto() ? FONT_SIZES_WITH_AUTO : FONT_SIZES; + return isFontSizeAuto() + ? (ChartEditContext.duchampMode() ? FONT_SIZES_WITH_AUTO_4_DUCHAMP : FONT_SIZES_WITH_AUTO) + : super.getFontSizeComboBoxModel(); } protected float updateFontSize() { From adf49bfded20a12f7fc261119314b1fc582069f4 Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 6 Dec 2021 09:50:47 +0800 Subject: [PATCH 2/2] update --- .../fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index 956a28e142..d07ec476e9 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -36,7 +36,7 @@ public class ChartTextAttrPane extends BasicPane { private UIToggleButton bold; private UIToggleButton italic; private UIColorButton fontColor; - private static Integer[] FONT_SIZES = new Integer[FONT_END - FONT_START + 1]; + public static Integer[] FONT_SIZES = new Integer[FONT_END - FONT_START + 1]; private static Integer[] FONT_SIZES_4_DUCHAMP = new Integer[FONT_END_4_DUCHAMP - FONT_START + 1]; static { for (int i = FONT_START; i <= FONT_END; i++) {