Browse Source

CHART-2006

master
zheng 7 years ago
parent
commit
dc71ac9584
  1. 1
      designer_base/src/com/fr/design/locale/designer.properties
  2. 1
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  3. 1
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  4. 1
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  5. 1
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  6. 1
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  7. 39
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  8. 19
      designer_chart/src/com/fr/extended/chart/AbstractExtendedChartUIProvider.java
  9. 8
      designer_chart/src/com/fr/extended/chart/AbstractExtendedStylePane.java
  10. 48
      designer_chart/src/com/fr/extended/chart/ExtendedOtherPane.java
  11. 12
      designer_chart/src/com/fr/extended/chart/ExtendedScrollPane.java

1
designer_base/src/com/fr/design/locale/designer.properties

@ -2382,3 +2382,4 @@ Plugin-ChartF_Time=
Plugin-ChartF_Add=
Plugin-ChartF_Non_Adjustment=
Plugin-ChartF_Add_Interval=
FR-Designer_Auto_Refresh=

1
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -2381,3 +2381,4 @@ Plugin-ChartF_Time=
Plugin-ChartF_Add=
Plugin-ChartF_Non_Adjustment=
Plugin-ChartF_Add_Interval=
FR-Designer_Auto_Refresh=

1
designer_base/src/com/fr/design/locale/designer_ja_JP.properties

@ -2382,3 +2382,4 @@ Plugin-ChartF_Time=
Plugin-ChartF_Add=
Plugin-ChartF_Non_Adjustment=
Plugin-ChartF_Add_Interval=
FR-Designer_Auto_Refresh=

1
designer_base/src/com/fr/design/locale/designer_ko_KR.properties

@ -2382,3 +2382,4 @@ Plugin-ChartF_Time=
Plugin-ChartF_Add=
Plugin-ChartF_Non_Adjustment=
Plugin-ChartF_Add_Interval=
FR-Designer_Auto_Refresh=

1
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -2382,3 +2382,4 @@ Plugin-ChartF_Time=\u65F6\u95F4
Plugin-ChartF_Add=\u6DFB\u52A0
Plugin-ChartF_Non_Adjustment=\u4E0D\u53EF\u8C03\u6574
Plugin-ChartF_Add_Interval=\u6DFB\u52A0\u95F4\u9694
FR-Designer_Auto_Refresh=\u5B9A\u65F6\u5237\u65B0

1
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -2381,3 +2381,4 @@ Plugin-ChartF_Time=
Plugin-ChartF_Add=
Plugin-ChartF_Non_Adjustment=
Plugin-ChartF_Add_Interval=
FR-Designer_Auto_Refresh=

39
designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

@ -290,20 +290,27 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
}
}
private static String getChartName(String plotID, IndependentChartUIProvider provider) {
String name = provider.getPlotTypeTitle4PopupWindow();
if (StringUtils.isEmpty(name)) {
name = ChartTypeManager.getInstance().getChartName(plotID);
}
return name;
}
public String[] getTitle4PopupWindow(String priority) {
if (priority.isEmpty()) {
if (StringUtils.isEmpty(priority)) {
return getTitle4PopupWindow();
}
String[] names = new String[getChartSize(priority)];
if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority)) {
Map<String, IndependentChartUIProvider> chartUIList = chartTypeInterfaces.get(priority);
Iterator iterator = chartUIList.entrySet().iterator();
Iterator<Map.Entry<String, IndependentChartUIProvider>> iterator = chartUIList.entrySet().iterator();
int i = 0;
while (iterator.hasNext()) {
Map.Entry entry = (Map.Entry) iterator.next();
IndependentChartUIProvider provider = (IndependentChartUIProvider) entry.getValue();
names[i++] = provider.getPlotTypeTitle4PopupWindow();
Map.Entry<String, IndependentChartUIProvider> entry = iterator.next();
names[i++] = getChartName(entry.getKey(), entry.getValue());
}
return names;
}
@ -317,7 +324,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority) && chartTypeInterfaces.get(priority).containsKey(plotID)) {
IndependentChartUIProvider provider = chartTypeInterfaces.get(priority).get(plotID);
return provider.getPlotTypeTitle4PopupWindow();
return getChartName(plotID, provider);
}
//兼容老的插件
@ -327,7 +334,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
Map.Entry entry = (Map.Entry) iterator.next();
String defaultPriority = (String) entry.getKey();
if (chartTypeInterfaces.get(defaultPriority).containsKey(plotID)) {
return chartTypeInterfaces.get(defaultPriority).get(plotID).getPlotTypeTitle4PopupWindow();
return getChartName(plotID, chartTypeInterfaces.get(defaultPriority).get(plotID));
}
}
}
@ -352,8 +359,12 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
int index = 0;
for (Integer aPriorityList : priorityList) {
String priority = String.valueOf(aPriorityList);
Iterator chartUI = chartTypeInterfaces.get(priority).entrySet().iterator();
index = fetchNames(chartUI, names, index);
Iterator<Map.Entry<String, IndependentChartUIProvider>> chartUI = chartTypeInterfaces.get(priority).entrySet().iterator();
while (chartUI.hasNext()) {
Map.Entry<String, IndependentChartUIProvider> chartUIEntry = chartUI.next();
names[index++] = getChartName(chartUIEntry.getKey(), chartUIEntry.getValue());
}
}
return names;
@ -373,16 +384,6 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
return ChartTypeManager.orderInPriority(priorityList);
}
private int fetchNames(Iterator chartUI, String[] names, int index) {
while (chartUI.hasNext()) {
Map.Entry chartUIEntry = (Map.Entry) chartUI.next();
IndependentChartUIProvider provider = (IndependentChartUIProvider) chartUIEntry.getValue();
names[index++] = provider.getPlotTypeTitle4PopupWindow();
}
return index;
}
public String getIconPath(String plotID) {
if (chartTypeInterfaces != null) {

19
designer_chart/src/com/fr/extended/chart/AbstractExtendedChartUIProvider.java

@ -10,6 +10,8 @@ import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.ChartsConfigPane;
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;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.stable.fun.impl.AbstractProvider;
@ -18,6 +20,10 @@ import com.fr.stable.fun.impl.AbstractProvider;
*/
public abstract class AbstractExtendedChartUIProvider extends AbstractProvider implements IndependentChartUIProvider {
protected abstract AbstractExtendedChartTableDataPane getTableDataSourcePane();
protected abstract AbstractReportDataContentPane getReportDataSourcePane();
@Override
public boolean needChartChangePane() {
return false;
@ -33,6 +39,16 @@ public abstract class AbstractExtendedChartUIProvider extends AbstractProvider i
return new ChartDataPane(listener);
}
@Override
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
return getTableDataSourcePane();
}
@Override
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {
return getReportDataSourcePane();
}
@Override
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) {
return new AbstractChartAttrPane[0];
@ -68,8 +84,7 @@ public abstract class AbstractExtendedChartUIProvider extends AbstractProvider i
return null;
}
@Override
public String getIconPath() {
public String getPlotTypeTitle4PopupWindow(){
return null;
}

8
designer_chart/src/com/fr/extended/chart/AbstractExtendedStylePane.java

@ -3,12 +3,10 @@ package com.fr.extended.chart;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.ibutton.UITabGroup;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import javax.swing.JPanel;
import java.awt.BorderLayout;
@ -27,7 +25,7 @@ public abstract class AbstractExtendedStylePane<T extends AbstractChart> extends
private JPanel centerPane;
private CardLayout cardLayout;
private List<BasicScrollPane<T>> paneList;
private List<ExtendedScrollPane<T>> paneList;
private AttributeChangeListener listener;
@ -82,13 +80,15 @@ public abstract class AbstractExtendedStylePane<T extends AbstractChart> extends
}
private void dealWithTabChanged() {
if (chart != null) {
AbstractExtendedStylePane.this.removeAttributeChangeListener();
paneList.get(tabPane.getSelectedIndex()).populateBean(chart);
AbstractExtendedStylePane.this.addAttributeChangeListener(listener);
}
}
protected abstract List<BasicScrollPane<T>> initPaneList();
protected abstract List<ExtendedScrollPane<T>> initPaneList();
@Override
public void populate(ChartCollection collection) {

48
designer_chart/src/com/fr/extended/chart/ExtendedOtherPane.java

@ -2,6 +2,8 @@ package com.fr.extended.chart;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -11,6 +13,9 @@ import com.fr.general.Inter;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Component;
/**
@ -19,7 +24,9 @@ import java.awt.Component;
public class ExtendedOtherPane extends AbstractChartAttrPane {
private ExtendedChartHyperLinkPane hyperLinkPane;
private UIButtonGroup refreshEnabled;
private UISpinner autoRefreshTime;
private JPanel contentPane;
@Override
public void populate(ChartCollection collection) {
@ -28,6 +35,8 @@ public class ExtendedOtherPane extends AbstractChartAttrPane {
if (chart != null && chart instanceof AbstractChart) {
hyperLinkPane.populateBean((AbstractChart) chart);
autoRefreshTime.setValue(((AbstractChart) chart).getAutoRefreshTime());
refreshEnabled.setSelectedIndex(((AbstractChart) chart).isRefreshEnabled() ? 0 : 1);
checkRefreshEnable();
}
}
@ -40,14 +49,17 @@ public class ExtendedOtherPane extends AbstractChartAttrPane {
if (chart != null && chart instanceof AbstractChart) {
hyperLinkPane.updateBean((AbstractChart) chart);
((AbstractChart) chart).setAutoRefreshTime(autoRefreshTime.getValue());
((AbstractChart) chart).setRefreshEnabled(refreshEnabled.getSelectedIndex() == 0);
}
}
}
private void checkRefreshEnable() {
contentPane.setVisible(refreshEnabled.getSelectedIndex() == 0);
}
@Override
protected JPanel createContentPane() {
autoRefreshTime = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
@ -56,7 +68,7 @@ public class ExtendedOtherPane extends AbstractChartAttrPane {
double[] rowSize = {p, p, p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{autoRefreshTime, null},
new Component[]{createRefreshPane(), null},
new Component[]{createHyperlinkPane(), null}
};
@ -68,6 +80,36 @@ public class ExtendedOtherPane extends AbstractChartAttrPane {
return null;
}
private JPanel createRefreshPane() {
refreshEnabled = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Open"), Inter.getLocText("Plugin-ChartF_Close")});
refreshEnabled.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
checkRefreshEnable();
}
});
autoRefreshTime = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f, 20};
double[] rowSize = {p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Time_Interval")), autoRefreshTime, new UILabel(Inter.getLocText("Chart-Time_Seconds"))},
};
contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
JPanel panel = new JPanel(new BorderLayout(0,4));
panel.add(refreshEnabled, BorderLayout.NORTH);
panel.add(contentPane, BorderLayout.CENTER);
JPanel gapPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("FR-Designer_Auto_Refresh"), panel);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Chart-Use_Refresh"), gapPane);
}
private JPanel createHyperlinkPane() {
hyperLinkPane = new ExtendedChartHyperLinkPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("M_Insert-Hyperlink"), hyperLinkPane);

12
designer_chart/src/com/fr/extended/chart/ExtendedScrollPane.java

@ -0,0 +1,12 @@
package com.fr.extended.chart;
import com.fr.plugin.chart.designer.AbstractVanChartScrollPane;
/**
* Created by shine on 2018/3/24.
*/
public abstract class ExtendedScrollPane<T> extends AbstractVanChartScrollPane<T> {
@Override
public abstract void updateBean(T ob);
}
Loading…
Cancel
Save