Browse Source
Merge in DESIGN/design from ~QINGHUI.LIU/design:release/10.0 to release/10.0 * commit 'dbcdf851828b67dfa580affe0622372db11539e0': 系列标记点界面 结果数据不支持数据筛选 系列和数据点提示界面feature/big-screen
Qinghui.Liu
4 years ago
8 changed files with 308 additions and 30 deletions
@ -1,12 +1,107 @@
|
||||
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 JPanel normalMarker; |
||||
private JPanel outlierMarker; |
||||
|
||||
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(); |
||||
normalMarker = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Engine_Chart_Normal_Value"), normalValuePane); |
||||
|
||||
return normalMarker; |
||||
} |
||||
|
||||
private JPanel createOutlierValuePane() { |
||||
outlierValuePane = new VanChartMarkerPane(); |
||||
outlierMarker = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Engine_Chart_Outlier_Value"), outlierValuePane); |
||||
|
||||
return outlierMarker; |
||||
} |
||||
|
||||
private void checkMarkerPane(boolean isDetailed) { |
||||
normalMarker.setVisible(isDetailed); |
||||
outlierMarker.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); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,59 @@
|
||||
package com.fr.van.chart.box.data.table; |
||||
|
||||
import com.fr.base.chart.chartdata.TopDefinitionProvider; |
||||
import com.fr.chart.chartattr.Chart; |
||||
import com.fr.chart.chartattr.ChartCollection; |
||||
import com.fr.chart.chartdata.NormalTableDataDefinition; |
||||
import com.fr.plugin.chart.box.data.VanBoxTableDefinition; |
||||
import com.fr.plugin.chart.box.data.VanBoxTableResultDefinition; |
||||
|
||||
public class BoxTableDefinitionHelper { |
||||
|
||||
public static VanBoxTableDefinition getBoxTableDefinition(ChartCollection collection) { |
||||
if (collection != null) { |
||||
|
||||
Chart chart = collection.getSelectedChart(); |
||||
|
||||
if (chart != null) { |
||||
TopDefinitionProvider definitionProvider = chart.getFilterDefinition(); |
||||
|
||||
if (definitionProvider instanceof VanBoxTableDefinition) { |
||||
return (VanBoxTableDefinition) definitionProvider; |
||||
} |
||||
} |
||||
} |
||||
|
||||
return null; |
||||
} |
||||
|
||||
public static VanBoxTableResultDefinition getBoxTableResultDefinition(ChartCollection collection) { |
||||
VanBoxTableDefinition table = getBoxTableDefinition(collection); |
||||
|
||||
if (table != null) { |
||||
return table.getResultDefinition(); |
||||
} |
||||
|
||||
return null; |
||||
} |
||||
|
||||
public static NormalTableDataDefinition getBoxTableDetailedDefinition(ChartCollection collection) { |
||||
VanBoxTableDefinition table = getBoxTableDefinition(collection); |
||||
|
||||
if (table != null) { |
||||
return table.getDetailedDefinition(); |
||||
} |
||||
|
||||
return null; |
||||
} |
||||
|
||||
public static boolean isDetailedTableDataType(ChartCollection collection) { |
||||
VanBoxTableDefinition table = getBoxTableDefinition(collection); |
||||
|
||||
if (table != null) { |
||||
return table.isDetailed(); |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue