Browse Source
* commit 'a371b8d62e6c550dbccfa80cc78ad0d33f034371': (37 commits) module 1 单元格血缘关系, 自定义gridui接口 rt 不可变接口增加一个层级系数,用于可以指定插件的优先级 设计器部分接口简化 简化插件接口添加 rt 表单设计器获取数据集参数 rt rt rt rt rt rt rt rt rt rt rt ...master
superman
9 years ago
106 changed files with 625 additions and 1091 deletions
@ -1 +1 @@
|
||||
package com.fr.design.report;
import com.fr.data.Verifier;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.fun.VerifyDefineProvider;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.ObjectJControlPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.report.write.ReportWriteAttr;
import com.fr.report.write.ValueVerifier;
import com.fr.report.write.WClassVerifier;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
import java.util.ArrayList;
/**
* 校验列表
*/
public class VerifierListPane extends ObjectJControlPane {
public VerifierListPane(ElementCasePane ePane) {
super(ePane);
}
/**
* 创建选项
*
* @return 选项
*/
public NameableCreator[] createNameableCreators() {
NameableCreator[] creators = new NameableCreator[]{
new NameObjectCreator(Inter.getLocText(new String[]{"BuildIn", "Verify"}),
"/com/fr/web/images/reportlet.png",
ValueVerifier.class,
BuildInVerifierPane.class)
};
for (VerifyDefineProvider provider : ExtraDesignClassManager.getInstance().getVerifyDefineProviders()) {
creators = ArrayUtils.add(creators, new NameObjectCreator(
provider.nameForVerifier(),
provider.iconPath(),
provider.classForVerifier(),
provider.appearanceForVerifier()
) {
});
}
creators = ArrayUtils.add(creators, new NameObjectCreator(
Inter.getLocText(new String[]{"Custom", "Verify"}),
"/com/fr/web/images/reportlet.png",
WClassVerifier.class,
CustomVerifierPane.class));
return creators;
}
@Override
protected String title4PopupWindow() {
return "Verify Collections";
}
public void populate(ReportWriteAttr reportWriteAttr) {
if (reportWriteAttr == null) {
return;
}
java.util.List<NameObject> nameObjectList = new ArrayList<>();
int verifierCount = reportWriteAttr.getVerifierCount();
for (int i = 0; i < verifierCount; i++) {
Verifier verifier = reportWriteAttr.getVerifier(i);
nameObjectList.add(new NameObject(verifier.getName(), verifier));
}
this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()]));
}
public void updateReportWriteAttr(ReportWriteAttr reportWriteAttr) {
// Nameable[]居然不能强转成NameObject[],一定要这么写...
Nameable[] res = this.update();
NameObject[] res_array = new NameObject[res.length];
java.util.Arrays.asList(res).toArray(res_array);
reportWriteAttr.clearVerifiers();
for (int i = 0; i < res_array.length; i++) {
NameObject nameObject = res_array[i];
if (nameObject.getObject() instanceof Verifier) {
Verifier verifier = (Verifier) nameObject.getObject();
verifier.setName(nameObject.getName());
reportWriteAttr.addVerifier(verifier);
}
}
}
} |
||||
package com.fr.design.report;
import com.fr.data.Verifier;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.fun.VerifyDefineProvider;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.ObjectJControlPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.report.write.ReportWriteAttr;
import com.fr.report.write.ValueVerifier;
import com.fr.report.write.WClassVerifier;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
import java.util.ArrayList;
import java.util.Set;
/**
* 校验列表
*/
public class VerifierListPane extends ObjectJControlPane {
public VerifierListPane(ElementCasePane ePane) {
super(ePane);
}
/**
* 创建选项
*
* @return 选项
*/
public NameableCreator[] createNameableCreators() {
NameableCreator[] creators = new NameableCreator[]{
new NameObjectCreator(Inter.getLocText(new String[]{"BuildIn", "Verify"}),
"/com/fr/web/images/reportlet.png",
ValueVerifier.class,
BuildInVerifierPane.class)
};
Set<VerifyDefineProvider> set = ExtraDesignClassManager.getInstance().getArray(VerifyDefineProvider.MARK_STRING);
for (VerifyDefineProvider provider : set) {
creators = ArrayUtils.add(creators, new NameObjectCreator(
provider.nameForVerifier(),
provider.iconPath(),
provider.classForVerifier(),
provider.appearanceForVerifier()
) {
});
}
creators = ArrayUtils.add(creators, new NameObjectCreator(
Inter.getLocText(new String[]{"Custom", "Verify"}),
"/com/fr/web/images/reportlet.png",
WClassVerifier.class,
CustomVerifierPane.class));
return creators;
}
@Override
protected String title4PopupWindow() {
return "Verify Collections";
}
public void populate(ReportWriteAttr reportWriteAttr) {
if (reportWriteAttr == null) {
return;
}
java.util.List<NameObject> nameObjectList = new ArrayList<>();
int verifierCount = reportWriteAttr.getVerifierCount();
for (int i = 0; i < verifierCount; i++) {
Verifier verifier = reportWriteAttr.getVerifier(i);
nameObjectList.add(new NameObject(verifier.getName(), verifier));
}
this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()]));
}
public void updateReportWriteAttr(ReportWriteAttr reportWriteAttr) {
// Nameable[]居然不能强转成NameObject[],一定要这么写...
Nameable[] res = this.update();
NameObject[] res_array = new NameObject[res.length];
java.util.Arrays.asList(res).toArray(res_array);
reportWriteAttr.clearVerifiers();
for (int i = 0; i < res_array.length; i++) {
NameObject nameObject = res_array[i];
if (nameObject.getObject() instanceof Verifier) {
Verifier verifier = (Verifier) nameObject.getObject();
verifier.setName(nameObject.getName());
reportWriteAttr.addVerifier(verifier);
}
}
}
} |
@ -0,0 +1,17 @@
|
||||
package com.fr.grid; |
||||
|
||||
import com.fr.design.fun.impl.AbstractGridUIProcessor; |
||||
|
||||
import javax.swing.plaf.ComponentUI; |
||||
|
||||
/** |
||||
* Created by Administrator on 2016/6/28/0028. |
||||
*/ |
||||
public class DefaultGridUIProcessor extends AbstractGridUIProcessor{ |
||||
|
||||
@Override |
||||
public ComponentUI appearanceForGrid(int resolution) { |
||||
return new GridUI(resolution); |
||||
} |
||||
|
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,23 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.stable.fun.mark.Immutable; |
||||
|
||||
import javax.swing.plaf.ComponentUI; |
||||
|
||||
/** |
||||
* 自定义单元格ui接口 |
||||
* |
||||
* @return |
||||
*/ |
||||
public interface GridUIProcessor extends Immutable { |
||||
|
||||
String MARK_STRING = "GridUIProcessor"; |
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
/** |
||||
* 自定义gridui, 用于实现一些自定义的格子绘制. |
||||
* |
||||
* @return 自定义gridui |
||||
*/ |
||||
ComponentUI appearanceForGrid(int paramInt); |
||||
} |
@ -1,14 +1,20 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.CellAttributeProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* Created by zhouping on 2015/11/11. |
||||
*/ |
||||
@API(level = CellAttributeProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractCellAttributeProvider implements CellAttributeProvider { |
||||
|
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
public int layerIndex() { |
||||
return DEFAULT_LAYER_INDEX; |
||||
} |
||||
|
||||
} |
@ -1,17 +1,23 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.CellWidgetOptionProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @date 2015-05-13 |
||||
* @since 8.0 |
||||
*/ |
||||
public abstract class AbstractCellWidgetOptionProvider implements CellWidgetOptionProvider { |
||||
@API(level = CellWidgetOptionProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractCellWidgetOptionProvider extends AbstractProvider implements CellWidgetOptionProvider { |
||||
|
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
} |
@ -1,16 +1,24 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.ConnectionProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @date 2015-05-13 |
||||
* @since 8.0 |
||||
*/ |
||||
public abstract class AbstractConnectionProvider implements ConnectionProvider { |
||||
@API(level = ConnectionProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractConnectionProvider extends AbstractProvider implements ConnectionProvider { |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
} |
@ -1,15 +1,21 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.GlobalListenerProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* Created by zack on 2015/8/17. |
||||
*/ |
||||
public abstract class AbstractGlobalListenerProvider implements GlobalListenerProvider { |
||||
@API(level = GlobalListenerProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractGlobalListenerProvider extends AbstractProvider implements GlobalListenerProvider { |
||||
|
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
} |
@ -0,0 +1,15 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.GridUIProcessor; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
@API(level = GridUIProcessor.CURRENT_LEVEL) |
||||
public abstract class AbstractGridUIProcessor implements GridUIProcessor { |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
public int layerIndex() { |
||||
return DEFAULT_LAYER_INDEX; |
||||
} |
||||
} |
@ -1,16 +1,23 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.HighlightProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @date 2015-05-13 |
||||
* @since 8.0 |
||||
*/ |
||||
public abstract class AbstractHighlightProvider implements HighlightProvider { |
||||
@API(level = HighlightProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractHighlightProvider extends AbstractProvider implements HighlightProvider { |
||||
|
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
} |
@ -1,14 +1,21 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.HyperlinkProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* Created by zack on 2016/1/18. |
||||
*/ |
||||
public abstract class AbstractHyperlinkProvider implements HyperlinkProvider { |
||||
@API(level = HyperlinkProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractHyperlinkProvider extends AbstractProvider implements HyperlinkProvider { |
||||
|
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
} |
@ -1,14 +1,21 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.JavaScriptActionProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* Created by zack on 2015/8/20. |
||||
*/ |
||||
public abstract class AbstractJavaScriptActionProvider implements JavaScriptActionProvider { |
||||
@API(level = JavaScriptActionProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractJavaScriptActionProvider extends AbstractProvider implements JavaScriptActionProvider { |
||||
|
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
} |
@ -1,16 +1,23 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.ParameterWidgetOptionProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @date 2015-05-13 |
||||
* @since 8.0 |
||||
*/ |
||||
public abstract class AbstractParameterWidgetOptionProvider implements ParameterWidgetOptionProvider { |
||||
@API(level = ParameterWidgetOptionProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractParameterWidgetOptionProvider extends AbstractProvider implements ParameterWidgetOptionProvider { |
||||
|
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
} |
@ -1,17 +1,23 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.PresentKindProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @date 2015-05-22 |
||||
* @since 8.0 |
||||
*/ |
||||
public abstract class AbstractPresentKindProvider implements PresentKindProvider { |
||||
@API(level = PresentKindProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractPresentKindProvider extends AbstractProvider implements PresentKindProvider { |
||||
|
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
} |
@ -1,12 +1,39 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.data.datapane.TableDataNameObjectCreator; |
||||
import com.fr.design.data.tabledata.wrapper.TableDataFactory; |
||||
import com.fr.design.fun.ServerTableDataDefineProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @date 2015-05-13 |
||||
* @since 8.0 |
||||
*/ |
||||
public abstract class AbstractServerTableDataDefineProvider implements ServerTableDataDefineProvider { |
||||
@API(level = ServerTableDataDefineProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractServerTableDataDefineProvider extends AbstractProvider implements ServerTableDataDefineProvider { |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
|
||||
@Override |
||||
public void process() { |
||||
TableDataNameObjectCreator creator = new TableDataNameObjectCreator( |
||||
nameForTableData(), |
||||
prefixForTableData(), |
||||
iconPathForTableData(), |
||||
classForTableData(), |
||||
classForInitTableData(), |
||||
appearanceForTableData() |
||||
); |
||||
TableDataFactory.register(classForTableData(), creator); |
||||
} |
||||
} |
@ -1,12 +1,18 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.SubmitProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
public abstract class AbstractSubmitProvider implements SubmitProvider { |
||||
@API(level = SubmitProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractSubmitProvider extends AbstractProvider implements SubmitProvider { |
||||
|
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
} |
@ -1,15 +1,21 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.TableDataPaneProcessor; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* Coder: zack |
||||
* Date: 2016/4/18 |
||||
* Time: 10:30 |
||||
*/ |
||||
@API(level = TableDataPaneProcessor.CURRENT_LEVEL) |
||||
public abstract class AbstractTDPaneProcessor implements TableDataPaneProcessor { |
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
public int layerIndex() { |
||||
return DEFAULT_LAYER_INDEX; |
||||
} |
||||
} |
||||
|
@ -1,16 +1,39 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.data.datapane.TableDataNameObjectCreator; |
||||
import com.fr.design.data.tabledata.wrapper.TableDataFactory; |
||||
import com.fr.design.fun.TableDataDefineProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @date 2015-05-13 |
||||
* @since 8.0 |
||||
*/ |
||||
public abstract class AbstractTableDataDefineProvider implements TableDataDefineProvider { |
||||
@API(level = TableDataDefineProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractTableDataDefineProvider extends AbstractProvider implements TableDataDefineProvider { |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
|
||||
@Override |
||||
public void process() { |
||||
TableDataNameObjectCreator creator = new TableDataNameObjectCreator( |
||||
nameForTableData(), |
||||
prefixForTableData(), |
||||
iconPathForTableData(), |
||||
classForTableData(), |
||||
classForInitTableData(), |
||||
appearanceForTableData() |
||||
); |
||||
TableDataFactory.register(classForTableData(), creator); |
||||
} |
||||
} |
@ -1,12 +1,18 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.TitlePlaceProcessor; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
@API(level = TitlePlaceProcessor.CURRENT_LEVEL) |
||||
public abstract class AbstractTitleProcessor implements TitlePlaceProcessor { |
||||
|
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
public int layerIndex() { |
||||
return DEFAULT_LAYER_INDEX; |
||||
} |
||||
|
||||
|
||||
} |
@ -1,14 +1,21 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.ToolbarItemProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* Created by richie on 15/12/1. |
||||
*/ |
||||
public abstract class AbstractToolbarItem implements ToolbarItemProvider { |
||||
@API(level = ToolbarItemProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractToolbarItem extends AbstractProvider implements ToolbarItemProvider { |
||||
|
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
} |
@ -1,16 +1,22 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.UIFormulaProcessor; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @date 2015-05-13 |
||||
* @since 8.0 |
||||
*/ |
||||
@API(level = UIFormulaProcessor.CURRENT_LEVEL) |
||||
public abstract class AbstractUIFormulaProcessor implements UIFormulaProcessor { |
||||
|
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
public int layerIndex() { |
||||
return DEFAULT_LAYER_INDEX; |
||||
} |
||||
|
||||
} |
@ -1,11 +1,22 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.WidgetDesignHandler; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* Coder: zack |
||||
* Date: 2016/5/12 |
||||
* Time: 10:41 |
||||
*/ |
||||
@API(level = WidgetDesignHandler.CURRENT_LEVEL) |
||||
public abstract class AbstractWidgetDesignHandler implements WidgetDesignHandler { |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
public int layerIndex() { |
||||
return DEFAULT_LAYER_INDEX; |
||||
} |
||||
} |
||||
|
@ -1,13 +1,26 @@
|
||||
package com.fr.design.mainframe; |
||||
|
||||
import com.fr.base.io.IOFile; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* Created by Administrator on 2016/3/17/0017. |
||||
*/ |
||||
public abstract class AbstractAppProvider<T extends IOFile> implements App{ |
||||
@API(level = App.CURRENT_LEVEL) |
||||
public abstract class AbstractAppProvider<T extends IOFile> extends AbstractProvider implements App{ |
||||
|
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
|
||||
@Override |
||||
public void process() { |
||||
DesignerFrame.registApp(this); |
||||
} |
||||
} |
||||
|
@ -1 +1 @@
|
||||
package com.fr.design.module;
import com.fr.chart.base.ChartInternationalNameContentBean;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.chart.ChartDialog;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.ChartWidgetOption;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.mainframe.App;
import com.fr.design.mainframe.ChartAndWidgetPropertyPane;
import com.fr.design.mainframe.ChartPropertyPane;
import com.fr.form.ui.ChartEditor;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import com.fr.stable.plugin.PluginReadListener;
import javax.swing.*;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 7.0.3
* Date: 13-7-8
* Time: 上午9:13
*/
public class ChartDesignerModule extends DesignModule {
public void start() {
super.start();
dealBeforeRegister();
register();
registerFloatEditor();
}
protected void dealBeforeRegister(){
StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class);
}
private void register(){
DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup());
GeneralContext.addPluginReadListener(new PluginReadListener() {
@Override
public void success() {
DesignModuleFactory.registerExtraWidgetOptions(options4Show());
}
});
DesignModuleFactory.registerChartEditorClass(ChartEditor.class);
DesignModuleFactory.registerChartComponentClass(ChartComponent.class);
DesignModuleFactory.registerChartDialogClass(ChartDialog.class);
DesignModuleFactory.registerChartAndWidgetPropertyPane(ChartAndWidgetPropertyPane.class);
DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class);
ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction());
}
protected void registerFloatEditor() {
ActionFactory.registerChartCollection(ChartCollection.class);
}
/**
* 返回设计器能打开的模板类型的一个数组列表
*
* @return 可以打开的模板类型的数组
*/
public App<?>[] apps4TemplateOpener() {
return new App[0];
}
protected WidgetOption[] options4Show() {
ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames();
ChartWidgetOption[] child = new ChartWidgetOption[typeName.length];
for (int i = 0; i < typeName.length; i++) {
String plotID = typeName[i].getPlotID();
Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID);
String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID);
Icon icon = IOUtils.readIcon(iconPath);
child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]);
}
return child;
}
public String getInterNationalName() {
return Inter.getLocText("FR-Chart-Design_ChartModule");
}
} |
||||
package com.fr.design.module;
import com.fr.chart.base.ChartInternationalNameContentBean;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.chart.ChartDialog;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.ChartWidgetOption;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.mainframe.App;
import com.fr.design.mainframe.ChartAndWidgetPropertyPane;
import com.fr.design.mainframe.ChartPropertyPane;
import com.fr.form.ui.ChartEditor;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import com.fr.stable.plugin.PluginReadListener;
import javax.swing.*;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 7.0.3
* Date: 13-7-8
* Time: 上午9:13
*/
public class ChartDesignerModule extends DesignModule {
public void start() {
super.start();
dealBeforeRegister();
register();
registerFloatEditor();
}
protected void dealBeforeRegister(){
StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class);
}
private void register(){
DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup());
GeneralContext.addPluginReadListener(new PluginReadListener() {
@Override
public void success() {
DesignModuleFactory.registerExtraWidgetOptions(options4Show());
}
});
DesignModuleFactory.registerChartEditorClass(ChartEditor.class);
DesignModuleFactory.registerChartComponentClass(ChartComponent.class);
DesignModuleFactory.registerChartDialogClass(ChartDialog.class);
DesignModuleFactory.registerChartAndWidgetPropertyPane(ChartAndWidgetPropertyPane.class);
DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class);
ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction());
}
protected void registerFloatEditor() {
ActionFactory.registerChartCollection(ChartCollection.class);
}
/**
* 返回设计器能打开的模板类型的一个数组列表
*
* @return 可以打开的模板类型的数组
*/
public App<?>[] apps4TemplateOpener() {
return new App[0];
}
protected WidgetOption[] options4Show() {
ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames();
ChartWidgetOption[] child = new ChartWidgetOption[typeName.length];
for (int i = 0; i < typeName.length; i++) {
String plotID = typeName[i].getPlotID();
Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID);
if(rowChart == null) {
continue;
}
String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID);
Icon icon = IOUtils.readIcon(iconPath);
child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]);
}
return child;
}
public String getInterNationalName() {
return Inter.getLocText("FR-Chart-Design_ChartModule");
}
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue