From f0e1d1255f93a05340160e90bb80d310b8d00fca Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 11 Nov 2019 11:27:44 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-22869=2019fdc=E6=8E=A5=E5=8F=A3=E2=80=94?= =?UTF-8?q?=E2=80=94=E9=A2=84=E5=AE=9A=E4=B9=89=E6=A0=B7=E5=BC=8F=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=9B=B4=E5=A4=9A=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/CustomStyleUIConfigProvider.java | 39 ++++++++++++++++ .../fun/MultiStyleUIConfigProvider.java | 23 ++++++++++ .../AbstractCustomStyleUIConfigProvider.java | 45 +++++++++++++++++++ .../AbstractMultiStyleUIConfigProvider.java | 30 +++++++++++++ .../java/com/fr/design/style/StylePane.java | 26 +++++------ .../preference/PreferenceConfigProvider.java | 22 --------- .../style/preference/PreferenceTabConfig.java | 32 ------------- .../AbstractPreferenceConfigProvider.java | 29 ------------ .../impl/AbstractPreferenceTabConfig.java | 33 -------------- 9 files changed, 150 insertions(+), 129 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/fun/CustomStyleUIConfigProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/MultiStyleUIConfigProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractCustomStyleUIConfigProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractMultiStyleUIConfigProvider.java delete mode 100644 designer-realize/src/main/java/com/fr/design/style/preference/PreferenceConfigProvider.java delete mode 100644 designer-realize/src/main/java/com/fr/design/style/preference/PreferenceTabConfig.java delete mode 100644 designer-realize/src/main/java/com/fr/design/style/preference/impl/AbstractPreferenceConfigProvider.java delete mode 100644 designer-realize/src/main/java/com/fr/design/style/preference/impl/AbstractPreferenceTabConfig.java diff --git a/designer-base/src/main/java/com/fr/design/fun/CustomStyleUIConfigProvider.java b/designer-base/src/main/java/com/fr/design/fun/CustomStyleUIConfigProvider.java new file mode 100644 index 0000000000..9bb23d9ab8 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/CustomStyleUIConfigProvider.java @@ -0,0 +1,39 @@ +package com.fr.design.fun; + +import com.fr.base.Style; +import com.fr.common.annotations.Open; +import com.fr.stable.fun.mark.Mutable; + +import javax.swing.JComponent; +import javax.swing.event.ChangeListener; + +/** + * Created by kerry on 2019-11-11 + */ +@Open +public interface CustomStyleUIConfigProvider extends Mutable { + String XML_TAG = "CustomStyleUIConfigProvider"; + + int CURRENT_LEVEL = 1; + + /** + * @return 配置名 + */ + String configName(); + + /** + * @param changeListener 需要添加的listener + * @return 对应的component + */ + JComponent uiComponent(ChangeListener changeListener); + + /** + * @return 更新后的样式 + */ + Style updateConfig(); + + /** + * @param style 待渲染的样式 + */ + void populateConfig(Style style); +} diff --git a/designer-base/src/main/java/com/fr/design/fun/MultiStyleUIConfigProvider.java b/designer-base/src/main/java/com/fr/design/fun/MultiStyleUIConfigProvider.java new file mode 100644 index 0000000000..d76c703773 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/MultiStyleUIConfigProvider.java @@ -0,0 +1,23 @@ +package com.fr.design.fun; + +import com.fr.common.annotations.Open; +import com.fr.stable.fun.mark.Mutable; + +import java.util.List; + +/** + * Created by kerry on 2019-11-11 + */ +@Open +public interface MultiStyleUIConfigProvider extends Mutable { + String XML_TAG = "MultiStyleUIConfigProvider"; + + int CURRENT_LEVEL = 1; + + /** + * 获取配置项list + * + * @return 配置项list + */ + List getConfigList(); +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractCustomStyleUIConfigProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractCustomStyleUIConfigProvider.java new file mode 100644 index 0000000000..ceda5621cf --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractCustomStyleUIConfigProvider.java @@ -0,0 +1,45 @@ +package com.fr.design.fun.impl; + +import com.fr.base.Style; +import com.fr.design.fun.CustomStyleUIConfigProvider; +import com.fr.stable.StringUtils; +import com.fr.stable.fun.mark.API; + +import javax.swing.JComponent; +import javax.swing.event.ChangeListener; + +/** + * Created by kerry on 2019-11-11 + */ +@API(level = CustomStyleUIConfigProvider.CURRENT_LEVEL) +public class AbstractCustomStyleUIConfigProvider implements CustomStyleUIConfigProvider { + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } + + @Override + public String configName() { + return StringUtils.EMPTY; + } + + @Override + public JComponent uiComponent(ChangeListener changeListener) { + return null; + } + + @Override + public Style updateConfig() { + return null; + } + + @Override + public void populateConfig(Style style) { + + } +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractMultiStyleUIConfigProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractMultiStyleUIConfigProvider.java new file mode 100644 index 0000000000..9c9c8d2aea --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractMultiStyleUIConfigProvider.java @@ -0,0 +1,30 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.CustomStyleUIConfigProvider; +import com.fr.design.fun.MultiStyleUIConfigProvider; +import com.fr.stable.fun.mark.API; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by kerry on 2019-11-11 + */ +@API(level = MultiStyleUIConfigProvider.CURRENT_LEVEL) +public abstract class AbstractMultiStyleUIConfigProvider implements MultiStyleUIConfigProvider { + @Override + public List getConfigList() { + return new ArrayList(); + } + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } + +} diff --git a/designer-realize/src/main/java/com/fr/design/style/StylePane.java b/designer-realize/src/main/java/com/fr/design/style/StylePane.java index a408450fbf..64d3a0f667 100644 --- a/designer-realize/src/main/java/com/fr/design/style/StylePane.java +++ b/designer-realize/src/main/java/com/fr/design/style/StylePane.java @@ -10,12 +10,12 @@ import com.fr.base.Style; import com.fr.base.core.StyleUtils; import com.fr.design.ExtraDesignClassManager; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.fun.CustomStyleUIConfigProvider; +import com.fr.design.fun.MultiStyleUIConfigProvider; import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.style.background.BackgroundPane; -import com.fr.design.style.preference.PreferenceConfigProvider; -import com.fr.design.style.preference.PreferenceTabConfig; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; @@ -63,13 +63,13 @@ public class StylePane extends BasicBeanPane