|
|
@ -3,6 +3,8 @@ package com.fr.van.chart.designer.style.background; |
|
|
|
import com.fr.chart.chartattr.Chart; |
|
|
|
import com.fr.chart.chartattr.Chart; |
|
|
|
import com.fr.chart.chartattr.Plot; |
|
|
|
import com.fr.chart.chartattr.Plot; |
|
|
|
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; |
|
|
|
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; |
|
|
|
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
import com.fr.design.mainframe.chart.PaneTitleConstants; |
|
|
|
import com.fr.design.mainframe.chart.PaneTitleConstants; |
|
|
@ -12,8 +14,10 @@ import com.fr.van.chart.designer.component.background.VanChartBackgroundPane; |
|
|
|
import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane; |
|
|
|
import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane; |
|
|
|
import com.fr.van.chart.designer.style.background.radar.VanChartRadarAxisAreaPane; |
|
|
|
import com.fr.van.chart.designer.style.background.radar.VanChartRadarAxisAreaPane; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
|
|
|
import java.awt.Color; |
|
|
|
import java.awt.Component; |
|
|
|
import java.awt.Component; |
|
|
|
|
|
|
|
|
|
|
|
//图表区|绘图区 边框和背景
|
|
|
|
//图表区|绘图区 边框和背景
|
|
|
@ -25,12 +29,13 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart |
|
|
|
private VanChartAxisAreaPane chartAxisAreaPane; |
|
|
|
private VanChartAxisAreaPane chartAxisAreaPane; |
|
|
|
|
|
|
|
|
|
|
|
private JPanel contentPane; |
|
|
|
private JPanel contentPane; |
|
|
|
|
|
|
|
private UILabel tooltipLabel; |
|
|
|
|
|
|
|
|
|
|
|
private boolean isPlot;//绘图区
|
|
|
|
private boolean isPlot;//绘图区
|
|
|
|
|
|
|
|
|
|
|
|
private AbstractAttrNoScrollPane parent; |
|
|
|
private AbstractAttrNoScrollPane parent; |
|
|
|
|
|
|
|
|
|
|
|
public VanChartAreaBackgroundPane(boolean isPlot, AbstractAttrNoScrollPane parent){ |
|
|
|
public VanChartAreaBackgroundPane(boolean isPlot, AbstractAttrNoScrollPane parent) { |
|
|
|
super(); |
|
|
|
super(); |
|
|
|
this.isPlot = isPlot; |
|
|
|
this.isPlot = isPlot; |
|
|
|
this.parent = parent; |
|
|
|
this.parent = parent; |
|
|
@ -50,14 +55,22 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart |
|
|
|
|
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double[] columnSize = { f }; |
|
|
|
double[] columnSize = {f}; |
|
|
|
double[] rowSize = {p,p,p}; |
|
|
|
double[] rowSize = {p, p, p}; |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"),chartBorderPane)}, |
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"), chartBorderPane)}, |
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Background"), chartBackgroundPane)}, |
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Background"), chartBackgroundPane)}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
contentPane.add(panel, BorderLayout.CENTER); |
|
|
|
contentPane.add(panel, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isPlot) { |
|
|
|
|
|
|
|
tooltipLabel = new UILabel("<html>" + Toolkit.i18nText("Fine-Design_Chart_Background_Tooltip") + "</html>"); |
|
|
|
|
|
|
|
tooltipLabel.setForeground(Color.gray); |
|
|
|
|
|
|
|
tooltipLabel.setBorder(BorderFactory.createEmptyBorder(0, 10, 5, 10)); |
|
|
|
|
|
|
|
contentPane.add(tooltipLabel, BorderLayout.NORTH); |
|
|
|
|
|
|
|
tooltipLabel.setVisible(false); |
|
|
|
|
|
|
|
} |
|
|
|
return contentPane; |
|
|
|
return contentPane; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -68,11 +81,11 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart |
|
|
|
|
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double[] columnSize = { f }; |
|
|
|
double[] columnSize = {f}; |
|
|
|
double[] rowSize = {p,p,p}; |
|
|
|
double[] rowSize = {p, p, p}; |
|
|
|
Component[][] components; |
|
|
|
Component[][] components; |
|
|
|
|
|
|
|
|
|
|
|
if(plot.isSupportBorder()){//有边框和背景
|
|
|
|
if (plot.isSupportBorder()) {//有边框和背景
|
|
|
|
|
|
|
|
|
|
|
|
chartAxisAreaPane = initAxisAreaPane(); |
|
|
|
chartAxisAreaPane = initAxisAreaPane(); |
|
|
|
|
|
|
|
|
|
|
@ -85,7 +98,7 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
contentPane.add(panel,BorderLayout.CENTER); |
|
|
|
contentPane.add(panel, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
parent.initAllListeners(); |
|
|
|
parent.initAllListeners(); |
|
|
|
} |
|
|
|
} |
|
|
@ -96,7 +109,7 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart |
|
|
|
|
|
|
|
|
|
|
|
protected Component[][] initComponents() { |
|
|
|
protected Component[][] initComponents() { |
|
|
|
return new Component[][]{ |
|
|
|
return new Component[][]{ |
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"),chartBorderPane)}, |
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"), chartBorderPane)}, |
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Background"), chartBackgroundPane)}, |
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Background"), chartBackgroundPane)}, |
|
|
|
new Component[]{chartAxisAreaPane} |
|
|
|
new Component[]{chartAxisAreaPane} |
|
|
|
}; |
|
|
|
}; |
|
|
@ -104,10 +117,11 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 标题 |
|
|
|
* 标题 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 标题 |
|
|
|
* @return 标题 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public String title4PopupWindow() { |
|
|
|
public String title4PopupWindow() { |
|
|
|
if(isPlot){ |
|
|
|
if (isPlot) { |
|
|
|
return PaneTitleConstants.CHART_STYLE_AREA_PLOT_TITLE; |
|
|
|
return PaneTitleConstants.CHART_STYLE_AREA_PLOT_TITLE; |
|
|
|
} |
|
|
|
} |
|
|
|
return PaneTitleConstants.CHART_STYLE_AREA_AREA_TITLE; |
|
|
|
return PaneTitleConstants.CHART_STYLE_AREA_AREA_TITLE; |
|
|
@ -118,11 +132,11 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart |
|
|
|
if (chart == null) { |
|
|
|
if (chart == null) { |
|
|
|
chart = new Chart(); |
|
|
|
chart = new Chart(); |
|
|
|
} |
|
|
|
} |
|
|
|
if(isPlot){ |
|
|
|
if (isPlot) { |
|
|
|
Plot plot = chart.getPlot(); |
|
|
|
Plot plot = chart.getPlot(); |
|
|
|
chartBorderPane.update(plot); |
|
|
|
chartBorderPane.update(plot); |
|
|
|
chartBackgroundPane.update(plot); |
|
|
|
chartBackgroundPane.update(plot); |
|
|
|
if(plot.isSupportIntervalBackground() && chartAxisAreaPane != null){ |
|
|
|
if (plot.isSupportIntervalBackground() && chartAxisAreaPane != null) { |
|
|
|
chartAxisAreaPane.updateBean(plot); |
|
|
|
chartAxisAreaPane.updateBean(plot); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -133,12 +147,12 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void populateBean(Chart chart) { |
|
|
|
public void populateBean(Chart chart) { |
|
|
|
if(chart == null) { |
|
|
|
if (chart == null) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if(isPlot){ |
|
|
|
if (isPlot) { |
|
|
|
Plot plot = chart.getPlot(); |
|
|
|
Plot plot = chart.getPlot(); |
|
|
|
if(plot.isSupportIntervalBackground()){ |
|
|
|
if (plot.isSupportIntervalBackground()) { |
|
|
|
//含有坐标轴相关设置,例如警戒线、网格线、间隔背景
|
|
|
|
//含有坐标轴相关设置,例如警戒线、网格线、间隔背景
|
|
|
|
if (chartAxisAreaPane == null) { |
|
|
|
if (chartAxisAreaPane == null) { |
|
|
|
refreshContentPane(plot); |
|
|
|
refreshContentPane(plot); |
|
|
@ -157,4 +171,8 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart |
|
|
|
public Chart updateBean() { |
|
|
|
public Chart updateBean() { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void refreshTooltipLabel(boolean inForm) { |
|
|
|
|
|
|
|
tooltipLabel.setVisible(inForm); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |