Browse Source

Merge pull request #1140 in DESIGN/design from ~BJORN/design:feature/10.0 to feature/10.0

* commit '009567cc4541692d6e667cb28d9d2a0001c0f1cc':
  CHART-10603 对老图表的plotpane父类增加了获取提示的默认实现,默认取图表选择中子类型的名称
  CHART-10233 接口修改
research/11.0
Bjorn 5 years ago
parent
commit
3fa7587aa1
  1. 5
      designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractChartTypeUI.java
  2. 79
      designer-chart/src/main/java/com/fr/design/chartx/impl/DefaultTypePane.java
  3. 25
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java
  4. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractDeprecatedChartTypePane.java
  5. 14
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AreaPlotPane.java
  6. 17
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/BarPlotPane.java
  7. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/BubblePlotPane.java
  8. 17
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ColumnPlotPane.java
  9. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/CustomPlotPane.java
  10. 9
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/DonutPlotPane.java
  11. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/FunnelPlotPane.java
  12. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/GanttPlotPane.java
  13. 5
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/GisMapPlotPane.java
  14. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/LinePlotPane.java
  15. 10
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/MeterPlotPane.java
  16. 9
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/PiePlotPane.java
  17. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/RadarPlotPane.java
  18. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/RangePlotPane.java
  19. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/StockPlotPane.java
  20. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/XYScatterPlotPane.java

5
designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractChartTypeUI.java

@ -5,7 +5,6 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.fun.ChartTypeUIProvider;
import com.fr.design.chartx.impl.AbstractDataPane;
import com.fr.design.chartx.impl.AbstractOtherPane;
import com.fr.design.chartx.impl.DefaultTypePane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.ChartEditPane;
@ -25,9 +24,7 @@ import com.fr.stable.fun.mark.API;
public abstract class AbstractChartTypeUI extends AbstractProvider implements ChartTypeUIProvider {
@Override
public AbstractChartTypePane getPlotTypePane() {
return new DefaultTypePane();
}
public abstract AbstractChartTypePane getPlotTypePane();
@Override
public abstract AbstractDataPane getChartDataPane(AttributeChangeListener listener);

79
designer-chart/src/main/java/com/fr/design/chartx/impl/DefaultTypePane.java

@ -1,79 +0,0 @@
package com.fr.design.chartx.impl;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chart.impl.AbstractChartWithData;
import com.fr.chartx.attr.ChartProvider;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
/**
* Created by shine on 2019/09/04.
*/
public class DefaultTypePane<T extends AbstractChartWithData> extends AbstractChartTypePane<T> {
@Override
protected String[] getTypeIconPath() {
return ChartTypeInterfaceManager.getInstance().getDemoImagePath(getPlotID());
}
@Override
protected String[] getTypeTipName() {
return ChartTypeInterfaceManager.getInstance().getSubName(getPlotID());
}
@Override
public ChartProvider getDefaultChart() {
return ChartTypeManager.getInstance().getChartTypes(getPlotID())[0];
}
@Override
public String title4PopupWindow() {
return ChartTypeInterfaceManager.getInstance().getName(getPlotID());
}
protected int getSelectIndexInChart(T chart) {
return 0;
}
protected void setSelectIndexInChart(T chart, int index) {
}
@Override
public void populateBean(T ob) {
if (getTypeIconPath().length > 0) {
for (ChartImagePane imagePane : typeDemo) {
imagePane.isPressing = false;
}
typeDemo.get(getSelectIndexInChart(ob)).isPressing = true;
checkDemosBackground();
}
}
@Override
public void updateBean(T ob) {
if (getTypeIconPath().length > 0) {
for (int index = 0, len = typeDemo.size(); index < len; index++) {
if (typeDemo.get(index).isPressing) {
setSelectIndexInChart(ob, index);
return;
}
}
}
}
@Override
protected String[] getTypeLayoutPath() {
return new String[0];
}
@Override
protected String[] getTypeLayoutTipName() {
return new String[0];
}
@Override
protected String getPlotTypeID() {
return null;
}
}

25
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java

@ -17,11 +17,11 @@ import com.fr.stable.Constants;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import java.util.ArrayList;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.util.ArrayList;
import java.util.List;
public abstract class AbstractChartTypePane<T extends ChartProvider> extends FurtherBasicBeanPane<T> {
@ -43,10 +43,19 @@ public abstract class AbstractChartTypePane<T extends ChartProvider> extends Fur
protected JPanel stylePane; //样式布局的面板
private JPanel typePane;
protected abstract String[] getTypeIconPath();
protected abstract String[] getTypeTipName();
protected abstract String[] getTypeLayoutPath();
protected abstract String[] getTypeLayoutTipName();
protected String[] getTypeLayoutPath() {
return new String[0];
}
protected String[] getTypeLayoutTipName() {
return new String[0];
}
protected int lastStyleIndex = -1;
protected boolean typeChanged = false;//图表类型是否发生变化
@ -192,20 +201,22 @@ public abstract class AbstractChartTypePane<T extends ChartProvider> extends Fur
/**
* 此接口已删除不用实现了
*
* <p>
* 获取各图表类型界面ID, 本质是plotID
* 使用getPlotID
*
* @return 图表类型界面ID
*/
@Deprecated
protected abstract String getPlotTypeID();
protected String getPlotTypeID() {
return null;
}
public String getPlotID() {
return plotID;
}
/**
*
* @param ob 对象
* @return
*/

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractDeprecatedChartTypePane.java

@ -16,6 +16,7 @@ import com.fr.chart.chartattr.Legend;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartattr.Title;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont;
import com.fr.js.NameJavaScriptGroup;
@ -38,6 +39,12 @@ public abstract class AbstractDeprecatedChartTypePane extends AbstractChartTypeP
}
}
@Override
protected String[] getTypeTipName() {
return ChartTypeInterfaceManager.getInstance().getSubName(getPlotID());
}
/**
* 更新界面属性
*/

14
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AreaPlotPane.java

@ -32,20 +32,6 @@ public class AreaPlotPane extends AbstractDeprecatedChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
String area = Toolkit.i18nText("Fine-Design_Chart_Type_Area");
String stack = Toolkit.i18nText("Fine-Design_Chart_Stacked");
String percent = Toolkit.i18nText("Fine-Design_Chart_Use_Percent");
String td = Toolkit.i18nText("Fine-Design_Chart_3D");
return new String[]{
stack + area,
percent + stack + area,
td + stack + area,
td + percent + stack + area
};
}
@Override
protected String getPlotTypeID() {
return ChartConstants.AREA_CHART;

17
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/BarPlotPane.java

@ -30,23 +30,6 @@ public class BarPlotPane extends AbstractBarPane{
};
}
@Override
protected String[] getTypeTipName() {
String bar = Toolkit.i18nText("Fine-Design_Chart_Type_Bar");
String stack = Toolkit.i18nText("Fine-Design_Chart_Stacked");
String percent = Toolkit.i18nText("Fine-Design_Chart_Use_Percent");
String td = Toolkit.i18nText("Fine-Design_Chart_3D");
return new String[]{
bar,
stack + bar,
percent + stack + bar,
td + bar,
td + bar + "(" + Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal") + ")",
td + stack + bar,
td + percent + stack + bar
};
}
@Override
protected String[] getTypeLayoutPath() {
return new String[]{"/com/fr/design/images/chart/ColumnPlot/layout/0.png",

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/BubblePlotPane.java

@ -23,13 +23,6 @@ public class BubblePlotPane extends AbstractDeprecatedChartTypePane {
return new String[]{"/com/fr/design/images/chart/BubblePlot/type/0.png",};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Bubble_Chart_OLD")
};
}
@Override
protected String[] getTypeLayoutPath() {
return new String[0];

17
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ColumnPlotPane.java

@ -29,23 +29,6 @@ public class ColumnPlotPane extends AbstractBarPane{
};
}
@Override
protected String[] getTypeTipName() {
String column = Toolkit.i18nText("Fine-Design_Chart_Type_Column");
String stack = Toolkit.i18nText("Fine-Design_Chart_Stacked");
String percent = Toolkit.i18nText("Fine-Design_Chart_Use_Percent");
String td = Toolkit.i18nText("Fine-Design_Chart_3D");
return new String[]{
column,
stack + column,
percent + stack + column,
td + column,
td + column + "(" + Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal") + ")",
td + stack + column,
td + percent + stack + column
};
}
@Override
protected String[] getTypeLayoutPath() {
return new String[]{"/com/fr/design/images/chart/BarPlot/layout/0.png",

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/CustomPlotPane.java

@ -24,13 +24,6 @@ public class CustomPlotPane extends AbstractDeprecatedChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Type_Combine")
};
}
@Override
protected String[] getTypeLayoutPath() {
return new String[0];

9
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/DonutPlotPane.java

@ -33,15 +33,6 @@ public class DonutPlotPane extends AbstractDeprecatedChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
String donut = Toolkit.i18nText("Fine-Design_Chart_Type_Donut");
return new String[]{
donut,
Toolkit.i18nText("Fine-Design_Chart_3D") + donut
};
}
@Override
protected String[] getTypeLayoutPath() {
return new String[]{"/com/fr/design/images/chart/DonutPlot/layout/0.png",

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/FunnelPlotPane.java

@ -28,13 +28,6 @@ public class FunnelPlotPane extends AbstractDeprecatedChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Type_Funnel")
};
}
@Override
protected String[] getTypeLayoutPath() {
return new String[0];

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/GanttPlotPane.java

@ -22,13 +22,6 @@ public class GanttPlotPane extends AbstractDeprecatedChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Type_Gantt")
};
}
@Override
protected String getPlotTypeID() {
return ChartConstants.GANTT_CHART;

5
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/GisMapPlotPane.java

@ -65,6 +65,11 @@ public class GisMapPlotPane extends AbstractDeprecatedChartTypePane {
}
@Override
public void reLayout(String chartID){
}
@Override
protected String[] getTypeIconPath() {
return new String[]{"/com/fr/design/images/chart/GisMapPlot/type/0.png",

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/LinePlotPane.java

@ -19,13 +19,6 @@ public class LinePlotPane extends AbstractDeprecatedChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Type_Line")
};
}
@Override
protected String[] getTypeLayoutPath() {
return new String[0];

10
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/MeterPlotPane.java

@ -30,16 +30,6 @@ public class MeterPlotPane extends AbstractDeprecatedChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
String meter = Toolkit.i18nText("Fine-Design_Chart_Type_Meter");
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Mode_Custom") + meter,
meter + "1",
meter + "2"
};
}
@Override
protected String[] getTypeLayoutPath() {
return new String[0];

9
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/PiePlotPane.java

@ -34,15 +34,6 @@ public class PiePlotPane extends AbstractDeprecatedChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
String pie = Toolkit.i18nText("Fine-Design_Chart_Type_Pie");
return new String[]{
pie,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_3D") + pie
};
}
@Override
protected String[] getTypeLayoutPath() {
return new String[]{"/com/fr/design/images/chart/PiePlot/layout/0.png",

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/RadarPlotPane.java

@ -22,13 +22,6 @@ public class RadarPlotPane extends AbstractDeprecatedChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Type_Radar")
};
}
@Override
protected String getPlotTypeID() {
return ChartConstants.RADAR_CHART;

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/RangePlotPane.java

@ -23,13 +23,6 @@ public class RangePlotPane extends AbstractDeprecatedChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Type_Range")
};
}
@Override
protected String getPlotTypeID() {
return ChartConstants.RANGE_CHART;

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/StockPlotPane.java

@ -22,13 +22,6 @@ public class StockPlotPane extends AbstractDeprecatedChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Type_Stock")
};
}
@Override
protected String getPlotTypeID() {
return ChartConstants.STOCK_CHART;

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/XYScatterPlotPane.java

@ -25,13 +25,6 @@ public class XYScatterPlotPane extends AbstractDeprecatedChartTypePane {
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Type_XYScatter")
};
}
@Override
protected String[] getTypeLayoutPath() {
return new String[0];

Loading…
Cancel
Save