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..8d0c572da5 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,6 +1,8 @@ package com.fr.design.gui.style; +import com.fine.theme.utils.FineLayoutBuilder; import com.formdev.flatlaf.util.ScaledEmptyBorder; +import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.IntervalConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.UIPercentDragPane; @@ -46,27 +48,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[]{LayoutConstants.LEFT_WEIGHT, LayoutConstants.RIGHT_WEIGHT}); - 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[]{LayoutConstants.LEFT_WEIGHT, LayoutConstants.RIGHT_WEIGHT}); 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..65c72b6d2d 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,7 @@ package com.fr.design.gui.style; +import com.fine.theme.utils.FineLayoutBuilder; +import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.IntervalConstants; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ispinner.UISpinner; @@ -66,17 +68,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[]{LayoutConstants.LEFT_WEIGHT, LayoutConstants.RIGHT_WEIGHT}); 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..d8167d090a 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,7 +1,9 @@ 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.constants.LayoutConstants; import com.fr.design.designer.IntervalConstants; import com.fr.design.formula.TinyFormulaPane; import com.fr.design.gui.ibutton.UIButtonGroup; @@ -187,21 +189,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[]{LayoutConstants.LEFT_WEIGHT, LayoutConstants.RIGHT_WEIGHT}); } 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 +205,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[]{LayoutConstants.LEFT_WEIGHT, LayoutConstants.RIGHT_WEIGHT}); 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..61872ff7b9 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,9 +1,11 @@ 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; import com.fr.design.border.UIRoundedBorder; +import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.UIConstants; import com.fr.design.designer.IntervalConstants; import com.fr.design.event.UIObserver; @@ -154,7 +156,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 +164,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[]{LayoutConstants.LEFT_WEIGHT, LayoutConstants.RIGHT_WEIGHT}); } 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 b8ea2bf0a9..48984a4590 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 @@ -65,8 +65,15 @@ public class PatternBackgroundQuickPane extends BackgroundQuickPane { backgroundLabel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background")); this.add(Layouts.column(LayoutConstants.VERTICAL_GAP, - row(cell(foregroundLabel).weight(1), cell(foregroundColorPane).weight(4)), - row(cell(backgroundLabel).weight(1), cell(backgroundColorPane).weight(4)) + row( + 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)) + .with(it -> it.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"))).weight(1), + cell(backgroundColorPane).weight(4)), + row(cell(foregroundLabel).weight(1), cell(foregroundColorPane).weight(4)) ).with(it -> it.setBorder(new ScaledEmptyBorder(LayoutConstants.VERTICAL_GAP, 0, 0, 0))).getComponent(), BorderLayout.CENTER); foregroundColorPane.addSelectChangeListener(colorChangeListener); backgroundColorPane.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..94067cd59b 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 @@ -1,5 +1,6 @@ package com.fr.design.mainframe.theme; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.theme.FormTheme; import com.fr.base.theme.TemplateThemeConfig; import com.fr.base.theme.settings.ThemedComponentStyle; @@ -71,6 +72,7 @@ public class FormThemeProfilePane extends TemplateThemeProfilePane { componentStyleSettingPane = new ComponentStyleEditPane(); addCustomEditorPane(i18nText("Fine-Design_Predefined_Component_Style"), componentStyleSettingPane); + initializePane(); refreshExtraAdvancedPane(); } @@ -98,5 +100,11 @@ public class FormThemeProfilePane extends TemplateThemeProfilePane { ThemedComponentStyle componentStyle = componentStyleSettingPane.updateBean(); theme.setComponentStyle(componentStyle); } + + @Override + protected void buildTabPane() { + uiTabbedPane = tabPaneBuilder.withHeadRatio(0.6f).build(); + uiTabbedPane.setBorder(new ScaledEmptyBorder(10, 5, 10, 1)); + } } } 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; } + + protected 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..ef66eb5515 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,6 +1,8 @@ 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.constants.LayoutConstants; import com.fr.design.designer.IntervalConstants; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; @@ -50,16 +52,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[]{LayoutConstants.LEFT_WEIGHT, LayoutConstants.RIGHT_WEIGHT} ); 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..bd243f2c35 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,14 @@ public class GradientBar extends AbstractComponentPopBox implements UIObserver, }); } + protected void addMouseDragListener() { + this.addMouseMotionListener(new MouseAdapter() { + public void mouseDragged(MouseEvent e) { + dragAction(e); + } + }); + } + protected void clickButton(int select) { setIndex(select); showPopupMenu(); @@ -305,4 +315,36 @@ public class GradientBar extends AbstractComponentPopBox implements UIObserver, public void setDraggable(boolean draggable) { this.draggable = draggable; } + + private void dragAction(MouseEvent e) { + int oldIndex = index; + int size = list.size(); + for (int i = 0; i < size; i++) { + if (list.get(i).contains(e.getX(), e.getY())) { + index = i; + break; + } + } + updateX(oldIndex, index, e); + + GradientBar.this.repaint(); + if (index == 1) { + endLabel.setText(Double.toString(p2.getX())); + } else { + startLabel.setText(Double.toString(p1.getX())); + } + } + + private void updateX(int oldIndex, int newIndex, MouseEvent e) { + if (OperatingSystem.isLinux() && AssistUtils.equals(oldIndex, newIndex)) { + if (Math.abs(p1.getX() - e.getX()) > Math.abs(p2.getX() - e.getX())) { + index = 1; + } else { + index = 0; + } + } + if (e.getX() <= max && e.getX() >= min && e.getY() < MAX_VERTICAL) { + list.get(index).setX(e.getX()); + } + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java b/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java index 9c1a65b723..7b67d5137d 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java @@ -2,6 +2,7 @@ package com.fr.design.write.submit; import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIUtils; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.GraphHelper; import com.fr.data.AbstractClassJob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; @@ -43,17 +44,10 @@ public abstract class CustomJobPane extends BasicBeanPane { this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel reportletNamePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); classNameTextField = new UITextField(); - classNameTextField.setPreferredSize(FineUIScale.scale(new Dimension(0, 24))); UIButton browserButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); - browserButton.setPreferredSize(new Dimension( - GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")) + 40, - FineUIScale.scale(24))); UIButton editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")); - editButton.setPreferredSize(new Dimension( - GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")) + 40, - FineUIScale.scale(24))); UITextArea area = new UITextArea(2, 1); @@ -95,16 +89,16 @@ public abstract class CustomJobPane extends BasicBeanPane { }); reportletNamePane.setLayout(new BorderLayout()); - reportletNamePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); + reportletNamePane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); reportletNamePane.add(row(4, - cell(classNameTextField).weight(1.0), + cell(classNameTextField).weight(1), cell(browserButton), cell(editButton) ).getComponent(), BorderLayout.CENTER); objectProperiesPane = new ObjectProperiesPane(); JPanel dsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - dsPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); + dsPane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); dsPane.add(area); this.add(column(20, cell(FineUIUtils.wrapComponentWithTitle(reportletNamePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Class_Name"))), 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); } diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java index ff46e08971..4cb4dea409 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java @@ -196,7 +196,7 @@ public class SubmitVisitorListPane extends ObjectJControlPane { JPanel typePane = new JPanel(new BorderLayout()); typePane.add(row(10, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Choose_Submit_Type"))), - cell(csjConfigComboBox)).getComponent()); + cell(csjConfigComboBox).weight(0.5)).getComponent()); this.add(column( cell(FineUIUtils.wrapComponentWithTitle(typePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Submit_Type"))),