Browse Source

调整实现,使用组合代替之前的继承,更新的方法签名退回

release/11.0
obo 11 months ago
parent
commit
2b6564440c
  1. 22
      designer-form/src/main/java/com/fr/design/widgettheme/ParaSelectEditorSettingPane.java
  2. 16
      designer-form/src/main/java/com/fr/design/widgettheme/common/EditorSettingPane.java
  3. 23
      designer-form/src/main/java/com/fr/design/widgettheme/common/SelectEditorSettingPane.java

22
designer-form/src/main/java/com/fr/design/widgettheme/ParaSelectEditorSettingPane.java

@ -1,8 +1,6 @@
package com.fr.design.widgettheme;
import com.fr.form.ui.Widget;
import com.fr.widgettheme.theme.widget.theme.ParaSelectEditorTheme;
import com.fr.widgettheme.theme.widget.theme.cell.EditorTheme;
import java.util.Arrays;
@ -27,23 +25,7 @@ public class ParaSelectEditorSettingPane<T extends Widget> extends ParaEditorSet
}
@Override
protected void populateEditorBean(EditorTheme editorTheme) {
ParaSelectEditorTheme paraSelectEditorTheme= new ParaSelectEditorTheme(editorTheme);
if (!paraSelectEditorTheme.isFollowTheme()) {
selectBgColorBox.setSelectObject(paraSelectEditorTheme.getSelectBoxBgColor());
}
super.populateEditorBean(paraSelectEditorTheme);
}
@Override
protected EditorTheme updateEditorStyleBean(EditorTheme editorTheme) {
ParaSelectEditorTheme paraSelectEditorTheme= new ParaSelectEditorTheme(editorTheme);
paraSelectEditorTheme.setSelectBoxBgColor(selectBgColorBox.getSelectObject());
return super.updateEditorStyleBean(paraSelectEditorTheme);
}
@Override
protected EditorTheme getEditorTheme() {
return new ParaSelectEditorTheme();
protected String title4PopupWindow() {
return "paraSelectEditorSetting";
}
}

16
designer-form/src/main/java/com/fr/design/widgettheme/common/EditorSettingPane.java

@ -81,6 +81,9 @@ public class EditorSettingPane<T extends Widget> extends BaseStyleSettingPane<T>
}
lineComboBox.setSelectedLineStyle(editorTheme.getBorderStyle().getLineType());
borderRadiusSpinner.setValue(editorTheme.getBorderStyle().getRadius());
if(selectBgColorBox != null) {
selectBgColorBox.setSelectObject(editorTheme.getSelectBoxBgColor());
}
assignFontSizePane(editorTheme);
}
switchCard();
@ -94,23 +97,26 @@ public class EditorSettingPane<T extends Widget> extends BaseStyleSettingPane<T>
@Override
public void updateBean(T t) {
EditorTheme widgetTheme = initEditorTheme(t);
t.setWidgetTheme(updateEditorBean(widgetTheme));
updateEditorBean(widgetTheme);
}
protected EditorTheme updateEditorBean(EditorTheme editorTheme) {
protected void updateEditorBean(EditorTheme editorTheme) {
int selectIndex = styleSettingHead.getSelectedIndex();
editorTheme.setFollowTheme(selectIndex == 0);
return updateEditorStyleBean(editorTheme);
updateEditorStyleBean(editorTheme);
}
protected EditorTheme updateEditorStyleBean(EditorTheme editorTheme) {
protected void updateEditorStyleBean(EditorTheme editorTheme) {
editorTheme.setThemeColor(colorSelectBox.getSelectObject());
if(selectBgColorBox != null) {
editorTheme.setSelectBoxBgColor(selectBgColorBox.getSelectObject());
}
editorTheme.setStyleType(style1.isSelected() ? WidgetThemeDisplayConstants.STYLE_1 : WidgetThemeDisplayConstants.STYLE_2);
editorTheme.setBorderStyle(new BorderStyle((int) borderRadiusSpinner.getValue(), lineComboBox.getSelectedLineStyle()));
assignFontSizeStyle(editorTheme);
switchCard();
return editorTheme;
}
}

23
designer-form/src/main/java/com/fr/design/widgettheme/common/SelectEditorSettingPane.java

@ -2,8 +2,6 @@ package com.fr.design.widgettheme.common;
import com.fr.design.widgettheme.StyleSetting;
import com.fr.form.ui.Widget;
import com.fr.widgettheme.theme.widget.theme.cell.EditorTheme;
import com.fr.widgettheme.theme.widget.theme.cell.SelectEditTheme;
import java.util.Arrays;
@ -31,25 +29,4 @@ public class SelectEditorSettingPane <T extends Widget> extends EditorSettingPan
protected String title4PopupWindow() {
return "selectEditorSetting";
}
@Override
protected EditorTheme getEditorTheme() {
return new SelectEditTheme();
}
@Override
protected void populateEditorBean(EditorTheme editorTheme) {
SelectEditTheme selectEditTheme = new SelectEditTheme(editorTheme);
if (!selectEditTheme.isFollowTheme()) {
selectBgColorBox.setSelectObject(selectEditTheme.getSelectBoxBgColor());
}
super.populateEditorBean(selectEditTheme);
}
@Override
protected EditorTheme updateEditorStyleBean(EditorTheme editorTheme) {
SelectEditTheme selectEditTheme = new SelectEditTheme(editorTheme);
selectEditTheme.setSelectBoxBgColor(selectBgColorBox.getSelectObject());
return super.updateEditorStyleBean(selectEditTheme);
}
}

Loading…
Cancel
Save