帆软报表设计器源代码。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

149 lines
5.9 KiB

package com.fr.van.chart.box;
import com.fr.design.i18n.Toolkit;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.box.attr.AttrBoxTooltipContent;
import com.fr.van.chart.designer.component.VanChartTooltipContentPane;
import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithCheckBox;
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel;
import java.awt.Component;
public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane {
private VanChartFormatPaneWithCheckBox number;
private VanChartFormatPaneWithCheckBox max;
private VanChartFormatPaneWithCheckBox q3;
private VanChartFormatPaneWithCheckBox median;
private VanChartFormatPaneWithCheckBox q1;
private VanChartFormatPaneWithCheckBox min;
private VanChartFormatPaneWithCheckBox outlier;
public VanChartBoxTooltipContentPane(VanChartStylePane parent, JPanel showOnPane) {
super(parent, showOnPane);
}
protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) {
categoryNameFormatPane = new CategoryNameFormatPaneWithCheckBox(parent, showOnPane);
seriesNameFormatPane = new SeriesNameFormatPaneWithCheckBox(parent, showOnPane);
number = new VanChartFormatPaneWithCheckBox(parent, showOnPane) {
protected String getCheckBoxText() {
return Toolkit.i18nText("Fine-Design_Chart_Data_Number");
}
};
max = new VanChartFormatPaneWithCheckBox(parent, showOnPane) {
protected String getCheckBoxText() {
return Toolkit.i18nText("Fine-Design_Chart_Max_Value");
}
};
q3 = new VanChartFormatPaneWithCheckBox(parent, showOnPane) {
protected String getCheckBoxText() {
return Toolkit.i18nText("Fine-Design_Chart_Data_Q3");
}
};
median = new VanChartFormatPaneWithCheckBox(parent, showOnPane) {
protected String getCheckBoxText() {
return Toolkit.i18nText("Fine-Design_Chart_Data_Median");
}
};
q1 = new VanChartFormatPaneWithCheckBox(parent, showOnPane) {
protected String getCheckBoxText() {
return Toolkit.i18nText("Fine-Design_Chart_Data_Q1");
}
};
min = new VanChartFormatPaneWithCheckBox(parent, showOnPane) {
protected String getCheckBoxText() {
return Toolkit.i18nText("Fine-Design_Chart_Min_Value");
}
};
outlier = new VanChartFormatPaneWithCheckBox(parent, showOnPane) {
protected String getCheckBoxText() {
return Toolkit.i18nText("Fine-Design_Chart_Outlier_Value");
}
};
}
protected double[] getRowSize(double p) {
return new double[]{p, p, p, p, p, p, p, p, p};
}
protected Component[][] getPaneComponents() {
return new Component[][]{
new Component[]{categoryNameFormatPane, null},
new Component[]{seriesNameFormatPane, null},
new Component[]{number, null},
new Component[]{max, null},
new Component[]{q3, null},
new Component[]{median, null},
new Component[]{q1, null},
new Component[]{min, null},
new Component[]{outlier, null}
};
}
public boolean isDirty() {
return categoryNameFormatPane.isDirty()
|| seriesNameFormatPane.isDirty()
|| number.isDirty()
|| max.isDirty()
|| q3.isDirty()
|| median.isDirty()
|| q1.isDirty()
|| min.isDirty()
|| outlier.isDirty();
}
public void setDirty(boolean isDirty) {
categoryNameFormatPane.setDirty(isDirty);
seriesNameFormatPane.setDirty(isDirty);
number.setDirty(isDirty);
max.setDirty(isDirty);
q3.setDirty(isDirty);
median.setDirty(isDirty);
q1.setDirty(isDirty);
min.setDirty(isDirty);
outlier.setDirty(isDirty);
}
protected AttrTooltipContent createAttrTooltip() {
return new AttrBoxTooltipContent();
}
protected void populateFormatPane(AttrTooltipContent attrTooltipContent) {
categoryNameFormatPane.populate(attrTooltipContent.getCategoryFormat());
seriesNameFormatPane.populate(attrTooltipContent.getSeriesFormat());
if (attrTooltipContent instanceof AttrBoxTooltipContent) {
AttrBoxTooltipContent boxTooltipContent = (AttrBoxTooltipContent) attrTooltipContent;
number.populate(boxTooltipContent.getNumber());
max.populate(boxTooltipContent.getMax());
q3.populate(boxTooltipContent.getQ3());
median.populate(boxTooltipContent.getMedian());
q1.populate(boxTooltipContent.getQ1());
min.populate(boxTooltipContent.getMin());
outlier.populate(boxTooltipContent.getOutlier());
}
}
protected void updateFormatPane(AttrTooltipContent attrTooltipContent) {
categoryNameFormatPane.update(attrTooltipContent.getCategoryFormat());
seriesNameFormatPane.update(attrTooltipContent.getSeriesFormat());
if (attrTooltipContent instanceof AttrBoxTooltipContent) {
AttrBoxTooltipContent boxTooltipContent = (AttrBoxTooltipContent) attrTooltipContent;
number.update(boxTooltipContent.getNumber());
max.update(boxTooltipContent.getMax());
q3.update(boxTooltipContent.getQ3());
median.update(boxTooltipContent.getMedian());
q1.update(boxTooltipContent.getQ1());
min.update(boxTooltipContent.getMin());
outlier.update(boxTooltipContent.getOutlier());
}
}
}