Browse Source

Merge pull request #15 in DESIGN/design from ~ZHENG/c-design:feature/10.0 to feature/10.0

* commit 'cc8470f8810e88605121b5cf4ad2876f1fe4c316':
  update
  disable add button not whole button pan
  整理一波assets/map assist/phantomjs
  CHART-2109
master
superman 7 years ago
parent
commit
81500c1755
  1. 68
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  2. 1
      designer_chart/src/com/fr/design/chartinterface/ColumnIndependentChartInterface.java
  3. 1
      designer_chart/src/com/fr/design/chartinterface/CustomIndependentChartInterface.java
  4. 1
      designer_chart/src/com/fr/design/chartinterface/DonutIndependentChartInterface.java
  5. 1
      designer_chart/src/com/fr/design/chartinterface/FunnelIndependentChartInterface.java
  6. 1
      designer_chart/src/com/fr/design/chartinterface/GanttIndependentChartInterface.java
  7. 1
      designer_chart/src/com/fr/design/chartinterface/GisMapIndependentChartInterface.java
  8. 1
      designer_chart/src/com/fr/design/chartinterface/LineIndependentChartInterface.java
  9. 1
      designer_chart/src/com/fr/design/chartinterface/MapIndependentChartInterface.java
  10. 1
      designer_chart/src/com/fr/design/chartinterface/MeterIndependentChartInterface.java
  11. 1
      designer_chart/src/com/fr/design/chartinterface/PieIndependentChartInterface.java
  12. 1
      designer_chart/src/com/fr/design/chartinterface/RadarIndependentChartInterface.java
  13. 1
      designer_chart/src/com/fr/design/chartinterface/RangeIndependentChartInterface.java
  14. 1
      designer_chart/src/com/fr/design/chartinterface/StockIndependentChartInterface.java
  15. 1
      designer_chart/src/com/fr/design/chartinterface/XYScatterIndependentChartInterface.java
  16. 16
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  17. 23
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  18. 2
      designer_chart/src/com/fr/extended/chart/ExtendedOtherPane.java
  19. 7
      designer_chart/src/com/fr/van/chart/DownloadOnlineSourcesHelper.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;
public String[] getTitle4PopupWindow() {
List<Integer> priorityList = getPriorityInOrder();
List<String> result = new ArrayList<String>();
for (Integer priority : priorityList) {
addTitles(String.valueOf(priority), result);
}
return new String[0];
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>();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

16
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java

@ -5,6 +5,7 @@ import com.fr.chart.base.AttrChangeConfig;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.SwitchState;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.dialog.UIDialog;
@ -21,8 +22,17 @@ import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.BorderFactory;
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.ActionListener;
import java.awt.event.FocusEvent;
@ -302,7 +312,7 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
}
private void checkConfigButtonVisible() {
addButton.setVisible(true);
addButton.setVisible(ChartTypeManager.enabledChart(editingCollection.getSelectedChart().getPlot().getPlotID()));
//新建一个collection
if(editingCollection.getState() == SwitchState.DEFAULT && editingCollection.getSelectedChart() != null){
//Chart 不支持图表切换

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);
//重新选中

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

@ -105,7 +105,7 @@ public class ExtendedOtherPane extends AbstractChartAttrPane {
panel.add(refreshEnabled, BorderLayout.NORTH);
panel.add(contentPane, BorderLayout.CENTER);
JPanel gapPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("FR-Designer_Auto_Refresh"), panel);
JPanel gapPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("FR-Design-Chart_Auto_Refresh"), panel);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Chart-Use_Refresh"), gapPane);
}

7
designer_chart/src/com/fr/van/chart/DownloadOnlineSourcesHelper.java

@ -1,6 +1,7 @@
package com.fr.van.chart;
import com.fr.base.FRContext;
import com.fr.chart.base.ChartConstants;
import com.fr.design.RestartHelper;
import com.fr.design.extra.PluginConstants;
import com.fr.design.gui.ilable.UILabel;
@ -59,17 +60,17 @@ public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent {
private static final double PHANTOM_MB = 96.1 * 1024 * 1024;
public void addPhantomSiteInfo() {
this.addSiteInfo("plugin.phantomjs", "/assist/phantomjs", PHANTOM_MB);
this.addSiteInfo("plugin.phantomjs", ChartConstants.PHANTOMJS_URL, PHANTOM_MB);
}
private static final double MAP_JSON_MB = 3.8 * 1024 * 1024;
public void addMapJSONSiteInfo() {
this.addSiteInfo("map.json", "/assets/map", MAP_JSON_MB);
this.addSiteInfo("map.json", ChartConstants.MAP_JSON_URL, MAP_JSON_MB);
}
public void addSiteInfo(String siteKind, String localDir, double megaBits) {
if (new File(FRContext.getCurrentEnv().getPath() + localDir).exists()) {
if (new File(StableUtils.pathJoin(FRContext.getCurrentEnv().getPath(), localDir)).exists()) {
//本地有这个资源,不下载
return;
}

Loading…
Cancel
Save