Browse Source

Merge remote-tracking branch 'origin/9.0' into 9.0

master
mengao 7 years ago
parent
commit
f8a2fd4617
  1. 3
      designer/src/com/fr/start/Designer.java
  2. 14
      designer_base/src/com/fr/design/actions/core/ActionFactory.java
  3. 93
      designer_chart/src/com/fr/design/module/ChartDesignerModule.java
  4. 61
      designer_chart/src/com/fr/plugin/chart/map/server/MapMenuHandler.java

3
designer/src/com/fr/start/Designer.java

@ -116,6 +116,9 @@ public class Designer extends BaseDesigner {
if (ActionFactory.getChartPreStyleAction() != null) { if (ActionFactory.getChartPreStyleAction() != null) {
menuDef.addShortCut(ActionFactory.getChartPreStyleAction()); menuDef.addShortCut(ActionFactory.getChartPreStyleAction());
} }
if (ActionFactory.getChartMapEditorAction() != null) {
menuDef.addShortCut(ActionFactory.getChartMapEditorAction());
}
} }
insertMenu(menuDef, MenuHandler.SERVER); insertMenu(menuDef, MenuHandler.SERVER);

14
designer_base/src/com/fr/design/actions/core/ActionFactory.java

@ -32,6 +32,8 @@ public class ActionFactory {
private static UpdateAction chartPreStyleAction = null; private static UpdateAction chartPreStyleAction = null;
private static UpdateAction chartMapEditorAction = null;
/** /**
* 待说明 * 待说明
* *
@ -69,6 +71,18 @@ public class ActionFactory {
return chartPreStyleAction; return chartPreStyleAction;
} }
/**
* 注册图表的 地图资源
* @param action 地图资源action
*/
public static void registerChartMapEditorAction(UpdateAction action) {
chartMapEditorAction = action;
}
public static UpdateAction getChartMapEditorAction() {
return chartMapEditorAction;
}
/** /**
* kunsnat: 图表注册 悬浮元素编辑器 , 因为ChartCollecion和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册. * kunsnat: 图表注册 悬浮元素编辑器 , 因为ChartCollecion和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册.
* *

93
designer_chart/src/com/fr/design/module/ChartDesignerModule.java

@ -1 +1,92 @@
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.ChartPropertyPane; import com.fr.form.ui.ChartEditor; import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.stable.ArrayUtils; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; 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); StableFactory.getStaticMarkedInstanceObjectFromClass(ExtraChartDesignClassManagerProvider.XML_TAG, ExtraChartDesignClassManagerProvider.class); } private void register(){ DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup()); DesignModuleFactory.registerChartEditorClass(ChartEditor.class); DesignModuleFactory.registerChartComponentClass(ChartComponent.class); DesignModuleFactory.registerChartDialogClass(ChartDialog.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 (ArrayUtils.isEmpty(rowChart)) { 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"); } } 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.ChartPropertyPane;
import com.fr.form.ui.ChartEditor;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.plugin.chart.map.server.ChartMapEditorAction;
import com.fr.stable.ArrayUtils;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
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);
StableFactory.getStaticMarkedInstanceObjectFromClass(ExtraChartDesignClassManagerProvider.XML_TAG, ExtraChartDesignClassManagerProvider.class);
}
private void register(){
DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup());
DesignModuleFactory.registerChartEditorClass(ChartEditor.class);
DesignModuleFactory.registerChartComponentClass(ChartComponent.class);
DesignModuleFactory.registerChartDialogClass(ChartDialog.class);
DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class);
ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction());
ActionFactory.registerChartMapEditorAction(new ChartMapEditorAction());
}
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 (ArrayUtils.isEmpty(rowChart)) {
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");
}
}

61
designer_chart/src/com/fr/plugin/chart/map/server/MapMenuHandler.java

@ -1,61 +0,0 @@
package com.fr.plugin.chart.map.server;
import com.fr.design.fun.impl.AbstractMenuHandler;
import com.fr.design.menu.ShortCut;
/**
* Created by Mitisky on 16/4/29.
*/
public class MapMenuHandler extends AbstractMenuHandler {
private static final int POSITION_OFFSET = 11;
/**
* 插入菜单的位置
*
* @param total 插入的位置
* @return 插入位置如果想放到最后则返回-1
*/
@Override
public int insertPosition(int total) {
return POSITION_OFFSET;
}
/**
* 是否在插入的菜单前插入一个分割符
*
* @return 是否插入分隔符
*/
@Override
public boolean insertSeparatorBefore() {
return false;
}
/**
* 是否在插入的菜单后插入一个分割符
*
* @return 是否插入分隔符
*/
@Override
public boolean insertSeparatorAfter() {
return false;
}
/**
* 所属的分类菜单
*
* @return 分类菜单名
*/
@Override
public String category() {
return SERVER;
}
/**
* 快捷方式
* @return 生成一个实例
*/
@Override
public ShortCut shortcut() {
return new ChartMapEditorAction();
}
}
Loading…
Cancel
Save