Browse Source

Pull request #13560: REPORT-111619 控件增强-更多的样式配置--报表支撑 移动端部分代码之前在别的工程漏提了,补一下

Merge in DESIGN/design from ~OBO/design1:release/11.0 to release/11.0

* commit '8a89fd2fc78364f90e0196bdacade93dcf2fb732':
  REPORT-111619 控件增强-更多的样式配置--报表支撑 移动端部分代码之前在别的工程漏提了,补一下
release/11.0
Obo-王学仁 11 months ago
parent
commit
e7c80ee920
  1. 10
      designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java
  2. 16
      designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/MobileWidgetStyleEditPane.java
  3. 5
      designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditPane.java
  4. 24
      designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/DisplayEnhanceMobileStyleDefinePane.java
  5. 16
      designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/FreeButtonMobileStyleDefinePane.java
  6. 2
      designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/IconColorMobileStyleDefinePane.java
  7. 4
      designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/LabelMobileStyleDefinePane.java
  8. 2
      designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/TextAreaMobileStyleDefinePane.java
  9. 4
      designer-base/src/main/java/com/fr/widgettheme/widget/mobile/provider/WidgetThemeMobileStyleDefinePaneCreator.java
  10. 2
      designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java

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

@ -2,6 +2,7 @@ package com.fr.widgettheme.theme.edit.widget;
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.style.color.NewColorSelectBox;
import com.fr.design.utils.DesignUtils;
@ -57,7 +58,7 @@ public class DesktopWidgetStyleEditPane<T extends TemplateTheme> extends WidgetS
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Radius")), borderRadiusSpinner},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Icon_Color")), iconColorSelectBox},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Text_Style")), fontNameSelectBox},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Text_Style")), WidgetStyleComponentCombiner.combineTextStyleComponent(fontSizePane, fontColorButton, bold, italic)},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Text_Style")), WidgetStyleComponentCombiner.combineTextStyleComponent(fontSizePane, fontColorButton, italic, bold)},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Background_Select_Box")), selectBackgroundColorBox}
};
}
@ -154,4 +155,11 @@ public class DesktopWidgetStyleEditPane<T extends TemplateTheme> extends WidgetS
widgetBgColorSelectBox.setSelectObject(ColorUtils.ignoreColorAlpha(style.getWidgetBackground().getColor()));
widgetBgAlphaDragPane.populateBean(ColorUtils.roundColorAlphaDouble(style.getWidgetBackground().getColor()));
}
@Override
public void initLineBox() {
lineComboBox = new LineComboBox(WidgetThemeDisplayConstants.BORDER_LINE_STYLE_ARRAY);
lineComboColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true);
lineComboBox.addItemListener(e -> lineComboColorSelectBox.setVisible(!Integer.valueOf(0).equals(e.getItem())));
}
}

16
designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/MobileWidgetStyleEditPane.java

@ -1,7 +1,10 @@
package com.fr.widgettheme.theme.edit.widget;
import com.fr.base.background.ColorBackground;
import com.fr.base.theme.TemplateTheme;
import com.fr.design.gui.frpane.FontSizeComboPane;
import com.fr.design.style.color.NewColorSelectBox;
import com.fr.util.ColorUtils;
import com.fr.widgettheme.theme.widget.style.BorderStyle;
import com.fr.widgettheme.theme.widget.style.MobileThemedWidgetStyle;
import com.fr.design.gui.icombobox.LineComboBox;
@ -36,6 +39,8 @@ public class MobileWidgetStyleEditPane<T extends TemplateTheme> extends WidgetSt
public void initLineBox() {
lineComboBox = new LineComboBox(WidgetThemeDisplayConstants.MOBILE_BORDER_LINE_STYLE_ARRAY);
lineComboBox.setSelectedLineStyle(com.fr.stable.Constants.LINE_THIN);
lineComboColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true);
lineComboBox.addItemListener(e -> lineComboColorSelectBox.setVisible(!Integer.valueOf(0).equals(e.getItem())));
}
@Override
@ -51,10 +56,16 @@ public class MobileWidgetStyleEditPane<T extends TemplateTheme> extends WidgetSt
t.setMobileWidgetStyle(style);
}
colorSelectBox.setSelectObject(style.getThemeColor());
widgetBgColorSelectBox.setSelectObject(ColorUtils.ignoreColorAlpha(style.getSelectBackgroundColor()));
widgetBgAlphaDragPane.populateBean(ColorUtils.roundColorAlphaDouble(style.getSelectBackgroundColor()));
lineComboBox.setSelectedLineStyle(style.getBorderStyle().getLineType());
lineComboColorSelectBox.setSelectObject(style.getBorderStyle().getBorderColor());
iconColorSelectBox.setSelectObject(style.getIconColor());
borderRadiusSpinner.setValue(style.getBorderStyle().getRadius());
fontSizePane.setValue(style.getTextStyle().getFontSize());
fontColorButton.setColor(style.getTextStyle().getFontColor());
bold.setSelected(style.getTextStyle().isBold());
italic.setSelected(style.getTextStyle().isItalic());
}
@Override
@ -65,13 +76,18 @@ public class MobileWidgetStyleEditPane<T extends TemplateTheme> extends WidgetSt
t.setMobileWidgetStyle(style);
}
style.setThemeColor(colorSelectBox.getSelectObject());
style.setWidgetBackground(ColorUtils.createColorBackgroundWithAlpha(widgetBgColorSelectBox.getSelectObject(), widgetBgAlphaDragPane.updateBean()));
BorderStyle borderStyle = new BorderStyle();
borderStyle.setLineType(lineComboBox.getSelectedLineStyle());
borderStyle.setRadius((int) borderRadiusSpinner.getValue());
borderStyle.setBorderColor(lineComboColorSelectBox.getSelectObject());
style.setBorderStyle(borderStyle);
style.setIconColor(iconColorSelectBox.getSelectObject());
ThemeTextStyle textStyle = new ThemeTextStyle();
textStyle.setFontSize(fontSizePane.getValue());
textStyle.setFontColor(fontColorButton.getColor());
textStyle.setBold(bold.isSelected());
textStyle.setItalic(italic.isSelected());
style.setTextStyle(textStyle);
}

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

@ -109,7 +109,7 @@ public class WidgetStyleEditPane<T extends TemplateTheme> extends BasicBeanPane<
new Component[]{null, lineComboColorSelectBox},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Radius")), borderRadiusSpinner},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Icon_Color")), iconColorSelectBox},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Text_Style")), WidgetStyleComponentCombiner.combineTextStyleComponent(fontSizePane, fontColorButton, bold, italic)}
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Text_Style")), WidgetStyleComponentCombiner.combineTextStyleComponent(fontSizePane, fontColorButton, italic, bold)}
};
}
@ -135,9 +135,6 @@ public class WidgetStyleEditPane<T extends TemplateTheme> extends BasicBeanPane<
* 初始化边框线型
*/
public void initLineBox() {
lineComboBox = new LineComboBox(WidgetThemeDisplayConstants.BORDER_LINE_STYLE_ARRAY);
lineComboColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true);
lineComboBox.addItemListener(e -> lineComboColorSelectBox.setVisible(!Integer.valueOf(0).equals(e.getItem())));
}

24
designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/DisplayEnhanceMobileStyleDefinePane.java

@ -121,6 +121,7 @@ public class DisplayEnhanceMobileStyleDefinePane extends BasicBeanPane<MobileSty
mobileStyle = Reflect.on(mobileStyleClazz).create().get();
WidgetThemeMobileCommonExtraStyle extraStyle = new WidgetThemeMobileCommonExtraStyle();
extraStyle.setCustom(customCombo.getSelectedIndex() == 1);
setThemeColor(extraStyle);
setIconColor(extraStyle);
setBorderType(extraStyle);
setBorderRadius(extraStyle);
@ -144,8 +145,9 @@ public class DisplayEnhanceMobileStyleDefinePane extends BasicBeanPane<MobileSty
createCustomPane();
}
protected void createFontPane(Color defaultFontColor) {
fontConfigPane = new MobileStyleFontConfigPane(defaultFontColor);
protected void createFontPane() {
Color fontColor = ColorUtils.hexToColor(WidgetThemeDesignerUtils.isCurrentTemplateThemeDark() ? WidgetThemeDisplayConstants.COLOR_CCFFFFFF_HEX : WidgetThemeDisplayConstants.COLOR_CC000000_HEX);
fontConfigPane = new MobileStyleFontConfigPane(fontColor);
settingPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Font")), fontConfigPane));
}
@ -202,7 +204,7 @@ public class DisplayEnhanceMobileStyleDefinePane extends BasicBeanPane<MobileSty
// 圆角边框
createBorderRadiusPane();
// 字体
createFontPane(WidgetThemeDisplayConstants.DEFAULT_FONT_COLOR_BLACK);
createFontPane();
}
@ -215,7 +217,9 @@ public class DisplayEnhanceMobileStyleDefinePane extends BasicBeanPane<MobileSty
}
protected void initBackgroundColor() {
widgetBackgroundSelectBox.setSelectObject(WidgetThemeDisplayConstants.DEFAULT_TRANSPARENT_COLOR);
Color widgetBackgroundColor = ColorUtils.hexToColor(WidgetThemeDesignerUtils.isCurrentTemplateThemeDark() ? WidgetThemeDisplayConstants.COLOR_000000_HEX : WidgetThemeDisplayConstants.COLOR_FFFFFF_HEX);
widgetBackgroundSelectBox.setSelectObject(widgetBackgroundColor);
widgetBgAlphaDragPane.populateBean(0);
}
protected void createThemePane() {
@ -230,14 +234,15 @@ public class DisplayEnhanceMobileStyleDefinePane extends BasicBeanPane<MobileSty
borderType = new LineComboBox(WidgetThemeDisplayConstants.MOBILE_BORDER_LINE_STYLE_ARRAY);
borderColorSelectBox = new NewColorSelectBox(NORMAL_COMBO_WIDTH);
JPanel borderComponent = WidgetStyleComponentCombiner.combineWidgetBorderComponent(borderType, borderColorSelectBox);
initDefaultLineType();
initDefaultBorder();
borderType.setPreferredSize(new Dimension(NORMAL_COMBO_WIDTH + 15, 20));
// 边框线型
settingPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderType")), borderComponent));
}
protected void initDefaultLineType() {
protected void initDefaultBorder() {
borderType.setSelectedLineStyle(Constants.LINE_THIN);
borderColorSelectBox.setSelectObject(ColorUtils.hexToColor(WidgetThemeDesignerUtils.isCurrentTemplateThemeDark() ? WidgetThemeDisplayConstants.COLOR_26FFFFFF_HEX : WidgetThemeDisplayConstants.COLOR_26000000_HEX));
}
protected void createBorderRadiusPane() {
@ -294,9 +299,14 @@ public class DisplayEnhanceMobileStyleDefinePane extends BasicBeanPane<MobileSty
protected void createIconColorSelectBox() {
iconColorSelectBox = new NewColorSelectBox(NORMAL_COMBO_WIDTH);
iconColorSelectBox.setSelectObject(getCurrentTemplateThemeColor());
settingPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Icon_Color")), iconColorSelectBox));
}
protected void setThemeColor(WidgetThemeMobileCommonExtraStyle extraStyle) {
if(themeColorSelectBox != null) {
extraStyle.setThemeColor(themeColorSelectBox.getSelectObject());
}
}
protected void setIconColor(WidgetThemeMobileCommonExtraStyle extraStyle) {
if(iconColorSelectBox != null) {
extraStyle.setIconColor(iconColorSelectBox.getSelectObject());

16
designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/FreeButtonMobileStyleDefinePane.java

@ -1,9 +1,14 @@
package com.fr.widgettheme.widget.mobile.pane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.mobile.ui.MobileStyleCustomDefinePane;
import com.fr.form.ui.Widget;
import com.fr.form.ui.mobile.MobileStyle;
import com.fr.util.ColorUtils;
import com.fr.widgettheme.theme.widget.theme.WidgetThemeDisplayConstants;
import com.fr.widgettheme.util.WidgetThemeDesignerUtils;
import java.awt.Color;
/**
* 按钮控件通用属性面板
@ -23,16 +28,23 @@ public class FreeButtonMobileStyleDefinePane extends DisplayEnhanceMobileStyleDe
createBackgroundPane();
createBorderLinePane();
createBorderRadiusPane();
createFontPane(WidgetThemeDisplayConstants.DEFAULT_WHITE_COLOR);
createFontPane();
}
@Override
protected void initDefaultLineType() {
protected void initDefaultBorder() {
borderType.setSelectedLineStyle(com.fr.stable.Constants.LINE_NONE);
}
@Override
protected void initBackgroundColor() {
widgetBackgroundSelectBox.setSelectObject(getCurrentTemplateThemeColor());
widgetBgAlphaDragPane.populateBean(0);
}
@Override
protected void createFontPane() {
fontConfigPane = new MobileStyleFontConfigPane(ColorUtils.hexToColor(WidgetThemeDisplayConstants.COLOR_FFFFFF_HEX));
settingPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Font")), fontConfigPane));
}
}

2
designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/IconColorMobileStyleDefinePane.java

@ -31,6 +31,6 @@ public class IconColorMobileStyleDefinePane extends DisplayEnhanceMobileStyleDef
//图标颜色
createIconColorSelectBox();
// 字体
createFontPane(WidgetThemeDisplayConstants.DEFAULT_FONT_COLOR_BLACK);
createFontPane();
}
}

4
designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/LabelMobileStyleDefinePane.java

@ -23,11 +23,11 @@ public class LabelMobileStyleDefinePane extends DisplayEnhanceMobileStyleDefineP
createBackgroundPane();
createBorderLinePane();
createBorderRadiusPane();
createFontPane(WidgetThemeDisplayConstants.DEFAULT_FONT_COLOR_BLACK);
createFontPane();
}
@Override
protected void initDefaultLineType() {
protected void initDefaultBorder() {
borderType.setSelectedLineStyle(com.fr.stable.Constants.LINE_NONE);
}
}

2
designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/TextAreaMobileStyleDefinePane.java

@ -28,6 +28,6 @@ public class TextAreaMobileStyleDefinePane extends DisplayEnhanceMobileStyleDefi
// 圆角边框
createBorderRadiusPane();
// 字体
createFontPane(WidgetThemeDisplayConstants.DEFAULT_FONT_COLOR_BLACK);
createFontPane();
}
}

4
designer-base/src/main/java/com/fr/widgettheme/widget/mobile/provider/WidgetThemeMobileStyleDefinePaneCreator.java

@ -7,7 +7,7 @@ import com.fr.form.ui.NumberEditor;
import com.fr.form.ui.Password;
import com.fr.form.ui.TextArea;
import com.fr.form.ui.TextEditor;
import com.fr.form.ui.TreeEditor;
import com.fr.form.ui.TreeComboBoxEditor;
import com.fr.widgettheme.util.WidgetThemeDesignerUtils;
import com.fr.widgettheme.utils.WidgetThemeServerUtils;
import com.fr.widgettheme.widget.mobile.pane.DisplayEnhanceMobileStyleDefinePane;
@ -59,7 +59,7 @@ public class WidgetThemeMobileStyleDefinePaneCreator {
ICON_WIDGET_SET.add(DateEditor.class);
ICON_WIDGET_SET.add(ComboBox.class);
ICON_WIDGET_SET.add(ComboCheckBox.class);
ICON_WIDGET_SET.add(TreeEditor.class);
ICON_WIDGET_SET.add(TreeComboBoxEditor.class);
}
/**
* 创建移动端控件样式属性窗口

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

@ -145,7 +145,7 @@ public abstract class BaseStyleSettingPane<T extends Widget> extends BasicBeanPa
paneMap.put(StyleSetting.THEME_COLOR, colorSelectBox);
paneMap.put(StyleSetting.LINE_TYPE, lineComboBox);
paneMap.put(StyleSetting.LINE_COLOR, borderColorSelectBox);
paneMap.put(StyleSetting.TEXT_STYLE, WidgetStyleComponentCombiner.combineTextStyleComponent(fontNameSelectBox, fontSizePane, fontColorButton, bold, italic));
paneMap.put(StyleSetting.TEXT_STYLE, WidgetStyleComponentCombiner.combineTextStyleComponent(fontNameSelectBox, fontSizePane, fontColorButton, italic, bold));
paneMap.put(StyleSetting.BORDER_RADIUS, borderRadiusSpinner);
paneMap.put(StyleSetting.FONT, frFontPane);
paneMap.put(StyleSetting.BTN_BACKGROUND, buttonStyleDefinedPane);

Loading…
Cancel
Save