Browse Source

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

feature/big-screen
白岳 4 years ago
parent
commit
1e415b0fc9
  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. 12
      designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.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);

12
designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java

@ -21,7 +21,6 @@ import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.type.GaugeStyle;
import com.fr.stable.Constants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartBeautyPane;
import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane;
import javax.swing.JPanel;
@ -72,6 +71,12 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane {
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}
//获取颜色面板
protected JPanel getColorPane() {
JPanel panel = new JPanel(new BorderLayout());
return panel;
}
private JPanel createGaugeLayoutPane() {
gaugeLayout = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical")});
@ -306,9 +311,4 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane {
colorPickerPane.updateBean(detailStyle.getHotAreaColor());
}
}
@Override
protected VanChartBeautyPane createStylePane() {
return null;
}
}

Loading…
Cancel
Save