From 5ad2313830c4700cbf3f482a3c6c89f228816271 Mon Sep 17 00:00:00 2001 From: "Richard.Fang" Date: Tue, 3 Sep 2024 18:57:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-132799=20&=20REPORT-131838=20&=20REP?= =?UTF-8?q?ORT-132389=20&=20REPORT-132382=20&=20REPORT-132380=20&=20REPORT?= =?UTF-8?q?-132375=20&=20REPORT-132357=20&=20REPORT-132231=20&=20REPORT-13?= =?UTF-8?q?2227=E3=80=90newUI=E3=80=91fix:=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E8=B0=83=E6=95=B4=E5=8F=8ATab=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E4=BF=AE=E5=A4=8D/fbp=E5=9B=9E=E5=BD=92=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/light/ui/FineToggleButtonUI.java | 11 ++++- .../theme/utils/FineClientProperties.java | 1 + .../com/fine/theme/utils/FineUIUtils.java | 18 +++---- .../design/actions/file/PreferencePane.java | 2 +- .../data/datapane/connect/AdvancePane.java | 3 +- .../data/datapane/connect/DBCPAttrPane.java | 3 +- .../fr/design/gui/frpane/FineTabbedPane.java | 48 +++++++++++++++---- .../fr/design/gui/ibutton/UIButtonGroup.java | 2 +- .../fr/design/gui/ibutton/UIHeadGroup.java | 16 +++++++ .../mainframe/vcs/ui/RecycleSettingPane.java | 3 +- .../style/background/BackgroundPane.java | 3 +- .../fr/design/i18n/dimension_en.properties | 2 + .../fr/design/i18n/dimension_ja_JP.properties | 2 + .../fr/design/i18n/dimension_ko_KR.properties | 2 + .../fr/design/i18n/dimension_zh.properties | 2 + .../fr/design/i18n/dimension_zh_TW.properties | 2 + .../gui/style/series/UIColorPickerPane.java | 4 +- .../design/module/ChartPreFillStylePane.java | 15 ++---- .../component/VanChartHeatValueColorPane.java | 2 +- .../SectionIntervalConfigPaneWithOutNum.java | 10 ---- .../report/ReportPrintSettingAction.java | 5 +- .../headerfooter/HFAttributesEditDialog.java | 2 +- .../report/freeze/FreezeAndRepeatPane.java | 3 +- .../fr/design/webattr/PageToolBarPane.java | 20 ++++---- .../design/webattr/ReportWriteAttrPane.java | 5 +- .../AbstractNativePrintSettingPane.java | 40 ++++++++-------- .../printsettings/PrintSettingPane.java | 5 +- 27 files changed, 137 insertions(+), 94 deletions(-) diff --git a/designer-base/src/main/java/com/fine/theme/light/ui/FineToggleButtonUI.java b/designer-base/src/main/java/com/fine/theme/light/ui/FineToggleButtonUI.java index ad28f76f8c..49df9d63d1 100644 --- a/designer-base/src/main/java/com/fine/theme/light/ui/FineToggleButtonUI.java +++ b/designer-base/src/main/java/com/fine/theme/light/ui/FineToggleButtonUI.java @@ -22,6 +22,7 @@ import java.awt.Shape; import java.awt.Rectangle; import static com.fine.theme.utils.FineClientProperties.BUTTON_TYPE_GROUP; +import static com.fine.theme.utils.FineClientProperties.BUTTON_TYPE_GROUP_FIT; import static com.fine.theme.utils.FineClientProperties.BUTTON_TYPE; import static com.fine.theme.utils.FineClientProperties.BUTTON_TYPE_TAB; import static com.fine.theme.utils.FineClientProperties.BUTTON_GROUP_POSITION; @@ -96,12 +97,20 @@ public class FineToggleButtonUI extends FlatToggleButtonUI { } static boolean isGroupButton(Component c) { + if (!(c instanceof UIButton)) { + return false; + } + String buttonType = getButtonTypeStr((UIButton) c); + return BUTTON_TYPE_GROUP.equals(buttonType) || BUTTON_TYPE_GROUP_FIT.equals(buttonType); + } + + static boolean isGroupButtonNotFit(Component c) { return c instanceof UIButton && BUTTON_TYPE_GROUP.equals(getButtonTypeStr((UIButton) c)); } @Override public void paint(Graphics g, JComponent c) { - if (isGroupButton(c) || isTabButton(c)) { + if (isGroupButtonNotFit(c) || isTabButton(c)) { ((AbstractButton)c).setMargin(FineUIUtils.getUIInsets("ToggleButton.compact.margin", "ToggleButton.margin")); } super.paint(g, c); diff --git a/designer-base/src/main/java/com/fine/theme/utils/FineClientProperties.java b/designer-base/src/main/java/com/fine/theme/utils/FineClientProperties.java index 3b1e5933b2..da8e252ca5 100644 --- a/designer-base/src/main/java/com/fine/theme/utils/FineClientProperties.java +++ b/designer-base/src/main/java/com/fine/theme/utils/FineClientProperties.java @@ -13,6 +13,7 @@ public interface FineClientProperties extends FlatClientProperties { //--------------------------- ButtonGroup ----------------------- String BUTTON_TYPE_GROUP = "group"; + String BUTTON_TYPE_GROUP_FIT = "groupFit"; String BUTTON_BORDER = "buttonBorder"; String BUTTON_BORDER_LEFT_ROUND_RECT = "leftRoundRect"; diff --git a/designer-base/src/main/java/com/fine/theme/utils/FineUIUtils.java b/designer-base/src/main/java/com/fine/theme/utils/FineUIUtils.java index 686788b680..c749bf5f3c 100644 --- a/designer-base/src/main/java/com/fine/theme/utils/FineUIUtils.java +++ b/designer-base/src/main/java/com/fine/theme/utils/FineUIUtils.java @@ -6,7 +6,7 @@ import com.fr.design.border.FineBorderFactory; import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.utils.gui.UIComponentUtils; +import com.fr.design.mainframe.theme.edit.ui.LabelUtils; import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.stable.os.OperatingSystem; import com.fr.value.AtomicClearableLazyValue; @@ -15,6 +15,7 @@ import javax.swing.JLabel; import javax.swing.JLayer; import javax.swing.ScrollPaneConstants; import javax.swing.UIManager; +import javax.swing.JTextArea; import java.awt.Color; import java.awt.Component; import java.awt.Composite; @@ -450,16 +451,11 @@ public class FineUIUtils { } /** - * 创建一个支持自动换行的 UILabel,并应用指定样式。 - * - * @param text 要显示的文本内容 - * @param style 样式字符串 - * @return 支持自动换行的 UILabel + * 创建一个支持自动换行的提示文本 + * @param text 显示的文本内容 + * @return 自动换行提示文本 */ - public static UILabel createLineWrapLabel(String text, String style) { - UILabel label = new UILabel(text); - FineUIStyle.setStyle(label, style); - UIComponentUtils.setLineWrap(label); - return label; + public static JTextArea createAutoWrapTipLabel(String text) { + return LabelUtils.createAutoWrapLabel(text, FineUIUtils.getUIColor("Label.tipColor", "inactiveCaption")); } } diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index d7fc13554e..28cf547f61 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -48,7 +48,6 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; -import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.general.log.Log4jConfig; import com.fr.io.attr.ImageExportAttr; @@ -347,6 +346,7 @@ public class PreferencePane extends BasicPane { .addTab(i18nText("Fine-Design_Basic_General"), generalScrollPane) .addTab(i18nText("Fine-Design_Basic_Advanced"), adviceScrollPane) .addTab(i18nText("Fine-Design_Vcs_Title"), vcsParentPane) + .withAdaptiveFit() .build(); contentPane.add(tabbedPane, BorderLayout.CENTER); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/AdvancePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/AdvancePane.java index a2aadbb030..a9a2c90da9 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/AdvancePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/AdvancePane.java @@ -53,7 +53,8 @@ public class AdvancePane extends BasicPane { flex(2) ), row( - cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_On_Borrow"), SwingConstants.LEFT)).weight(1), + cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_On_Borrow"), SwingConstants.LEFT)) + .with(it -> it.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_On_Borrow"))).weight(1), cell(DBCP_TEST_ON_BORROW).weight(1.5), flex(2) ), diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DBCPAttrPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DBCPAttrPane.java index 5436a4affb..d114f64544 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DBCPAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DBCPAttrPane.java @@ -15,6 +15,7 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.theme.edit.ui.LabelUtils; import com.fr.general.ComparatorUtils; import com.fr.stable.StringUtils; @@ -83,7 +84,7 @@ public class DBCPAttrPane extends BasicPane { row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Connection_Pool_Evictionruns_millis"))).weight(1), cell(DBCP_TIMEBETWEENEVICTIONRUNSMILLS).weight(1)), row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Num_Test_Per_Evction_Run"))).weight(1), cell(DBCP_NUMTESTSPEREVICTIONRUN).weight(1)), row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Connection_Pool_Mix_Evictable_Idle_Time_Millis"))).weight(1), cell(DBCP_MINEVICTABLEIDLETIMEMILLIS).weight(1)), - cell(FineUIUtils.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Dbcp_Warning"), FineUIStyle.LABEL_WARNING_TIP)) + cell(LabelUtils.createAutoWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Dbcp_Warning"), FineUIUtils.getUIColor("Label.warningColor", "Label.warningColor"))) ).getComponent(); defaultPane.add(northFlowPane); this.add(defaultPane); diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java index 5ed4b5bcf3..1d4274bb99 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java @@ -4,9 +4,14 @@ import com.fine.swing.ui.layout.Box; import com.fine.theme.utils.FineUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.util.ScaledEmptyBorder; +import com.fr.design.gui.ibutton.FitUIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.utils.ColorUtils; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.List; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; @@ -42,15 +47,15 @@ public class FineTabbedPane extends Box { private final UIButtonGroup tabGroup; private final Map tabComponents; private final int[] tabLayout; + private final boolean useFitTab ; - private FineTabbedPane(Map tabComponents, float headRatio, int[] tabLayout) { + private FineTabbedPane(Map tabComponents, float headRatio, int[] tabLayout, boolean useFitTab) { this.headRatio = headRatio; this.tabComponents = tabComponents; this.tabLayout = tabLayout; - + this.useFitTab = useFitTab; String[] titleArray = tabComponents.keySet().toArray(new String[0]); - this.tabGroup = new UIButtonGroup<>(titleArray, titleArray, tabLayout); - + this.tabGroup = useFitTab ? new FitUIButtonGroup<>(titleArray, titleArray, tabLayout) : new UIButtonGroup<>(titleArray, titleArray, tabLayout); initLayout(); initListeners(); } @@ -71,6 +76,7 @@ public class FineTabbedPane extends Box { private int[] tabLayout; private float headRatio = 0.5f; private final Map tabComponents = new LinkedHashMap<>(); + private boolean useFitTab = false; /** * 设置头部居中比例,0-1之间 @@ -94,6 +100,16 @@ public class FineTabbedPane extends Box { return this; } + /** + * 设置使用自适应文本Tab + * + * @return TabPaneBuilder + */ + public TabPaneBuilder withAdaptiveFit() { + this.useFitTab = true; + return this; + } + /** * 添加tab标签 * @@ -122,7 +138,7 @@ public class FineTabbedPane extends Box { } else if (Arrays.stream(tabLayout).sum() != tabComponents.size()) { throw new IllegalArgumentException("illegal tab layout argument!"); } - return new FineTabbedPane(tabComponents, headRatio, tabLayout); + return new FineTabbedPane(tabComponents, headRatio, tabLayout, useFitTab); } } @@ -131,11 +147,10 @@ public class FineTabbedPane extends Box { setMatchParentSize(true); float flexRatio = (1 - headRatio) / 2; int headHeight = FlatUIUtils.getUIInt("Component.defaultHeight",24) * tabLayout.length / 2; + Component component = useFitTab ? row(flex(), cell(tabGroup), flex()).getComponent() : row(flex(flexRatio), cell(tabGroup).weight(headRatio), flex(flexRatio)).getComponent(); add( column( - row( - flex(flexRatio), cell(tabGroup).weight(headRatio), flex(flexRatio) - ), + cell(component), flex() ), column( @@ -170,6 +185,23 @@ public class FineTabbedPane extends Box { }); tabGroup.setSelectedIndex(0); cards.show(centerPane, String.valueOf(tabGroup.getSelectedItem())); + if (!useFitTab) { + initTabListeners(); + } + } + + private void initTabListeners() { + List tabs = tabGroup.getLabelButtonList(); + for (UIToggleButton tab : tabs) { + tab.addMouseListener(new MouseAdapter() { + @Override + public void mouseEntered(MouseEvent e) { + if (tab.getPreferredSize().width > tab.getWidth()) { + tab.setToolTipText(tab.getText()); + } + } + }); + } } private void fireStateChanged() { diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java index d5fa52cc21..fd74f7d042 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java @@ -227,7 +227,7 @@ public class UIButtonGroup extends Column implements GlobalNameObserver, UIOb } } - protected List getLabelButtonList() { + public List getLabelButtonList() { return labelButtonList; } diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIHeadGroup.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIHeadGroup.java index 4f6ee08cc8..715fd3e793 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIHeadGroup.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIHeadGroup.java @@ -5,6 +5,8 @@ import com.fine.swing.ui.layout.Row; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.third.guava.collect.Streams; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import javax.swing.AbstractButton; import javax.swing.ButtonGroup; import javax.swing.Icon; @@ -72,6 +74,20 @@ public class UIHeadGroup extends Row { add(buttonGroup()); setSelectedIndex(0); setBorder(new ScaledEmptyBorder(2, 2, 2, 2)); + initButtonListeners(); + } + + private void initButtonListeners() { + for (AbstractButton tab : btns) { + tab.addMouseListener(new MouseAdapter() { + @Override + public void mouseEntered(MouseEvent e) { + if (tab.getPreferredSize().width > tab.getWidth()) { + tab.setToolTipText(tab.getText()); + } + } + }); + } } private Layouts.Cell[] buttonGroup() { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecycleSettingPane.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecycleSettingPane.java index 65549bc1a9..84903f848b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecycleSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecycleSettingPane.java @@ -10,7 +10,6 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.VerticalFlowLayout; import com.fr.design.mainframe.vcs.VcsRecycleSettingHelper; import com.fr.workspace.server.vcs.VcsConfig; @@ -63,7 +62,7 @@ public class RecycleSettingPane extends BasicPane { FineTabbedPane tabbedPane = FineTabbedPane.builder() .addTab(Toolkit.i18nText("Fine-Design_Vcs_Recycle_Content"), recycleScrollPane) .addTab(Toolkit.i18nText("Fine-Design_Basic_Carton_General_Settings"), settingScrollPane) - .withHeadRatio(0.3f).build(); + .withAdaptiveFit().build(); this.add(tabbedPane, BorderLayout.CENTER); } diff --git a/designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java b/designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java index 7099ed7652..786c472c08 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java +++ b/designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java @@ -24,7 +24,6 @@ import com.fr.general.Background; import com.fr.log.FineLoggerFactory; import static com.fine.swing.ui.layout.Layouts.cell; -import static com.fine.swing.ui.layout.Layouts.column; public class BackgroundPane extends BasicPane { @@ -47,7 +46,7 @@ public class BackgroundPane extends BasicPane { protected void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); initTabPane(); - tabbedPane = tabbedPaneBuilder.withHeadRatio(0.65f).build(); + tabbedPane = tabbedPaneBuilder.withAdaptiveFit().build(); add(cell(tabbedPane).weight(1).getComponent()); } diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties index 4e672107a3..f35b30539f 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties @@ -35,4 +35,6 @@ com.fr.design.mainframe.EastRegionContainerPane.minimum=340*400 com.fr.design.mainframe.EastRegionContainerPane.standard=480*400 com.fr.design.ds.column.cellEditor.pane=900*600 com.fr.design.actions.reportWebAttr.dialog=800*630 +com.fr.design.actions.printingSetting.dialog=800*600 + diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties index 53506f2463..31e4ae38e5 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties @@ -34,4 +34,6 @@ com.fr.design.mainframe.EastRegionContainerPane.minimum=340*400 com.fr.design.mainframe.EastRegionContainerPane.standard=480*400 com.fr.design.ds.column.cellEditor.pane=900*600 com.fr.design.actions.reportWebAttr.dialog=700*630 +com.fr.design.actions.printingSetting.dialog=700*600 + diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties index 090dc8025f..73b022f454 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties @@ -34,4 +34,6 @@ com.fr.design.mainframe.EastRegionContainerPane.minimum=340*400 com.fr.design.mainframe.EastRegionContainerPane.standard=340*400 com.fr.design.ds.column.cellEditor.pane=900*600 com.fr.design.actions.reportWebAttr.dialog=700*630 +com.fr.design.actions.printingSetting.dialog=700*600 + diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties index b67ce3ad52..bc6f1a8810 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties @@ -34,4 +34,6 @@ com.fr.design.mainframe.EastRegionContainerPane.minimum=286*400 com.fr.design.mainframe.EastRegionContainerPane.standard=286*400 com.fr.design.ds.column.cellEditor.pane=700*600 com.fr.design.actions.reportWebAttr.dialog=660*600 +com.fr.design.actions.printingSetting.dialog=660*600 + diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties index 8b2561a9ec..842dde7fc3 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties @@ -33,4 +33,6 @@ com.fr.design.mainframe.EastRegionContainerPane.minimum=286*400 com.fr.design.mainframe.EastRegionContainerPane.standard=286*400 com.fr.design.ds.column.cellEditor.pane=700*600 com.fr.design.actions.reportWebAttr.dialog=700*630 +com.fr.design.actions.printingSetting.dialog=700*600 + diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java index 50f498c30a..c8fdc1adce 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe.chart.gui.style.series; import com.fine.theme.utils.FineLayoutBuilder; -import com.fine.theme.utils.FineUIScale; import com.fr.base.BaseFormula; import com.fr.chart.base.AreaColor; import com.fr.chart.base.ChartBaseUtils; @@ -45,13 +44,12 @@ import java.awt.event.MouseEvent; import java.util.ArrayList; import java.util.List; -import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.theme.utils.FineUIScale.scale; public class UIColorPickerPane extends BasicPane implements UIObserver { private static final int MARGIN_TOP = scale(7); private static final int MARGIN_LEFT = scale(5); - private static final int COLORGROUP_MARGIN_LEFT = scale(20); + private static final int COLORGROUP_MARGIN_LEFT = scale(15); private static final int OFF_HEIGHT = scale(6); private static final int COLOR_REC_HEIGHT = scale(40); private static final int COLOR_REC_WIDTH = scale(30); diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java index 15ab98fd8a..24a31be407 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java @@ -3,17 +3,13 @@ package com.fr.design.module; import com.fine.theme.utils.FineUIScale; import com.fr.base.ChartColorMatching; import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.ibutton.FitUIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.style.background.gradient.FixedGradientBarNoTheme; import com.fr.design.style.color.ColorAdjustPane; import com.fr.design.style.background.gradient.FixedGradientBar; -import javax.swing.BorderFactory; import javax.swing.JPanel; import java.util.ArrayList; import java.util.Collections; @@ -21,7 +17,6 @@ import java.util.List; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Color; -import java.awt.Component; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -43,7 +38,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { private JPanel changeColorSetPane; private CardLayout cardLayout; - private UIButtonGroup groupButton; + private FitUIButtonGroup groupButton; private ColorAdjustPane colorAdjustPane; private FixedGradientBar colorGradient; @@ -59,7 +54,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { } private void initComponents() { - groupButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Custom_Color"), Toolkit.i18nText("Fine-Design_Chart_Gradient_Color")}); + groupButton = new FitUIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Custom_Color"), Toolkit.i18nText("Fine-Design_Chart_Gradient_Color")}); groupButton.setSelectedIndex(0); changeColorSetPane = new JPanel(cardLayout = new CardLayout()); changeColorSetPane.add(colorGradient = new FixedGradientBarNoTheme(4, 150), "gradient"); @@ -76,8 +71,8 @@ public class ChartPreFillStylePane extends BasicBeanPane { 10, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color_Match"))), row( - cell(groupButton).weight(0.1), - flex(0.2) + cell(groupButton), + flex() ), row( cell(changeColorSetPane).with(it -> it.setPreferredSize(FineUIScale.scale(new Dimension(COLOR_ADJUST_PANE_WIDTH, COLOR_ADJUST_PANE_HEIGHT)))), diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHeatValueColorPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHeatValueColorPane.java index 527c50f3ae..e75726b3c5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHeatValueColorPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHeatValueColorPane.java @@ -51,7 +51,7 @@ public class VanChartHeatValueColorPane extends VanChartValueColorPane { @Override protected MapColorPickerPaneWithFormula createSectionIntervalConfigPane(AbstractAttrNoScrollPane parent) { return new SectionIntervalConfigPaneWithOutNum(parent) { - private final int WIDTH = FineUIScale.scale(227); + private final int WIDTH = FineUIScale.scale(218); @Override protected int getBoundX() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java b/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java index a6fc4cfbe8..044945d63e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java +++ b/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java @@ -9,7 +9,6 @@ import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithForm import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.Component; -import java.awt.Dimension; /** * Created by Mitisky on 16/10/20. @@ -44,21 +43,12 @@ public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithF @Override protected Component[][] createComponents() { numLabel = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Value_Divided_Stage")); - - setRegionVisible(false); - return new Component[][]{ new Component[]{new BoldFontTextLabel(getNameOfSubRange()), getDesignTypeButtonGroup()}, new Component[]{numLabel, getRegionNumPane()}, }; } - @Override - public Dimension getPreferredSize() { - Dimension dim = super.getPreferredSize(); - return new Dimension((int) dim.getWidth(), (int) dim.getHeight() - (numLabel.isVisible() ? 0 : 30)); - } - @Override public void populateBean(MapHotAreaColor hotAreaColor) { super.populateBean(hotAreaColor); diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportPrintSettingAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportPrintSettingAction.java index f77fc913dd..ab6bbf04d7 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportPrintSettingAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportPrintSettingAction.java @@ -5,6 +5,7 @@ import com.fr.base.print.PrintSettingsAttrMark; import com.fr.design.actions.JWorkBookAction; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JWorkBook; import com.fr.design.menu.MenuKeySet; @@ -44,14 +45,14 @@ public class ReportPrintSettingAction extends JWorkBookAction { final ReportPrintSettingPane reportPrintSettingPane = new ReportPrintSettingPane(); reportPrintSettingPane.populate(printSettings); - BasicDialog dialog = reportPrintSettingPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { + BasicDialog dialog = reportPrintSettingPane.showWindowWithCustomSize(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { PrintSettingsAttrMark newPrintSettings = reportPrintSettingPane.updateBean(); wbTpl.addAttrMark(newPrintSettings); jwb.fireTargetModified(); } - }); + }, DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.actions.printingSetting.dialog")); dialog.setVisible(true); } diff --git a/designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java b/designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java index 092aa71210..5bdd671ea1 100644 --- a/designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java +++ b/designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java @@ -213,7 +213,7 @@ public class HFAttributesEditDialog extends BasicPane { this.revalidate(); add(column( cell(centerPane), - cell(tabbedPaneBuilder.withHeadRatio(0.13f).build()).weight(1) + cell(tabbedPaneBuilder.withAdaptiveFit().build()).weight(1) ).getComponent()); if (isInsert) { this.moveLeftButton.setEnabled(false); diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java index 83848152b1..7d22ebabb1 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java @@ -1,5 +1,6 @@ package com.fr.design.report.freeze; +import com.fine.theme.utils.FineUIScale; import java.awt.Dimension; import javax.swing.JComponent; import com.fr.design.gui.ilable.UILabel; @@ -26,7 +27,7 @@ public abstract class FreezeAndRepeatPane extends BasicBeanPane { protected boolean isEnalbed; protected void initComponent() { - Dimension size = new Dimension(50, 21); + Dimension size = FineUIScale.createScaleDimension(50, 21); if (start instanceof UISpinner) { start.setPreferredSize(size); ((UISpinner) start).addChangeListener(new ChangeListener() { diff --git a/designer-realize/src/main/java/com/fr/design/webattr/PageToolBarPane.java b/designer-realize/src/main/java/com/fr/design/webattr/PageToolBarPane.java index 181bb9dc26..952d3cc8a2 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/PageToolBarPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/PageToolBarPane.java @@ -1,7 +1,6 @@ package com.fr.design.webattr; -import com.fine.theme.utils.FineUIStyle; -import com.formdev.flatlaf.util.ScaledEmptyBorder; +import com.fine.theme.utils.FineUIUtils; import com.fr.base.ConfigManager; import com.fr.config.Configuration; import com.fr.design.constants.LayoutConstants; @@ -104,25 +103,22 @@ public class PageToolBarPane extends AbstractEditToolBarPane { pageFixedRowCountTextField.addKeyListener(rowCountKeyListener); pageFixedRowCountTextField.addInputMethodListener(rowCountInputMethodListener); - UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Page_Fixed_Row_Tip")); - FineUIStyle.setStyle(tipLabel, FineUIStyle.LABEL_TIP); - JPanel northPanel = column(LayoutConstants.VERTICAL_GAP, //报表显示位置:居中展示-左展示 - row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Location"))).weight(0.15), - row(cell(centerRadioButton), fix(12), cell(leftRadioButton), flex()).weight(0.85) + row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Location"))).weight(0.2), + row(cell(centerRadioButton), fix(12), cell(leftRadioButton), flex()).weight(0.8) ), //页面:以图片方式显示-iframe嵌入时自动缩放-重方式输出格子 - row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Page"))).weight(0.15), - row(cell(isShowAsImageBox), fix(12), cell(isAutoScaleBox), fix(12), cell(isTDHeavyBox),flex()).weight(0.85) + row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Page"))).weight(0.2), + row(cell(isShowAsImageBox), fix(12), cell(isAutoScaleBox), fix(12), cell(isTDHeavyBox),flex()).weight(0.8) ), //分页设置:按行分页-每页显示行数 - row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Paging_Settings"))).weight(0.15), + row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Paging_Settings"))).weight(0.2), row(cell(isPageFixedRowBox), fix(20), cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Rows_Per_Page"))), - fix(10), cell(pageFixedRowCountTextField),flex()).weight(0.85) + fix(10), cell(pageFixedRowCountTextField),flex()).weight(0.8) ), //提示 - cell(tipLabel), + cell(FineUIUtils.createAutoWrapTipLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Page_Fixed_Row_Tip"))), //使用工具栏-编辑 row(LayoutConstants.HORIZONTAL_GAP, cell(isUseToolBarCheckBox), cell(editToolBarButton)) ).getComponent(); diff --git a/designer-realize/src/main/java/com/fr/design/webattr/ReportWriteAttrPane.java b/designer-realize/src/main/java/com/fr/design/webattr/ReportWriteAttrPane.java index 708fef7a86..09b23cbc6a 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/ReportWriteAttrPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/ReportWriteAttrPane.java @@ -2,7 +2,6 @@ package com.fr.design.webattr; import com.fr.design.gui.frpane.FineTabbedPane; import com.fr.design.gui.frpane.LoadingBasicPane; -import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.report.VerifierListPane; @@ -13,8 +12,6 @@ import com.fr.report.worksheet.WorkSheet; import com.fr.report.write.ReportWriteAttr; import javax.swing.JPanel; -import javax.swing.JTabbedPane; -import javax.swing.SwingConstants; import java.awt.BorderLayout; @@ -56,7 +53,7 @@ public class ReportWriteAttrPane extends LoadingBasicPane { .addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Submit"), submiterListPane) .addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Verify_Data_Verify"), verifierListPane) .addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Writer_ShortCuts_Setting"), writeShortCutsPane) - .withHeadRatio(0.5f) + .withAdaptiveFit() .build(); container.setPreferredSize(this.getPreferredSize()); container.add(tabbedPane, BorderLayout.CENTER); diff --git a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java index 8cded20f76..c497d1ecd0 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java @@ -14,7 +14,6 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.report.UnitFieldPane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; @@ -44,6 +43,7 @@ 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.flex; import static com.fine.swing.ui.layout.Layouts.row; +import static com.fine.swing.ui.layout.Layouts.fix; import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle; /** @@ -199,29 +199,29 @@ public abstract class AbstractNativePrintSettingPane extends JPanel { JPanel scaleCheckPane = GUICoreUtils.createCheckboxAndDynamicPane(fitPaperSizeCheck, scalePane, true); // 整体布局 centerPane = column(LayoutConstants.VERTICAL_GAP, - row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Printer"))).weight(0.1), - cell(printerComboBox).weight(0.35), - flex(0.55)), - row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Copy_Number"))).weight(0.1), - cell(copySpinner).weight(0.15), - flex(0.75)), + row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Printer"))).weight(0.15), + cell(printerComboBox).weight(0.5), + flex(0.35)), + row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Copy_Number"))).weight(0.15), + cell(copySpinner).weight(0.2), + flex(0.65)), row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Page_Number"))) - .weight(0.1).with(it -> it.setBorder(new ScaledEmptyBorder(2, 0, 0, 0))), + .weight(0.15).with(it -> it.setBorder(new ScaledEmptyBorder(2, 0, 0, 0))), cell(getPrintAreaPane()).weight(0.7), - flex(0.2)), + flex(0.15)), row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Paper"))) - .weight(0.1).with(it -> it.setBorder(new ScaledEmptyBorder(2, 0, 0, 0))), + .weight(0.15).with(it -> it.setBorder(new ScaledEmptyBorder(2, 0, 0, 0))), cell(paperSettingCheckPane).weight(0.5), - flex(0.4)), - row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout"))).weight(0.1), - cell(layoutSettingCheckPane).weight(0.2), - flex(0.7)), - row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Margin"))).weight(0.1), + flex(0.35)), + row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout"))).weight(0.15), + cell(layoutSettingCheckPane).weight(0.5), + flex(0.35)), + row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Margin"))).weight(0.15), cell(pageMarginCheckPane).weight(0.5), - flex(0.4)), - row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_EnlargeOrReduce"))).weight(0.1), + flex(0.35)), + row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_EnlargeOrReduce"))).weight(0.15), cell(scaleCheckPane).weight(0.3), - flex(0.6)) + flex(0.55)) ).getComponent(); } @@ -353,8 +353,8 @@ public abstract class AbstractNativePrintSettingPane extends JPanel { return column(LayoutConstants.VERTICAL_GAP, cell(allPageRadioButton), cell(currentPageRadioButton), - row(cell(customPageRadioButton).weight(0.1), cell(specifiedAreaField).weight(0.3), cell(areaFieldTip).weight(0.1)), - row(cell(doublePrintRadioButton).weight(0.1),cell(doublePrintComboBox).weight(0.3), flex(0.1)) + row(cell(customPageRadioButton).weight(0.11), cell(specifiedAreaField).weight(0.29), fix(4), cell(areaFieldTip).weight(0.1)), + row(cell(doublePrintRadioButton).weight(0.11),cell(doublePrintComboBox).weight(0.29), fix(4), flex(0.1)) ).getComponent(); } diff --git a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/PrintSettingPane.java b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/PrintSettingPane.java index 002401178d..3b6d761011 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/PrintSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/PrintSettingPane.java @@ -11,6 +11,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import javax.swing.ButtonGroup; import javax.swing.JPanel; +import javax.swing.ScrollPaneConstants; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Dimension; @@ -55,8 +56,8 @@ public class PrintSettingPane extends BasicPane { printPane.setLayout(printCard); printPane.add(noClientPrintRadioButton.getText(), noClientPrintSettingPane); - UIScrollPane scrollPane = new UIScrollPane(nativePrintSettingPane); - scrollPane.setPreferredSize(FineUIScale.scale(new Dimension(600, 400))); + UIScrollPane scrollPane = new UIScrollPane(nativePrintSettingPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + scrollPane.setPreferredSize(new Dimension(super.getPreferredSize().width, FineUIScale.scale(400))); printPane.add(nativePrintRadioButton.getText(), scrollPane); JPanel allPanel = column(LayoutConstants.VERTICAL_GAP, cell(north), cell(printPane)) From 5bc9c29561d4b30ac1d58e1f0a13c4904ff032e4 Mon Sep 17 00:00:00 2001 From: "Richard.Fang" Date: Tue, 3 Sep 2024 18:57:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-132799=20&=20REPORT-131838=20&=20REP?= =?UTF-8?q?ORT-132389=20&=20REPORT-132382=20&=20REPORT-132380=20&=20REPORT?= =?UTF-8?q?-132375=20&=20REPORT-132357=20&=20REPORT-132231=20&=20REPORT-13?= =?UTF-8?q?2227=E3=80=90newUI=E3=80=91fix:=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E8=B0=83=E6=95=B4=E5=8F=8ATab=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E4=BF=AE=E5=A4=8D/fbp=E5=9B=9E=E5=BD=92=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/light/ui/FineToggleButtonUI.java | 11 +++- .../theme/utils/FineClientProperties.java | 1 + .../com/fine/theme/utils/FineUIUtils.java | 18 +++---- .../design/actions/file/PreferencePane.java | 2 +- .../data/datapane/connect/AdvancePane.java | 3 +- .../data/datapane/connect/DBCPAttrPane.java | 3 +- .../fr/design/gui/frpane/FineTabbedPane.java | 48 ++++++++++++++--- .../design/gui/ibutton/FitUIButtonGroup.java | 53 +++++++++++++++++++ .../fr/design/gui/ibutton/UIButtonGroup.java | 2 +- .../fr/design/gui/ibutton/UIHeadGroup.java | 16 ++++++ .../mainframe/vcs/ui/RecycleSettingPane.java | 3 +- .../style/background/BackgroundPane.java | 3 +- .../fr/design/i18n/dimension_en.properties | 2 + .../fr/design/i18n/dimension_ja_JP.properties | 2 + .../fr/design/i18n/dimension_ko_KR.properties | 2 + .../fr/design/i18n/dimension_zh.properties | 2 + .../fr/design/i18n/dimension_zh_TW.properties | 2 + .../gui/style/series/UIColorPickerPane.java | 4 +- .../design/module/ChartPreFillStylePane.java | 15 ++---- .../component/VanChartHeatValueColorPane.java | 2 +- .../SectionIntervalConfigPaneWithOutNum.java | 10 ---- .../report/ReportPrintSettingAction.java | 5 +- .../headerfooter/HFAttributesEditDialog.java | 2 +- .../report/freeze/FreezeAndRepeatPane.java | 3 +- .../fr/design/webattr/PageToolBarPane.java | 20 +++---- .../design/webattr/ReportWriteAttrPane.java | 5 +- .../AbstractNativePrintSettingPane.java | 40 +++++++------- .../printsettings/PrintSettingPane.java | 5 +- 28 files changed, 190 insertions(+), 94 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/gui/ibutton/FitUIButtonGroup.java diff --git a/designer-base/src/main/java/com/fine/theme/light/ui/FineToggleButtonUI.java b/designer-base/src/main/java/com/fine/theme/light/ui/FineToggleButtonUI.java index ad28f76f8c..49df9d63d1 100644 --- a/designer-base/src/main/java/com/fine/theme/light/ui/FineToggleButtonUI.java +++ b/designer-base/src/main/java/com/fine/theme/light/ui/FineToggleButtonUI.java @@ -22,6 +22,7 @@ import java.awt.Shape; import java.awt.Rectangle; import static com.fine.theme.utils.FineClientProperties.BUTTON_TYPE_GROUP; +import static com.fine.theme.utils.FineClientProperties.BUTTON_TYPE_GROUP_FIT; import static com.fine.theme.utils.FineClientProperties.BUTTON_TYPE; import static com.fine.theme.utils.FineClientProperties.BUTTON_TYPE_TAB; import static com.fine.theme.utils.FineClientProperties.BUTTON_GROUP_POSITION; @@ -96,12 +97,20 @@ public class FineToggleButtonUI extends FlatToggleButtonUI { } static boolean isGroupButton(Component c) { + if (!(c instanceof UIButton)) { + return false; + } + String buttonType = getButtonTypeStr((UIButton) c); + return BUTTON_TYPE_GROUP.equals(buttonType) || BUTTON_TYPE_GROUP_FIT.equals(buttonType); + } + + static boolean isGroupButtonNotFit(Component c) { return c instanceof UIButton && BUTTON_TYPE_GROUP.equals(getButtonTypeStr((UIButton) c)); } @Override public void paint(Graphics g, JComponent c) { - if (isGroupButton(c) || isTabButton(c)) { + if (isGroupButtonNotFit(c) || isTabButton(c)) { ((AbstractButton)c).setMargin(FineUIUtils.getUIInsets("ToggleButton.compact.margin", "ToggleButton.margin")); } super.paint(g, c); diff --git a/designer-base/src/main/java/com/fine/theme/utils/FineClientProperties.java b/designer-base/src/main/java/com/fine/theme/utils/FineClientProperties.java index 3b1e5933b2..da8e252ca5 100644 --- a/designer-base/src/main/java/com/fine/theme/utils/FineClientProperties.java +++ b/designer-base/src/main/java/com/fine/theme/utils/FineClientProperties.java @@ -13,6 +13,7 @@ public interface FineClientProperties extends FlatClientProperties { //--------------------------- ButtonGroup ----------------------- String BUTTON_TYPE_GROUP = "group"; + String BUTTON_TYPE_GROUP_FIT = "groupFit"; String BUTTON_BORDER = "buttonBorder"; String BUTTON_BORDER_LEFT_ROUND_RECT = "leftRoundRect"; diff --git a/designer-base/src/main/java/com/fine/theme/utils/FineUIUtils.java b/designer-base/src/main/java/com/fine/theme/utils/FineUIUtils.java index 686788b680..c749bf5f3c 100644 --- a/designer-base/src/main/java/com/fine/theme/utils/FineUIUtils.java +++ b/designer-base/src/main/java/com/fine/theme/utils/FineUIUtils.java @@ -6,7 +6,7 @@ import com.fr.design.border.FineBorderFactory; import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.utils.gui.UIComponentUtils; +import com.fr.design.mainframe.theme.edit.ui.LabelUtils; import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.stable.os.OperatingSystem; import com.fr.value.AtomicClearableLazyValue; @@ -15,6 +15,7 @@ import javax.swing.JLabel; import javax.swing.JLayer; import javax.swing.ScrollPaneConstants; import javax.swing.UIManager; +import javax.swing.JTextArea; import java.awt.Color; import java.awt.Component; import java.awt.Composite; @@ -450,16 +451,11 @@ public class FineUIUtils { } /** - * 创建一个支持自动换行的 UILabel,并应用指定样式。 - * - * @param text 要显示的文本内容 - * @param style 样式字符串 - * @return 支持自动换行的 UILabel + * 创建一个支持自动换行的提示文本 + * @param text 显示的文本内容 + * @return 自动换行提示文本 */ - public static UILabel createLineWrapLabel(String text, String style) { - UILabel label = new UILabel(text); - FineUIStyle.setStyle(label, style); - UIComponentUtils.setLineWrap(label); - return label; + public static JTextArea createAutoWrapTipLabel(String text) { + return LabelUtils.createAutoWrapLabel(text, FineUIUtils.getUIColor("Label.tipColor", "inactiveCaption")); } } diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index d7fc13554e..28cf547f61 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -48,7 +48,6 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; -import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.general.log.Log4jConfig; import com.fr.io.attr.ImageExportAttr; @@ -347,6 +346,7 @@ public class PreferencePane extends BasicPane { .addTab(i18nText("Fine-Design_Basic_General"), generalScrollPane) .addTab(i18nText("Fine-Design_Basic_Advanced"), adviceScrollPane) .addTab(i18nText("Fine-Design_Vcs_Title"), vcsParentPane) + .withAdaptiveFit() .build(); contentPane.add(tabbedPane, BorderLayout.CENTER); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/AdvancePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/AdvancePane.java index a2aadbb030..a9a2c90da9 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/AdvancePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/AdvancePane.java @@ -53,7 +53,8 @@ public class AdvancePane extends BasicPane { flex(2) ), row( - cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_On_Borrow"), SwingConstants.LEFT)).weight(1), + cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_On_Borrow"), SwingConstants.LEFT)) + .with(it -> it.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_On_Borrow"))).weight(1), cell(DBCP_TEST_ON_BORROW).weight(1.5), flex(2) ), diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DBCPAttrPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DBCPAttrPane.java index 5436a4affb..d114f64544 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DBCPAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DBCPAttrPane.java @@ -15,6 +15,7 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.theme.edit.ui.LabelUtils; import com.fr.general.ComparatorUtils; import com.fr.stable.StringUtils; @@ -83,7 +84,7 @@ public class DBCPAttrPane extends BasicPane { row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Connection_Pool_Evictionruns_millis"))).weight(1), cell(DBCP_TIMEBETWEENEVICTIONRUNSMILLS).weight(1)), row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Num_Test_Per_Evction_Run"))).weight(1), cell(DBCP_NUMTESTSPEREVICTIONRUN).weight(1)), row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Connection_Pool_Mix_Evictable_Idle_Time_Millis"))).weight(1), cell(DBCP_MINEVICTABLEIDLETIMEMILLIS).weight(1)), - cell(FineUIUtils.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Dbcp_Warning"), FineUIStyle.LABEL_WARNING_TIP)) + cell(LabelUtils.createAutoWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Dbcp_Warning"), FineUIUtils.getUIColor("Label.warningColor", "Label.warningColor"))) ).getComponent(); defaultPane.add(northFlowPane); this.add(defaultPane); diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java index 5ed4b5bcf3..1d4274bb99 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java @@ -4,9 +4,14 @@ import com.fine.swing.ui.layout.Box; import com.fine.theme.utils.FineUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.util.ScaledEmptyBorder; +import com.fr.design.gui.ibutton.FitUIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.utils.ColorUtils; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.List; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; @@ -42,15 +47,15 @@ public class FineTabbedPane extends Box { private final UIButtonGroup tabGroup; private final Map tabComponents; private final int[] tabLayout; + private final boolean useFitTab ; - private FineTabbedPane(Map tabComponents, float headRatio, int[] tabLayout) { + private FineTabbedPane(Map tabComponents, float headRatio, int[] tabLayout, boolean useFitTab) { this.headRatio = headRatio; this.tabComponents = tabComponents; this.tabLayout = tabLayout; - + this.useFitTab = useFitTab; String[] titleArray = tabComponents.keySet().toArray(new String[0]); - this.tabGroup = new UIButtonGroup<>(titleArray, titleArray, tabLayout); - + this.tabGroup = useFitTab ? new FitUIButtonGroup<>(titleArray, titleArray, tabLayout) : new UIButtonGroup<>(titleArray, titleArray, tabLayout); initLayout(); initListeners(); } @@ -71,6 +76,7 @@ public class FineTabbedPane extends Box { private int[] tabLayout; private float headRatio = 0.5f; private final Map tabComponents = new LinkedHashMap<>(); + private boolean useFitTab = false; /** * 设置头部居中比例,0-1之间 @@ -94,6 +100,16 @@ public class FineTabbedPane extends Box { return this; } + /** + * 设置使用自适应文本Tab + * + * @return TabPaneBuilder + */ + public TabPaneBuilder withAdaptiveFit() { + this.useFitTab = true; + return this; + } + /** * 添加tab标签 * @@ -122,7 +138,7 @@ public class FineTabbedPane extends Box { } else if (Arrays.stream(tabLayout).sum() != tabComponents.size()) { throw new IllegalArgumentException("illegal tab layout argument!"); } - return new FineTabbedPane(tabComponents, headRatio, tabLayout); + return new FineTabbedPane(tabComponents, headRatio, tabLayout, useFitTab); } } @@ -131,11 +147,10 @@ public class FineTabbedPane extends Box { setMatchParentSize(true); float flexRatio = (1 - headRatio) / 2; int headHeight = FlatUIUtils.getUIInt("Component.defaultHeight",24) * tabLayout.length / 2; + Component component = useFitTab ? row(flex(), cell(tabGroup), flex()).getComponent() : row(flex(flexRatio), cell(tabGroup).weight(headRatio), flex(flexRatio)).getComponent(); add( column( - row( - flex(flexRatio), cell(tabGroup).weight(headRatio), flex(flexRatio) - ), + cell(component), flex() ), column( @@ -170,6 +185,23 @@ public class FineTabbedPane extends Box { }); tabGroup.setSelectedIndex(0); cards.show(centerPane, String.valueOf(tabGroup.getSelectedItem())); + if (!useFitTab) { + initTabListeners(); + } + } + + private void initTabListeners() { + List tabs = tabGroup.getLabelButtonList(); + for (UIToggleButton tab : tabs) { + tab.addMouseListener(new MouseAdapter() { + @Override + public void mouseEntered(MouseEvent e) { + if (tab.getPreferredSize().width > tab.getWidth()) { + tab.setToolTipText(tab.getText()); + } + } + }); + } } private void fireStateChanged() { diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/FitUIButtonGroup.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/FitUIButtonGroup.java new file mode 100644 index 0000000000..25267feaaf --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/FitUIButtonGroup.java @@ -0,0 +1,53 @@ +package com.fr.design.gui.ibutton; + +import com.fine.swing.ui.layout.Row; + +import java.util.List; + +import static com.fine.theme.utils.FineClientProperties.BUTTON_GROUP_POSITION; +import static com.fine.theme.utils.FineClientProperties.BUTTON_TYPE_GROUP_FIT; +import static com.formdev.flatlaf.FlatClientProperties.BUTTON_TYPE; + + +/** + * 自适应文案宽度的ButtonGroup + * + * @author Levy.Xie + * @since 11.0 + * Created on 2024/08/28 + */ +public class FitUIButtonGroup extends UIButtonGroup { + + public FitUIButtonGroup(String[] textArray) { + super(textArray); + } + + public FitUIButtonGroup(String[] textArray, T[] objects) { + super(textArray, objects); + } + + public FitUIButtonGroup(String[] textArray, T[] objects, int[] customCols) { + super(textArray, objects, customCols); + } + + @Override + protected void initLayout(int[] cols, boolean inToolbar) { + Row row = new Row(); + List buttonList = getLabelButtonList(); + for (int i = 0; i < buttonList.size(); i++) { + row.add(buttonList.get(i)); + if (i != buttonList.size() - 1 && !inToolbar) { + row.add(createDivider()); + } + } + add(row); + } + + @Override + protected void initButton(UIToggleButton labelButton, int index) { + labelButton.setBorderPainted(false); + labelButton.putClientProperty(BUTTON_TYPE, BUTTON_TYPE_GROUP_FIT); + labelButton.putClientProperty(BUTTON_GROUP_POSITION, getGroupButtonPosition(index)); + labelButtonList.add(labelButton); + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java index d5fa52cc21..fd74f7d042 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java @@ -227,7 +227,7 @@ public class UIButtonGroup extends Column implements GlobalNameObserver, UIOb } } - protected List getLabelButtonList() { + public List getLabelButtonList() { return labelButtonList; } diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIHeadGroup.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIHeadGroup.java index 4f6ee08cc8..715fd3e793 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIHeadGroup.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIHeadGroup.java @@ -5,6 +5,8 @@ import com.fine.swing.ui.layout.Row; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.third.guava.collect.Streams; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import javax.swing.AbstractButton; import javax.swing.ButtonGroup; import javax.swing.Icon; @@ -72,6 +74,20 @@ public class UIHeadGroup extends Row { add(buttonGroup()); setSelectedIndex(0); setBorder(new ScaledEmptyBorder(2, 2, 2, 2)); + initButtonListeners(); + } + + private void initButtonListeners() { + for (AbstractButton tab : btns) { + tab.addMouseListener(new MouseAdapter() { + @Override + public void mouseEntered(MouseEvent e) { + if (tab.getPreferredSize().width > tab.getWidth()) { + tab.setToolTipText(tab.getText()); + } + } + }); + } } private Layouts.Cell[] buttonGroup() { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecycleSettingPane.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecycleSettingPane.java index 65549bc1a9..84903f848b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecycleSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecycleSettingPane.java @@ -10,7 +10,6 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.VerticalFlowLayout; import com.fr.design.mainframe.vcs.VcsRecycleSettingHelper; import com.fr.workspace.server.vcs.VcsConfig; @@ -63,7 +62,7 @@ public class RecycleSettingPane extends BasicPane { FineTabbedPane tabbedPane = FineTabbedPane.builder() .addTab(Toolkit.i18nText("Fine-Design_Vcs_Recycle_Content"), recycleScrollPane) .addTab(Toolkit.i18nText("Fine-Design_Basic_Carton_General_Settings"), settingScrollPane) - .withHeadRatio(0.3f).build(); + .withAdaptiveFit().build(); this.add(tabbedPane, BorderLayout.CENTER); } diff --git a/designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java b/designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java index 7099ed7652..786c472c08 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java +++ b/designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java @@ -24,7 +24,6 @@ import com.fr.general.Background; import com.fr.log.FineLoggerFactory; import static com.fine.swing.ui.layout.Layouts.cell; -import static com.fine.swing.ui.layout.Layouts.column; public class BackgroundPane extends BasicPane { @@ -47,7 +46,7 @@ public class BackgroundPane extends BasicPane { protected void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); initTabPane(); - tabbedPane = tabbedPaneBuilder.withHeadRatio(0.65f).build(); + tabbedPane = tabbedPaneBuilder.withAdaptiveFit().build(); add(cell(tabbedPane).weight(1).getComponent()); } diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties index 4e672107a3..f35b30539f 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties @@ -35,4 +35,6 @@ com.fr.design.mainframe.EastRegionContainerPane.minimum=340*400 com.fr.design.mainframe.EastRegionContainerPane.standard=480*400 com.fr.design.ds.column.cellEditor.pane=900*600 com.fr.design.actions.reportWebAttr.dialog=800*630 +com.fr.design.actions.printingSetting.dialog=800*600 + diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties index 53506f2463..31e4ae38e5 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties @@ -34,4 +34,6 @@ com.fr.design.mainframe.EastRegionContainerPane.minimum=340*400 com.fr.design.mainframe.EastRegionContainerPane.standard=480*400 com.fr.design.ds.column.cellEditor.pane=900*600 com.fr.design.actions.reportWebAttr.dialog=700*630 +com.fr.design.actions.printingSetting.dialog=700*600 + diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties index 090dc8025f..73b022f454 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties @@ -34,4 +34,6 @@ com.fr.design.mainframe.EastRegionContainerPane.minimum=340*400 com.fr.design.mainframe.EastRegionContainerPane.standard=340*400 com.fr.design.ds.column.cellEditor.pane=900*600 com.fr.design.actions.reportWebAttr.dialog=700*630 +com.fr.design.actions.printingSetting.dialog=700*600 + diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties index b67ce3ad52..bc6f1a8810 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties @@ -34,4 +34,6 @@ com.fr.design.mainframe.EastRegionContainerPane.minimum=286*400 com.fr.design.mainframe.EastRegionContainerPane.standard=286*400 com.fr.design.ds.column.cellEditor.pane=700*600 com.fr.design.actions.reportWebAttr.dialog=660*600 +com.fr.design.actions.printingSetting.dialog=660*600 + diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties index 8b2561a9ec..842dde7fc3 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties @@ -33,4 +33,6 @@ com.fr.design.mainframe.EastRegionContainerPane.minimum=286*400 com.fr.design.mainframe.EastRegionContainerPane.standard=286*400 com.fr.design.ds.column.cellEditor.pane=700*600 com.fr.design.actions.reportWebAttr.dialog=700*630 +com.fr.design.actions.printingSetting.dialog=700*600 + diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java index 50f498c30a..c8fdc1adce 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe.chart.gui.style.series; import com.fine.theme.utils.FineLayoutBuilder; -import com.fine.theme.utils.FineUIScale; import com.fr.base.BaseFormula; import com.fr.chart.base.AreaColor; import com.fr.chart.base.ChartBaseUtils; @@ -45,13 +44,12 @@ import java.awt.event.MouseEvent; import java.util.ArrayList; import java.util.List; -import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.theme.utils.FineUIScale.scale; public class UIColorPickerPane extends BasicPane implements UIObserver { private static final int MARGIN_TOP = scale(7); private static final int MARGIN_LEFT = scale(5); - private static final int COLORGROUP_MARGIN_LEFT = scale(20); + private static final int COLORGROUP_MARGIN_LEFT = scale(15); private static final int OFF_HEIGHT = scale(6); private static final int COLOR_REC_HEIGHT = scale(40); private static final int COLOR_REC_WIDTH = scale(30); diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java index 15ab98fd8a..24a31be407 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java @@ -3,17 +3,13 @@ package com.fr.design.module; import com.fine.theme.utils.FineUIScale; import com.fr.base.ChartColorMatching; import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.ibutton.FitUIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.style.background.gradient.FixedGradientBarNoTheme; import com.fr.design.style.color.ColorAdjustPane; import com.fr.design.style.background.gradient.FixedGradientBar; -import javax.swing.BorderFactory; import javax.swing.JPanel; import java.util.ArrayList; import java.util.Collections; @@ -21,7 +17,6 @@ import java.util.List; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Color; -import java.awt.Component; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -43,7 +38,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { private JPanel changeColorSetPane; private CardLayout cardLayout; - private UIButtonGroup groupButton; + private FitUIButtonGroup groupButton; private ColorAdjustPane colorAdjustPane; private FixedGradientBar colorGradient; @@ -59,7 +54,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { } private void initComponents() { - groupButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Custom_Color"), Toolkit.i18nText("Fine-Design_Chart_Gradient_Color")}); + groupButton = new FitUIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Custom_Color"), Toolkit.i18nText("Fine-Design_Chart_Gradient_Color")}); groupButton.setSelectedIndex(0); changeColorSetPane = new JPanel(cardLayout = new CardLayout()); changeColorSetPane.add(colorGradient = new FixedGradientBarNoTheme(4, 150), "gradient"); @@ -76,8 +71,8 @@ public class ChartPreFillStylePane extends BasicBeanPane { 10, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color_Match"))), row( - cell(groupButton).weight(0.1), - flex(0.2) + cell(groupButton), + flex() ), row( cell(changeColorSetPane).with(it -> it.setPreferredSize(FineUIScale.scale(new Dimension(COLOR_ADJUST_PANE_WIDTH, COLOR_ADJUST_PANE_HEIGHT)))), diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHeatValueColorPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHeatValueColorPane.java index 527c50f3ae..e75726b3c5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHeatValueColorPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHeatValueColorPane.java @@ -51,7 +51,7 @@ public class VanChartHeatValueColorPane extends VanChartValueColorPane { @Override protected MapColorPickerPaneWithFormula createSectionIntervalConfigPane(AbstractAttrNoScrollPane parent) { return new SectionIntervalConfigPaneWithOutNum(parent) { - private final int WIDTH = FineUIScale.scale(227); + private final int WIDTH = FineUIScale.scale(218); @Override protected int getBoundX() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java b/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java index a6fc4cfbe8..044945d63e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java +++ b/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java @@ -9,7 +9,6 @@ import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithForm import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.Component; -import java.awt.Dimension; /** * Created by Mitisky on 16/10/20. @@ -44,21 +43,12 @@ public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithF @Override protected Component[][] createComponents() { numLabel = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Value_Divided_Stage")); - - setRegionVisible(false); - return new Component[][]{ new Component[]{new BoldFontTextLabel(getNameOfSubRange()), getDesignTypeButtonGroup()}, new Component[]{numLabel, getRegionNumPane()}, }; } - @Override - public Dimension getPreferredSize() { - Dimension dim = super.getPreferredSize(); - return new Dimension((int) dim.getWidth(), (int) dim.getHeight() - (numLabel.isVisible() ? 0 : 30)); - } - @Override public void populateBean(MapHotAreaColor hotAreaColor) { super.populateBean(hotAreaColor); diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportPrintSettingAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportPrintSettingAction.java index f77fc913dd..ab6bbf04d7 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportPrintSettingAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportPrintSettingAction.java @@ -5,6 +5,7 @@ import com.fr.base.print.PrintSettingsAttrMark; import com.fr.design.actions.JWorkBookAction; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JWorkBook; import com.fr.design.menu.MenuKeySet; @@ -44,14 +45,14 @@ public class ReportPrintSettingAction extends JWorkBookAction { final ReportPrintSettingPane reportPrintSettingPane = new ReportPrintSettingPane(); reportPrintSettingPane.populate(printSettings); - BasicDialog dialog = reportPrintSettingPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { + BasicDialog dialog = reportPrintSettingPane.showWindowWithCustomSize(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { PrintSettingsAttrMark newPrintSettings = reportPrintSettingPane.updateBean(); wbTpl.addAttrMark(newPrintSettings); jwb.fireTargetModified(); } - }); + }, DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.actions.printingSetting.dialog")); dialog.setVisible(true); } diff --git a/designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java b/designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java index 092aa71210..5bdd671ea1 100644 --- a/designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java +++ b/designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java @@ -213,7 +213,7 @@ public class HFAttributesEditDialog extends BasicPane { this.revalidate(); add(column( cell(centerPane), - cell(tabbedPaneBuilder.withHeadRatio(0.13f).build()).weight(1) + cell(tabbedPaneBuilder.withAdaptiveFit().build()).weight(1) ).getComponent()); if (isInsert) { this.moveLeftButton.setEnabled(false); diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java index 83848152b1..7d22ebabb1 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java @@ -1,5 +1,6 @@ package com.fr.design.report.freeze; +import com.fine.theme.utils.FineUIScale; import java.awt.Dimension; import javax.swing.JComponent; import com.fr.design.gui.ilable.UILabel; @@ -26,7 +27,7 @@ public abstract class FreezeAndRepeatPane extends BasicBeanPane { protected boolean isEnalbed; protected void initComponent() { - Dimension size = new Dimension(50, 21); + Dimension size = FineUIScale.createScaleDimension(50, 21); if (start instanceof UISpinner) { start.setPreferredSize(size); ((UISpinner) start).addChangeListener(new ChangeListener() { diff --git a/designer-realize/src/main/java/com/fr/design/webattr/PageToolBarPane.java b/designer-realize/src/main/java/com/fr/design/webattr/PageToolBarPane.java index 181bb9dc26..952d3cc8a2 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/PageToolBarPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/PageToolBarPane.java @@ -1,7 +1,6 @@ package com.fr.design.webattr; -import com.fine.theme.utils.FineUIStyle; -import com.formdev.flatlaf.util.ScaledEmptyBorder; +import com.fine.theme.utils.FineUIUtils; import com.fr.base.ConfigManager; import com.fr.config.Configuration; import com.fr.design.constants.LayoutConstants; @@ -104,25 +103,22 @@ public class PageToolBarPane extends AbstractEditToolBarPane { pageFixedRowCountTextField.addKeyListener(rowCountKeyListener); pageFixedRowCountTextField.addInputMethodListener(rowCountInputMethodListener); - UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Page_Fixed_Row_Tip")); - FineUIStyle.setStyle(tipLabel, FineUIStyle.LABEL_TIP); - JPanel northPanel = column(LayoutConstants.VERTICAL_GAP, //报表显示位置:居中展示-左展示 - row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Location"))).weight(0.15), - row(cell(centerRadioButton), fix(12), cell(leftRadioButton), flex()).weight(0.85) + row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Location"))).weight(0.2), + row(cell(centerRadioButton), fix(12), cell(leftRadioButton), flex()).weight(0.8) ), //页面:以图片方式显示-iframe嵌入时自动缩放-重方式输出格子 - row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Page"))).weight(0.15), - row(cell(isShowAsImageBox), fix(12), cell(isAutoScaleBox), fix(12), cell(isTDHeavyBox),flex()).weight(0.85) + row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Page"))).weight(0.2), + row(cell(isShowAsImageBox), fix(12), cell(isAutoScaleBox), fix(12), cell(isTDHeavyBox),flex()).weight(0.8) ), //分页设置:按行分页-每页显示行数 - row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Paging_Settings"))).weight(0.15), + row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Paging_Settings"))).weight(0.2), row(cell(isPageFixedRowBox), fix(20), cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Rows_Per_Page"))), - fix(10), cell(pageFixedRowCountTextField),flex()).weight(0.85) + fix(10), cell(pageFixedRowCountTextField),flex()).weight(0.8) ), //提示 - cell(tipLabel), + cell(FineUIUtils.createAutoWrapTipLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Page_Fixed_Row_Tip"))), //使用工具栏-编辑 row(LayoutConstants.HORIZONTAL_GAP, cell(isUseToolBarCheckBox), cell(editToolBarButton)) ).getComponent(); diff --git a/designer-realize/src/main/java/com/fr/design/webattr/ReportWriteAttrPane.java b/designer-realize/src/main/java/com/fr/design/webattr/ReportWriteAttrPane.java index 708fef7a86..09b23cbc6a 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/ReportWriteAttrPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/ReportWriteAttrPane.java @@ -2,7 +2,6 @@ package com.fr.design.webattr; import com.fr.design.gui.frpane.FineTabbedPane; import com.fr.design.gui.frpane.LoadingBasicPane; -import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.report.VerifierListPane; @@ -13,8 +12,6 @@ import com.fr.report.worksheet.WorkSheet; import com.fr.report.write.ReportWriteAttr; import javax.swing.JPanel; -import javax.swing.JTabbedPane; -import javax.swing.SwingConstants; import java.awt.BorderLayout; @@ -56,7 +53,7 @@ public class ReportWriteAttrPane extends LoadingBasicPane { .addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Submit"), submiterListPane) .addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Verify_Data_Verify"), verifierListPane) .addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Writer_ShortCuts_Setting"), writeShortCutsPane) - .withHeadRatio(0.5f) + .withAdaptiveFit() .build(); container.setPreferredSize(this.getPreferredSize()); container.add(tabbedPane, BorderLayout.CENTER); diff --git a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java index 8cded20f76..c497d1ecd0 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java @@ -14,7 +14,6 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.report.UnitFieldPane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; @@ -44,6 +43,7 @@ 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.flex; import static com.fine.swing.ui.layout.Layouts.row; +import static com.fine.swing.ui.layout.Layouts.fix; import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle; /** @@ -199,29 +199,29 @@ public abstract class AbstractNativePrintSettingPane extends JPanel { JPanel scaleCheckPane = GUICoreUtils.createCheckboxAndDynamicPane(fitPaperSizeCheck, scalePane, true); // 整体布局 centerPane = column(LayoutConstants.VERTICAL_GAP, - row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Printer"))).weight(0.1), - cell(printerComboBox).weight(0.35), - flex(0.55)), - row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Copy_Number"))).weight(0.1), - cell(copySpinner).weight(0.15), - flex(0.75)), + row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Printer"))).weight(0.15), + cell(printerComboBox).weight(0.5), + flex(0.35)), + row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Copy_Number"))).weight(0.15), + cell(copySpinner).weight(0.2), + flex(0.65)), row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Page_Number"))) - .weight(0.1).with(it -> it.setBorder(new ScaledEmptyBorder(2, 0, 0, 0))), + .weight(0.15).with(it -> it.setBorder(new ScaledEmptyBorder(2, 0, 0, 0))), cell(getPrintAreaPane()).weight(0.7), - flex(0.2)), + flex(0.15)), row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Paper"))) - .weight(0.1).with(it -> it.setBorder(new ScaledEmptyBorder(2, 0, 0, 0))), + .weight(0.15).with(it -> it.setBorder(new ScaledEmptyBorder(2, 0, 0, 0))), cell(paperSettingCheckPane).weight(0.5), - flex(0.4)), - row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout"))).weight(0.1), - cell(layoutSettingCheckPane).weight(0.2), - flex(0.7)), - row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Margin"))).weight(0.1), + flex(0.35)), + row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout"))).weight(0.15), + cell(layoutSettingCheckPane).weight(0.5), + flex(0.35)), + row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Margin"))).weight(0.15), cell(pageMarginCheckPane).weight(0.5), - flex(0.4)), - row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_EnlargeOrReduce"))).weight(0.1), + flex(0.35)), + row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_EnlargeOrReduce"))).weight(0.15), cell(scaleCheckPane).weight(0.3), - flex(0.6)) + flex(0.55)) ).getComponent(); } @@ -353,8 +353,8 @@ public abstract class AbstractNativePrintSettingPane extends JPanel { return column(LayoutConstants.VERTICAL_GAP, cell(allPageRadioButton), cell(currentPageRadioButton), - row(cell(customPageRadioButton).weight(0.1), cell(specifiedAreaField).weight(0.3), cell(areaFieldTip).weight(0.1)), - row(cell(doublePrintRadioButton).weight(0.1),cell(doublePrintComboBox).weight(0.3), flex(0.1)) + row(cell(customPageRadioButton).weight(0.11), cell(specifiedAreaField).weight(0.29), fix(4), cell(areaFieldTip).weight(0.1)), + row(cell(doublePrintRadioButton).weight(0.11),cell(doublePrintComboBox).weight(0.29), fix(4), flex(0.1)) ).getComponent(); } diff --git a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/PrintSettingPane.java b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/PrintSettingPane.java index 002401178d..3b6d761011 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/PrintSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/PrintSettingPane.java @@ -11,6 +11,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import javax.swing.ButtonGroup; import javax.swing.JPanel; +import javax.swing.ScrollPaneConstants; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Dimension; @@ -55,8 +56,8 @@ public class PrintSettingPane extends BasicPane { printPane.setLayout(printCard); printPane.add(noClientPrintRadioButton.getText(), noClientPrintSettingPane); - UIScrollPane scrollPane = new UIScrollPane(nativePrintSettingPane); - scrollPane.setPreferredSize(FineUIScale.scale(new Dimension(600, 400))); + UIScrollPane scrollPane = new UIScrollPane(nativePrintSettingPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + scrollPane.setPreferredSize(new Dimension(super.getPreferredSize().width, FineUIScale.scale(400))); printPane.add(nativePrintRadioButton.getText(), scrollPane); JPanel allPanel = column(LayoutConstants.VERTICAL_GAP, cell(north), cell(printPane))