Browse Source

CHART-2109

master
zheng 7 years ago
parent
commit
43528c866f
  1. 68
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  2. 4
      designer_chart/src/com/fr/design/chartinterface/AreaIndependentChartInterface.java
  3. 5
      designer_chart/src/com/fr/design/chartinterface/BarIndependentChartInterface.java
  4. 5
      designer_chart/src/com/fr/design/chartinterface/BubbleIndependentChartInterface.java
  5. 5
      designer_chart/src/com/fr/design/chartinterface/ColumnIndependentChartInterface.java
  6. 5
      designer_chart/src/com/fr/design/chartinterface/CustomIndependentChartInterface.java
  7. 5
      designer_chart/src/com/fr/design/chartinterface/DonutIndependentChartInterface.java
  8. 5
      designer_chart/src/com/fr/design/chartinterface/FunnelIndependentChartInterface.java
  9. 5
      designer_chart/src/com/fr/design/chartinterface/GanttIndependentChartInterface.java
  10. 5
      designer_chart/src/com/fr/design/chartinterface/GisMapIndependentChartInterface.java
  11. 5
      designer_chart/src/com/fr/design/chartinterface/LineIndependentChartInterface.java
  12. 5
      designer_chart/src/com/fr/design/chartinterface/MapIndependentChartInterface.java
  13. 5
      designer_chart/src/com/fr/design/chartinterface/MeterIndependentChartInterface.java
  14. 5
      designer_chart/src/com/fr/design/chartinterface/PieIndependentChartInterface.java
  15. 5
      designer_chart/src/com/fr/design/chartinterface/RadarIndependentChartInterface.java
  16. 5
      designer_chart/src/com/fr/design/chartinterface/RangeIndependentChartInterface.java
  17. 5
      designer_chart/src/com/fr/design/chartinterface/StockIndependentChartInterface.java
  18. 5
      designer_chart/src/com/fr/design/chartinterface/XYScatterIndependentChartInterface.java
  19. 23
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java

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

@ -100,6 +100,7 @@ import java.util.Map;
import static com.fr.chart.charttypes.ChartTypeManager.CHART_PRIORITY;
import static com.fr.chart.charttypes.ChartTypeManager.VAN_CHART_PRIORITY;
import static com.fr.chart.charttypes.ChartTypeManager.enabledChart;
/**
* Created by eason on 14/12/29.
@ -298,23 +299,41 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
return name;
}
public String[] getTitle4PopupWindow(String priority) {
if (StringUtils.isEmpty(priority)) {
return getTitle4PopupWindow();
}
String[] names = new String[getChartSize(priority)];
private void addTitles(String priority, List<String> list) {
if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority)) {
Map<String, IndependentChartUIProvider> chartUIList = chartTypeInterfaces.get(priority);
Iterator<Map.Entry<String, IndependentChartUIProvider>> iterator = chartUIList.entrySet().iterator();
int i = 0;
while (iterator.hasNext()) {
Map.Entry<String, IndependentChartUIProvider> entry = iterator.next();
names[i++] = getChartName(entry.getKey(), entry.getValue());
String plotID = entry.getKey();
if (enabledChart(plotID)) {
list.add(getChartName(plotID, entry.getValue()));
}
}
return names;
}
return new String[0];
}
public String[] getTitle4PopupWindow() {
List<Integer> priorityList = getPriorityInOrder();
List<String> result = new ArrayList<String>();
for (Integer priority : priorityList) {
addTitles(String.valueOf(priority), result);
}
return result.toArray(new String[result.size()]);
}
public String[] getTitle4PopupWindow(String priority) {
List<String> list = new ArrayList<String>();
addTitles(priority, list);
return list.toArray(new String[list.size()]);
}
/**
@ -341,35 +360,6 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
return StringUtils.EMPTY;
}
private String[] getTitle4PopupWindow() {
List<Integer> priorityList = getPriorityInOrder();
if (priorityList.size() == 0) {
return new String[0];
}
int size = 0;
//获取总得图表格式
for (Integer aPriorityList : priorityList) {
size += getChartSize(String.valueOf(aPriorityList));
}
String[] names = new String[size];
int index = 0;
for (Integer aPriorityList : priorityList) {
String priority = String.valueOf(aPriorityList);
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;
}
private List<Integer> getPriorityInOrder() {
List<Integer> priorityList = new ArrayList<Integer>();

4
designer_chart/src/com/fr/design/chartinterface/AreaIndependentChartInterface.java

@ -21,6 +21,10 @@ import com.fr.design.mainframe.chart.gui.type.AreaPlotPane;
* Created by eason on 15/4/21.
*/
public class AreaIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel {
@Override
public boolean needChartChangePane() {
return false;
}
public AbstractChartTypePane getPlotTypePane(){
return new AreaPlotPane();

5
designer_chart/src/com/fr/design/chartinterface/BarIndependentChartInterface.java

@ -23,6 +23,11 @@ import com.fr.design.mainframe.chart.gui.type.BarPlotPane;
*/
public class BarIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel {
@Override
public boolean needChartChangePane() {
return false;
}
public AbstractChartTypePane getPlotTypePane(){
return new BarPlotPane();
}

5
designer_chart/src/com/fr/design/chartinterface/BubbleIndependentChartInterface.java

@ -20,6 +20,11 @@ import com.fr.design.mainframe.chart.gui.type.BubblePlotPane;
*/
public class BubbleIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel {
@Override
public boolean needChartChangePane() {
return false;
}
public AbstractChartTypePane getPlotTypePane(){
return new BubblePlotPane();
}

5
designer_chart/src/com/fr/design/chartinterface/ColumnIndependentChartInterface.java

@ -22,6 +22,11 @@ import com.fr.design.mainframe.chart.gui.type.ColumnPlotPane;
* Created by eason on 15/4/21.
*/
public class ColumnIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel {
@Override
public boolean needChartChangePane() {
return false;
}
public AbstractChartTypePane getPlotTypePane(){
return new ColumnPlotPane();
}

5
designer_chart/src/com/fr/design/chartinterface/CustomIndependentChartInterface.java

@ -20,6 +20,11 @@ import com.fr.design.mainframe.chart.gui.type.CustomPlotPane;
*/
public class CustomIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel {
@Override
public boolean needChartChangePane() {
return false;
}
public AbstractChartTypePane getPlotTypePane(){
return new CustomPlotPane();
}

5
designer_chart/src/com/fr/design/chartinterface/DonutIndependentChartInterface.java

@ -22,6 +22,11 @@ import com.fr.design.mainframe.chart.gui.type.DonutPlotPane;
*/
public class DonutIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel {
@Override
public boolean needChartChangePane() {
return false;
}
public AbstractChartTypePane getPlotTypePane(){
return new DonutPlotPane();
}

5
designer_chart/src/com/fr/design/chartinterface/FunnelIndependentChartInterface.java

@ -20,6 +20,11 @@ import com.fr.design.mainframe.chart.gui.type.FunnelPlotPane;
*/
public class FunnelIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel {
@Override
public boolean needChartChangePane() {
return false;
}
public AbstractChartTypePane getPlotTypePane(){
return new FunnelPlotPane();
}

5
designer_chart/src/com/fr/design/chartinterface/GanttIndependentChartInterface.java

@ -17,6 +17,11 @@ import com.fr.design.mainframe.chart.gui.type.GanttPlotPane;
*/
public class GanttIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel {
@Override
public boolean needChartChangePane() {
return false;
}
public AbstractChartTypePane getPlotTypePane(){
return new GanttPlotPane();
}

5
designer_chart/src/com/fr/design/chartinterface/GisMapIndependentChartInterface.java

@ -13,6 +13,11 @@ import com.fr.design.mainframe.chart.gui.type.GisMapPlotPane;
*/
public class GisMapIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel {
@Override
public boolean needChartChangePane() {
return false;
}
public AbstractChartTypePane getPlotTypePane(){
return new GisMapPlotPane();
}

5
designer_chart/src/com/fr/design/chartinterface/LineIndependentChartInterface.java

@ -21,6 +21,11 @@ import com.fr.design.mainframe.chart.gui.type.LinePlotPane;
*/
public class LineIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel {
@Override
public boolean needChartChangePane() {
return false;
}
public AbstractChartTypePane getPlotTypePane(){
return new LinePlotPane();
}

5
designer_chart/src/com/fr/design/chartinterface/MapIndependentChartInterface.java

@ -18,6 +18,11 @@ import com.fr.design.mainframe.chart.gui.type.MapPlotPane;
*/
public class MapIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel {
@Override
public boolean needChartChangePane() {
return false;
}
public AbstractChartTypePane getPlotTypePane(){
return new MapPlotPane();
}

5
designer_chart/src/com/fr/design/chartinterface/MeterIndependentChartInterface.java

@ -18,6 +18,11 @@ import com.fr.design.mainframe.chart.gui.type.MeterPlotPane;
*/
public class MeterIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel {
@Override
public boolean needChartChangePane() {
return false;
}
public AbstractChartTypePane getPlotTypePane(){
return new MeterPlotPane();
}

5
designer_chart/src/com/fr/design/chartinterface/PieIndependentChartInterface.java

@ -22,6 +22,11 @@ import com.fr.design.mainframe.chart.gui.type.PiePlotPane;
*/
public class PieIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel {
@Override
public boolean needChartChangePane() {
return false;
}
public AbstractChartTypePane getPlotTypePane(){
return new PiePlotPane();
}

5
designer_chart/src/com/fr/design/chartinterface/RadarIndependentChartInterface.java

@ -20,6 +20,11 @@ import com.fr.design.mainframe.chart.gui.type.RadarPlotPane;
*/
public class RadarIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel {
@Override
public boolean needChartChangePane() {
return false;
}
public AbstractChartTypePane getPlotTypePane(){
return new RadarPlotPane();
}

5
designer_chart/src/com/fr/design/chartinterface/RangeIndependentChartInterface.java

@ -18,6 +18,11 @@ import com.fr.design.mainframe.chart.gui.type.RangePlotPane;
*/
public class RangeIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel {
@Override
public boolean needChartChangePane() {
return false;
}
public AbstractChartTypePane getPlotTypePane(){
return new RangePlotPane();
}

5
designer_chart/src/com/fr/design/chartinterface/StockIndependentChartInterface.java

@ -21,6 +21,11 @@ import com.fr.design.mainframe.chart.gui.type.StockPlotPane;
*/
public class StockIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel {
@Override
public boolean needChartChangePane() {
return false;
}
public AbstractChartTypePane getPlotTypePane(){
return new StockPlotPane();
}

5
designer_chart/src/com/fr/design/chartinterface/XYScatterIndependentChartInterface.java

@ -21,6 +21,11 @@ import com.fr.design.mainframe.chart.gui.type.XYScatterPlotPane;
*/
public class XYScatterIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel {
@Override
public boolean needChartChangePane() {
return false;
}
public AbstractChartTypePane getPlotTypePane(){
return new XYScatterPlotPane();
}

23
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -17,7 +17,6 @@ import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.item.FlexibleComboBox;
import com.fr.design.mainframe.chart.gui.item.ItemEventType;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.extended.chart.AbstractChart;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
@ -202,21 +201,27 @@ public class ChartTypePane extends AbstractChartAttrPane{
public void relayout(ChartCollection collection){
//重构需要重构下拉框选项和cardNames
Chart chart = collection.getSelectedChart();
String chartID = chart.getPriority();
if (collection.getState() == SwitchState.DEFAULT){
chartID = StringUtils.EMPTY;
}
String priority = chart.getPriority();
String plotID = chart.getPlot().getPlotID();
boolean enabledChart = ChartTypeManager.enabledChart(plotID);
String item = ChartTypeInterfaceManager.getInstance().getTitle4PopupWindow(priority, plotID);
//第一步就是重构cardNames
cardNames = ChartTypeInterfaceManager.getInstance().getTitle4PopupWindow(chartID);
if (enabledChart) {
cardNames = collection.getState() == SwitchState.DEFAULT
? ChartTypeInterfaceManager.getInstance().getTitle4PopupWindow()
: ChartTypeInterfaceManager.getInstance().getTitle4PopupWindow(priority);
} else {
cardNames = new String[]{item};
}
//下拉框重构开始。为了防止重构是触发update
((FlexibleComboBox)jcb).setItemEvenType(ItemEventType.REACTOR);
//重构下拉框选项
reactorComboBox();
//重新选择选中的下拉项
chartID = chart.getPriority();
String plotID = chart.getPlot().getPlotID();
Object item = ChartTypeInterfaceManager.getInstance().getTitle4PopupWindow(chartID, plotID);
jcb.setSelectedItem(item);
jcb.setEnabled(enabledChart);
//下拉框重构结束
((FlexibleComboBox)jcb).setItemEvenType(ItemEventType.DEFAULT);
//重新选中

Loading…
Cancel
Save