Browse Source

CHART-19719 图例交互修改 && CHART-19692 仪表盘固定大小最小值修改

feature/10.0
白岳 3 years ago
parent
commit
47aca6fa35
  1. 6
      designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java
  2. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/HeatMapRangeLegendPane.java
  3. 36
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java
  4. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java
  5. 21
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanLegendPaneWidthOutFixedCheck.java
  6. 21
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanLegendPaneWidthOutHighlight.java
  7. 16
      designer-chart/src/main/java/com/fr/van/chart/pie/RadiusCardLayoutPane.java

6
designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java

@ -34,7 +34,7 @@ import com.fr.van.chart.designer.style.MapRangeLegendPane;
import com.fr.van.chart.designer.style.VanChartPlotLegendPane; import com.fr.van.chart.designer.style.VanChartPlotLegendPane;
import com.fr.van.chart.designer.style.VanChartRangeLegendPane; import com.fr.van.chart.designer.style.VanChartRangeLegendPane;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.designer.style.VanLegendPaneWidthOutHighlight; import com.fr.van.chart.designer.style.VanLegendPaneWidthOutFixedCheck;
import com.fr.van.chart.designer.style.label.VanChartGaugePlotLabelPane; import com.fr.van.chart.designer.style.label.VanChartGaugePlotLabelPane;
import com.fr.van.chart.designer.style.label.VanChartPiePlotLabelPane; import com.fr.van.chart.designer.style.label.VanChartPiePlotLabelPane;
import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane; import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane;
@ -128,8 +128,8 @@ public class PlotFactory {
private static Map<Class<? extends Plot>, Class<? extends VanChartPlotLegendPane>> legendMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartPlotLegendPane>>(); private static Map<Class<? extends Plot>, Class<? extends VanChartPlotLegendPane>> legendMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartPlotLegendPane>>();
static { static {
legendMap.put(VanChartGaugePlot.class, VanLegendPaneWidthOutHighlight.class); legendMap.put(VanChartGaugePlot.class, VanLegendPaneWidthOutFixedCheck.class);
legendMap.put(VanChartMultiPiePlot.class, VanLegendPaneWidthOutHighlight.class); legendMap.put(VanChartMultiPiePlot.class, VanLegendPaneWidthOutFixedCheck.class);
legendMap.put(VanChartScatterPlot.class, VanChartRangeLegendPane.class); legendMap.put(VanChartScatterPlot.class, VanChartRangeLegendPane.class);
legendMap.put(VanChartBubblePlot.class, VanChartRangeLegendPane.class); legendMap.put(VanChartBubblePlot.class, VanChartRangeLegendPane.class);
legendMap.put(VanChartMapPlot.class, MapRangeLegendPane.class); legendMap.put(VanChartMapPlot.class, MapRangeLegendPane.class);

2
designer-chart/src/main/java/com/fr/van/chart/designer/style/HeatMapRangeLegendPane.java

@ -17,6 +17,6 @@ public class HeatMapRangeLegendPane extends MapRangeLegendPane {
} }
protected JPanel createCommonLegendPane(){ protected JPanel createCommonLegendPane(){
return this.createLegendPaneWithoutHighlight(); return this.createLegendPaneWithoutFixedCheck();
} }
} }

36
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java

@ -72,9 +72,9 @@ public class VanChartPlotLegendPane extends BasicPane {
//private LimitPane limitPane; //private LimitPane limitPane;
//高亮显示的按钮 //高亮显示的按钮
private UILabel highlightLabel; private UILabel fixedCheckLabel;
private UIButtonGroup<Boolean> highlightButton; private UICheckBox fixedCheck;
private JPanel highlightPane; private JPanel fixedCheckPane;
private VanChartStylePane parent; private VanChartStylePane parent;
@ -91,8 +91,8 @@ public class VanChartPlotLegendPane extends BasicPane {
this.plot = plot; this.plot = plot;
} }
public JPanel getHighlightPane() { public JPanel getFixedCheckPane() {
return highlightPane; return fixedCheckPane;
} }
public VanChartStylePane getLegendPaneParent() { public VanChartStylePane getLegendPaneParent() {
@ -135,7 +135,7 @@ public class VanChartPlotLegendPane extends BasicPane {
}); });
} }
protected JPanel createLegendPaneWithoutHighlight() { protected JPanel createLegendPaneWithoutFixedCheck() {
borderPane = new VanChartBorderWithRadiusPane(); borderPane = new VanChartBorderWithRadiusPane();
backgroundPane = creatBackgroundPane(); backgroundPane = creatBackgroundPane();
@ -162,11 +162,11 @@ public class VanChartPlotLegendPane extends BasicPane {
protected JPanel createLegendPane() { protected JPanel createLegendPane() {
borderPane = new VanChartBorderWithRadiusPane(); borderPane = new VanChartBorderWithRadiusPane();
backgroundPane = creatBackgroundPane(); backgroundPane = creatBackgroundPane();
highlightPane = createHighlightPane(); fixedCheckPane = createFixedCheckPane();
JPanel panel = new JPanel(); JPanel panel = new JPanel();
panel.setLayout(new BorderLayout()); panel.setLayout(new BorderLayout());
panel.add(createDisplayStrategy(), BorderLayout.CENTER); panel.add(createDisplayStrategy(), BorderLayout.CENTER);
panel.add(highlightPane, BorderLayout.SOUTH); panel.add(fixedCheckPane, BorderLayout.SOUTH);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
@ -319,9 +319,9 @@ public class VanChartPlotLegendPane extends BasicPane {
// return limitPane; // return limitPane;
} }
private JPanel createHighlightPane() { private JPanel createFixedCheckPane() {
highlightButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_On"), Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false}); fixedCheck = new UICheckBox(Toolkit.i18nText("Fine-Engine_Chart_Open_Fixed_Display"));
highlightLabel = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Highlight")); fixedCheckLabel = new UILabel(Toolkit.i18nText("Fine-Engine_Chart_Fixed_Display"));
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
@ -329,7 +329,7 @@ public class VanChartPlotLegendPane extends BasicPane {
double[] rowSize = {p, p}; double[] rowSize = {p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{highlightLabel, highlightButton} new Component[]{fixedCheckLabel, fixedCheck}
}; };
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
} }
@ -408,8 +408,8 @@ public class VanChartPlotLegendPane extends BasicPane {
//legend.setLimitAttribute(limitPane.updateBean()); //legend.setLimitAttribute(limitPane.updateBean());
legend.setFloatPercentX(customFloatPositionPane.getFloatPosition_x()); legend.setFloatPercentX(customFloatPositionPane.getFloatPosition_x());
legend.setFloatPercentY(customFloatPositionPane.getFloatPosition_y()); legend.setFloatPercentY(customFloatPositionPane.getFloatPosition_y());
if (highlightButton != null && highlightButton.getSelectedItem() != null) { if (fixedCheck != null) {
legend.setHighlight(highlightButton.getSelectedItem()); legend.setHighlight(fixedCheck.isSelected());
} }
} }
@ -431,11 +431,11 @@ public class VanChartPlotLegendPane extends BasicPane {
maxProportion.populateBean(legend.getMaxHeight()); maxProportion.populateBean(legend.getMaxHeight());
//区域显示策略 恢复用注释。取消注释。 //区域显示策略 恢复用注释。取消注释。
//limitPane.populateBean(legend.getLimitAttribute()); //limitPane.populateBean(legend.getLimitAttribute());
if (highlightButton != null) { if (fixedCheck != null) {
highlightButton.setSelectedItem(legend.isHighlight()); fixedCheck.setSelected(legend.isHighlight());
boolean largeDataModel = PlotFactory.largeDataModel(plot); boolean largeDataModel = PlotFactory.largeDataModel(plot);
highlightButton.setEnabled(!largeDataModel); fixedCheck.setEnabled(!largeDataModel);
highlightLabel.setEnabled(!largeDataModel); fixedCheckLabel.setEnabled(!largeDataModel);
} }
} }

2
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java

@ -114,7 +114,7 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane {
} }
private void checkHighlightVisible() { private void checkHighlightVisible() {
JPanel highlightPane = this.getHighlightPane(); JPanel highlightPane = this.getFixedCheckPane();
if (highlightPane != null) { if (highlightPane != null) {
highlightPane.setVisible(legendType != LegendType.GRADUAL); highlightPane.setVisible(legendType != LegendType.GRADUAL);

21
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanLegendPaneWidthOutFixedCheck.java

@ -0,0 +1,21 @@
package com.fr.van.chart.designer.style;
import javax.swing.JPanel;
/**
* Created by eason on 2016/12/14.
*/
public class VanLegendPaneWidthOutFixedCheck extends VanChartPlotLegendPane{
public VanLegendPaneWidthOutFixedCheck(){
}
public VanLegendPaneWidthOutFixedCheck(VanChartStylePane parent){
super(parent);
}
protected JPanel createLegendPane(){
return this.createLegendPaneWithoutFixedCheck();
}
}

21
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanLegendPaneWidthOutHighlight.java

@ -1,21 +0,0 @@
package com.fr.van.chart.designer.style;
import javax.swing.JPanel;
/**
* Created by eason on 2016/12/14.
*/
public class VanLegendPaneWidthOutHighlight extends VanChartPlotLegendPane{
public VanLegendPaneWidthOutHighlight(){
}
public VanLegendPaneWidthOutHighlight(VanChartStylePane parent){
super(parent);
}
protected JPanel createLegendPane(){
return this.createLegendPaneWithoutHighlight();
}
}

16
designer-chart/src/main/java/com/fr/van/chart/pie/RadiusCardLayoutPane.java

@ -42,7 +42,7 @@ public class RadiusCardLayoutPane extends BasicBeanPane<Plot> {
Map<String, Component> paneList = new HashMap<String, Component>(); Map<String, Component> paneList = new HashMap<String, Component>();
radiusType = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"), Toolkit.i18nText("Fine-Design_Chart_Fixed")}); radiusType = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"), Toolkit.i18nText("Fine-Design_Chart_Fixed")});
radius = new UISpinnerWithPx(100); radius = new UISpinnerWithPx(1, Double.MAX_VALUE, 1, 100);
radiusContent = new JPanel(new BorderLayout()); radiusContent = new JPanel(new BorderLayout());
radiusContent.add(radius, BorderLayout.CENTER); radiusContent.add(radius, BorderLayout.CENTER);
@ -55,12 +55,12 @@ public class RadiusCardLayoutPane extends BasicBeanPane<Plot> {
radiusType.setSelectedIndex(0); radiusType.setSelectedIndex(0);
cardPane = new VanChartCardLayoutPane(paneList, "auto"){ cardPane = new VanChartCardLayoutPane(paneList, "auto") {
@Override @Override
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
if (radiusType.getSelectedIndex() == 1) { if (radiusType.getSelectedIndex() == 1) {
return radiusContent.getPreferredSize(); return radiusContent.getPreferredSize();
}else { } else {
return new Dimension(0, 0); return new Dimension(0, 0);
} }
} }
@ -69,15 +69,15 @@ public class RadiusCardLayoutPane extends BasicBeanPane<Plot> {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {p, f}; double[] columnSize = {p, f};
double[] rowSize = {p,p}; double[] rowSize = {p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{radiusType,null}, new Component[]{radiusType, null},
new Component[]{cardPane, null}, new Component[]{cardPane, null},
}; };
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout(0,0)); this.setLayout(new BorderLayout(0, 0));
this.add(panel, BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);
@ -90,7 +90,7 @@ public class RadiusCardLayoutPane extends BasicBeanPane<Plot> {
@Override @Override
public void populateBean(Plot plot) { public void populateBean(Plot plot) {
if (plot instanceof VanChartRadiusPlot){ if (plot instanceof VanChartRadiusPlot) {
VanChartRadiusPlot radiusPlot = (VanChartRadiusPlot) plot; VanChartRadiusPlot radiusPlot = (VanChartRadiusPlot) plot;
VanChartRadius vanChartRadius = radiusPlot.getRadius(); VanChartRadius vanChartRadius = radiusPlot.getRadius();
radiusType.setSelectedIndex(vanChartRadius.getRadiusType() == RadiusType.AUTO ? 0 : 1); radiusType.setSelectedIndex(vanChartRadius.getRadiusType() == RadiusType.AUTO ? 0 : 1);
@ -102,7 +102,7 @@ public class RadiusCardLayoutPane extends BasicBeanPane<Plot> {
public void updateBean(Plot plot) { public void updateBean(Plot plot) {
//更新半径 //更新半径
if (plot instanceof VanChartRadiusPlot){ if (plot instanceof VanChartRadiusPlot) {
VanChartRadiusPlot radiusPlot = (VanChartRadiusPlot) plot; VanChartRadiusPlot radiusPlot = (VanChartRadiusPlot) plot;
VanChartRadius vanChartRadius = radiusPlot.getRadius(); VanChartRadius vanChartRadius = radiusPlot.getRadius();
vanChartRadius.setRadiusType(radiusType.getSelectedIndex() == 0 ? RadiusType.AUTO : RadiusType.FIXED); vanChartRadius.setRadiusType(radiusType.getSelectedIndex() == 0 ? RadiusType.AUTO : RadiusType.FIXED);

Loading…
Cancel
Save