From 2a5b9a4e2a8251f2df82913d7f4943371058840c Mon Sep 17 00:00:00 2001 From: hugh Date: Wed, 15 Feb 2017 10:48:52 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=99=90=E5=88=B6?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E5=85=81=E8=AE=B8=E6=B7=BB=E5=8A=A0=E5=90=8C?= =?UTF-8?q?=E5=88=86=E7=BB=84=E5=90=8D=E7=9A=84=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/formula/FunctionConstants.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/formula/FunctionConstants.java b/designer_base/src/com/fr/design/formula/FunctionConstants.java index 8a0675897b..43926e38b0 100644 --- a/designer_base/src/com/fr/design/formula/FunctionConstants.java +++ b/designer_base/src/com/fr/design/formula/FunctionConstants.java @@ -34,10 +34,16 @@ public abstract class FunctionConstants { * @param listModel */ public static void addFunctionGroupFromPlugins(DefaultListModel listModel){ - //hugh:自定义函数分组 + //hugh:自定义函数分组,分组名不允许重复 Set containers = ExtraClassManager.getInstance().getArray(FunctionDefContainer.MARK_STRING); + List nameList = new ArrayList(); if(!containers.isEmpty()){ for(Mutable container : containers){ + String name = ((FunctionDefContainer)container).getGroupName(); + if(nameList.contains(name)){ + continue; + } + nameList.add(name); listModel.addElement(createFunctionGroup((FunctionDefContainer)container)); } } From abc43081b68f73186b1015b5fad4832555e01f31 Mon Sep 17 00:00:00 2001 From: hugh Date: Thu, 11 May 2017 12:30:23 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/style/BackgroundSpecialPane.java | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/style/BackgroundSpecialPane.java b/designer_base/src/com/fr/design/gui/style/BackgroundSpecialPane.java index 43c1d133c2..ca538e944a 100644 --- a/designer_base/src/com/fr/design/gui/style/BackgroundSpecialPane.java +++ b/designer_base/src/com/fr/design/gui/style/BackgroundSpecialPane.java @@ -1,6 +1,12 @@ package com.fr.design.gui.style; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import com.fr.design.ExtraDesignClassManager; import com.fr.design.event.UIObserverListener; +import com.fr.design.fun.BackgroundQuickUIProvider; import com.fr.design.mainframe.backgroundpane.*; /** @@ -40,11 +46,26 @@ public class BackgroundSpecialPane extends BackgroundPane{ fireStateChanged(); } }); - return new BackgroundQuickPane[] { - new NullBackgroundQuickPane(), - colorBackgroundPane, - imageBackgroundPane, - gradientPane - }; + //hugh:表单支持背景接口 + List kinds = new ArrayList(); + + kinds.add(new NullBackgroundQuickPane()); + kinds.add(colorBackgroundPane); + kinds.add(imageBackgroundPane); + kinds.add(gradientPane); + + Set providers = ExtraDesignClassManager.getInstance().getArray(BackgroundQuickUIProvider.MARK_STRING); + for (BackgroundQuickUIProvider provider : providers) { + BackgroundQuickPane newTypePane = provider.appearanceForBackground(); + newTypePane.registerChangeListener(new UIObserverListener() { + @Override + public void doChange() { + fireStateChanged(); + } + }); + kinds.add(newTypePane); + } + + return kinds.toArray(new BackgroundQuickPane[kinds.size()]); } } \ No newline at end of file From cc4994a9eb6feea66425bd927d98322045ac9a58 Mon Sep 17 00:00:00 2001 From: hugh Date: Thu, 11 May 2017 12:34:21 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=86=97=E4=BD=99=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/formula/FunctionConstants.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/designer_base/src/com/fr/design/formula/FunctionConstants.java b/designer_base/src/com/fr/design/formula/FunctionConstants.java index 43926e38b0..8a0675897b 100644 --- a/designer_base/src/com/fr/design/formula/FunctionConstants.java +++ b/designer_base/src/com/fr/design/formula/FunctionConstants.java @@ -34,16 +34,10 @@ public abstract class FunctionConstants { * @param listModel */ public static void addFunctionGroupFromPlugins(DefaultListModel listModel){ - //hugh:自定义函数分组,分组名不允许重复 + //hugh:自定义函数分组 Set containers = ExtraClassManager.getInstance().getArray(FunctionDefContainer.MARK_STRING); - List nameList = new ArrayList(); if(!containers.isEmpty()){ for(Mutable container : containers){ - String name = ((FunctionDefContainer)container).getGroupName(); - if(nameList.contains(name)){ - continue; - } - nameList.add(name); listModel.addElement(createFunctionGroup((FunctionDefContainer)container)); } }