diff --git a/designer/src/com/fr/quickeditor/ChartQuickEditor.java b/designer/src/com/fr/quickeditor/ChartQuickEditor.java index 991cf33989..b64cd68343 100644 --- a/designer/src/com/fr/quickeditor/ChartQuickEditor.java +++ b/designer/src/com/fr/quickeditor/ChartQuickEditor.java @@ -46,9 +46,9 @@ public class ChartQuickEditor extends QuickEditor{ element = ((ElementCasePane)tc).getEditingElementCase().getFloatElement(fs.getSelectedFloatName()); } collection = (BaseChartCollection) element.getValue(); - //将chartCollection存在DesignModuleFactory - DesignModuleFactory.setChartCollection((ChartCollection) collection); + add(editingPropertyPane = DesignModuleFactory.getChartPropertyPane(), BorderLayout.CENTER); + editingPropertyPane.addChartEditPane(((ChartCollection)collection).getSelectedChart().getPlot().getPlotID()); editingPropertyPane.setSupportCellData(true); } editingPropertyPane.populateChartPropertyPane(collection, tc); diff --git a/designer_base/src/com/fr/design/gui/chart/BaseChartPropertyPane.java b/designer_base/src/com/fr/design/gui/chart/BaseChartPropertyPane.java index c5b58ae268..327c444684 100644 --- a/designer_base/src/com/fr/design/gui/chart/BaseChartPropertyPane.java +++ b/designer_base/src/com/fr/design/gui/chart/BaseChartPropertyPane.java @@ -2,7 +2,6 @@ package com.fr.design.gui.chart; import com.fr.base.chart.BaseChartCollection; import com.fr.design.designer.TargetComponent; -import com.fr.design.mainframe.BaseWidgetPropertyPane; import com.fr.design.mainframe.DockingView; /** @@ -23,5 +22,7 @@ public abstract class BaseChartPropertyPane extends DockingView { public abstract ChartEditPaneProvider getChartEditPane(); + public abstract void addChartEditPane(String plotID); + //public abstract void clear(); } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/module/DesignModuleFactory.java b/designer_base/src/com/fr/design/module/DesignModuleFactory.java index 960236e48d..2e1d390063 100644 --- a/designer_base/src/com/fr/design/module/DesignModuleFactory.java +++ b/designer_base/src/com/fr/design/module/DesignModuleFactory.java @@ -1 +1,255 @@ -package com.fr.design.module; import com.fr.base.FRContext; import com.fr.base.chart.BaseChartCollection; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.gui.chart.BaseChartPropertyPane; import com.fr.design.gui.chart.MiddleChartComponent; import com.fr.design.gui.chart.MiddleChartDialog; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.frpane.BaseHyperlinkGroup; import com.fr.design.gui.frpane.HyperlinkGroupType; import com.fr.design.mainframe.BaseFormDesigner; import com.fr.design.mainframe.BaseWidgetPropertyPane; import com.fr.design.parameter.HierarchyTreePane; import com.fr.design.parameter.ParameterDesignerProvider; import com.fr.design.parameter.ParameterReader; import com.fr.form.ui.Widget; import com.fr.stable.StableUtils; import java.awt.*; import java.lang.reflect.Constructor; import java.util.ArrayList; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-7-8 * Time: 下午1:57 */ public class DesignModuleFactory { private static DesignModuleFactory instance = new DesignModuleFactory(); private static ChartCollection chartCollection; public static ChartCollection getChartCollection() { return chartCollection; } public static void setChartCollection(ChartCollection chartCollection) { DesignModuleFactory.chartCollection = chartCollection; } private DesignModuleFactory() { } private HyperlinkGroupType hyperlinkGroupType = new BaseHyperlinkGroup(); private NameableCreator[] creators4Hyperlink; private WidgetOption[] extraOptions; private Class chartEditorClass; private Class chartComponentClass; private Class chartDialogClass; private Class chartPropertyPaneClass; private Class newFormAction; private Class formParaDesigner; private Class paraPropertyPane; private Class formHierarchyPaneCls; private Class widgetPropertyPane; private Class buttonDetailPaneClass; private java.util.List parameterReaderList; public static void registerHyperlinkGroupType(HyperlinkGroupType hyperlinkGroupType) { instance.hyperlinkGroupType = hyperlinkGroupType; } public static HyperlinkGroupType getHyperlinkGroupType() { return instance.hyperlinkGroupType; } public static void registerCreators4Hyperlink(NameableCreator[] nameableCreators) { instance.creators4Hyperlink = nameableCreators; } public static NameableCreator[] getCreators4Hyperlink() { return instance.creators4Hyperlink; } public static void registerExtraWidgetOptions(WidgetOption[] options) { instance.extraOptions = options; } public static WidgetOption[] getExtraWidgetOptions() { if (instance.extraOptions == null) { instance.extraOptions = new WidgetOption[0]; } return instance.extraOptions; } public static void registerChartEditorClass(Class cls) { instance.chartEditorClass = cls; } public static Class getChartEditorClass() { return instance.chartEditorClass; } public static void registerChartComponentClass(Class bcc) { instance.chartComponentClass = bcc; } public static void registerChartDialogClass(Class cd) { instance.chartDialogClass = cd; } public static void registerChartPropertyPaneClass(Class p) { instance.chartPropertyPaneClass = p; } public static void registerNewFormActionClass(Class f) { instance.newFormAction = f; } public static Class getNewFormAction() { return instance.newFormAction; } public static void registerParaPropertyPaneClass(Class p) { instance.paraPropertyPane = p; } /** * 获取参数属性界面 * * @return 参数属性界面. */ public static Object getParaPropertyPane() { if (instance.paraPropertyPane != null) { try { return instance.paraPropertyPane.newInstance(); } catch (Exception e) { FRContext.getLogger().error("Error in Para PropertyPane"); } } return null; } public static void registerFormParaDesignerClass(Class f) { instance.formParaDesigner = f; } public static ParameterDesignerProvider getFormParaDesigner() { if (instance.formParaDesigner != null) { try { return (ParameterDesignerProvider) instance.formParaDesigner.newInstance(); } catch (Exception e) { FRContext.getLogger().error("error in form para designer"); } } return null; } public static void registerFormHierarchyPaneClass(Class fClass) { instance.formHierarchyPaneCls = fClass; } public static HierarchyTreePane getFormHierarchyPane() { return StableUtils.getInstance(instance.formHierarchyPaneCls); } public static void registerWidgetPropertyPaneClass(Class wp) { instance.widgetPropertyPane = wp; } public static BaseWidgetPropertyPane getWidgetPropertyPane(BaseFormDesigner fd) { BaseWidgetPropertyPane wp = null; if (instance.widgetPropertyPane != null) { wp = StableUtils.getInstance(instance.widgetPropertyPane); wp.setEditingFormDesigner(fd); wp.refreshDockingView(); } return wp; } public static MiddleChartComponent getChartComponent(BaseChartCollection collection) { MiddleChartComponent bcc = null; if (instance.chartComponentClass != null) { try { bcc = instance.chartComponentClass.newInstance(); bcc.populate(collection); } catch (InstantiationException e) { FRContext.getLogger().error("Error in ChartComponent instant", e); } catch (IllegalAccessException e) { FRContext.getLogger().error("Error in Access", e); } } return bcc; } /** * kunsnat: 初始化图表向导对话框, 调用静态方法showWindow, 参数window. * * @return 返回调出的ChartDailog */ public static MiddleChartDialog getChartDialog(Window window) { try { Constructor c; if (window instanceof Frame) { c = instance.chartDialogClass.getConstructor(Frame.class); } else { c = instance.chartDialogClass.getConstructor(Dialog.class); } return c.newInstance(window); } catch (Exception e) { FRContext.getLogger().error(e.getMessage(), e); } return null; } /** * kunsnat: 获取图表属性界面 * * @return 返回界面. */ public static BaseChartPropertyPane getChartPropertyPane() { BaseChartPropertyPane bp = null; if (instance.chartPropertyPaneClass != null) { bp = StableUtils.getInstance(instance.chartPropertyPaneClass); } return bp; } public static void clearChartPropertyPane() { if (instance.chartPropertyPaneClass != null) { StableUtils.clearInstance(instance.chartPropertyPaneClass); } } public static void registerButtonDetailPaneClass(Class clazz) { instance.buttonDetailPaneClass = clazz; } public static Class getButtonDetailPaneClass() { return instance.buttonDetailPaneClass; } public static void registerParameterReader(ParameterReader reader) { if (instance.parameterReaderList == null) { instance.parameterReaderList = new ArrayList(); } instance.parameterReaderList.add(reader); } public static ParameterReader[] getParameterReaders() { if (instance.parameterReaderList == null) { return new ParameterReader[0]; } return instance.parameterReaderList.toArray(new ParameterReader[instance.parameterReaderList.size()]); } } \ No newline at end of file +package com.fr.design.module; + +import com.fr.base.FRContext; +import com.fr.base.chart.BaseChartCollection; +import com.fr.chart.chartattr.ChartCollection; +import com.fr.design.gui.chart.BaseChartPropertyPane; +import com.fr.design.gui.chart.MiddleChartComponent; +import com.fr.design.gui.chart.MiddleChartDialog; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.gui.core.WidgetOption; +import com.fr.design.gui.frpane.BaseHyperlinkGroup; +import com.fr.design.gui.frpane.HyperlinkGroupType; +import com.fr.design.mainframe.BaseFormDesigner; +import com.fr.design.mainframe.BaseWidgetPropertyPane; +import com.fr.design.parameter.HierarchyTreePane; +import com.fr.design.parameter.ParameterDesignerProvider; +import com.fr.design.parameter.ParameterReader; +import com.fr.form.ui.Widget; +import com.fr.stable.StableUtils; + +import java.awt.*; +import java.lang.reflect.Constructor; +import java.util.ArrayList; + +/** + * Created by IntelliJ IDEA. + * Author : Richer + * Version: 7.0.3 + * Date: 13-7-8 + * Time: 下午1:57 + */ +public class DesignModuleFactory { + private static DesignModuleFactory instance = new DesignModuleFactory(); + private static ChartCollection chartCollection; + + public static ChartCollection getChartCollection() { + return chartCollection; + } + + public static void setChartCollection(ChartCollection chartCollection) { + DesignModuleFactory.chartCollection = chartCollection; + } + + private DesignModuleFactory() { + + } + + private HyperlinkGroupType hyperlinkGroupType = new BaseHyperlinkGroup(); + private NameableCreator[] creators4Hyperlink; + private WidgetOption[] extraOptions; + private Class chartEditorClass; + private Class chartComponentClass; + private Class chartDialogClass; + private Class chartPropertyPaneClass; + private Class newFormAction; + private Class formParaDesigner; + private Class paraPropertyPane; + private Class formHierarchyPaneCls; + private Class widgetPropertyPane; + private Class buttonDetailPaneClass; + private java.util.List parameterReaderList; + + + public static void registerHyperlinkGroupType(HyperlinkGroupType hyperlinkGroupType) { + instance.hyperlinkGroupType = hyperlinkGroupType; + } + + public static HyperlinkGroupType getHyperlinkGroupType() { + return instance.hyperlinkGroupType; + } + + public static void registerCreators4Hyperlink(NameableCreator[] nameableCreators) { + instance.creators4Hyperlink = nameableCreators; + } + + public static NameableCreator[] getCreators4Hyperlink() { + return instance.creators4Hyperlink; + } + + public static void registerExtraWidgetOptions(WidgetOption[] options) { + instance.extraOptions = options; + } + + public static WidgetOption[] getExtraWidgetOptions() { + if (instance.extraOptions == null) { + instance.extraOptions = new WidgetOption[0]; + } + + return instance.extraOptions; + } + + public static void registerChartEditorClass(Class cls) { + instance.chartEditorClass = cls; + } + + public static Class getChartEditorClass() { + return instance.chartEditorClass; + } + + public static void registerChartComponentClass(Class bcc) { + instance.chartComponentClass = bcc; + } + + public static void registerChartDialogClass(Class cd) { + instance.chartDialogClass = cd; + } + + public static void registerChartPropertyPaneClass(Class p) { + instance.chartPropertyPaneClass = p; + } + + + public static void registerNewFormActionClass(Class f) { + instance.newFormAction = f; + } + + public static Class getNewFormAction() { + return instance.newFormAction; + } + + public static void registerParaPropertyPaneClass(Class p) { + instance.paraPropertyPane = p; + } + + /** + * 获取参数属性界面 + * + * @return 参数属性界面. + */ + public static Object getParaPropertyPane() { + if (instance.paraPropertyPane != null) { + try { + return instance.paraPropertyPane.newInstance(); + } catch (Exception e) { + FRContext.getLogger().error("Error in Para PropertyPane"); + } + } + return null; + } + + public static void registerFormParaDesignerClass(Class f) { + instance.formParaDesigner = f; + } + + public static ParameterDesignerProvider getFormParaDesigner() { + if (instance.formParaDesigner != null) { + try { + return (ParameterDesignerProvider) instance.formParaDesigner.newInstance(); + } catch (Exception e) { + FRContext.getLogger().error("error in form para designer"); + } + } + return null; + } + + public static void registerFormHierarchyPaneClass(Class fClass) { + instance.formHierarchyPaneCls = fClass; + } + + public static HierarchyTreePane getFormHierarchyPane() { + return StableUtils.getInstance(instance.formHierarchyPaneCls); + } + + public static void registerWidgetPropertyPaneClass(Class wp) { + instance.widgetPropertyPane = wp; + } + + public static BaseWidgetPropertyPane getWidgetPropertyPane(BaseFormDesigner fd) { + BaseWidgetPropertyPane wp = null; + if (instance.widgetPropertyPane != null) { + wp = StableUtils.getInstance(instance.widgetPropertyPane); + wp.setEditingFormDesigner(fd); + wp.refreshDockingView(); + } + return wp; + } + + public static MiddleChartComponent getChartComponent(BaseChartCollection collection) { + MiddleChartComponent bcc = null; + if (instance.chartComponentClass != null) { + try { + bcc = instance.chartComponentClass.newInstance(); + bcc.populate(collection); + } catch (InstantiationException e) { + FRContext.getLogger().error("Error in ChartComponent instant", e); + } catch (IllegalAccessException e) { + FRContext.getLogger().error("Error in Access", e); + } + } + return bcc; + } + + /** + * kunsnat: 初始化图表向导对话框, 调用静态方法showWindow, 参数window. + * + * @return 返回调出的ChartDailog + */ + public static MiddleChartDialog getChartDialog(Window window) { + try { + Constructor c; + if (window instanceof Frame) { + c = instance.chartDialogClass.getConstructor(Frame.class); + } else { + c = instance.chartDialogClass.getConstructor(Dialog.class); + } + return c.newInstance(window); + } catch (Exception e) { + FRContext.getLogger().error(e.getMessage(), e); + } + return null; + } + + /** + * kunsnat: 获取图表属性界面 + * + * @return 返回界面. + */ + public static BaseChartPropertyPane getChartPropertyPane() { + BaseChartPropertyPane bp = null; + if (instance.chartPropertyPaneClass != null) { + bp = StableUtils.getInstance(instance.chartPropertyPaneClass); + } + return bp; + } + + + public static void clearChartPropertyPane() { + if (instance.chartPropertyPaneClass != null) { + StableUtils.clearInstance(instance.chartPropertyPaneClass); + } + } + + + public static void registerButtonDetailPaneClass(Class clazz) { + instance.buttonDetailPaneClass = clazz; + } + + public static Class getButtonDetailPaneClass() { + return instance.buttonDetailPaneClass; + } + + public static void registerParameterReader(ParameterReader reader) { + if (instance.parameterReaderList == null) { + instance.parameterReaderList = new ArrayList(); + } + instance.parameterReaderList.add(reader); + } + + public static ParameterReader[] getParameterReaders() { + if (instance.parameterReaderList == null) { + return new ParameterReader[0]; + } + return instance.parameterReaderList.toArray(new ParameterReader[instance.parameterReaderList.size()]); + } +} \ No newline at end of file diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index 67a04c19fe..1168009e85 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -12,10 +12,10 @@ import com.fr.design.chart.gui.ChartWidgetOption; import com.fr.design.chartinterface.*; import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.extra.ChartTypeInterfaceCloseableHandler; +import com.fr.design.gui.chart.ChartEditPaneProvider; import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.mainframe.chart.AbstractChartAttrPane; -import com.fr.design.mainframe.chart.ChartEditPane; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; @@ -415,7 +415,7 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh } //获取指定图表的编辑面板 - public ChartEditPane getChartConfigPane(String plotID) { + public ChartEditPaneProvider getChartConfigPane(String plotID) { Iterator iterator = chartTypeInterfaces.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); @@ -427,7 +427,7 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh return getChartConfigPane(ChartTypeManager.CHART_PRIORITY, plotID); } - private ChartEditPane getChartConfigPane(String priority, String plotID) { + private ChartEditPaneProvider getChartConfigPane(String priority, String plotID) { return chartTypeInterfaces.get(priority).get(plotID).getChartConfigPane(plotID); } diff --git a/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java b/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java index fa581301e6..46677df62b 100644 --- a/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java +++ b/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java @@ -3,9 +3,9 @@ package com.fr.design.chart.fun; import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; import com.fr.design.condition.ConditionAttributesPane; +import com.fr.design.gui.chart.ChartEditPaneProvider; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.mainframe.chart.AbstractChartAttrPane; -import com.fr.design.mainframe.chart.ChartEditPane; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; @@ -90,6 +90,6 @@ public interface IndependentChartUIProvider extends Level { */ String getPlotTypeTitle4PopupWindow(); - ChartEditPane getChartConfigPane(String plotID); + ChartEditPaneProvider getChartConfigPane(String plotID); } \ No newline at end of file diff --git a/designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUI4Custom.java b/designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUI4Custom.java index fdc7ac64d4..4ba55e055f 100644 --- a/designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUI4Custom.java +++ b/designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUI4Custom.java @@ -21,7 +21,7 @@ import com.fr.general.ComparatorUtils; */ public abstract class AbstractIndependentChartUI4Custom implements IndependentChartUIProvider { - int CURRENT_API_LEVEL = 3; + int CURRENT_API_LEVEL = 100000; @Override public AbstractChartTypePane getPlotTypePane() { return new PiePlotPane(); diff --git a/designer_chart/src/com/fr/design/mainframe/ChartPropertyPane.java b/designer_chart/src/com/fr/design/mainframe/ChartPropertyPane.java index 1c04543d68..457379245c 100644 --- a/designer_chart/src/com/fr/design/mainframe/ChartPropertyPane.java +++ b/designer_chart/src/com/fr/design/mainframe/ChartPropertyPane.java @@ -3,15 +3,11 @@ */ package com.fr.design.mainframe; -import java.awt.BorderLayout; -import java.awt.Dimension; - -import javax.swing.BorderFactory; -import javax.swing.JComponent; -import javax.swing.SwingConstants; - import com.fr.design.gui.ilable.UILabel; +import javax.swing.*; +import java.awt.*; + public class ChartPropertyPane extends MiddleChartPropertyPane{ /** @@ -21,8 +17,6 @@ public class ChartPropertyPane extends MiddleChartPropertyPane{ if(singleton == null) { singleton = new ChartPropertyPane(); } - - singleton.setSureProperty(); return singleton; } diff --git a/designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java b/designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java index 00f38d5333..7e37d8beb2 100644 --- a/designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java +++ b/designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java @@ -14,7 +14,6 @@ import com.fr.design.gui.frpane.UITitlePanel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itabpane.TitleChangeListener; import com.fr.design.mainframe.chart.ChartEditPane; -import com.fr.design.module.DesignModuleFactory; import com.fr.general.Inter; import javax.swing.*; @@ -26,9 +25,6 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{ protected UILabel nameLabel; protected ChartEditPane chartEditPane; - //获取ChartCollection和当前图表的plotID,用来获取对应的面板 - protected ChartCollection chartCollection = DesignModuleFactory.getChartCollection(); - protected String plotID = chartCollection.getSelectedChart().getPlot().getPlotID(); public MiddleChartPropertyPane() { initComponenet(); @@ -40,9 +36,13 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{ createNameLabel(); this.add(createNorthComponent(), BorderLayout.NORTH); - chartEditPane = ChartTypeInterfaceManager.getInstance().getChartConfigPane(plotID); + } + + public void addChartEditPane(String plotID){ + chartEditPane = (ChartEditPane) ChartTypeInterfaceManager.getInstance().getChartConfigPane(plotID); chartEditPane.setSupportCellData(true); this.createMainPane(); + setSureProperty(); } protected abstract void createNameLabel(); diff --git a/designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java b/designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java index 1e855476e0..fc3b70108e 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java @@ -5,10 +5,10 @@ import com.fr.base.BaseUtils; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.ChartTypeInterfaceManager; -import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.tabledata.Prepare4DataSourceChange; +import com.fr.design.dialog.BasicPane; import com.fr.design.gui.chart.ChartEditPaneProvider; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.ibutton.UIHeadGroup; @@ -31,7 +31,7 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.List; -public class ChartEditPane extends BasicBeanPane implements AttributeChange,Prepare4DataSourceChange, ChartEditPaneProvider { +public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4DataSourceChange, ChartEditPaneProvider { private final static int CHANGE_MIN_TIME = 80; @@ -49,10 +49,8 @@ public class ChartEditPane extends BasicBeanPane implements AttributeChange,Prep private ChartCollection lastCollection; protected CardLayout card; protected JPanel center; - protected TargetComponentContainer container = null; - protected TitleChangeListener titleChangeListener = null; - protected ChartEditPane chartEditPane =this; - + private TargetComponentContainer container = null; + private TitleChangeListener titleChangeListener = null; private Calendar lastTime; protected ChartEditPane() { @@ -348,14 +346,4 @@ public class ChartEditPane extends BasicBeanPane implements AttributeChange,Prep } }); } - //添加populate和update方法,第三方图表继承使用 - @Override - public void populateBean(Object ob) { - - } - - @Override - public Object updateBean() { - return null; - } } \ No newline at end of file diff --git a/designer_chart/src/com/fr/design/mainframe/chart/CustomChartEditPane.java b/designer_chart/src/com/fr/design/mainframe/chart/ThirdChartEditPane.java similarity index 84% rename from designer_chart/src/com/fr/design/mainframe/chart/CustomChartEditPane.java rename to designer_chart/src/com/fr/design/mainframe/chart/ThirdChartEditPane.java index 19572b8a92..823f0e7dc7 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/CustomChartEditPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/ThirdChartEditPane.java @@ -3,9 +3,9 @@ package com.fr.design.mainframe.chart; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.ChartTypeInterfaceManager; +import com.fr.design.gui.chart.ChartEditPaneProvider; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.ibutton.UIHeadGroup; -import com.fr.design.gui.itabpane.TitleChangeListener; import com.fr.design.mainframe.TargetComponentContainer; import com.fr.design.mainframe.chart.gui.ChartDataPane; @@ -15,7 +15,7 @@ import java.awt.*; /** * Created by mengao on 2017/5/3. */ -public class CustomChartEditPane extends ChartEditPane { +public abstract class ThirdChartEditPane extends ChartEditPane implements ChartEditPaneProvider, ThirdChartInterface { //构建主面板 protected void createTabsPane() { Icon[] iconArray = new Icon[paneList.size()]; @@ -34,7 +34,7 @@ public class CustomChartEditPane extends ChartEditPane { AttributeChangeListener listener = new AttributeChangeListener() { @Override public void attributeChange() { - chartEditPane.updateBean(collection.getSelectedChart()); + updateBean(collection.getSelectedChart()); } }; @@ -72,16 +72,6 @@ public class CustomChartEditPane extends ChartEditPane { int index = Math.min(tabsHeaderIconPane.getSelectedIndex(), paneList.size() - 1); return paneList.get(index).title4PopupWindow(); } - - /** - * 添加标题变化监听事件. - * - * @param titleChangeListener 标题的ChangeListener - */ - public void addTitleChangeListener(TitleChangeListener titleChangeListener) { - this.titleChangeListener = titleChangeListener; - } - /** * 设置容器. */ @@ -92,7 +82,7 @@ public class CustomChartEditPane extends ChartEditPane { public void populate(ChartCollection collection) { - chartEditPane.populateBean(collection.getSelectedChart()); + populateBean(collection.getSelectedChart()); } protected ChartEditPane getCurrentChartEditPane() { @@ -145,7 +135,7 @@ public class CustomChartEditPane extends ChartEditPane { } protected void dealWithStyleChange(){ - chartEditPane.populateBean(collection.getSelectedChart()); + populateBean(collection.getSelectedChart()); } /** @@ -160,7 +150,7 @@ public class CustomChartEditPane extends ChartEditPane { * 图表设计器,显示选中的面板 */ public void populateSelectedTabPane() { - chartEditPane.populateBean(collection.getSelectedChart()); + populateBean(collection.getSelectedChart()); } /** @@ -169,4 +159,10 @@ public class CustomChartEditPane extends ChartEditPane { public void registerDSChangeListener() { } + + @Override + protected String title4PopupWindow() { + return null; + } + } diff --git a/designer_chart/src/com/fr/design/mainframe/chart/ThirdChartInterface.java b/designer_chart/src/com/fr/design/mainframe/chart/ThirdChartInterface.java new file mode 100644 index 0000000000..bdef854b40 --- /dev/null +++ b/designer_chart/src/com/fr/design/mainframe/chart/ThirdChartInterface.java @@ -0,0 +1,11 @@ +package com.fr.design.mainframe.chart; + +/** + * Created by mengao on 2017/5/8. + */ +public interface ThirdChartInterface { + + void populateBean(Object ob); + + void updateBean(Object ob); +}