Qinghui.Liu
4 years ago
4 changed files with 222 additions and 5 deletions
@ -1,12 +1,102 @@
|
||||
package com.fr.van.chart.box; |
||||
|
||||
import com.fr.chart.chartattr.Plot; |
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.design.layout.TableLayout; |
||||
import com.fr.design.layout.TableLayoutHelper; |
||||
import com.fr.design.mainframe.chart.gui.ChartStylePane; |
||||
import com.fr.van.chart.column.VanChartColumnSeriesPane; |
||||
import com.fr.plugin.chart.box.VanChartBoxPlot; |
||||
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
||||
import com.fr.van.chart.designer.component.VanChartBeautyPane; |
||||
import com.fr.van.chart.designer.component.VanChartMarkerPane; |
||||
import com.fr.van.chart.designer.component.border.VanChartBorderPane; |
||||
import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane; |
||||
|
||||
public class VanChartBoxSeriesPane extends VanChartColumnSeriesPane { |
||||
import javax.swing.JPanel; |
||||
import java.awt.BorderLayout; |
||||
import java.awt.Component; |
||||
|
||||
public class VanChartBoxSeriesPane extends VanChartAbstractPlotSeriesPane { |
||||
|
||||
private VanChartMarkerPane normalValuePane; |
||||
private VanChartMarkerPane outlierValuePane; |
||||
|
||||
public VanChartBoxSeriesPane(ChartStylePane parent, Plot plot) { |
||||
super(parent, plot); |
||||
} |
||||
|
||||
protected JPanel getContentInPlotType() { |
||||
double p = TableLayout.PREFERRED; |
||||
double f = TableLayout.FILL; |
||||
|
||||
double[] columnSize = {f}; |
||||
double[] rowSize = {p, p, p}; |
||||
|
||||
Component[][] components = new Component[][]{ |
||||
new Component[]{createBorderPane()}, |
||||
new Component[]{createNormalValuePane()}, |
||||
new Component[]{createOutlierValuePane()} |
||||
}; |
||||
|
||||
contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
||||
|
||||
return contentPane; |
||||
} |
||||
|
||||
protected VanChartBorderPane createDiffBorderPane() { |
||||
return new VanChartBorderPane(); |
||||
} |
||||
|
||||
private JPanel createNormalValuePane() { |
||||
normalValuePane = new VanChartMarkerPane(); |
||||
|
||||
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Engine_Chart_Normal_Value"), normalValuePane); |
||||
} |
||||
|
||||
private JPanel createOutlierValuePane() { |
||||
outlierValuePane = new VanChartMarkerPane(); |
||||
|
||||
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Engine_Chart_Outlier_Value"), outlierValuePane); |
||||
} |
||||
|
||||
private void checkMarkerPane(boolean isDetailed) { |
||||
normalValuePane.setVisible(isDetailed); |
||||
outlierValuePane.setVisible(isDetailed); |
||||
} |
||||
|
||||
protected void setColorPaneContent(JPanel panel) { |
||||
panel.add(createAlphaPane(), BorderLayout.SOUTH); |
||||
} |
||||
|
||||
protected VanChartBeautyPane createStylePane() { |
||||
return null; |
||||
} |
||||
|
||||
public void populateBean(Plot plot) { |
||||
if (plot == null) { |
||||
return; |
||||
} |
||||
|
||||
super.populateBean(plot); |
||||
|
||||
if (plot instanceof VanChartBoxPlot) { |
||||
normalValuePane.populate(((VanChartBoxPlot) plot).getNormalValue()); |
||||
outlierValuePane.populate(((VanChartBoxPlot) plot).getOutlierValue()); |
||||
|
||||
checkMarkerPane(((VanChartBoxPlot) plot).isDetailed()); |
||||
} |
||||
} |
||||
|
||||
public void updateBean(Plot plot) { |
||||
if (plot == null) { |
||||
return; |
||||
} |
||||
|
||||
if (plot instanceof VanChartBoxPlot) { |
||||
((VanChartBoxPlot) plot).setNormalValue(normalValuePane.update()); |
||||
((VanChartBoxPlot) plot).setOutlierValue(outlierValuePane.update()); |
||||
} |
||||
|
||||
super.updateBean(plot); |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue