From 9bfe7a56a14b61737f8f8c846aaa1f90aa831e9a Mon Sep 17 00:00:00 2001 From: renekton Date: Fri, 30 Aug 2024 15:05:23 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E5=85=B3=E8=81=94=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E5=A2=9E=E5=8A=A0=E5=9B=BD=E9=99=85=E5=8C=96=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E5=92=8C=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tabledata/tabledatapane/MultiTDTableDataPane.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java index 2a187c199b..219b4bdb37 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java @@ -102,8 +102,12 @@ public class MultiTDTableDataPane extends AbstractTableDataPane it.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Multi_Dataset_Name"))) + .weight(0.2), + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Multi_Dataset_Conditions"))) + .with(it -> it.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Multi_Dataset_Conditions"))) + .weight(0.2), flex(0.6) ).getComponent()); From 8269123076d76d9438baeb2aaf7c59e4ddd9394e Mon Sep 17 00:00:00 2001 From: renekton Date: Tue, 3 Sep 2024 11:18:50 +0800 Subject: [PATCH 02/11] =?UTF-8?q?fbp=E5=9B=9E=E5=BD=92=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tabledatapane/FileTableDataPane.java | 6 ++-- .../gui/icombobox/ColorSchemeComboBox.java | 2 +- .../fr/design/gui/icombobox/LineComboBox.java | 2 +- .../border/VanChartBorderWithShapePane.java | 29 +++++-------------- .../VanChartPieValueLabelDetailPane.java | 9 ++---- 5 files changed, 14 insertions(+), 34 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java index ac644474a4..7efe6f7196 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java @@ -205,9 +205,9 @@ public class FileTableDataPane extends AbstractTableDataPane { testConnection.addActionListener(testConnectionListener); // 提示信息 tipPanel = column( - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter_Desc"), FineUIStyle.LABEL_TIP)), - cell(new UILabel("reportlets/excel/FineReport${abc}." + "txt", FineUIStyle.LABEL_TIP)), - cell(new UILabel("http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp", FineUIStyle.LABEL_TIP)) + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter"), FineUIStyle.LABEL_TIP)), + cell(new UILabel("assets/file_dataset/FineReport${abc}." + "txt", FineUIStyle.LABEL_TIP)), + cell(new UILabel("http://192.168.100.120:8080/webroot/help/excel${abc}.jsp", FineUIStyle.LABEL_TIP)) ).getComponent(); return column( LayoutConstants.VERTICAL_GAP, diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/ColorSchemeComboBox.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/ColorSchemeComboBox.java index 2ace77e344..1c7ced9ec6 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/ColorSchemeComboBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/ColorSchemeComboBox.java @@ -233,7 +233,7 @@ public class ColorSchemeComboBox extends UIComboBox { @Override public Dimension getPreferredSize() { Dimension preferredSize = super.getPreferredSize(); - preferredSize.setSize(super.getPreferredSize().getWidth(), FineUIScale.scale(HEIGHT)); + preferredSize.setSize(ColorSchemeComboBox.this.getPreferredSize().width, FineUIScale.scale(HEIGHT)); return preferredSize; } diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/LineComboBox.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/LineComboBox.java index eef2c2c8b9..28f29c23b1 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/LineComboBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/LineComboBox.java @@ -129,7 +129,7 @@ public class LineComboBox extends UIComboBox { } public Dimension getPreferredSize() { - return new Dimension(getWidth(), FineUIScale.scale(LINE_HEIGHT)); + return new Dimension(super.getPreferredSize().width, FineUIScale.scale(LINE_HEIGHT)); } public Dimension getMinimumSize() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java index 292ae55acb..8e508e810c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java @@ -1,5 +1,6 @@ package com.fr.van.chart.designer.component.border; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.chartglyph.Marker; import com.fr.chart.chartglyph.MarkerFactory; import com.fr.design.dialog.BasicPane; @@ -112,28 +113,16 @@ public class VanChartBorderWithShapePane extends BasicPane { } protected JPanel createLineTypePane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - - double[] columnSize = {f, e}; - double[] rowSize = {p, p}; Component[][] components = new Component[][]{ new Component[]{null, null}, new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), UIComponentUtils.wrapWithBorderLayoutPane(lineTypeBox)}}; - return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); } private JPanel createDetailPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - - double[] columnSize = {f, e}; - double[] rowSize = {p, p, p}; Component[][] components = new Component[][]{ new Component[]{null, null}, @@ -143,7 +132,8 @@ public class VanChartBorderWithShapePane extends BasicPane { }; JPanel center = createLineColorPane(); - JPanel south = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + JPanel south = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); + JPanel panel = new JPanel(new BorderLayout()); @@ -154,12 +144,6 @@ public class VanChartBorderWithShapePane extends BasicPane { } private JPanel createLineColorPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - - double[] columnSize = {f, e}; - double[] rowSize = {p, p}; Component[][] center = new Component[][]{ new Component[]{null, null}, @@ -171,11 +155,12 @@ public class VanChartBorderWithShapePane extends BasicPane { new Component[]{null, lineColorBox} }; - colorBoxPane = TableLayout4VanChartHelper.createGapTableLayoutPane(south, rowSize, columnSize); + colorBoxPane = FineLayoutBuilder.compatibleTableLayout(10, south, new double[]{1.2, 3}); + JPanel panel = new JPanel(new BorderLayout()); - panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(center, rowSize, columnSize), BorderLayout.CENTER); + panel.add(FineLayoutBuilder.compatibleTableLayout(10, center, new double[]{1.2, 3}), BorderLayout.CENTER); panel.add(colorBoxPane, BorderLayout.SOUTH); return panel; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java index bd705b0e06..1923776980 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java @@ -1,5 +1,6 @@ package com.fr.van.chart.designer.style.label; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.chartattr.Plot; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; @@ -47,18 +48,12 @@ public class VanChartPieValueLabelDetailPane extends VanChartPlotLabelDetailPane VanChartBorderWithShapePane borderPane = new VanChartBorderWithShapePane() { @Override protected JPanel createLineTypePane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - - double[] columnSize = {f, e}; - double[] rowSize = {p}; Component[][] components = new Component[][]{ new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Border")), UIComponentUtils.wrapWithBorderLayoutPane(getLineTypeBox())}}; - return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); } }; setBorderPane(borderPane); From c5e45656270bfad813d5a270cb73fc8e864bfbac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Tue, 3 Sep 2024 14:20:10 +0800 Subject: [PATCH 03/11] =?UTF-8?q?REPORT-133106=20fix:=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E9=81=AE=E7=BD=A9=E5=B1=82=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/icontainer/UIModeControlContainer.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java index 9002faf8b6..18ac4eaeeb 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java @@ -123,6 +123,8 @@ public class UIModeControlContainer extends JLayeredPane { horizontToolPane = new JPanel() { @Override public void paint(Graphics g) { + g.setColor(FineUIUtils.getUIColor("fill.normal", "fill.normal")); + g.fillRect(0, 0, getWidth(), getHeight()); if (upEditMode) { g.drawImage(UIConstants.DRAG_DOT, (getWidth() - toolPaneHeight) / 2, 3, toolPaneHeight, 8, null); } From 19e7961e3ceaaa55ecf34e852db5cc94def0580e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Tue, 3 Sep 2024 14:22:39 +0800 Subject: [PATCH 04/11] =?UTF-8?q?REPORT-132916=20fix:=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E7=9B=98=E3=80=81=E6=B0=94=E6=B3=A1=E5=9B=BE=E6=BC=8F=E7=BF=BB?= =?UTF-8?q?=E6=96=B0=E9=9D=A2=E6=9D=BF=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/ibutton/UIButtonGroup.java | 9 +++--- .../chart/gui/data/ChartDataFilterPane.java | 10 +++---- .../BubblePlotReportDataContentPane.java | 7 ++--- .../MeterPlotReportDataContentPane.java | 30 +++++-------------- .../table/MeterPlotTableDataContentPane.java | 7 +++-- .../chart/gui/style/ChartTextAttrPane.java | 12 +++----- 6 files changed, 28 insertions(+), 47 deletions(-) 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 ddb402db2d..d5fa52cc21 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 @@ -1,6 +1,7 @@ package com.fr.design.gui.ibutton; import com.fine.swing.ui.layout.Column; +import com.fine.swing.ui.layout.Layouts; import com.fine.swing.ui.layout.Row; import com.fine.swing.ui.layout.Spacer; import com.fine.theme.light.ui.FineRoundBorder; @@ -213,24 +214,24 @@ public class UIButtonGroup extends Column implements GlobalNameObserver, UIOb int col = cols[row]; Row rowContainer = new Row(); for (int j = 0; j < col; j++) { - rowContainer.add(cell(getLabelButtonList().get(currentIndex)).weight(1.0)); + Layouts.populate(rowContainer, cell(getLabelButtonList().get(currentIndex)).weight(1.0)); currentIndex++; if (j != col - 1 && !inToolbar) { rowContainer.add(createDivider()); } } - add(rowContainer); + Layouts.populate(this, cell(rowContainer).weight(1.0)); if (row != cols.length - 1) { add(createDivider()); } } } - private List getLabelButtonList() { + protected List getLabelButtonList() { return labelButtonList; } - private Spacer createDivider() { + protected Spacer createDivider() { Spacer spacer = new Spacer(FineUIScale.scale(1)); spacer.setBorder(new LineBorder(FineUIUtils.getUIColor("defaultBorderColor", "Component.borderColor"))); return spacer; diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java index d4b98adb5e..1b928c8505 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe.chart.gui.data; -import com.fine.theme.utils.FineUIScale; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.Utils; import com.fr.base.chart.chartdata.TopDefinitionProvider; @@ -26,6 +25,7 @@ import java.awt.Dimension; 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.row; +import static com.fine.theme.utils.FineUIScale.scale; /** * 图表数据 分类 系列 过滤界面. @@ -60,7 +60,7 @@ public class ChartDataFilterPane extends ThirdTabPane { } protected void initLayout() { - this.setLayout(new BorderLayout()); + this.setLayout(new BorderLayout(0, scale(10))); if (!paneList.isEmpty()) { if (nameArray.length > 1) { this.add(tabPane, BorderLayout.NORTH); @@ -251,7 +251,7 @@ public class ChartDataFilterPane extends ThirdTabPane { cell(preDataNumPane), cell(notShowNull), cell(presentPane) - ).with(it -> it.setBorder(new ScaledEmptyBorder(10, 0, 0, 0))).getComponent(); + ).getComponent(); } @@ -356,7 +356,7 @@ public class ChartDataFilterPane extends ThirdTabPane { @Override public Dimension getPreferredSize() { Dimension dim = super.getPreferredSize(); - dim.height = FineUIScale.scale(FIL_HEIGHT); + dim.height = scale(FIL_HEIGHT); return dim; } @@ -410,7 +410,7 @@ public class ChartDataFilterPane extends ThirdTabPane { cell(preDataNumPane), cell(notShowNull), cell(presentPane) - ).with(it -> it.setBorder(new ScaledEmptyBorder(10, 0, 0, 0))).getComponent(); + ).getComponent(); } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/BubblePlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/BubblePlotReportDataContentPane.java index 01c412d314..9aafe20192 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/BubblePlotReportDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/BubblePlotReportDataContentPane.java @@ -5,11 +5,10 @@ import com.fr.chart.chartattr.BubblePlot; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartdata.BubbleReportDefinition; import com.fr.chart.chartdata.BubbleSeriesValue; +import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; - import javax.swing.JPanel; import java.util.ArrayList; import java.util.List; @@ -26,9 +25,7 @@ public class BubblePlotReportDataContentPane extends AbstractReportDataContentPa public BubblePlotReportDataContentPane(ChartDataPane parent) { initEveryPane(); filterPane = new ChartDataFilterPane(new BubblePlot(), parent); - JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"),filterPane); - panel.setBorder(getSidesBorder()); - filterPane.setBorder(getFilterPaneBorder()); + JPanel panel = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), filterPane); this.add(panel, "0,6,2,4"); } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java index 0eec72c37e..afc424bd88 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java @@ -1,18 +1,20 @@ package com.fr.design.mainframe.chart.gui.data.report; +import com.fine.theme.utils.FineLayoutBuilder; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.MeterPlot; import com.fr.chart.chartdata.MeterReportDefinition; +import com.fr.design.border.FineBorderFactory; +import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.formula.DefaultTinyFormulaPane; import com.fr.design.formula.TinyFormulaPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.BorderFactory; import javax.swing.JPanel; @@ -37,31 +39,15 @@ public class MeterPlotReportDataContentPane extends AbstractReportDataContentPan private ChartDataFilterPane filterPane; public MeterPlotReportDataContentPane(ChartDataPane parent) { -// initEveryPane(); -// -// List list = new ArrayList(); -// list.add(new Object[] { singCateName, "" }); -// list.add(new Object[] { singNeedleValue, "" }); -// seriesPane.populateBean(list); -// -// seriesPane.noAddUse(); - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f}; - double[] rowSize = getRowSize(); - Component[][] components = getShowComponents(); - JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 24, 6); - panel.setBorder(BorderFactory.createEmptyBorder(0, 24, 5, 8)); - + JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); + panel.setBorder(BorderFactory.createCompoundBorder(FineBorderFactory.createDefaultUnderlineBorder(), + new ScaledEmptyBorder(0, 0, 10, 0))); this.setLayout(new BorderLayout()); this.add(panel, BorderLayout.NORTH); filterPane = new ChartDataFilterPane(new MeterPlot(), parent); - JPanel pane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), filterPane); - pane.setBorder(getSidesBorder()); - filterPane.setBorder(getFilterPaneBorder()); + JPanel pane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), filterPane); this.add(pane, BorderLayout.CENTER); } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java index 9224674924..2a8722c2fb 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java @@ -48,7 +48,7 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane private Column boxPane; public MeterPlotTableDataContentPane(ChartDataPane parent) { - this.setLayout(new BorderLayout(0, FineUIScale.scale(10))); + this.setLayout(new BorderLayout()); nameBox = new UIComboBoxWithNone(); nameBox.setSelectedIndex(nameBox.getItemCount() -1); @@ -59,6 +59,7 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane boxPane = new Column(); boxPane.setSpacing(10); + boxPane.add(getJSeparator()); JPanel namePane = createPaneWithLabel(Toolkit.i18nText(METER_NAME), getNameComponent()); boxPane.add(namePane); @@ -71,6 +72,7 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane final JPanel customPane = createPaneWithLabel(StringUtils.EMPTY, custom); boxPane.add(customPane); + boxPane.add(getJSeparator()); customPane.setVisible(false); @@ -86,9 +88,8 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane } }); - JPanel jPanel = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), filterPane, true); + JPanel jPanel = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), filterPane); - this.add(getJSeparator(), BorderLayout.NORTH); this.add(boxPane, BorderLayout.CENTER); this.add(jPanel, BorderLayout.SOUTH); 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 89281390d0..a7eba5d7e7 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 @@ -4,7 +4,6 @@ import com.fine.theme.icon.LazyIcon; import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.FRContext; import com.fr.chart.base.TextAttr; -import com.fr.design.constants.LayoutConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.event.UIObserverListener; import com.fr.design.gui.ibutton.UIColorButton; @@ -15,7 +14,6 @@ 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.DesignUtils; -import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; import com.fr.general.GeneralUtils; @@ -23,9 +21,10 @@ import javax.swing.JPanel; import javax.swing.SwingConstants; import java.awt.BorderLayout; import java.awt.Component; -import java.awt.FlowLayout; import java.awt.Font; +import static com.fine.theme.utils.FineUIScale.scale; + public class ChartTextAttrPane extends BasicPane { private static final long serialVersionUID = 6731679928019436869L; public static final int FONT_START = 6; @@ -202,12 +201,9 @@ public class ChartTextAttrPane extends BasicPane { } protected void initComponents() { - Component[] components1 = new Component[]{ - fontColor, italic, bold - }; - JPanel buttonPane = new JPanel(new BorderLayout()); + JPanel buttonPane = new JPanel(new BorderLayout(scale(10), 0)); buttonPane.add(fontSizeComboBox, BorderLayout.CENTER); - buttonPane.add(GUICoreUtils.createFlowPane(components1, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE), BorderLayout.EAST); + buttonPane.add(FineLayoutBuilder.createHorizontalLayout(10, fontColor, italic, bold), BorderLayout.EAST); this.setLayout(new BorderLayout()); this.add(getContentPane(buttonPane), BorderLayout.CENTER); From 7881d57f7882560064514ed8221882f93385714d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Tue, 3 Sep 2024 14:24:04 +0800 Subject: [PATCH 05/11] =?UTF-8?q?REPORT-132601=20fix:=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E9=9D=A2=E6=9D=BF=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartHtmlLabelPane.java | 18 +++--------------- ...nChartHtmlLabelPaneWithBackGroundLabel.java | 10 ++-------- .../designer/style/VanChartTitlePane.java | 9 +++++++-- .../label/VanChartPlotLabelDetailPane.java | 2 +- 4 files changed, 13 insertions(+), 26 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java index ebff936c1c..0c916ef4dd 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java @@ -1,5 +1,6 @@ package com.fr.van.chart.designer.component; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.design.DesignerEnvManager; import com.fr.design.constants.KeyWords; import com.fr.design.gui.autocomplete.AutoCompletion; @@ -13,11 +14,8 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.plugin.chart.base.VanChartHtmlLabel; -import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JComponent; import javax.swing.JPanel; @@ -63,18 +61,13 @@ public class VanChartHtmlLabelPane extends JPanel { UIComponentUtils.setLineWrap(useHtml); useHtml.addChangeListener(e -> checkWidthAndHeightPane()); widthAndHeightPane = createWidthAndHeightPane(); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {f}; - double[] rowSize = {p, p, p, p}; Component[][] components = new Component[][]{ new Component[]{createJSContentPane()}, new Component[]{useHtml}, - new Component[]{null, null}, }; - JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1}); this.setLayout(new BorderLayout()); this.add(contentPane, BorderLayout.NORTH); @@ -152,17 +145,12 @@ public class VanChartHtmlLabelPane extends JPanel { checkHeight(); } }); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f}; - double[] rowSize = {p, p, p}; Component[][] components = new Component[][]{ new Component[]{isCustomWidth, customWidth}, new Component[]{isCustomHeight, customHeight}, - new Component[]{null, null} }; - return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); } private void checkWidth() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithBackGroundLabel.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithBackGroundLabel.java index 4e29e3c827..6125ed1ed3 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithBackGroundLabel.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithBackGroundLabel.java @@ -1,10 +1,8 @@ package com.fr.van.chart.designer.component; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; import java.awt.Component; @@ -12,16 +10,12 @@ import java.awt.Component; public class VanChartHtmlLabelPaneWithBackGroundLabel extends VanChartHtmlLabelPane { protected JPanel createWidthAndHeightPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; - JPanel panel = super.createWidthAndHeightPane(); Component[][] components = new Component[][]{ new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Background")), panel}, }; - return TableLayoutHelper.createTableLayoutPane(components, new double[]{p, p}, new double[]{d, f}); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java index 9b1adec3ec..9761c618ba 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java @@ -1,7 +1,6 @@ package com.fr.van.chart.designer.style; import com.fine.theme.utils.FineComponentsFactory; -import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIStyle; import com.fr.base.BaseFormula; import com.fr.base.Utils; @@ -46,6 +45,7 @@ import java.awt.event.MouseEvent; 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.flex; import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.theme.utils.FineUIScale.scale; @@ -139,7 +139,12 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { row( cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"), SwingConstants.LEFT)).weight(1.2), cell(titleContent).weight(3) - )).getComponent(); + ), + row( + flex(1.2), + cell(useHtml).weight(3) + ) + ).getComponent(); return new UIExpandablePane( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content"), titleContentPane); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index ae862a170b..3f1f248a0b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -126,7 +126,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { double[] rowSize = getLabelPaneRowSize(plot, p); Component[][] components = getLabelPaneComponents(plot, p, columnSize); - return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1, 0}); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1, 0}); } protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) { From 87382872c296627eefb731819261915963f67d57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Tue, 3 Sep 2024 15:47:52 +0800 Subject: [PATCH 06/11] =?UTF-8?q?REPORT-133037=20fix:=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E9=9D=A2=E6=9D=BF=E4=BF=AE=E5=A4=8D&?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=95=88=E6=9E=9C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controlpane/UISimpleListControlPane.java | 18 +++---------- .../chart/designer/other/AutoRefreshPane.java | 26 +++++++++++-------- .../other/AutoRefreshPaneWithoutTooltip.java | 9 +++---- .../other/VanChartInteractivePane.java | 3 ++- .../designer/mobile/ParaMobileDefinePane.java | 18 +++---------- 5 files changed, 27 insertions(+), 47 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UISimpleListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UISimpleListControlPane.java index 79c96067fe..c6536e138b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UISimpleListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UISimpleListControlPane.java @@ -2,13 +2,13 @@ package com.fr.design.gui.controlpane; import com.fine.theme.icon.LazyIcon; import com.fr.design.actions.UpdateAction; +import com.fr.design.border.FineBorderFactory; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.UIList; -import com.fr.design.gui.itoolbar.UIToolBarUI; import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.menu.ShortCut; @@ -22,7 +22,6 @@ import sun.swing.DefaultLookup; import javax.swing.BorderFactory; import javax.swing.DefaultListModel; -import javax.swing.JComponent; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.ListCellRenderer; @@ -33,8 +32,6 @@ import javax.swing.event.ListSelectionListener; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; -import java.awt.Graphics; -import java.awt.Graphics2D; import java.awt.Point; import java.awt.Toolkit; import java.awt.event.ActionEvent; @@ -89,22 +86,14 @@ public class UISimpleListControlPane extends BasicPane { toolbarDef.addShortCut(sj.getShortCut()); } toolBar = ToolBarDef.createJToolBar(); - toolBar.setUI(new UIToolBarUI(){ - @Override - public void paint(Graphics g, JComponent c) { - Graphics2D g2 = (Graphics2D) g; - g2.setColor(Color.WHITE); - g2.fillRect(0, 0, c.getWidth(), c.getHeight()); - } - }); toolbarDef.updateToolBar(toolBar); // 封装一层,加边框 JPanel toolBarPane = new JPanel(new BorderLayout()); toolBarPane.add(toolBar, BorderLayout.CENTER); - toolBarPane.setBorder(BorderFactory.createMatteBorder(1, 1, 0, 1, UIConstants.RULER_LINE_COLOR)); + toolBarPane.setBorder(FineBorderFactory.createDefaultUnderlineBorder()); listPane.add(toolBarPane, BorderLayout.NORTH); - + contentPane.setBorder(FineBorderFactory.createWrappedRoundBorder()); return contentPane; } @@ -420,7 +409,6 @@ public class UISimpleListControlPane extends BasicPane { private void initComponents() { label = new UILabel(); -// label.setBorder(BorderFactory.createEmptyBorder(3, 10, 3, 0)); initialLabelForeground = label.getForeground(); this.setLayout(new BorderLayout()); this.add(label, BorderLayout.CENTER); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java index 2f94ab42f7..77c7be9dd8 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java @@ -18,6 +18,7 @@ import com.fr.plugin.chart.base.RefreshMoreLabel; import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane; +import org.jetbrains.annotations.Nullable; import javax.swing.JPanel; import javax.swing.SwingUtilities; @@ -82,28 +83,22 @@ public class AutoRefreshPane extends BasicBeanPane { initTooltipSet(); - JPanel jPanel = new JPanel(new BorderLayout()); - jPanel.add(autoTooltip, BorderLayout.CENTER); - jPanel.add(tooltipSet, BorderLayout.EAST); + JPanel tipPane = getTooltipPane(); JPanel moreLabelPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_More_Label")), moreLabel); - Component[][] components = initComponent(jPanel); - JPanel panel1 = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); + Component[][] components = initComponent(tipPane); contentPane = new JPanel(new BorderLayout()); - contentPane.add(panel1, BorderLayout.CENTER); + contentPane.add(FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}), BorderLayout.CENTER); - Component[][] AutoTooltipComponent = initAutoTooltipComponent(); - JPanel panel2 = FineLayoutBuilder.compatibleTableLayout(10, AutoTooltipComponent, new double[]{1.2, 2, 1}); - contentPane.add(panel2, BorderLayout.SOUTH); return FineLayoutBuilder.createVerticalLayout(10, moreLabelPane, contentPane); } protected Component[][] initComponent(JPanel autoTooltipPane){ - Column toolTipPane = column(10, + Column centerPane = column(10, row( cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Interval"))), flex(), @@ -114,11 +109,20 @@ public class AutoRefreshPane extends BasicBeanPane { ).getComponent(); return new Component[][]{ - new Component[]{null, toolTipPane} + new Component[]{null, centerPane} }; } + @Nullable + protected JPanel getTooltipPane() { + JPanel tipPane = new JPanel(new BorderLayout()); + tipPane.add(autoTooltip, BorderLayout.CENTER); + tipPane.add(tooltipSet, BorderLayout.EAST); + return tipPane; + } + + @Deprecated protected Component[][] initAutoTooltipComponent () { return new Component[][]{ diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPaneWithoutTooltip.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPaneWithoutTooltip.java index 21cfe6443f..845c15dbc4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPaneWithoutTooltip.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPaneWithoutTooltip.java @@ -3,7 +3,7 @@ package com.fr.van.chart.designer.other; import com.fr.plugin.chart.base.RefreshMoreLabel; import com.fr.plugin.chart.vanchart.VanChart; -import java.awt.Component; +import javax.swing.JPanel; /** * Created by mengao on 2017/6/21. @@ -14,10 +14,9 @@ public class AutoRefreshPaneWithoutTooltip extends AutoRefreshPane { super(chart, isLargeModel); } - protected Component[][] initAutoTooltipComponent () { - return new Component[][]{ - new Component[]{null, null}, - }; + @Override + protected JPanel getTooltipPane() { + return null; } protected void updateAutoTooltip(RefreshMoreLabel refreshMoreLabel) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java index 334104128c..c0018a5919 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java @@ -281,7 +281,8 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { //图表缩放新设计 恢复用注释。删除下面八个方法getzoomTypePane createZoomPaneContent // checkZoomEnabled getNameArray getValueArray checkZoomPane populateChartZoom updateChartZoom。 protected JPanel getZoomTypePane(UIButtonGroup zoomType) { - return TableLayout4VanChartHelper.createGapTableLayoutPaneWithoutTop(Toolkit.i18nText("Fine-Design_Chart_Zoom_Direction"), zoomType); + return FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, + new UILabel(Toolkit.i18nText("Fine-Design_Chart_Zoom_Direction")), zoomType); } protected JPanel createZoomPaneContent(JPanel zoomWidgetPane, JPanel zoomGesturePane, VanChartPlot plot) { diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java index 1682985261..d2a9bb4f73 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java @@ -1,7 +1,7 @@ package com.fr.design.widget.ui.designer.mobile; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.design.ExtraDesignClassManager; -import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.properties.PropertyTab; @@ -10,8 +10,6 @@ import com.fr.design.fun.ParameterExpandablePaneUIProvider; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.MobileWidgetListPane; import com.fr.design.mainframe.WidgetPropertyPane; @@ -22,7 +20,6 @@ import com.fr.form.ui.container.WSortLayout; import com.fr.form.ui.mobile.MobileParamStyle; import com.fr.report.mobile.EmptyMobileParamStyle; -import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; @@ -68,25 +65,16 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { // 手机属性 private UIExpandablePane getMobilePropertyPane() { mobileParamEditor = new AccessibleMobileParamEditor(new MobileParamSettingPane()); - double f = TableLayout.FILL; - double p = TableLayout.PREFERRED; - double[] rowSize = {p, p}; - double[] columnSize = {p, f}; - int[][] rowCount = {{1, 1}, {1, 1}}; Component[][] components = new Component[][]{ new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Param_Style")), mobileParamEditor}, }; - JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_L1); - JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); - panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); - jPanel.add(panel); - return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Properties_Mobile"), 280, 20, jPanel); + JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); + return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Properties_Mobile"), 280, 20, panel); } // 控件顺序 private UIExpandablePane getMobileWidgetListPane() { mobileWidgetListPane = new MobileWidgetListPane(designer, (WSortLayout) paraCreator.toData()); - mobileWidgetListPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 5, 0)); JPanel panelWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane(); panelWrapper.add(mobileWidgetListPane, BorderLayout.CENTER); From 08795afd60ba43fe9c5f34e13bbc69de7c94a5d1 Mon Sep 17 00:00:00 2001 From: renekton Date: Tue, 3 Sep 2024 16:23:42 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E8=A7=A3=E5=AF=86?= =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E6=A1=86=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/DecodeDialog.java | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DecodeDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/DecodeDialog.java index f76ed4711b..88b126e07b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DecodeDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DecodeDialog.java @@ -1,11 +1,15 @@ package com.fr.design.mainframe; +import java.awt.BorderLayout; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JDialog; +import javax.swing.JPanel; +import com.fine.theme.utils.FineUIStyle; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.BaseUtils; import com.fr.base.io.XMLEncryptUtils; import com.fr.design.DesignerEnvManager; @@ -19,6 +23,9 @@ import com.fr.stable.CodeUtils; import com.fr.stable.StringUtils; import com.fr.design.utils.gui.GUICoreUtils; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.row; + public class DecodeDialog { private UITextField jt; @@ -32,22 +39,18 @@ public class DecodeDialog { this.file = file; jd = new JDialog(); - jd.setLayout(null); + jd.setLayout(new BorderLayout()); UILabel newNameLable = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ECP_Input_Pwd")); - newNameLable.setBounds(20, 10, 130, 30); jt = new UITextField(StringUtils.EMPTY); jt.selectAll(); - jt.setBounds(130, 15, 150, 20); - jd.add(newNameLable); - jd.add(jt); + jd.add(row(20, cell(newNameLable), cell(jt)).getComponent(), BorderLayout.NORTH); hintsLabel = new UILabel(); - hintsLabel.setBounds(20, 50, 250, 30); hintsLabel.setForeground(Color.RED); hintsLabel.setVisible(false); confirmButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Confirm")); - confirmButton.setBounds(180, 90, 60, 25); + FineUIStyle.setStyle(confirmButton, FineUIStyle.PLAIN_BUTTON); confirmButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String key = jt.getText(); @@ -64,16 +67,17 @@ public class DecodeDialog { }); UIButton cancelButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cancel")); - cancelButton.setBounds(250, 90, 60, 25); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jd.dispose(); } }); - jd.add(cancelButton); - jd.add(confirmButton); - jd.add(hintsLabel); + JPanel buttonPane = new JPanel(new BorderLayout()); + buttonPane.setBorder(new ScaledEmptyBorder(10, 10, 10, 10)); + buttonPane.add(row(8, cell(confirmButton), cell(cancelButton)).getComponent(), BorderLayout.EAST); + jd.add(buttonPane, BorderLayout.SOUTH); + jd.add(hintsLabel, BorderLayout.CENTER); jd.setSize(340, 180); jd.setModal(true); jd.setTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ECP_Decode")); From 09284a661f1be8811b6839c043bc9db96dff27d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Tue, 3 Sep 2024 17:06:56 +0800 Subject: [PATCH 08/11] =?UTF-8?q?REPORT-133198=20fix:List=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E8=83=8C=E6=99=AF=E9=80=BB=E8=BE=91=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/controlpane/JListControlPane.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java index 828d9f845f..7a1094ab17 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java @@ -374,10 +374,8 @@ public abstract class JListControlPane extends JControlPane implements ListContr this.iconLabel.setBorder(new ScaledEmptyBorder(0, 4, 0, 0)); add(this.textLabel, BorderLayout.CENTER); add(this.iconLabel, BorderLayout.WEST); - this.iconLabel.setBackground(FlatUIUtils.getUIColor("List.cellRender.background", Color.WHITE)); - //iconLabel和textLabel的背景颜色不会被JList背景颜色覆盖,开发者自定义 - this.textLabel.setOpaque(true); - this.iconLabel.setOpaque(true); + this.textLabel.setOpaque(false); + this.iconLabel.setOpaque(false); } @Override @@ -390,9 +388,9 @@ public abstract class JListControlPane extends JControlPane implements ListContr this.textLabel.setText(nameable.getName()); boolean iconSet = false; if(isSelected) { - this.textLabel.setBackground(FlatUIUtils.getUIColor("List.selectionInactiveBackground", Color.GRAY)); + setBackground(FlatUIUtils.getUIColor("List.selectionInactiveBackground", Color.GRAY)); } else { - this.textLabel.setBackground(FlatUIUtils.getUIColor("List.cellRender.background", Color.WHITE)); + setBackground(FlatUIUtils.getUIColor("List.cellRender.background", Color.WHITE)); } for (NameableCreator creator : JListControlPane.this.creators()) { if (creator.menuIcon() != null && creator.acceptObject2Populate(nameable) != null) { From 1f12b37afe2299c23fbeadf71dbcbf7e05864f70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Tue, 3 Sep 2024 17:07:59 +0800 Subject: [PATCH 09/11] =?UTF-8?q?REPORT-133167=20&=20REPORT-133157=20fix:?= =?UTF-8?q?=E7=BB=86=E8=8A=82=E7=BC=A9=E6=94=BE=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/parameter/ParameterPropertyPane.java | 8 +++++--- .../java/com/fr/design/mainframe/bbs/UserInfoLabel.java | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java b/designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java index 16c0e91d65..75257c0b01 100644 --- a/designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java +++ b/designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java @@ -1,5 +1,6 @@ package com.fr.design.parameter; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.Parameter; import com.fr.design.border.FineBorderFactory; import com.fr.design.constants.UIConstants; @@ -23,6 +24,8 @@ import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import static com.fine.theme.utils.FineUIScale.scale; + public class ParameterPropertyPane extends JPanel{ private ParameterToolBarPane toolbarPane; private ParaDefinitePane paraPane; @@ -32,8 +35,7 @@ public class ParameterPropertyPane extends JPanel{ private static ParameterPropertyPane THIS; private boolean isEditing = false; - private static final int PADDING_MIDDLE = 10; - private static final int ADD_PARA_PANE_MAX_HEIGHT = 95; + private static final int ADD_PARA_PANE_MAX_HEIGHT = scale(120); public static final ParameterPropertyPane getInstance() { if (THIS == null) { @@ -138,7 +140,7 @@ public class ParameterPropertyPane extends JPanel{ private void setEditor(FormDesigner editor) { if (formHierarchyTreePaneWrapper == null) { formHierarchyTreePaneWrapper = new JPanel(new BorderLayout()); - formHierarchyTreePaneWrapper.setBorder(BorderFactory.createEmptyBorder(0, PADDING_MIDDLE, 0, 0)); + formHierarchyTreePaneWrapper.setBorder(new ScaledEmptyBorder(0, 10, 0, 0)); this.add(formHierarchyTreePaneWrapper, BorderLayout.CENTER); } formHierarchyTreePaneWrapper.remove(FormHierarchyTreePane.getInstance()); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java index 1d1ff9ad48..c4fd87acef 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -49,6 +49,7 @@ import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; +import static com.fine.theme.utils.FineUIScale.scale; import static com.fine.theme.utils.FineUIStyle.BRAND_COLOR_LABEL; /** @@ -65,7 +66,7 @@ public class UserInfoLabel extends UILabel { private static final String MESSAGE_KEY = "messageCount"; private static final int MIN_MESSAGE_COUNT = 1; - private static final int MENU_HEIGHT = 20; + private static final int MENU_HEIGHT = scale(24); private static final int DEFAULT_BBS_UID = 0; From 5ad2313830c4700cbf3f482a3c6c89f228816271 Mon Sep 17 00:00:00 2001 From: "Richard.Fang" Date: Tue, 3 Sep 2024 18:57:36 +0800 Subject: [PATCH 10/11] =?UTF-8?q?REPORT-132799=20&=20REPORT-131838=20&=20R?= =?UTF-8?q?EPORT-132389=20&=20REPORT-132382=20&=20REPORT-132380=20&=20REPO?= =?UTF-8?q?RT-132375=20&=20REPORT-132357=20&=20REPORT-132231=20&=20REPORT-?= =?UTF-8?q?132227=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 11/11] =?UTF-8?q?REPORT-132799=20&=20REPORT-131838=20&=20R?= =?UTF-8?q?EPORT-132389=20&=20REPORT-132382=20&=20REPORT-132380=20&=20REPO?= =?UTF-8?q?RT-132375=20&=20REPORT-132357=20&=20REPORT-132231=20&=20REPORT-?= =?UTF-8?q?132227=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))