Browse Source

更改接口,分离原来的方法,单独成接口,为了方便算子生成时获取分组接口里面的函数。没有动FinctionGroup这个接口,因为动这里牵扯太广了,单独做一个接口专职获取公式就好

master
hugh 8 years ago
parent
commit
406c5e7d1b
  1. 3
      designer_base/src/com/fr/design/formula/FormulaPane.java
  2. 3
      designer_base/src/com/fr/design/formula/FunctionConstants.java
  3. 4
      designer_base/src/com/fr/design/formula/FunctionGroup.java
  4. 8
      designer_base/src/com/fr/design/fun/impl/AbstractFunctionGroup.java

3
designer_base/src/com/fr/design/formula/FormulaPane.java

@ -23,6 +23,7 @@ import com.fr.general.Inter;
import com.fr.parser.FRLexer; import com.fr.parser.FRLexer;
import com.fr.parser.FRParser; import com.fr.parser.FRParser;
import com.fr.plugin.ExtraClassManager; import com.fr.plugin.ExtraClassManager;
import com.fr.script.FunctionDefContainer;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.fun.mark.Mutable; import com.fr.stable.fun.mark.Mutable;
@ -619,7 +620,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
functionTypeListModel.addElement(FunctionConstants.CUSTOM); functionTypeListModel.addElement(FunctionConstants.CUSTOM);
functionTypeListModel.addElement(FunctionConstants.PLUGIN); functionTypeListModel.addElement(FunctionConstants.PLUGIN);
//hugh:自定义函数分组 //hugh:自定义函数分组
Set<Mutable> groups = ExtraClassManager.getInstance().getArray(FunctionGroup.MARK_STRING); Set<Mutable> groups = ExtraClassManager.getInstance().getArray(FunctionDefContainer.MARK_STRING);
if(!groups.isEmpty()){ if(!groups.isEmpty()){
for(Mutable group : groups){ for(Mutable group : groups){
functionTypeListModel.addElement(group); functionTypeListModel.addElement(group);

3
designer_base/src/com/fr/design/formula/FunctionConstants.java

@ -7,6 +7,7 @@ import com.fr.function.*;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.ExtraClassManager; import com.fr.plugin.ExtraClassManager;
import com.fr.script.FunctionDefContainer;
import com.fr.stable.EncodeConstants; import com.fr.stable.EncodeConstants;
import com.fr.stable.OperatingSystem; import com.fr.stable.OperatingSystem;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
@ -98,7 +99,7 @@ public abstract class FunctionConstants {
Collections.addAll(all, PLUGIN.getDescriptions()); Collections.addAll(all, PLUGIN.getDescriptions());
Collections.addAll(all, CUSTOM.getDescriptions()); Collections.addAll(all, CUSTOM.getDescriptions());
//hugh:自定义函数分组 //hugh:自定义函数分组
Set<Mutable> groups = ExtraClassManager.getInstance().getArray(FunctionGroup.MARK_STRING); Set<Mutable> groups = ExtraClassManager.getInstance().getArray(FunctionDefContainer.MARK_STRING);
if(!groups.isEmpty()){ if(!groups.isEmpty()){
for(Mutable group : groups){ for(Mutable group : groups){
Collections.addAll(all, ((FunctionGroup)group).getDescriptions()); Collections.addAll(all, ((FunctionGroup)group).getDescriptions());

4
designer_base/src/com/fr/design/formula/FunctionGroup.java

@ -2,10 +2,6 @@ package com.fr.design.formula;
public interface FunctionGroup { public interface FunctionGroup {
int CURRENT_LEVEL = 1;
String MARK_STRING = "FunctionGroup";
String getGroupName(); String getGroupName();
NameAndDescription[] getDescriptions(); NameAndDescription[] getDescriptions();
} }

8
designer_base/src/com/fr/design/fun/impl/AbstractFunctionGroup.java

@ -3,17 +3,18 @@ package com.fr.design.fun.impl;
import com.fr.design.formula.FunctionDefNAD; import com.fr.design.formula.FunctionDefNAD;
import com.fr.design.formula.FunctionGroup; import com.fr.design.formula.FunctionGroup;
import com.fr.design.formula.NameAndDescription; import com.fr.design.formula.NameAndDescription;
import com.fr.script.FunctionDefContainer;
import com.fr.stable.fun.mark.API; import com.fr.stable.fun.mark.API;
import com.fr.stable.fun.mark.Mutable; import com.fr.stable.fun.mark.Mutable;
import com.fr.stable.script.FunctionDef; import com.fr.stable.script.FunctionDef;
@API(level = FunctionGroup.CURRENT_LEVEL) @API(level = FunctionDefContainer.CURRENT_LEVEL)
public abstract class AbstractFunctionGroup implements Mutable, FunctionGroup { public abstract class AbstractFunctionGroup implements Mutable, FunctionGroup,FunctionDefContainer {
@Override @Override
public int currentAPILevel() { public int currentAPILevel() {
return CURRENT_LEVEL; return FunctionDefContainer.CURRENT_LEVEL;
} }
@Override @Override
@ -32,6 +33,7 @@ public abstract class AbstractFunctionGroup implements Mutable, FunctionGroup {
return nads; return nads;
} }
@Override
public FunctionDef[] getFunctionDefs(){ public FunctionDef[] getFunctionDefs(){
return new FunctionDef[0]; return new FunctionDef[0];
} }

Loading…
Cancel
Save