Browse Source

Merge pull request #14807 in DESIGN/design from fbp/release to fbp/feature

* commit '4a2d7ee5b137fc5550813e10e94ee93870404386':
  自定义提交按钮大小弹性变化
  合并冲突
  方法修改
  提取方法
  方法提取
  用定好的常量替代
  模板主题tab修改
  提交面板布局问题&主题模板国际化布局问题&单元格不随渐变条变化
fbp/feature
superman 3 months ago
parent
commit
394e63644c
  1. 18
      designer-base/src/main/java/com/fr/design/gui/style/AbstractTranslucentBackgroundSpecialPane.java
  2. 15
      designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java
  3. 3
      designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java
  4. 11
      designer-base/src/main/java/com/fr/design/gui/style/ComponentIntegralStylePane.java
  5. 24
      designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java
  6. 6
      designer-base/src/main/java/com/fr/design/gui/style/TextInsetImageBackgroundSpecialPane.java
  7. 5
      designer-base/src/main/java/com/fr/design/javascript/Commit2DBJavaScriptPane.java
  8. 5
      designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java
  9. 1
      designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java
  10. 11
      designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java
  11. 8
      designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java
  12. 1
      designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java
  13. 19
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java
  14. 4
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleAndBackgroundStylePane.java
  15. 13
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/component/ComponentMarginStylePane.java
  16. 42
      designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java
  17. 14
      designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java
  18. 19
      designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java
  19. 10
      designer-realize/src/main/java/com/fr/design/webattr/EventPane.java
  20. 2
      designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java

18
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<T extends Backgro
private void initializePane() {
setLayout(new BorderLayout(0, 0));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {this.uiLabelWidth, this.uiSettingWidth > 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);

15
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),

3
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)),

11
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);
}

24
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);

6
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() {

5
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<Commit2DBJavaS
}
cardPane.add((DBManipulationPane) this.dbmPaneList.get(i), cardNames[i]);
}
this.add(cardPane, BorderLayout.CENTER);
JPanel btPane = new JPanel(new BorderLayout());
btPane.setPreferredSize(createCallbackBtnPanePreferredSize());
this.add(row(cell(btPane), cell(new UILabel())).getComponent(), BorderLayout.SOUTH);
addCallbackButton = javaScriptActionPane.createCallButton();
btPane.add(addCallbackButton);
this.add(column(5, cell(cardPane), row(cell(btPane), cell(new UILabel()))).getComponent());
}
protected Dimension createCallbackBtnPanePreferredSize(){

5
designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java

@ -43,6 +43,7 @@ public class GradientBackgroundQuickPane extends BackgroundQuickPane {
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Top_To_Bottom")};
Integer[] valueArray = {GradientBackground.LEFT2RIGHT, GradientBackground.TOP2BOTTOM};
directionPane = new UIButtonGroup<>(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

1
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<Byte>(nameArray, valueArray);
imageLayoutPane.setAllToolTips(nameArray);
imageLayoutPane.setSelectedIndex(0);
previewPane = new ImagePreviewPane();

11
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);

8
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<FormTheme> {
componentStyleSettingPane = new ComponentStyleEditPane();
addCustomEditorPane(i18nText("Fine-Design_Predefined_Component_Style"), componentStyleSettingPane);
initializePane();
refreshExtraAdvancedPane();
}
@ -98,5 +100,11 @@ public class FormThemeProfilePane extends TemplateThemeProfilePane<FormTheme> {
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));
}
}
}

1
designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java

@ -51,6 +51,7 @@ public class ReportThemeProfilePane extends TemplateThemeProfilePane<ReportTheme
addCustomEditorPane(Toolkit.i18nText("Fine-Design_Predefined_Template_Background"), reportBodyStyleSettingPane);
addCustomEditorPane(Toolkit.i18nText("Fine-Design_Predefined_Cell_Style"), createCellStyleSettingPane());
addCustomEditorPane(Toolkit.i18nText("Fine-Design_Predefined_Chart_Style"), createChartStyleSettingPane());
initializePane();
refreshExtraAdvancedPane();
}

19
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java

@ -7,6 +7,7 @@ import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.TemplateThemeConfig;
import com.fr.base.theme.settings.ThemedCellStyleList;
import com.fr.base.theme.settings.ThemedColorScheme;
import com.fr.design.gui.frpane.FineTabbedPane;
import com.fr.widgettheme.ThemePreviewTerminal;
import com.fr.widgettheme.util.WidgetThemeDesignerUtils;
import com.fr.design.ExtraDesignClassManager;
@ -67,7 +68,8 @@ public abstract class TemplateThemeEditorPane<T extends TemplateTheme> extends J
protected final List<BasicBeanPane<T>> extraPaneList = new ArrayList<>();
protected boolean isPopulating = false;
protected UITabbedPane uiTabbedPane;
protected FineTabbedPane.TabPaneBuilder tabPaneBuilder;
protected FineTabbedPane uiTabbedPane;
private final TemplateThemeConfig<T> config;
@ -81,10 +83,10 @@ public abstract class TemplateThemeEditorPane<T extends TemplateTheme> 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<T extends TemplateTheme> 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<T extends TemplateTheme> extends J
fireAttributeChange();
}
});
uiTabbedPane.addTab(title, settingPane);
tabPaneBuilder.addTab(title, settingPane);
}
protected void refreshExtraAdvancedPane() {
@ -359,4 +359,9 @@ public abstract class TemplateThemeEditorPane<T extends TemplateTheme> extends J
}
return ThemePreviewTerminal.PC;
}
protected void buildTabPane() {
uiTabbedPane = tabPaneBuilder.withHeadRatio(0.6f).build();
uiTabbedPane.setBorder(new ScaledEmptyBorder(10, 5, 10, 1));
}
}

4
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}
};
}

13
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);
}

42
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());
}
}
}

14
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"))),

19
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<DBManipulation> {
@ -165,16 +166,16 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
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<DBManipulation> {
cell(bottomPane))
.getComponent(), BorderLayout.CENTER);
this.add(new UIScrollPane(contentPane));
this.add(contentPane);
initJTableColumn();
@ -216,7 +217,7 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
List<Layouts.Cell> 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<DBManipulation> {
}
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<DBManipulation> {
}
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() {

10
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);
}

2
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"))),

Loading…
Cancel
Save