|
|
|
@ -1,8 +1,5 @@
|
|
|
|
|
package com.fr.van.chart.designer.style.series; |
|
|
|
|
|
|
|
|
|
import com.fr.base.chart.chartdata.model.DataProcessor; |
|
|
|
|
import com.fr.base.chart.chartdata.model.LargeDataModel; |
|
|
|
|
import com.fr.base.chart.chartdata.model.NormalDataModel; |
|
|
|
|
import com.fr.chart.base.AttrAlpha; |
|
|
|
|
import com.fr.chart.base.AttrBorder; |
|
|
|
|
import com.fr.chart.base.ChartConstants; |
|
|
|
@ -10,11 +7,9 @@ import com.fr.chart.chartattr.Plot;
|
|
|
|
|
import com.fr.chart.chartglyph.ConditionAttr; |
|
|
|
|
import com.fr.chart.chartglyph.ConditionCollection; |
|
|
|
|
import com.fr.design.gui.frpane.UINumberDragPane; |
|
|
|
|
import com.fr.design.gui.ibutton.UIButtonGroup; |
|
|
|
|
import com.fr.design.mainframe.chart.gui.ChartStylePane; |
|
|
|
|
import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane; |
|
|
|
|
import com.fr.design.mainframe.chart.gui.style.series.AbstractPlotSeriesPane; |
|
|
|
|
|
|
|
|
|
import com.fr.plugin.chart.VanChartAttrHelper; |
|
|
|
|
import com.fr.plugin.chart.attr.plot.VanChartPlot; |
|
|
|
|
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; |
|
|
|
@ -28,6 +23,7 @@ import com.fr.plugin.chart.base.VanChartAttrTrendLine;
|
|
|
|
|
import com.fr.plugin.chart.map.line.condition.AttrLineEffect; |
|
|
|
|
import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel; |
|
|
|
|
import com.fr.van.chart.custom.style.VanChartCustomStylePane; |
|
|
|
|
import com.fr.van.chart.designer.PlotFactory; |
|
|
|
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
|
|
|
|
import com.fr.van.chart.designer.component.VanChartAreaSeriesFillColorPane; |
|
|
|
|
import com.fr.van.chart.designer.component.VanChartBeautyPane; |
|
|
|
@ -41,8 +37,6 @@ import com.fr.van.chart.pie.RadiusCardLayoutPane;
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.JScrollPane; |
|
|
|
|
import javax.swing.event.ChangeEvent; |
|
|
|
|
import javax.swing.event.ChangeListener; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -73,8 +67,6 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
|
|
|
|
|
private RadiusCardLayoutPane radiusPane;//半径设置界面
|
|
|
|
|
private JPanel radiusPaneWithTitle; |
|
|
|
|
|
|
|
|
|
private UIButtonGroup<DataProcessor> largeDataModelGroup;//大数据模式
|
|
|
|
|
|
|
|
|
|
protected JPanel contentPane; |
|
|
|
|
|
|
|
|
|
public VanChartAbstractPlotSeriesPane(ChartStylePane parent, Plot plot) { |
|
|
|
@ -168,50 +160,21 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
|
|
|
|
|
return ((VanChartPlot) plot).isInCustom() ? null : radiusPaneWithTitle; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected JPanel createLargeDataModelPane() { |
|
|
|
|
largeDataModelGroup = createLargeDataModelGroup(); |
|
|
|
|
largeDataModelGroup.addChangeListener(new ChangeListener() { |
|
|
|
|
@Override |
|
|
|
|
public void stateChanged(ChangeEvent e) { |
|
|
|
|
checkLarge(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Large_Model"), largeDataModelGroup); |
|
|
|
|
return createLargeDataModelPane(panel); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void checkLarge() { |
|
|
|
|
if(largeModel()) { |
|
|
|
|
AttrLabel attrLabel = ((VanChartPlot) plot).getAttrLabelFromConditionCollection(); |
|
|
|
|
if (attrLabel == null) { |
|
|
|
|
attrLabel = ((VanChartPlot) this.plot).getDefaultAttrLabel(); |
|
|
|
|
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr(); |
|
|
|
|
defaultAttr.addDataSeriesCondition(attrLabel); |
|
|
|
|
} |
|
|
|
|
attrLabel.setEnable(false); |
|
|
|
|
|
|
|
|
|
resetCustomCondition(plot.getConditionCollection()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
checkCompsEnabledWithLarge(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void checkCompsEnabledWithLarge() { |
|
|
|
|
if(markerPane != null && largeDataModelGroup != null){ |
|
|
|
|
markerPane.checkLargePlot(largeModel()); |
|
|
|
|
protected void checkCompsEnabledWithLarge(Plot plot) { |
|
|
|
|
if (markerPane != null) { |
|
|
|
|
markerPane.checkLargePlot(largeModel(plot)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void checkLinePane() { |
|
|
|
|
if(lineTypePane != null && largeDataModelGroup != null){ |
|
|
|
|
lineTypePane.checkLarge(largeModel()); |
|
|
|
|
if (lineTypePane != null) { |
|
|
|
|
lineTypePane.checkLarge(largeModel(plot)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected boolean largeModel() { |
|
|
|
|
return largeDataModelGroup != null && largeDataModelGroup.getSelectedIndex() == 0; |
|
|
|
|
protected boolean largeModel(Plot plot) { |
|
|
|
|
return PlotFactory.largeDataModel(plot); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void resetCustomCondition(ConditionCollection conditionCollection) { |
|
|
|
@ -229,17 +192,6 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected JPanel createLargeDataModelPane(JPanel jPanel) { |
|
|
|
|
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Large_Data"), jPanel); |
|
|
|
|
return panel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected UIButtonGroup<DataProcessor> createLargeDataModelGroup() { |
|
|
|
|
String[] strings = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}; |
|
|
|
|
DataProcessor[] values = new DataProcessor[]{new LargeDataModel(), new NormalDataModel()}; |
|
|
|
|
return new UIButtonGroup<DataProcessor>(strings, values); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected RadiusCardLayoutPane initRadiusPane() { |
|
|
|
|
return new RadiusCardLayoutPane(); |
|
|
|
|
} |
|
|
|
@ -284,10 +236,6 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
|
|
|
|
|
stylePane.populateBean(plot.getPlotStyle()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(largeDataModelGroup != null){ |
|
|
|
|
largeDataModelGroup.setSelectedItem(plot.getDataProcessor()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (stackAndAxisEditPane != null && plot instanceof VanChartRectanglePlot) {//堆积和坐标轴
|
|
|
|
|
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; |
|
|
|
|
if (rectanglePlot.isCustomChart()) { |
|
|
|
@ -306,11 +254,12 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
|
|
|
|
|
|
|
|
|
|
checkAreaSeriesFillColorPane(plot.getPlotStyle()); |
|
|
|
|
|
|
|
|
|
checkCompsEnabledWithLarge(); |
|
|
|
|
checkCompsEnabledWithLarge(plot); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* radius界面是否显示 |
|
|
|
|
* |
|
|
|
|
* @param plot |
|
|
|
|
*/ |
|
|
|
|
private void checkRadiusPane(Plot plot) { |
|
|
|
@ -339,10 +288,6 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
|
|
|
|
|
plot.setPlotStyle(stylePane.updateBean()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(largeDataModelGroup != null){ |
|
|
|
|
plot.setDataProcessor(largeDataModelGroup.getSelectedItem()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (stackAndAxisEditPane != null && plot instanceof VanChartRectanglePlot) {//堆积和坐标轴
|
|
|
|
|
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; |
|
|
|
|
if (rectanglePlot.isCustomChart()) { |
|
|
|
@ -373,23 +318,23 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
|
|
|
|
|
|
|
|
|
|
protected void populateCondition(ConditionAttr defaultAttr) { |
|
|
|
|
if (trendLinePane != null) {//趋势线
|
|
|
|
|
VanChartAttrTrendLine attrTrendLine =(VanChartAttrTrendLine)defaultAttr.getExisted(VanChartAttrTrendLine.class); |
|
|
|
|
VanChartAttrTrendLine attrTrendLine = defaultAttr.getExisted(VanChartAttrTrendLine.class); |
|
|
|
|
trendLinePane.populate(attrTrendLine); |
|
|
|
|
} |
|
|
|
|
if (lineTypePane != null) {//线-线型、控制断开等
|
|
|
|
|
VanChartAttrLine attrLine = (VanChartAttrLine)defaultAttr.getExisted(VanChartAttrLine.class); |
|
|
|
|
VanChartAttrLine attrLine = defaultAttr.getExisted(VanChartAttrLine.class); |
|
|
|
|
lineTypePane.populate(attrLine); |
|
|
|
|
} |
|
|
|
|
if (markerPane != null) {//标记点
|
|
|
|
|
VanChartAttrMarker attrMarker = (VanChartAttrMarker)defaultAttr.getExisted(VanChartAttrMarker.class); |
|
|
|
|
VanChartAttrMarker attrMarker = defaultAttr.getExisted(VanChartAttrMarker.class); |
|
|
|
|
markerPane.populate(attrMarker); |
|
|
|
|
} |
|
|
|
|
if (areaSeriesFillColorPane != null) {//填充颜色
|
|
|
|
|
AttrAreaSeriesFillColorBackground seriesFillColorBackground = (AttrAreaSeriesFillColorBackground)defaultAttr.getExisted(AttrAreaSeriesFillColorBackground.class); |
|
|
|
|
AttrAreaSeriesFillColorBackground seriesFillColorBackground = defaultAttr.getExisted(AttrAreaSeriesFillColorBackground.class); |
|
|
|
|
areaSeriesFillColorPane.populate(seriesFillColorBackground); |
|
|
|
|
} |
|
|
|
|
if (borderPane != null) {//边框
|
|
|
|
|
AttrBorder attrBorder = (AttrBorder)defaultAttr.getExisted(AttrBorder.class); |
|
|
|
|
AttrBorder attrBorder = defaultAttr.getExisted(AttrBorder.class); |
|
|
|
|
if (attrBorder != null) { |
|
|
|
|
borderPane.populate(attrBorder); |
|
|
|
|
} |
|
|
|
@ -399,7 +344,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
|
|
|
|
|
|
|
|
|
|
protected void populateAlpha(ConditionAttr defaultAttr) { |
|
|
|
|
if (transparent != null) {//不透明度
|
|
|
|
|
AttrAlpha attrAlpha = (AttrAlpha)defaultAttr.getExisted(AttrAlpha.class); |
|
|
|
|
AttrAlpha attrAlpha = defaultAttr.getExisted(AttrAlpha.class); |
|
|
|
|
if (attrAlpha != null) { |
|
|
|
|
transparent.populateBean(attrAlpha.getAlpha() * VanChartAttrHelper.PERCENT); |
|
|
|
|
} else { |
|
|
|
@ -412,18 +357,18 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
|
|
|
|
|
protected void updateCondition(ConditionAttr defaultAttr) { |
|
|
|
|
if (trendLinePane != null) { |
|
|
|
|
VanChartAttrTrendLine newTrendLine = trendLinePane.update(); |
|
|
|
|
VanChartAttrTrendLine attrTrendLine =(VanChartAttrTrendLine)defaultAttr.getExisted(VanChartAttrTrendLine.class); |
|
|
|
|
VanChartAttrTrendLine attrTrendLine = defaultAttr.getExisted(VanChartAttrTrendLine.class); |
|
|
|
|
defaultAttr.remove(attrTrendLine); |
|
|
|
|
defaultAttr.addDataSeriesCondition(newTrendLine); |
|
|
|
|
} |
|
|
|
|
if (lineTypePane != null) { |
|
|
|
|
VanChartAttrLine attrLine = (VanChartAttrLine)defaultAttr.getExisted(VanChartAttrLine.class); |
|
|
|
|
VanChartAttrLine attrLine = defaultAttr.getExisted(VanChartAttrLine.class); |
|
|
|
|
defaultAttr.remove(attrLine); |
|
|
|
|
defaultAttr.addDataSeriesCondition(lineTypePane.update()); |
|
|
|
|
} |
|
|
|
|
if (markerPane != null) { |
|
|
|
|
VanChartAttrMarker newMarker = markerPane.update(); |
|
|
|
|
VanChartAttrMarker attrMarker = (VanChartAttrMarker)defaultAttr.getExisted(VanChartAttrMarker.class); |
|
|
|
|
VanChartAttrMarker attrMarker = defaultAttr.getExisted(VanChartAttrMarker.class); |
|
|
|
|
defaultAttr.remove(attrMarker); |
|
|
|
|
defaultAttr.addDataSeriesCondition(newMarker); |
|
|
|
|
} |
|
|
|
@ -436,7 +381,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
|
|
|
|
|
defaultAttr.addDataSeriesCondition(newFillColorBackground); |
|
|
|
|
} |
|
|
|
|
if (borderPane != null) { |
|
|
|
|
AttrBorder attrBorder = (AttrBorder)defaultAttr.getExisted(AttrBorder.class); |
|
|
|
|
AttrBorder attrBorder = defaultAttr.getExisted(AttrBorder.class); |
|
|
|
|
if (attrBorder == null) { |
|
|
|
|
attrBorder = new AttrBorder(); |
|
|
|
|
defaultAttr.addDataSeriesCondition(attrBorder); |
|
|
|
@ -448,7 +393,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
|
|
|
|
|
|
|
|
|
|
protected void updateAlpha(ConditionAttr defaultAttr) { |
|
|
|
|
if (transparent != null) { |
|
|
|
|
AttrAlpha attrAlpha = (AttrAlpha)defaultAttr.getExisted(AttrAlpha.class); |
|
|
|
|
AttrAlpha attrAlpha = defaultAttr.getExisted(AttrAlpha.class); |
|
|
|
|
if (attrAlpha == null) { |
|
|
|
|
attrAlpha = new AttrAlpha(); |
|
|
|
|
defaultAttr.addDataSeriesCondition(attrAlpha); |
|
|
|
|