forked from fanruan/design
Browse Source
* commit '5d629a5b9c6874806375d762664c29df4f24bbd4': 1 单元格血缘关系, 自定义gridui接口 表单设计器获取数据集参数 11 模板web属性打不开.master
superman
8 years ago
8 changed files with 93 additions and 60 deletions
@ -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); |
||||
} |
||||
|
||||
} |
@ -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); |
||||
} |
@ -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 +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");
}
} |
Loading…
Reference in new issue