Browse Source

Pull request #2025: CHART-14999 && CHART-14811 && CHART-15010 新建图表去掉标题图例工具栏 && 自动推荐时间判断 && 组合地图面板调整

Merge in DESIGN/design from ~BJORN/design:release/10.0 to release/10.0

* commit '5340b0f3b53a0a9f0d13a5adc5f36fa798a1ed02':
  CHART-15010
  CHART-14999 && CHART-14811 && CHART-15010	 新建图表去掉标题图例工具栏 && 自动推荐时间判断 && 组合地图面板调整
feature/big-screen
Bjorn 4 years ago
parent
commit
ca74cc6914
  1. 10
      designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java
  2. 31
      designer-chart/src/main/java/com/fr/design/chart/auto/AutoTypeCalculate.java
  3. 1
      designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java

10
designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java

@ -23,6 +23,8 @@ import javax.swing.JSplitPane;
import javax.swing.ListCellRenderer;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.awt.Color;
import java.awt.Component;
@ -35,6 +37,8 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven
private JList iconViewList = null;
private DefaultListModel iconListModel = null;
private static Map<ChartProvider, ChartProvider> map = new ConcurrentHashMap();
public ChartTypePane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
DefaultListModel defaultListModel = new DefaultListModel();
@ -102,7 +106,11 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven
ChartTypePane.this.iconListModel.clear();
for (int i = 0, len = charts.length; i < len; i++) {
ChartProvider chart = charts[i];
ChartCollection chartCollection = new ChartCollection(chart);
if (map.get(chart) == null) {
ChartProvider chartProvider = chart.transformProperties();
map.put(chart, chartProvider);
}
ChartCollection chartCollection = new ChartCollection(map.get(chart));
ChartIcon chartIcon = new ChartIcon(chartCollection);
chartIcon.setChartName(subName[i]);
chartIcon.registerCallBackEvent(ChartTypePane.this);

31
designer-chart/src/main/java/com/fr/design/chart/auto/AutoTypeCalculate.java

@ -22,6 +22,8 @@ import com.fr.stable.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author Bjorn
@ -30,6 +32,15 @@ import java.util.List;
*/
public class AutoTypeCalculate {
public static Pattern[] dataPatterns;
static {
Pattern pattern1 = Pattern.compile("^(19|20)\\d{2}$");
Pattern pattern2 = Pattern.compile("^\\d{4}(0?[1-9]|1[012])$");
Pattern pattern3 = Pattern.compile("^\\d{4}(0?[1-9]|1[012])(0?[1-9]|[12]\\d|3[01])$");
dataPatterns = new Pattern[]{pattern1, pattern2, pattern3};
}
public static List<VanChart> calculateType(String tableName, List<String> columns) {
List<ColumnInfo> columnValue = calculateField(tableName, columns);
if (columnValue.isEmpty()) {
@ -86,8 +97,28 @@ public class AutoTypeCalculate {
return false;
}
}
//不是日期型数字才是指标
return !isNumberData(values);
}
private static boolean isNumberData(List<String> values) {
for (String value : values) {
if (!isNumberData(value)) {
return false;
}
}
return true;
}
private static boolean isNumberData(String value) {
for (Pattern pattern : dataPatterns) {
Matcher matcher = pattern.matcher(value);
if (matcher.matches()) {
return true;
}
}
return false;
}
private static List<ColumnInfo> calculateField(String tableName, List<String> columns) {
NameTableData nameTableData = new NameTableData(tableName);

1
designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java

@ -380,6 +380,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
} else {
panel = createMapCustomGroupPane(areaPane, pointPane, linePane);
}
panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
return panel;
}

Loading…
Cancel
Save