From 32ac35038d21b5a03ef2b85ce06eae67016af6e3 Mon Sep 17 00:00:00 2001 From: renekton Date: Tue, 10 Sep 2024 15:26:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=9D=A2=E6=9D=BF=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E9=97=AE=E9=A2=98&=E4=B8=BB=E9=A2=98=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=9B=BD=E9=99=85=E5=8C=96=E5=B8=83=E5=B1=80=E9=97=AE?= =?UTF-8?q?=E9=A2=98&=E5=8D=95=E5=85=83=E6=A0=BC=E4=B8=8D=E9=9A=8F?= =?UTF-8?q?=E6=B8=90=E5=8F=98=E6=9D=A1=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tractTranslucentBackgroundSpecialPane.java | 17 +++++----- .../fr/design/gui/style/AlignmentPane.java | 15 ++++++--- .../com/fr/design/gui/style/BorderPane.java | 3 +- .../gui/style/ComponentIntegralStylePane.java | 10 ++---- .../gui/style/ComponentTitleStylePane.java | 23 ++++---------- .../TextInsetImageBackgroundSpecialPane.java | 5 +-- .../javascript/Commit2DBJavaScriptPane.java | 5 ++- .../GradientBackgroundQuickPane.java | 5 ++- .../ImageBackgroundQuickPane.java | 1 + .../PatternBackgroundQuickPane.java | 6 ++-- .../mainframe/theme/FormThemeProfilePane.java | 1 + .../theme/ReportThemeProfilePane.java | 1 + .../theme/TemplateThemeEditorPane.java | 19 +++++++----- .../ChartTitleAndBackgroundStylePane.java | 4 ++- .../component/ComponentMarginStylePane.java | 12 ++----- .../background/gradient/GradientBar.java | 31 +++++++++++++++++++ .../write/submit/DBManipulationPane.java | 19 ++++++------ .../java/com/fr/design/webattr/EventPane.java | 10 +++--- 18 files changed, 108 insertions(+), 79 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/AbstractTranslucentBackgroundSpecialPane.java b/designer-base/src/main/java/com/fr/design/gui/style/AbstractTranslucentBackgroundSpecialPane.java index f1bc865c9f..bd6d633f33 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/AbstractTranslucentBackgroundSpecialPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/AbstractTranslucentBackgroundSpecialPane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.style; +import com.fine.theme.utils.FineLayoutBuilder; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.designer.IntervalConstants; import com.fr.design.dialog.BasicPane; @@ -46,27 +47,25 @@ public abstract class AbstractTranslucentBackgroundSpecialPane 0 ? this.uiSettingWidth : f}; - // 确保BackgroundSpecialPane高度变化时,Label依然保持与其顶部对齐 JPanel backgroundLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); backgroundLabelPane.setBorder(new ScaledEmptyBorder(7, 0, 0, 0)); - backgroundLabelPane.add(FRWidgetFactory.createLineWrapLabel(backgroundName), BorderLayout.NORTH); + UILabel backgroundLabel = new UILabel(backgroundName); + backgroundLabel.setToolTipText(backgroundName); + backgroundLabelPane.add(backgroundLabel, BorderLayout.NORTH); - JPanel backgroundComposedPane = TableLayoutHelper.createGapTableLayoutPane( + JPanel backgroundComposedPane = FineLayoutBuilder.compatibleTableLayout(10, new JComponent[][]{ {backgroundLabelPane, backgroundPane} }, - new double[]{p}, columnSize, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1); + new double[]{1.2, 3}); - JPanel opacityComposedPane = TableLayoutHelper.createGapTableLayoutPane( + JPanel opacityComposedPane = FineLayoutBuilder.compatibleTableLayout(10, new JComponent[][]{ {new UILabel(""), FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Alpha"))}, {new UILabel(""), opacityPane} }, - new double[]{p, p}, columnSize, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1); + new double[]{1.2, 3}); opacityComposedPane.setBorder(new ScaledEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0)); opacityComposedPane.setVisible(false); diff --git a/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java b/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java index 4cbbe01590..4ba5c9aa5b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java @@ -212,11 +212,12 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO private JPanel seniorUpPane() { return Layouts.column(LayoutConstants.VERTICAL_GAP, row( - cell(new UILabel((Toolkit.i18nText("Fine-Design_Basic_Image_Layout")), SwingConstants.LEFT)).weight(1.2), + cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Image_Layout"), SwingConstants.LEFT)) + .with(it -> it.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Image_Layout"))).weight(1.2), cell(imageLayoutComboBox).weight(3.0) ), row( - cell(new UILabel((Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Text_Style")), SwingConstants.LEFT)).weight(1.2), + cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Text_Style"), SwingConstants.LEFT)).weight(1.2), cell(textComboBox).weight(3.0) ) ).getComponent(); @@ -225,12 +226,14 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO private JPanel seniorMiddlePane() { rotationBarPane = ReactiveCardPane.create() .addSupplier("hide", () -> Layouts.row( - cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"), SwingConstants.LEFT)).weight(1.2), + cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"), SwingConstants.LEFT)) + .with(it -> it.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"))).weight(1.2), cell(textRotationComboBox).weight(3) ).getComponent()) .addSupplier("show", () -> Layouts.column(LayoutConstants.VERTICAL_GAP, row( - cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"), SwingConstants.LEFT)).weight(1.2), + cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"), SwingConstants.LEFT)) + .with(it -> it.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"))).weight(1.2), cell(textRotationComboBox).weight(3) ), row( @@ -249,9 +252,11 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO private JPanel seniorDownPane() { UILabel indentationLabel = new UILabel((Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Style_Indentation")), SwingConstants.LEFT); + indentationLabel.setToolTipText(indentationLabel.getText()); UILabel partSpacingLabel = new UILabel((Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Style_Part_Spacing")), SwingConstants.LEFT); + partSpacingLabel.setToolTipText(partSpacingLabel.getText()); UILabel spacingLabel = new UILabel((Toolkit.i18nText("Fine-Design_Basic_Style_Line_Spacing")), SwingConstants.LEFT); - + spacingLabel.setToolTipText(spacingLabel.getText()); return Layouts.column( row( cell(indentationLabel).weight(1.2), diff --git a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java index 81759d5f04..ca73c9b59e 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java @@ -104,7 +104,8 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Color"), SwingConstants.LEFT)).weight(1.2), cell(currentLineColorPane).weight(3)), row( - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Out_Border"), SwingConstants.LEFT)).weight(1.2), + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Out_Border"), SwingConstants.LEFT)) + .with(it -> it.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Out_Border"))).weight(1.2), cell(outerToggleButton = new UIToggleButton(new Icon[]{new LazyIcon("out"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/out_white.png")}, false)). with(it -> it.setPreferredSize(new Dimension(-1, FineUIScale.scale(24)))).weight(3)), diff --git a/designer-base/src/main/java/com/fr/design/gui/style/ComponentIntegralStylePane.java b/designer-base/src/main/java/com/fr/design/gui/style/ComponentIntegralStylePane.java index 0fe9c14891..476fb2529e 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/ComponentIntegralStylePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/ComponentIntegralStylePane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.style; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.design.designer.IntervalConstants; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ispinner.UISpinner; @@ -66,17 +67,12 @@ public class ComponentIntegralStylePane extends AbstractBorderPackerPane { setLayout(FRGUIPaneFactory.createBorderLayout()); this.initializeComponents(); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] rowSize = supportCornerRadius ? new double[] {p, p, p} : new double[]{p, p}; - double[] columnSize = {this.uiLabelWidth, this.uiSettingWidth > 0 ? this.uiSettingWidth : f}; - - JPanel content = TableLayoutHelper.createGapTableLayoutPane(new JComponent[][]{ + JPanel content = FineLayoutBuilder.compatibleTableLayout(10, new JComponent[][]{ {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Render_Style")), FRGUIPaneFactory.createBorderLayoutNorthPaneWithComponent(borderStyleCombo)}, {this.borderPane, null}, {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Radius")), cornerSpinner}, }, - rowSize, columnSize, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1); + new double[]{1.2, 3}); this.add(content, BorderLayout.NORTH); } diff --git a/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java b/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java index 1f2fb91b82..e391cde959 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.style; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.Utils; import com.fr.base.svg.IconUtils; import com.fr.design.designer.IntervalConstants; @@ -187,21 +188,13 @@ public class ComponentTitleStylePane extends AbstractBorderPackerPane { } private JPanel createTitleContentPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] rowSize = {p}; - double[] columnSize = {this.uiLabelWidth, this.uiSettingWidth > 0 ? this.uiSettingWidth : f}; - return TableLayoutHelper.createCommonTableLayoutPane( + return FineLayoutBuilder.compatibleTableLayout(10, new JComponent[][]{{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Content")), textContentPane}}, - rowSize, columnSize, IntervalConstants.INTERVAL_L1); + new double[]{1.2, 3}); } private JPanel createTitleOtherSettingPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] rowSize = {p, p, p, p, p}; - double[] columnSize = {this.uiLabelWidth, this.uiSettingWidth > 0 ? this.uiSettingWidth : f}; JComponent[][] components = new JComponent[][]{ {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Format")), FRGUIPaneFactory.createBorderLayoutNorthPaneWithComponent(fontFamilyComboBox)}, @@ -211,18 +204,14 @@ public class ComponentTitleStylePane extends AbstractBorderPackerPane { {backgroundPane, null} }; - return TableLayoutHelper.createCommonTableLayoutPane(components, rowSize, columnSize, IntervalConstants.INTERVAL_L1); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); } protected JPanel createTitleFontButtonPane(){ - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] rowSize = {p}; - double[] columnSize = {f, p, p, p, p}; - JPanel buttonPane = TableLayoutHelper.createCommonTableLayoutPane( new JComponent[][] { + JPanel buttonPane = FineLayoutBuilder.compatibleTableLayout(10, new JComponent[][] { {fontSizeComboBox, fontColorSelectPane, fontItalicButton, fontBoldButton, fontUnderlineButton}, - }, rowSize, columnSize, IntervalConstants.INTERVAL_W0); + }, new double[]{1.2, 3}); JPanel containerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); containerPane.add(buttonPane, BorderLayout.NORTH); diff --git a/designer-base/src/main/java/com/fr/design/gui/style/TextInsetImageBackgroundSpecialPane.java b/designer-base/src/main/java/com/fr/design/gui/style/TextInsetImageBackgroundSpecialPane.java index b3556dc6f8..59f0d8c1bd 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/TextInsetImageBackgroundSpecialPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/TextInsetImageBackgroundSpecialPane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.style; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.Style; import com.fr.base.background.ImageBackground; import com.fr.base.background.ImageFileBackground; @@ -154,7 +155,7 @@ public class TextInsetImageBackgroundSpecialPane extends JPanel implements UIObs } }); - return TableLayoutHelper.createCommonTableLayoutPane( + return FineLayoutBuilder.compatibleTableLayout(10, new JComponent[][]{ {null, deletableImagePreviewPane}, {null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Inset_Relative_Location"))}, @@ -162,7 +163,7 @@ public class TextInsetImageBackgroundSpecialPane extends JPanel implements UIObs {null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Inset_Padding"))}, {null, this.imagePaddingPane} }, - rowSize, columnSize, IntervalConstants.INTERVAL_L1); + new double[]{1.2, 3}); } private void initImageFileChooserIfNotExist() { diff --git a/designer-base/src/main/java/com/fr/design/javascript/Commit2DBJavaScriptPane.java b/designer-base/src/main/java/com/fr/design/javascript/Commit2DBJavaScriptPane.java index a475fa1cdb..35c40b8645 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/Commit2DBJavaScriptPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/Commit2DBJavaScriptPane.java @@ -17,6 +17,7 @@ import java.awt.Dimension; import java.util.ArrayList; import java.util.List; +import static com.fine.swing.ui.layout.Layouts.column; import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.swing.ui.layout.Layouts.cell; @@ -53,14 +54,12 @@ public class Commit2DBJavaScriptPane extends FurtherBasicBeanPane(textArray, valueArray); + directionPane.setAllToolTips(textArray); directionPane.setSelectedIndex(0); gradientBar = new GradientBar(4, this.gradientBarWidth); this.setLayout(new BorderLayout()); @@ -91,7 +92,9 @@ public class GradientBackgroundQuickPane extends BackgroundQuickPane { */ @Override public void registerChangeListener(final UIObserverListener listener) { - directionPane.addChangeListener(new ChangeListenerImpl(listener)); + gradientBar.addChangeListener(new ChangeListenerImpl(listener)); + + directionPane.addChangeListener(new ChangeListenerImpl(listener)); } @Override diff --git a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java index 6bdc8bb008..70ee8625d0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java @@ -50,6 +50,7 @@ public class ImageBackgroundQuickPane extends BackgroundQuickPane { String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Image_Default"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Image_Titled"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Image_Extend"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Image_Adjust")}; Byte[] valueArray = {Constants.IMAGE_CENTER, Constants.IMAGE_TILED, Constants.IMAGE_EXTEND, Constants.IMAGE_ADJUST}; imageLayoutPane = new UIButtonGroup(nameArray, valueArray); + imageLayoutPane.setAllToolTips(nameArray); imageLayoutPane.setSelectedIndex(0); previewPane = new ImagePreviewPane(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java index 789bcd16cf..d0be0875fe 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java @@ -61,10 +61,12 @@ public class PatternBackgroundQuickPane extends BackgroundQuickPane { foregroundColorPane.setSelectObject(DEFAULT_BACKGROUND); this.add(Layouts.column(LayoutConstants.VERTICAL_GAP, row( - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground"), UILabel.LEFT)).weight(1), + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground"), UILabel.LEFT)) + .with(it -> it.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground"))).weight(1), cell(foregroundColorPane).weight(4)), row( - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"), UILabel.LEFT)).weight(1), + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"), UILabel.LEFT)) + .with(it -> it.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"))).weight(1), cell(backgroundColorPane).weight(4)) ).with(it -> it.setBorder(new ScaledEmptyBorder(LayoutConstants.VERTICAL_GAP, 0, 0, 0))).getComponent(), BorderLayout.CENTER); foregroundColorPane.addSelectChangeListener(colorChangeListener); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java index 922230b158..b0d470ffed 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java @@ -71,6 +71,7 @@ public class FormThemeProfilePane extends TemplateThemeProfilePane { componentStyleSettingPane = new ComponentStyleEditPane(); addCustomEditorPane(i18nText("Fine-Design_Predefined_Component_Style"), componentStyleSettingPane); + initializePane(); refreshExtraAdvancedPane(); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java index 3f654cae5c..44253b983b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java @@ -51,6 +51,7 @@ public class ReportThemeProfilePane extends TemplateThemeProfilePane extends J protected final List> extraPaneList = new ArrayList<>(); protected boolean isPopulating = false; - protected UITabbedPane uiTabbedPane; + protected FineTabbedPane.TabPaneBuilder tabPaneBuilder; + protected FineTabbedPane uiTabbedPane; private final TemplateThemeConfig config; @@ -81,10 +83,10 @@ public abstract class TemplateThemeEditorPane extends J super(); this.config = config; theme = config.createNewTheme(); - initializePane(); + tabPaneBuilder = FineTabbedPane.builder(); } - private void initializePane() { + protected void initializePane() { setLayout(new BorderLayout(0, 0)); setPreferredSize(FineUIScale.scale(new Dimension(RIGHT_PANE_WIDTH, RIGHT_PANE_HEIGHT))); JPanel nameEditPane = createNameEditPane(); @@ -180,9 +182,7 @@ public abstract class TemplateThemeEditorPane extends J protected JPanel createCustomEditorsPane() { JPanel container = new JPanel(new BorderLayout()); container.setBorder(BorderUtils.createTitleBorder(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Custom_Settings_Title"))); - - uiTabbedPane = new UITabbedPane(); - uiTabbedPane.setBorder(new ScaledEmptyBorder(10, 5, 10, 1)); + buildTabPane(); container.add(uiTabbedPane, BorderLayout.CENTER); initPluginListener(); return container; @@ -203,7 +203,7 @@ public abstract class TemplateThemeEditorPane extends J fireAttributeChange(); } }); - uiTabbedPane.addTab(title, settingPane); + tabPaneBuilder.addTab(title, settingPane); } protected void refreshExtraAdvancedPane() { @@ -359,4 +359,9 @@ public abstract class TemplateThemeEditorPane extends J } return ThemePreviewTerminal.PC; } + + private void buildTabPane() { + uiTabbedPane = tabPaneBuilder.withHeadRatio(0.6f).build(); + uiTabbedPane.setBorder(new ScaledEmptyBorder(10, 5, 10, 1)); + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleAndBackgroundStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleAndBackgroundStylePane.java index 2dc0659d00..f2d928479c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleAndBackgroundStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleAndBackgroundStylePane.java @@ -86,12 +86,14 @@ public class ChartTitleAndBackgroundStylePane extends AbstractChartStylePane { String chartAreaBgLabelName = Toolkit.i18nText("Fine-Design_Chart_Area_Background_Color"); UILabel chartAreaBgLabel = new UILabel(chartAreaBgLabelName); chartAreaBgLabel.setToolTipText(chartAreaBgLabelName); + UILabel gridLineLabel = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Grid_Line_Color")); + gridLineLabel.setToolTipText(gridLineLabel.getText()); return new Component[][]{ new Component[]{chartFontPane, null}, new Component[]{null, null}, new Component[]{chartAreaBgLabel, typeComboBox}, new Component[]{null, centerPane}, - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Grid_Line_Color")), mainGridColor} + new Component[]{gridLineLabel, mainGridColor} }; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/component/ComponentMarginStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/component/ComponentMarginStylePane.java index 643c1e9601..5e5d43a6b1 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/component/ComponentMarginStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/component/ComponentMarginStylePane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.theme.edit.component; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.theme.settings.ThemedComponentStyle; import com.fr.design.designer.IntervalConstants; import com.fr.design.gui.ilable.UILabel; @@ -50,16 +51,9 @@ public class ComponentMarginStylePane extends JPanel { uiLabel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0)); uiLabel.setVerticalAlignment(SwingConstants.TOP); - - double f = TableLayout.FILL; - double p = TableLayout.PREFERRED; - double[] rowSize = { p }; - double[] columnSize = { this.uiLabelWidth, this.uiSettingWidth > 0 ? this.uiSettingWidth : f }; - - JPanel panel = TableLayoutHelper.createGapTableLayoutPane( + JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, new Component[][]{new Component[]{uiLabel, createPaddingPane()}}, - rowSize, columnSize, - IntervalConstants.INTERVAL_L1, 0 + new double[]{1.2, 3} ); this.add(panel); } diff --git a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java index 7954387448..25467b02ba 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java +++ b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java @@ -9,6 +9,7 @@ import com.fr.design.style.color.ColorCell; import com.fr.design.style.color.ColorSelectable; import com.fr.design.style.color.NewColorSelectPane; import com.fr.stable.AssistUtils; +import com.fr.stable.os.OperatingSystem; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; @@ -84,6 +85,7 @@ public class GradientBar extends AbstractComponentPopBox implements UIObserver, p1.setStartPosition(0); p2.setStartPosition(1); addMouseClickListener(); + addMouseDragListener(); iniListener(); } @@ -129,6 +131,35 @@ public class GradientBar extends AbstractComponentPopBox implements UIObserver, }); } + protected void addMouseDragListener() { + this.addMouseMotionListener(new MouseAdapter() { + public void mouseDragged(MouseEvent e) { + int oldIndex = index; + for (int i = 0; i < list.size(); i++) { + if (list.get(i).contains(e.getX(), e.getY())) { + index = i; + break; + } + } + if (OperatingSystem.isLinux() && AssistUtils.equals(oldIndex, index)) { + if (Math.abs(p1.getX() - e.getX()) > Math.abs(p2.getX() - e.getX())) { + index = 1; + } else { + index = 0; + } + } + boolean x = e.getX() <= max && e.getX() >= min; + if (x && e.getY() < MAX_VERTICAL) { + list.get(index).setX(e.getX()); + } + + GradientBar.this.repaint(); + startLabel.setText(Double.toString(p1.getX())); + endLabel.setText(Double.toString(p2.getX())); + } + }); + } + protected void clickButton(int select) { setIndex(select); showPopupMenu(); diff --git a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java index 3d366eb9a5..96dac6fd08 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java @@ -103,6 +103,7 @@ import static com.fine.swing.ui.layout.Layouts.row; 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; //august:这个东西应该分成两类,一类是有单元格的情况,一类是没有单元格的情况 public class DBManipulationPane extends BasicBeanPane { @@ -165,16 +166,16 @@ public class DBManipulationPane extends BasicBeanPane { cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Choose_Submit_Type"))), cell(dmlConfigComboBox)).getComponent()); chooseTable = new ChoosePaneSupportFormula(); - chooseTable.setTableNameComboBoxPopSize(FineUIScale.scale(160), FineUIScale.scale(320)); + chooseTable.setTableNameComboBoxPopSize(scale(160), scale(320)); // peter:编辑的TablePane - JPanel editTablePane = new JPanel(new BorderLayout(FineUIScale.scale(10), 0)); + JPanel editTablePane = new JPanel(new BorderLayout(scale(10), 0)); Dimension editTableDimension = createEditTablePreferredSize(); editTablePane.setBounds(0, 0, editTableDimension.width, editTableDimension.height); keyColumnValuesTable = new KeyColumnNameValueTable(); editTablePane.add(new UIVerticalScrollPane(keyColumnValuesTable), BorderLayout.CENTER); keyColumnValuesTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); - keyColumnValuesTable.setPreferredScrollableViewportSize(FineUIScale.scale(new Dimension(280, 150))); + keyColumnValuesTable.setPreferredScrollableViewportSize(scale(new Dimension(280, 150))); keyColumnValuesTable.setShowHorizontalLines(true); northPane.add(column(10, @@ -190,7 +191,7 @@ public class DBManipulationPane extends BasicBeanPane { cell(bottomPane)) .getComponent(), BorderLayout.CENTER); - this.add(new UIScrollPane(contentPane)); + this.add(contentPane); initJTableColumn(); @@ -216,7 +217,7 @@ public class DBManipulationPane extends BasicBeanPane { List buttonGroup = Arrays.stream(actions).map(action -> cell(new UIButton(action))).collect(Collectors.toList()); checkBoxUpdatePane = new JPanel(new BorderLayout(0, 0)); - checkBoxUpdatePane.setPreferredSize(new Dimension(120, 20)); + checkBoxUpdatePane.setPreferredSize(scale(new Dimension(120, 20))); UpdateCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_RWA_NotChange_Unmodified")); UIButton helpButton = new UIButton(HEIP_ICON); @@ -372,11 +373,11 @@ public class DBManipulationPane extends BasicBeanPane { } protected Dimension createEditTablePreferredSize() { - return FineUIScale.scale(new Dimension(280, 180)); + return scale(new Dimension(280, 180)); } protected Dimension createConditionPanePreferredSize() { - return FineUIScale.scale(new Dimension(454, 60)); + return scale(new Dimension(454, 60)); } protected boolean setJpVisible() { @@ -384,12 +385,12 @@ public class DBManipulationPane extends BasicBeanPane { } protected Dimension createJpPreferredSize() { - return FineUIScale.scale(new Dimension(280, 60)); + return scale(new Dimension(280, 60)); } protected Dimension createControlBtnPanePreferredSize() { - return FineUIScale.scale(new Dimension(110, 20)); + return scale(new Dimension(110, 20)); } protected String setControlBtnPanePosition() { diff --git a/designer-realize/src/main/java/com/fr/design/webattr/EventPane.java b/designer-realize/src/main/java/com/fr/design/webattr/EventPane.java index 5f3d43cf5c..812b7352f3 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/EventPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/EventPane.java @@ -218,14 +218,13 @@ public class EventPane extends BasicPane { jsPane.populateBean(lis); // BasicDialog dialog = jsPane.showWindow(DesignerContext.getDesignerFrame()); // 不能直接建立在DesignerFrame 不然里面事件里有提交入库进行智能添加单元格就麻烦了 - BasicDialog dialog = jsPane.showWindow(SwingUtilities.getWindowAncestor(EventPane.this)); - dialog.addDialogActionListener(new DialogActionAdapter() { + BasicDialog dialog = jsPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(EventPane.this), new DialogActionAdapter() { @Override public void doOk() { listModel.setElementAt(jsPane.updateBean(), i); eventList.validate(); } - }); + }, new Dimension(660, 660)); dialog.setVisible(true); } @@ -272,14 +271,13 @@ public class EventPane extends BasicPane { Listener lis = new Listener(menuName[j], new JavaScriptImpl()); listenerPane.populateBean(lis); - BasicDialog dialog = listenerPane.showWindow(SwingUtilities.getWindowAncestor(EventPane.this)); - dialog.addDialogActionListener(new DialogActionAdapter() { + BasicDialog dialog = listenerPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(EventPane.this), new DialogActionAdapter() { @Override public void doOk() { listModel.addElement(listenerPane.updateBean()); eventList.validate(); } - }); + }, new Dimension(660, 660)); dialog.setVisible(true); }