Browse Source

CHART-2611 去掉新特性这几个字 出的问题

master
zheng 6 years ago
parent
commit
01eea4751a
  1. 29
      designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java
  2. 14
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  3. 42
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java

29
designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java

@ -39,7 +39,6 @@ import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.form.ui.ChartEditor; import com.fr.form.ui.ChartEditor;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.plugin.chart.PiePlot4VanChart; import com.fr.plugin.chart.PiePlot4VanChart;
import com.fr.plugin.chart.area.VanChartAreaPlot; import com.fr.plugin.chart.area.VanChartAreaPlot;
import com.fr.plugin.chart.bubble.VanChartBubblePlot; import com.fr.plugin.chart.bubble.VanChartBubblePlot;
@ -84,7 +83,7 @@ import com.fr.van.chart.structure.desinger.StructureIndependentVanChartInterface
import com.fr.van.chart.treemap.TreeMapIndependentVanChartInterface; import com.fr.van.chart.treemap.TreeMapIndependentVanChartInterface;
import com.fr.van.chart.wordcloud.designer.WordCloudIndependentVanChartInterface; import com.fr.van.chart.wordcloud.designer.WordCloudIndependentVanChartInterface;
import javax.swing.*; import javax.swing.Icon;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
@ -92,7 +91,9 @@ import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static com.fr.chart.charttypes.ChartTypeManager.*; 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. * Created by eason on 14/12/29.
@ -254,17 +255,17 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
* *
* @param paneList pane容器 * @param paneList pane容器
*/ */
public void addPlotTypePaneList(List<FurtherBasicBeanPane<? extends Chart>> paneList) { public void addPlotTypePaneList(List<FurtherBasicBeanPane<? extends Chart>> paneList, Map<String, Map<String, FurtherBasicBeanPane<? extends Chart>>> allChartTypePane) {
List<Integer> priorityList = getPriorityInOrder(); List<Integer> priorityList = getPriorityInOrder();
for (Integer aPriorityList : priorityList) { for (Integer aPriorityList : priorityList) {
String priority = String.valueOf(aPriorityList); String priority = String.valueOf(aPriorityList);
addPlotTypePaneList(priority, paneList); addPlotTypePaneList(priority, paneList, allChartTypePane);
} }
} }
public void addPlotTypePaneList(String priority, List<FurtherBasicBeanPane<? extends Chart>> paneList) { public void addPlotTypePaneList(String priority, List<FurtherBasicBeanPane<? extends Chart>> paneList, Map<String, Map<String, FurtherBasicBeanPane<? extends Chart>>> allChartTypePane) {
if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority)) { if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority)) {
@ -279,22 +280,16 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
AbstractChartTypePane pane = entry.getValue().getPlotTypePane(); AbstractChartTypePane pane = entry.getValue().getPlotTypePane();
pane.setPlotID(plotID); pane.setPlotID(plotID);
paneList.add(pane); paneList.add(pane);
if (allChartTypePane.get(priority) == null) {
allChartTypePane.put(priority, new LinkedHashMap<String, FurtherBasicBeanPane<? extends Chart>>());
}
allChartTypePane.get(priority).put(plotID, pane);
} }
} }
} }
} }
public void addPlotTypePaneList(List<FurtherBasicBeanPane<? extends Chart>> paneList,
String priority, String plotID) {
if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority) && chartTypeInterfaces.get(priority).containsKey(plotID)) {
IndependentChartUIProvider provider = chartTypeInterfaces.get(priority).get(plotID);
AbstractChartTypePane pane = provider.getPlotTypePane();
pane.setPlotID(plotID);
paneList.add(pane);
}
}
private static String getChartName(String plotID, IndependentChartUIProvider provider) { private static String getChartName(String plotID, IndependentChartUIProvider provider) {
String name = provider.getPlotTypeTitle4PopupWindow(); String name = provider.getPlotTypeTitle4PopupWindow();
if (StringUtils.isEmpty(name)) { if (StringUtils.isEmpty(name)) {

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

@ -18,12 +18,20 @@ import com.fr.design.gui.imenutable.UIMenuNameableCreator;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.mainframe.chart.gui.ChartTypePane.ComboBoxPane; import com.fr.design.mainframe.chart.gui.ChartTypePane.ComboBoxPane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.BorderFactory;
import java.awt.*; import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.FocusEvent; import java.awt.event.FocusEvent;

42
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -26,7 +26,10 @@ import java.awt.CardLayout;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 图表 属性表, 类型选择 界面. * 图表 属性表, 类型选择 界面.
@ -121,10 +124,13 @@ public class ChartTypePane extends AbstractChartAttrPane{
} }
class ComboBoxPane extends UIComboBoxPane<Chart>{ class ComboBoxPane extends UIComboBoxPane<Chart>{
private Map<String, Map<String, FurtherBasicBeanPane<? extends Chart>>> allChartTypePane;
@Override @Override
protected List<FurtherBasicBeanPane<? extends Chart>> initPaneList() { protected List<FurtherBasicBeanPane<? extends Chart>> initPaneList() {
List<FurtherBasicBeanPane<? extends Chart>> paneList = new ArrayList<FurtherBasicBeanPane<? extends Chart>>(); List<FurtherBasicBeanPane<? extends Chart>> paneList = new ArrayList<FurtherBasicBeanPane<? extends Chart>>();
ChartTypeInterfaceManager.getInstance().addPlotTypePaneList(paneList); allChartTypePane = new LinkedHashMap<String, Map<String, FurtherBasicBeanPane<? extends Chart>>>();
ChartTypeInterfaceManager.getInstance().addPlotTypePaneList(paneList, allChartTypePane);
return paneList; return paneList;
} }
@ -198,7 +204,33 @@ public class ChartTypePane extends AbstractChartAttrPane{
}); });
} }
public void relayout(ChartCollection collection){ private void addAllCards() {
Iterator<String> iterator = allChartTypePane.keySet().iterator();
while (iterator.hasNext()) {
addOnePriorityCards(iterator.next());
}
}
private void addOnePriorityCards(String priority) {
Map<String, FurtherBasicBeanPane<? extends Chart>> map = allChartTypePane.get(priority);
Iterator<Map.Entry<String, FurtherBasicBeanPane<? extends Chart>>> iterator = map.entrySet().iterator();
while (iterator.hasNext()) {
cards.add(iterator.next().getValue());
}
}
private void addOnePlotIDCards(String priority, String plotID) {
cards.add(allChartTypePane.get(priority).get(plotID));
}
//因为饼图(新特性)把(新特性)去掉了,和老的饼图同名,下拉框选项和typePane不能一一对应了
//处理办法:这边除了重构 下拉项选项和cardNames 还需要把cards重构下(不需要init pane,只需要我需要的拿出来就好了)
private void relayout(ChartCollection collection){
//重构需要重构下拉框选项和cardNames //重构需要重构下拉框选项和cardNames
Chart chart = collection.getSelectedChart(); Chart chart = collection.getSelectedChart();
String priority = chart.getPriority(); String priority = chart.getPriority();
@ -210,12 +242,12 @@ public class ChartTypePane extends AbstractChartAttrPane{
cards.clear(); cards.clear();
if (enabledChart) { if (enabledChart) {
if (collection.getState() == SwitchState.DEFAULT) { if (collection.getState() == SwitchState.DEFAULT) {
ChartTypeInterfaceManager.getInstance().addPlotTypePaneList(cards); addAllCards();
} else { } else {
ChartTypeInterfaceManager.getInstance().addPlotTypePaneList(priority, cards); addOnePriorityCards(priority);
} }
} else { } else {
ChartTypeInterfaceManager.getInstance().addPlotTypePaneList(cards, priority, plotID); addOnePlotIDCards(priority, plotID);
} }
//下拉框重构开始。为了防止重构是触发update //下拉框重构开始。为了防止重构是触发update

Loading…
Cancel
Save