Browse Source

Merge pull request #13876 in DESIGN/design from release/11.0 to final/11.0

* commit 'ba9cdf05b4f418bed469e0b30a201625a039fab0':
  REPORT-116410 新多选下拉树配置项缺失 【问题原因】新多选下拉树之前当作编辑器了,少了些配置 【改动思路】使用下拉框相同的配置项
  修改一下UI,添加组件
  REPORT-116327 条码增强插件,新建条码,条码的默认配置会跟随上一个设置的条码变化 【问题原因】单元格为空时,未刷新插件面板,导致插件面板中配置没有被重置 【改动思路】重置所有面板
  fix: 报表块适配fvs深浅色主题 #REPORT-116912
  REPORT-116550 控件增强显示,设置圆角属性后无效,圆角设置框手动输入数字后,需要按回车才能保存 【问题原因】交互问题。之前使用的UIBoundSpinner,切换面板失焦时不会触发修改 【改动思路】产品确认修改交互。改为UISpinner组件,失焦时触发修改
  用toString
  REPORT-116843 设计器国际化适配
  REPORT-115048 设计器里控件背景栏宽度显示异常 【问题原因】之前的布局实现后显示有点问题 【改动思路】使用新布局重写UI
final/11.0
superman 8 months ago
parent
commit
f326730939
  1. 1
      build.gradle
  2. 1
      designer-base/src/main/java/com/fr/design/login/message/DesignerMessageHelper.java
  3. 14
      designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java
  4. 18
      designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java
  5. 15
      designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditPane.java
  6. 48
      designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java
  7. 16
      designer-form/src/main/java/com/fr/design/widgettheme/processor/WidgetThemeCreatorPaneAdder.java
  8. 7
      designer-realize/src/main/java/com/fr/design/present/PresentPane.java

1
build.gradle

@ -87,6 +87,7 @@ allprojects {
implementation 'com.fr.report:engine-chart:' + frDevVersion
implementation 'com.fr.report:engine-i18n:' + frDevVersion
implementation 'com.fr.design:design-i18n:' + frDevVersion
implementation 'com.fine.swing.ui:layout:1.0-SNAPSHOT'
testImplementation 'org.easymock:easymock:3.5.1'
testImplementation 'org.powermock:powermock-module-junit4:1.7.1'
testImplementation 'org.powermock:powermock-api-easymock:1.7.1'

1
designer-base/src/main/java/com/fr/design/login/message/DesignerMessageHelper.java

@ -77,6 +77,7 @@ public class DesignerMessageHelper {
String url = CloudCenter.getInstance().acquireUrlByKind("designer.message.push", "https://market.fanruan.com/api/v1/message/designer");
Map<String, String> params = new HashMap<>();
params.put("designerId", DesignerEnvManager.getEnvManager().getUUID());
params.put("lang", DesignerEnvManager.getEnvManager().getLanguage().toString());
String result = HttpToolbox.post(url, params);
JSONObject response = JSONFactory.createJSON(JSON.OBJECT, result);
String status = response.optString(STATUS);

14
designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java

@ -18,13 +18,23 @@ public class AdjustWorkBookDefaultStyleUtils {
private static final Color TEMPLATE_BACKGROUND = new Color(16, 11, 43);
private static final Color CELL_ELEMENT_BORDER = new Color(110, 110, 110);
private static final Color CELL_ELEMENT_FONT_FOREGROUND = Color.WHITE;
private static final Color CELL_ELEMENT_FONT_FOREGROUND_4_LIGHT_THEME = Color.BLACK;
private static Color currentStoryBack = null;
private static boolean isDarkTheme = true;
public static void setCurrentStoryBack(Color color) {
currentStoryBack = color;
}
public static void setIsDarkTheme(boolean isDarkTheme) {
AdjustWorkBookDefaultStyleUtils.isDarkTheme = isDarkTheme;
}
private static Color getCellForegroundColor() {
return isDarkTheme ? CELL_ELEMENT_FONT_FOREGROUND : CELL_ELEMENT_FONT_FOREGROUND_4_LIGHT_THEME;
}
private static Color getCurrentStoryBack() {
return currentStoryBack == null ? TEMPLATE_BACKGROUND : currentStoryBack;
}
@ -39,7 +49,7 @@ public class AdjustWorkBookDefaultStyleUtils {
public static Style adjustCellElement(Style style) {
if (DesignModeContext.isDuchampMode()) {
style = style.deriveFRFont(style.getFRFont().applyForeground(CELL_ELEMENT_FONT_FOREGROUND));
style = style.deriveFRFont(style.getFRFont().applyForeground(getCellForegroundColor()));
style = style.deriveBorder(0, CELL_ELEMENT_BORDER,
0, CELL_ELEMENT_BORDER,
0, CELL_ELEMENT_BORDER,
@ -49,7 +59,7 @@ public class AdjustWorkBookDefaultStyleUtils {
}
public static Color adjustCellElementFontForeground(Color color) {
return DesignModeContext.isDuchampMode() ? CELL_ELEMENT_FONT_FOREGROUND : color;
return DesignModeContext.isDuchampMode() ? getCellForegroundColor() : color;
}
public static void adjustFloatElement(FloatElement floatElement) {

18
designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java

@ -1,11 +1,15 @@
package com.fr.widgettheme.theme.edit.widget;
import com.fine.swing.ui.layout.Column;
import com.fr.base.background.ColorBackground;
import com.fr.base.theme.TemplateTheme;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.style.color.NewColorSelectBox;
import com.fr.design.utils.DesignUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.locale.InterProviderFactory;
import com.fr.stable.StringUtils;
import com.fr.util.ColorUtils;
@ -13,8 +17,6 @@ import com.fr.widgettheme.theme.widget.style.BorderStyle;
import com.fr.widgettheme.theme.widget.style.ButtonBackgroundStyle;
import com.fr.widgettheme.theme.widget.style.ThemeTextStyle;
import com.fr.widgettheme.theme.widget.style.ThemedWidgetStyle;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.widgettheme.theme.widget.theme.WidgetThemeDisplayConstants;
import com.fr.widgettheme.util.WidgetStyleComponentCombiner;
import com.fr.widgettheme.util.WidgetThemeDesignerUtils;
@ -22,6 +24,9 @@ import com.fr.widgettheme.util.WidgetThemeDesignerUtils;
import java.awt.Color;
import java.awt.Component;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
/**
* 桌面端主题面板
@ -52,7 +57,7 @@ public class DesktopWidgetStyleEditPane<T extends TemplateTheme> extends WidgetS
initFontNameSelectBox();
return new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Color")), colorSelectBox},
new Component[]{WidgetThemeDesignerUtils.createTopAlignmentLabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Widget_Background")), WidgetStyleComponentCombiner.combineWidgetBackgroundComponent(widgetBgColorSelectBox, widgetBgAlphaDragPane, colorSelectBox.getPreferredSize().width)},
new Component[]{WidgetThemeDesignerUtils.createTopAlignmentLabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Widget_Background")), initBackGroundComponent()},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Line")), lineComboBox},
new Component[]{null, lineComboColorSelectBox},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Radius")), borderRadiusSpinner},
@ -63,6 +68,13 @@ public class DesktopWidgetStyleEditPane<T extends TemplateTheme> extends WidgetS
};
}
private Column initBackGroundComponent() {
return column(10,
cell(widgetBgColorSelectBox),
cell(FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Form_Widget-Style_Alpha"))),
cell(widgetBgAlphaDragPane)).getComponent();
}
private void initSelectBackgroundColorBox() {
selectBackgroundColorBox = new NewColorSelectBox(140, true);
selectBackgroundColorBox.setSelectObject(WidgetThemeDisplayConstants.DEFAULT_THEME_COLOR);

15
designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditPane.java

@ -1,5 +1,6 @@
package com.fr.widgettheme.theme.edit.widget;
import com.fine.swing.ui.layout.Column;
import com.fr.base.theme.TemplateTheme;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.designer.IntervalConstants;
@ -17,6 +18,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.color.NewColorSelectBox;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.IOUtils;
import com.fr.stable.StringUtils;
import com.fr.widgettheme.theme.widget.theme.WidgetThemeDisplayConstants;
@ -29,6 +31,9 @@ import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
/**
* 组件样式编辑基础类
@ -104,7 +109,7 @@ public class WidgetStyleEditPane<T extends TemplateTheme> extends BasicBeanPane<
public Component[][] generateComponent() {
return new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Color")), colorSelectBox},
new Component[]{WidgetThemeDesignerUtils.createTopAlignmentLabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Widget_Background")), WidgetStyleComponentCombiner.combineWidgetBackgroundComponent(widgetBgColorSelectBox, widgetBgAlphaDragPane, colorSelectBox.getPreferredSize().width)},
new Component[]{WidgetThemeDesignerUtils.createTopAlignmentLabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Widget_Background")), initBackGroundComponent()},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Line")), lineComboBox},
new Component[]{null, lineComboColorSelectBox},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Radius")), borderRadiusSpinner},
@ -113,6 +118,14 @@ public class WidgetStyleEditPane<T extends TemplateTheme> extends BasicBeanPane<
};
}
private Column initBackGroundComponent() {
return column(10,
cell(widgetBgColorSelectBox),
cell(FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Form_Widget-Style_Alpha"))),
cell(widgetBgAlphaDragPane)
).getComponent();
}
private void initCommonStyleEditor() {
colorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true);
colorSelectBox.setSelectObject(WidgetThemeDisplayConstants.DEFAULT_THEME_COLOR);

48
designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java

@ -1,26 +1,20 @@
package com.fr.design.widgettheme;
import com.fine.swing.ui.layout.Column;
import com.fr.base.background.ColorBackground;
import com.fr.base.theme.TemplateTheme;
import com.fr.design.gui.frpane.FontSizeComboPane;
import com.fr.design.gui.frpane.UIPercentDragPane;
import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.utils.DesignUtils;
import com.fr.general.IOUtils;
import com.fr.util.ColorUtils;
import com.fr.widgettheme.theme.widget.style.BorderStyle;
import com.fr.widgettheme.theme.widget.style.ButtonBackgroundStyle;
import com.fr.widgettheme.theme.widget.style.ThemeTextStyle;
import com.fr.widgettheme.theme.widget.style.ThemedWidgetStyle;
import com.fr.widgettheme.theme.bean.ButtonBackground;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.frpane.FontSizeComboPane;
import com.fr.design.gui.frpane.UIPercentDragPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.style.FRFontPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
@ -28,10 +22,18 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.style.color.NewColorSelectBox;
import com.fr.design.widget.ui.designer.component.UIBoundSpinner;
import com.fr.design.utils.DesignUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.form.ui.Widget;
import com.fr.general.FRFont;
import com.fr.general.IOUtils;
import com.fr.util.ColorUtils;
import com.fr.widgettheme.theme.bean.ButtonBackground;
import com.fr.widgettheme.theme.panel.ButtonStyleDefinedPane;
import com.fr.widgettheme.theme.widget.style.BorderStyle;
import com.fr.widgettheme.theme.widget.style.ButtonBackgroundStyle;
import com.fr.widgettheme.theme.widget.style.ThemeTextStyle;
import com.fr.widgettheme.theme.widget.style.ThemedWidgetStyle;
import com.fr.widgettheme.theme.widget.theme.WidgetThemeDisplayConstants;
import com.fr.widgettheme.util.WidgetStyleComponentCombiner;
import com.fr.widgettheme.util.WidgetThemeDesignerUtils;
@ -45,6 +47,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
/**
* 样式设置pane抽象类
*
@ -68,7 +73,7 @@ public abstract class BaseStyleSettingPane<T extends Widget> extends BasicBeanPa
*/
protected NewColorSelectBox borderColorSelectBox;
// 圆角边框
protected UIBoundSpinner borderRadiusSpinner;
protected UISpinner borderRadiusSpinner;
// 字体详细设置
protected FRFontPane frFontPane;
// 按钮背景设置
@ -152,10 +157,19 @@ public abstract class BaseStyleSettingPane<T extends Widget> extends BasicBeanPa
paneMap.put(StyleSetting.FONT, frFontPane);
paneMap.put(StyleSetting.BTN_BACKGROUND, buttonStyleDefinedPane);
paneMap.put(StyleSetting.SELECT_COLOR, selectBgColorBox);
paneMap.put(StyleSetting.WIDGET_BACKGROUND, WidgetStyleComponentCombiner.combineWidgetBackgroundComponent(widgetBgColorSelectBox, widgetBgAlphaDragPane, WidgetThemeDisplayConstants.THEME_PC_WIDGET_BACKGROUND_WIDTH));
paneMap.put(StyleSetting.WIDGET_BACKGROUND, initBackGroundComponent());
paneMap.put(StyleSetting.ICON_COLOR, iconColorSelectBox);
}
private Column initBackGroundComponent() {
return column(
10,
cell(widgetBgColorSelectBox),
cell(FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Form_Widget-Style_Alpha"))),
cell(widgetBgAlphaDragPane)
).getComponent();
}
protected JPanel createHeadPane() {
UILabel headLabel = new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Style_Setting"));
String[] titles = new String[]{Toolkit.i18nText("Fine-Design_Widget_Follow_Theme"), Toolkit.i18nText("Fine-Design_Widget_Theme_Custom")};
@ -346,7 +360,7 @@ public abstract class BaseStyleSettingPane<T extends Widget> extends BasicBeanPa
private void initBorderPane() {
lineComboBox = new LineComboBox(WidgetThemeDisplayConstants.BORDER_LINE_STYLE_ARRAY);
borderColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true);
borderRadiusSpinner = new UIBoundSpinner(0, Integer.MAX_VALUE, 1);
borderRadiusSpinner = new UISpinner(0, Integer.MAX_VALUE, 1);
lineComboBox.addItemListener(e -> borderColorSelectBox.setVisible(!Integer.valueOf(0).equals(e.getItem())));
}
}

16
designer-form/src/main/java/com/fr/design/widgettheme/processor/WidgetThemeCreatorPaneAdder.java

@ -1,8 +1,11 @@
package com.fr.design.widgettheme.processor;
import com.fr.design.widgettheme.common.SelectEditorSettingPane;
import com.fr.widgettheme.util.WidgetThemeDesignerUtils;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.widgettheme.common.ButtonSettingPane;
import com.fr.design.widgettheme.common.EditorSettingPane;
import com.fr.design.widgettheme.common.NormalButtonSettingPane;
import com.fr.design.widgettheme.common.SelectEditorSettingPane;
import com.fr.design.widgettheme.common.TreeEditorSettingPane;
import com.fr.form.parameter.FormSubmitButton;
import com.fr.form.ui.Button;
import com.fr.form.ui.CheckBox;
@ -21,10 +24,7 @@ import com.fr.form.ui.TreeEditor;
import com.fr.report.web.button.form.TreeNodeToggleButton;
import com.fr.report.web.button.write.AppendRowButton;
import com.fr.report.web.button.write.DeleteRowButton;
import com.fr.design.widgettheme.common.ButtonSettingPane;
import com.fr.design.widgettheme.common.EditorSettingPane;
import com.fr.design.widgettheme.common.NormalButtonSettingPane;
import com.fr.design.widgettheme.common.TreeEditorSettingPane;
import com.fr.widgettheme.util.WidgetThemeDesignerUtils;
import com.fr.widgettheme.utils.WidgetThemeServerUtils;
import java.util.Arrays;
@ -97,7 +97,7 @@ public class WidgetThemeCreatorPaneAdder {
}
private static <T> void acceptEditor(Class<?> creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = WidgetThemeServerUtils.isNewComboBoxTreeEditor(creator) || EDITOR_SET.contains(creator);
boolean accept = EDITOR_SET.contains(creator);
if (accept) {
insertShortCut(extraPaneList, new EditorSettingPane<>());
}
@ -126,7 +126,7 @@ public class WidgetThemeCreatorPaneAdder {
}
private static <T> void acceptSelect(Class<?> creator, List<BasicBeanPane<T>> extraPaneList) {
boolean accept = SELECT_SET.contains(creator);
boolean accept = WidgetThemeServerUtils.isNewComboBoxTreeEditor(creator) || SELECT_SET.contains(creator);
if (accept) {
insertShortCut(extraPaneList, new SelectEditorSettingPane<>());
}

7
designer-realize/src/main/java/com/fr/design/present/PresentPane.java

@ -52,10 +52,9 @@ public class PresentPane extends UIComboBoxPane<Present> {
@Override
public void populateBean(Present ob) {
if(ob == null) {
dictPresentPane.reset();
formulaPresentPane.reset();
barCodePane.reset();
currencyLinePane.reset();
for (FurtherBasicBeanPane<?> pane : cards) {
pane.reset();
}
}
super.populateBean(ob);
}

Loading…
Cancel
Save