first commit
This commit is contained in:
154
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillAreaPlot.java
Normal file
154
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillAreaPlot.java
Normal file
@@ -0,0 +1,154 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.awt.Color;
|
||||
import net.sf.jasperreports.charts.JRAreaPlot;
|
||||
import net.sf.jasperreports.charts.JRCategoryAxisFormat;
|
||||
import net.sf.jasperreports.charts.JRValueAxisFormat;
|
||||
import net.sf.jasperreports.engine.JRChartPlot;
|
||||
import net.sf.jasperreports.engine.JRExpression;
|
||||
import net.sf.jasperreports.engine.JRFont;
|
||||
import net.sf.jasperreports.engine.JRStyleContainer;
|
||||
import net.sf.jasperreports.engine.base.JRBaseFont;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartPlot;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
import net.sf.jasperreports.engine.util.JRStyleResolver;
|
||||
|
||||
public class JRFillAreaPlot extends JRFillChartPlot implements JRAreaPlot {
|
||||
protected JRFont categoryAxisLabelFont = null;
|
||||
|
||||
protected Color categoryAxisLabelColor = null;
|
||||
|
||||
protected JRFont categoryAxisTickLabelFont = null;
|
||||
|
||||
protected Color categoryAxisTickLabelColor = null;
|
||||
|
||||
protected Color categoryAxisLineColor = null;
|
||||
|
||||
protected JRFont valueAxisLabelFont = null;
|
||||
|
||||
protected Color valueAxisLabelColor = null;
|
||||
|
||||
protected JRFont valueAxisTickLabelFont = null;
|
||||
|
||||
protected Color valueAxisTickLabelColor = null;
|
||||
|
||||
protected Color valueAxisLineColor = null;
|
||||
|
||||
public JRFillAreaPlot(JRAreaPlot areaPlot, JRFillObjectFactory factory) {
|
||||
super((JRChartPlot)areaPlot, factory);
|
||||
this.categoryAxisLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)areaPlot.getChart(), areaPlot.getCategoryAxisLabelFont());
|
||||
this.categoryAxisLabelColor = areaPlot.getOwnCategoryAxisLabelColor();
|
||||
this.categoryAxisTickLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)areaPlot.getChart(), areaPlot.getCategoryAxisTickLabelFont());
|
||||
this.categoryAxisTickLabelColor = areaPlot.getOwnCategoryAxisTickLabelColor();
|
||||
this.categoryAxisLineColor = areaPlot.getOwnCategoryAxisLineColor();
|
||||
this.valueAxisLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)areaPlot.getChart(), areaPlot.getValueAxisLabelFont());
|
||||
this.valueAxisLabelColor = areaPlot.getOwnValueAxisLabelColor();
|
||||
this.valueAxisTickLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)areaPlot.getChart(), areaPlot.getValueAxisTickLabelFont());
|
||||
this.valueAxisTickLabelColor = areaPlot.getOwnValueAxisTickLabelColor();
|
||||
this.valueAxisLineColor = areaPlot.getOwnValueAxisLineColor();
|
||||
}
|
||||
|
||||
public JRExpression getCategoryAxisLabelExpression() {
|
||||
return ((JRAreaPlot)this.parent).getCategoryAxisLabelExpression();
|
||||
}
|
||||
|
||||
public JRFont getCategoryAxisLabelFont() {
|
||||
return this.categoryAxisLabelFont;
|
||||
}
|
||||
|
||||
public void setCategoryAxisLabelFont(JRFont font) {}
|
||||
|
||||
public Color getCategoryAxisLabelColor() {
|
||||
return JRStyleResolver.getCategoryAxisLabelColor((JRCategoryAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnCategoryAxisLabelColor() {
|
||||
return this.categoryAxisLabelColor;
|
||||
}
|
||||
|
||||
public void setCategoryAxisLabelColor(Color color) {}
|
||||
|
||||
public JRFont getCategoryAxisTickLabelFont() {
|
||||
return this.categoryAxisTickLabelFont;
|
||||
}
|
||||
|
||||
public void setCategoryAxisTickLabelFont(JRFont font) {}
|
||||
|
||||
public Color getCategoryAxisTickLabelColor() {
|
||||
return JRStyleResolver.getCategoryAxisTickLabelColor((JRCategoryAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnCategoryAxisTickLabelColor() {
|
||||
return this.categoryAxisTickLabelColor;
|
||||
}
|
||||
|
||||
public void setCategoryAxisTickLabelColor(Color color) {}
|
||||
|
||||
public String getCategoryAxisTickLabelMask() {
|
||||
return ((JRAreaPlot)this.parent).getCategoryAxisTickLabelMask();
|
||||
}
|
||||
|
||||
public void setCategoryAxisTickLabelMask(String mask) {}
|
||||
|
||||
public Color getCategoryAxisLineColor() {
|
||||
return JRStyleResolver.getCategoryAxisLineColor((JRCategoryAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnCategoryAxisLineColor() {
|
||||
return this.categoryAxisLineColor;
|
||||
}
|
||||
|
||||
public void setCategoryAxisLineColor(Color color) {}
|
||||
|
||||
public JRExpression getValueAxisLabelExpression() {
|
||||
return ((JRAreaPlot)this.parent).getValueAxisLabelExpression();
|
||||
}
|
||||
|
||||
public JRFont getValueAxisLabelFont() {
|
||||
return this.valueAxisLabelFont;
|
||||
}
|
||||
|
||||
public void setValueAxisLabelFont(JRFont font) {}
|
||||
|
||||
public Color getValueAxisLabelColor() {
|
||||
return JRStyleResolver.getValueAxisLabelColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisLabelColor() {
|
||||
return this.valueAxisLabelColor;
|
||||
}
|
||||
|
||||
public void setValueAxisLabelColor(Color color) {}
|
||||
|
||||
public JRFont getValueAxisTickLabelFont() {
|
||||
return this.valueAxisTickLabelFont;
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelFont(JRFont font) {}
|
||||
|
||||
public Color getValueAxisTickLabelColor() {
|
||||
return JRStyleResolver.getValueAxisTickLabelColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisTickLabelColor() {
|
||||
return this.valueAxisTickLabelColor;
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelColor(Color color) {}
|
||||
|
||||
public String getValueAxisTickLabelMask() {
|
||||
return ((JRAreaPlot)this.parent).getValueAxisTickLabelMask();
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelMask(String mask) {}
|
||||
|
||||
public Color getValueAxisLineColor() {
|
||||
return JRStyleResolver.getValueAxisLineColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisLineColor() {
|
||||
return this.valueAxisLineColor;
|
||||
}
|
||||
|
||||
public void setValueAxisLineColor(Color color) {}
|
||||
}
|
172
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillBar3DPlot.java
Normal file
172
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillBar3DPlot.java
Normal file
@@ -0,0 +1,172 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.awt.Color;
|
||||
import net.sf.jasperreports.charts.JRBar3DPlot;
|
||||
import net.sf.jasperreports.charts.JRCategoryAxisFormat;
|
||||
import net.sf.jasperreports.charts.JRValueAxisFormat;
|
||||
import net.sf.jasperreports.engine.JRChartPlot;
|
||||
import net.sf.jasperreports.engine.JRExpression;
|
||||
import net.sf.jasperreports.engine.JRFont;
|
||||
import net.sf.jasperreports.engine.JRStyleContainer;
|
||||
import net.sf.jasperreports.engine.base.JRBaseFont;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartPlot;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
import net.sf.jasperreports.engine.util.JRStyleResolver;
|
||||
|
||||
public class JRFillBar3DPlot extends JRFillChartPlot implements JRBar3DPlot {
|
||||
protected JRFont categoryAxisLabelFont = null;
|
||||
|
||||
protected Color categoryAxisLabelColor = null;
|
||||
|
||||
protected JRFont categoryAxisTickLabelFont = null;
|
||||
|
||||
protected Color categoryAxisTickLabelColor = null;
|
||||
|
||||
protected Color categoryAxisLineColor = null;
|
||||
|
||||
protected JRFont valueAxisLabelFont = null;
|
||||
|
||||
protected Color valueAxisLabelColor = null;
|
||||
|
||||
protected JRFont valueAxisTickLabelFont = null;
|
||||
|
||||
protected Color valueAxisTickLabelColor = null;
|
||||
|
||||
protected Color valueAxisLineColor = null;
|
||||
|
||||
public JRFillBar3DPlot(JRBar3DPlot barPlot, JRFillObjectFactory factory) {
|
||||
super((JRChartPlot)barPlot, factory);
|
||||
this.categoryAxisLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)barPlot.getChart(), barPlot.getCategoryAxisLabelFont());
|
||||
this.categoryAxisLabelColor = barPlot.getOwnCategoryAxisLabelColor();
|
||||
this.categoryAxisTickLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)barPlot.getChart(), barPlot.getCategoryAxisTickLabelFont());
|
||||
this.categoryAxisTickLabelColor = barPlot.getOwnCategoryAxisTickLabelColor();
|
||||
this.categoryAxisLineColor = barPlot.getOwnCategoryAxisLineColor();
|
||||
this.valueAxisLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)barPlot.getChart(), barPlot.getValueAxisLabelFont());
|
||||
this.valueAxisLabelColor = barPlot.getOwnValueAxisLabelColor();
|
||||
this.valueAxisTickLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)barPlot.getChart(), barPlot.getValueAxisTickLabelFont());
|
||||
this.valueAxisTickLabelColor = barPlot.getOwnValueAxisTickLabelColor();
|
||||
this.valueAxisLineColor = barPlot.getOwnValueAxisLineColor();
|
||||
}
|
||||
|
||||
public JRExpression getCategoryAxisLabelExpression() {
|
||||
return ((JRBar3DPlot)this.parent).getCategoryAxisLabelExpression();
|
||||
}
|
||||
|
||||
public JRFont getCategoryAxisLabelFont() {
|
||||
return this.categoryAxisLabelFont;
|
||||
}
|
||||
|
||||
public void setCategoryAxisLabelFont(JRFont font) {}
|
||||
|
||||
public Color getCategoryAxisLabelColor() {
|
||||
return JRStyleResolver.getCategoryAxisLabelColor((JRCategoryAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnCategoryAxisLabelColor() {
|
||||
return this.categoryAxisLabelColor;
|
||||
}
|
||||
|
||||
public void setCategoryAxisLabelColor(Color color) {}
|
||||
|
||||
public JRFont getCategoryAxisTickLabelFont() {
|
||||
return this.categoryAxisTickLabelFont;
|
||||
}
|
||||
|
||||
public void setCategoryAxisTickLabelFont(JRFont font) {}
|
||||
|
||||
public Color getCategoryAxisTickLabelColor() {
|
||||
return JRStyleResolver.getCategoryAxisTickLabelColor((JRCategoryAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnCategoryAxisTickLabelColor() {
|
||||
return this.categoryAxisTickLabelColor;
|
||||
}
|
||||
|
||||
public void setCategoryAxisTickLabelColor(Color color) {}
|
||||
|
||||
public String getCategoryAxisTickLabelMask() {
|
||||
return ((JRBar3DPlot)this.parent).getCategoryAxisTickLabelMask();
|
||||
}
|
||||
|
||||
public void setCategoryAxisTickLabelMask(String mask) {}
|
||||
|
||||
public Color getCategoryAxisLineColor() {
|
||||
return JRStyleResolver.getCategoryAxisLineColor((JRCategoryAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnCategoryAxisLineColor() {
|
||||
return this.categoryAxisLineColor;
|
||||
}
|
||||
|
||||
public void setCategoryAxisLineColor(Color color) {}
|
||||
|
||||
public JRExpression getValueAxisLabelExpression() {
|
||||
return ((JRBar3DPlot)this.parent).getValueAxisLabelExpression();
|
||||
}
|
||||
|
||||
public JRFont getValueAxisLabelFont() {
|
||||
return this.valueAxisLabelFont;
|
||||
}
|
||||
|
||||
public void setValueAxisLabelFont(JRFont font) {}
|
||||
|
||||
public Color getValueAxisLabelColor() {
|
||||
return JRStyleResolver.getValueAxisLabelColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisLabelColor() {
|
||||
return this.valueAxisLabelColor;
|
||||
}
|
||||
|
||||
public void setValueAxisLabelColor(Color color) {}
|
||||
|
||||
public JRFont getValueAxisTickLabelFont() {
|
||||
return this.valueAxisTickLabelFont;
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelFont(JRFont font) {}
|
||||
|
||||
public Color getValueAxisTickLabelColor() {
|
||||
return JRStyleResolver.getValueAxisTickLabelColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisTickLabelColor() {
|
||||
return this.valueAxisTickLabelColor;
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelColor(Color color) {}
|
||||
|
||||
public String getValueAxisTickLabelMask() {
|
||||
return ((JRBar3DPlot)this.parent).getValueAxisTickLabelMask();
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelMask(String mask) {}
|
||||
|
||||
public Color getValueAxisLineColor() {
|
||||
return JRStyleResolver.getValueAxisLineColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisLineColor() {
|
||||
return this.valueAxisLineColor;
|
||||
}
|
||||
|
||||
public void setValueAxisLineColor(Color color) {}
|
||||
|
||||
public double getXOffset() {
|
||||
return ((JRBar3DPlot)this.parent).getXOffset();
|
||||
}
|
||||
|
||||
public void setXOffset(double xOffset) {}
|
||||
|
||||
public double getYOffset() {
|
||||
return ((JRBar3DPlot)this.parent).getYOffset();
|
||||
}
|
||||
|
||||
public void setYOffset(double yOffset) {}
|
||||
|
||||
public boolean isShowLabels() {
|
||||
return ((JRBar3DPlot)this.parent).isShowLabels();
|
||||
}
|
||||
|
||||
public void setShowLabels(boolean isShowLabels) {}
|
||||
}
|
172
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillBarPlot.java
Normal file
172
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillBarPlot.java
Normal file
@@ -0,0 +1,172 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.awt.Color;
|
||||
import net.sf.jasperreports.charts.JRBarPlot;
|
||||
import net.sf.jasperreports.charts.JRCategoryAxisFormat;
|
||||
import net.sf.jasperreports.charts.JRValueAxisFormat;
|
||||
import net.sf.jasperreports.engine.JRChartPlot;
|
||||
import net.sf.jasperreports.engine.JRExpression;
|
||||
import net.sf.jasperreports.engine.JRFont;
|
||||
import net.sf.jasperreports.engine.JRStyleContainer;
|
||||
import net.sf.jasperreports.engine.base.JRBaseFont;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartPlot;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
import net.sf.jasperreports.engine.util.JRStyleResolver;
|
||||
|
||||
public class JRFillBarPlot extends JRFillChartPlot implements JRBarPlot {
|
||||
protected JRFont categoryAxisLabelFont = null;
|
||||
|
||||
protected Color categoryAxisLabelColor = null;
|
||||
|
||||
protected JRFont categoryAxisTickLabelFont = null;
|
||||
|
||||
protected Color categoryAxisTickLabelColor = null;
|
||||
|
||||
protected Color categoryAxisLineColor = null;
|
||||
|
||||
protected JRFont valueAxisLabelFont = null;
|
||||
|
||||
protected Color valueAxisLabelColor = null;
|
||||
|
||||
protected JRFont valueAxisTickLabelFont = null;
|
||||
|
||||
protected Color valueAxisTickLabelColor = null;
|
||||
|
||||
protected Color valueAxisLineColor = null;
|
||||
|
||||
public JRFillBarPlot(JRBarPlot barPlot, JRFillObjectFactory factory) {
|
||||
super((JRChartPlot)barPlot, factory);
|
||||
this.categoryAxisLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)barPlot.getChart(), barPlot.getCategoryAxisLabelFont());
|
||||
this.categoryAxisLabelColor = barPlot.getOwnCategoryAxisLabelColor();
|
||||
this.categoryAxisTickLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)barPlot.getChart(), barPlot.getCategoryAxisTickLabelFont());
|
||||
this.categoryAxisTickLabelColor = barPlot.getOwnCategoryAxisTickLabelColor();
|
||||
this.categoryAxisLineColor = barPlot.getOwnCategoryAxisLineColor();
|
||||
this.valueAxisLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)barPlot.getChart(), barPlot.getValueAxisLabelFont());
|
||||
this.valueAxisLabelColor = barPlot.getOwnValueAxisLabelColor();
|
||||
this.valueAxisTickLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)barPlot.getChart(), barPlot.getValueAxisTickLabelFont());
|
||||
this.valueAxisTickLabelColor = barPlot.getOwnValueAxisTickLabelColor();
|
||||
this.valueAxisLineColor = barPlot.getOwnValueAxisLineColor();
|
||||
}
|
||||
|
||||
public JRExpression getCategoryAxisLabelExpression() {
|
||||
return ((JRBarPlot)this.parent).getCategoryAxisLabelExpression();
|
||||
}
|
||||
|
||||
public JRFont getCategoryAxisLabelFont() {
|
||||
return this.categoryAxisLabelFont;
|
||||
}
|
||||
|
||||
public void setCategoryAxisLabelFont(JRFont font) {}
|
||||
|
||||
public Color getCategoryAxisLabelColor() {
|
||||
return JRStyleResolver.getCategoryAxisLabelColor((JRCategoryAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnCategoryAxisLabelColor() {
|
||||
return this.categoryAxisLabelColor;
|
||||
}
|
||||
|
||||
public void setCategoryAxisLabelColor(Color color) {}
|
||||
|
||||
public JRFont getCategoryAxisTickLabelFont() {
|
||||
return this.categoryAxisTickLabelFont;
|
||||
}
|
||||
|
||||
public void setCategoryAxisTickLabelFont(JRFont font) {}
|
||||
|
||||
public Color getCategoryAxisTickLabelColor() {
|
||||
return JRStyleResolver.getCategoryAxisTickLabelColor((JRCategoryAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnCategoryAxisTickLabelColor() {
|
||||
return this.categoryAxisTickLabelColor;
|
||||
}
|
||||
|
||||
public void setCategoryAxisTickLabelColor(Color color) {}
|
||||
|
||||
public String getCategoryAxisTickLabelMask() {
|
||||
return ((JRBarPlot)this.parent).getCategoryAxisTickLabelMask();
|
||||
}
|
||||
|
||||
public void setCategoryAxisTickLabelMask(String mask) {}
|
||||
|
||||
public Color getCategoryAxisLineColor() {
|
||||
return JRStyleResolver.getCategoryAxisLineColor((JRCategoryAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnCategoryAxisLineColor() {
|
||||
return this.categoryAxisLineColor;
|
||||
}
|
||||
|
||||
public void setCategoryAxisLineColor(Color color) {}
|
||||
|
||||
public JRExpression getValueAxisLabelExpression() {
|
||||
return ((JRBarPlot)this.parent).getValueAxisLabelExpression();
|
||||
}
|
||||
|
||||
public JRFont getValueAxisLabelFont() {
|
||||
return this.valueAxisLabelFont;
|
||||
}
|
||||
|
||||
public void setValueAxisLabelFont(JRFont font) {}
|
||||
|
||||
public Color getValueAxisLabelColor() {
|
||||
return JRStyleResolver.getValueAxisLabelColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisLabelColor() {
|
||||
return this.valueAxisLabelColor;
|
||||
}
|
||||
|
||||
public void setValueAxisLabelColor(Color color) {}
|
||||
|
||||
public JRFont getValueAxisTickLabelFont() {
|
||||
return this.valueAxisTickLabelFont;
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelFont(JRFont font) {}
|
||||
|
||||
public Color getValueAxisTickLabelColor() {
|
||||
return JRStyleResolver.getValueAxisTickLabelColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisTickLabelColor() {
|
||||
return this.valueAxisTickLabelColor;
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelColor(Color color) {}
|
||||
|
||||
public String getValueAxisTickLabelMask() {
|
||||
return ((JRBarPlot)this.parent).getValueAxisTickLabelMask();
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelMask(String mask) {}
|
||||
|
||||
public Color getValueAxisLineColor() {
|
||||
return JRStyleResolver.getValueAxisLineColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisLineColor() {
|
||||
return this.valueAxisLineColor;
|
||||
}
|
||||
|
||||
public void setValueAxisLineColor(Color color) {}
|
||||
|
||||
public boolean isShowTickMarks() {
|
||||
return ((JRBarPlot)this.parent).isShowTickMarks();
|
||||
}
|
||||
|
||||
public void setShowTickMarks(boolean isShowTickMarks) {}
|
||||
|
||||
public boolean isShowTickLabels() {
|
||||
return ((JRBarPlot)this.parent).isShowTickLabels();
|
||||
}
|
||||
|
||||
public void setShowTickLabels(boolean isShowTickLabels) {}
|
||||
|
||||
public boolean isShowLabels() {
|
||||
return ((JRBarPlot)this.parent).isShowLabels();
|
||||
}
|
||||
|
||||
public void setShowLabels(boolean isShowLabels) {}
|
||||
}
|
136
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillBubblePlot.java
Normal file
136
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillBubblePlot.java
Normal file
@@ -0,0 +1,136 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.awt.Color;
|
||||
import net.sf.jasperreports.charts.JRBubblePlot;
|
||||
import net.sf.jasperreports.charts.JRXAxisFormat;
|
||||
import net.sf.jasperreports.charts.JRYAxisFormat;
|
||||
import net.sf.jasperreports.engine.JRChartPlot;
|
||||
import net.sf.jasperreports.engine.JRExpression;
|
||||
import net.sf.jasperreports.engine.JRFont;
|
||||
import net.sf.jasperreports.engine.JRStyleContainer;
|
||||
import net.sf.jasperreports.engine.base.JRBaseFont;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartPlot;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
import net.sf.jasperreports.engine.util.JRStyleResolver;
|
||||
|
||||
public class JRFillBubblePlot extends JRFillChartPlot implements JRBubblePlot {
|
||||
protected JRFont xAxisLabelFont = null;
|
||||
|
||||
protected Color xAxisLabelColor = null;
|
||||
|
||||
protected JRFont xAxisTickLabelFont = null;
|
||||
|
||||
protected Color xAxisTickLabelColor = null;
|
||||
|
||||
protected Color xAxisLineColor = null;
|
||||
|
||||
protected JRFont yAxisLabelFont = null;
|
||||
|
||||
protected Color yAxisLabelColor = null;
|
||||
|
||||
protected JRFont yAxisTickLabelFont = null;
|
||||
|
||||
protected Color yAxisTickLabelColor = null;
|
||||
|
||||
protected Color yAxisLineColor = null;
|
||||
|
||||
public JRFillBubblePlot(JRBubblePlot bubblePlot, JRFillObjectFactory factory) {
|
||||
super((JRChartPlot)bubblePlot, factory);
|
||||
this.xAxisLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)bubblePlot.getChart(), bubblePlot.getXAxisLabelFont());
|
||||
this.xAxisLabelColor = bubblePlot.getOwnXAxisLabelColor();
|
||||
this.xAxisTickLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)bubblePlot.getChart(), bubblePlot.getXAxisTickLabelFont());
|
||||
this.xAxisTickLabelColor = bubblePlot.getOwnXAxisTickLabelColor();
|
||||
this.xAxisLineColor = bubblePlot.getXAxisLineColor();
|
||||
this.yAxisLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)bubblePlot.getChart(), bubblePlot.getYAxisLabelFont());
|
||||
this.yAxisLabelColor = bubblePlot.getOwnYAxisLabelColor();
|
||||
this.yAxisTickLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)bubblePlot.getChart(), bubblePlot.getYAxisTickLabelFont());
|
||||
this.yAxisTickLabelColor = bubblePlot.getOwnYAxisTickLabelColor();
|
||||
this.yAxisLineColor = bubblePlot.getYAxisLineColor();
|
||||
}
|
||||
|
||||
public JRExpression getXAxisLabelExpression() {
|
||||
return ((JRBubblePlot)this.parent).getXAxisLabelExpression();
|
||||
}
|
||||
|
||||
public JRFont getXAxisLabelFont() {
|
||||
return this.xAxisLabelFont;
|
||||
}
|
||||
|
||||
public Color getXAxisLabelColor() {
|
||||
return JRStyleResolver.getXAxisLabelColor((JRXAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnXAxisLabelColor() {
|
||||
return this.xAxisLabelColor;
|
||||
}
|
||||
|
||||
public JRFont getXAxisTickLabelFont() {
|
||||
return this.xAxisTickLabelFont;
|
||||
}
|
||||
|
||||
public Color getXAxisTickLabelColor() {
|
||||
return JRStyleResolver.getXAxisTickLabelColor((JRXAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnXAxisTickLabelColor() {
|
||||
return this.xAxisTickLabelColor;
|
||||
}
|
||||
|
||||
public String getXAxisTickLabelMask() {
|
||||
return ((JRBubblePlot)this.parent).getXAxisTickLabelMask();
|
||||
}
|
||||
|
||||
public Color getXAxisLineColor() {
|
||||
return JRStyleResolver.getXAxisLineColor((JRXAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnXAxisLineColor() {
|
||||
return this.xAxisLineColor;
|
||||
}
|
||||
|
||||
public JRExpression getYAxisLabelExpression() {
|
||||
return ((JRBubblePlot)this.parent).getYAxisLabelExpression();
|
||||
}
|
||||
|
||||
public JRFont getYAxisLabelFont() {
|
||||
return this.yAxisLabelFont;
|
||||
}
|
||||
|
||||
public Color getYAxisLabelColor() {
|
||||
return JRStyleResolver.getYAxisLabelColor((JRYAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnYAxisLabelColor() {
|
||||
return this.yAxisLabelColor;
|
||||
}
|
||||
|
||||
public JRFont getYAxisTickLabelFont() {
|
||||
return this.yAxisTickLabelFont;
|
||||
}
|
||||
|
||||
public Color getYAxisTickLabelColor() {
|
||||
return JRStyleResolver.getYAxisTickLabelColor((JRYAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnYAxisTickLabelColor() {
|
||||
return this.yAxisTickLabelColor;
|
||||
}
|
||||
|
||||
public String getYAxisTickLabelMask() {
|
||||
return ((JRBubblePlot)this.parent).getYAxisTickLabelMask();
|
||||
}
|
||||
|
||||
public Color getYAxisLineColor() {
|
||||
return JRStyleResolver.getYAxisLineColor((JRYAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnYAxisLineColor() {
|
||||
return this.yAxisLineColor;
|
||||
}
|
||||
|
||||
public int getScaleType() {
|
||||
return ((JRBubblePlot)this.parent).getScaleType();
|
||||
}
|
||||
|
||||
public void setScaleType(int scaleType) {}
|
||||
}
|
@@ -0,0 +1,158 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.awt.Color;
|
||||
import net.sf.jasperreports.charts.JRCandlestickPlot;
|
||||
import net.sf.jasperreports.charts.JRTimeAxisFormat;
|
||||
import net.sf.jasperreports.charts.JRValueAxisFormat;
|
||||
import net.sf.jasperreports.engine.JRChartPlot;
|
||||
import net.sf.jasperreports.engine.JRExpression;
|
||||
import net.sf.jasperreports.engine.JRFont;
|
||||
import net.sf.jasperreports.engine.JRStyleContainer;
|
||||
import net.sf.jasperreports.engine.base.JRBaseFont;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartPlot;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
import net.sf.jasperreports.engine.util.JRStyleResolver;
|
||||
|
||||
public class JRFillCandlestickPlot extends JRFillChartPlot implements JRCandlestickPlot {
|
||||
protected JRFont timeAxisLabelFont = null;
|
||||
|
||||
protected Color timeAxisLabelColor = null;
|
||||
|
||||
protected JRFont timeAxisTickLabelFont = null;
|
||||
|
||||
protected Color timeAxisTickLabelColor = null;
|
||||
|
||||
protected Color timeAxisLineColor = null;
|
||||
|
||||
protected JRFont valueAxisLabelFont = null;
|
||||
|
||||
protected Color valueAxisLabelColor = null;
|
||||
|
||||
protected JRFont valueAxisTickLabelFont = null;
|
||||
|
||||
protected Color valueAxisTickLabelColor = null;
|
||||
|
||||
protected Color valueAxisLineColor = null;
|
||||
|
||||
public JRFillCandlestickPlot(JRCandlestickPlot candlestickPlot, JRFillObjectFactory factory) {
|
||||
super((JRChartPlot)candlestickPlot, factory);
|
||||
this.timeAxisLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)candlestickPlot.getChart(), candlestickPlot.getTimeAxisLabelFont());
|
||||
this.timeAxisLabelColor = candlestickPlot.getOwnTimeAxisLabelColor();
|
||||
this.timeAxisTickLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)candlestickPlot.getChart(), candlestickPlot.getTimeAxisTickLabelFont());
|
||||
this.timeAxisTickLabelColor = candlestickPlot.getOwnTimeAxisTickLabelColor();
|
||||
this.timeAxisLineColor = candlestickPlot.getTimeAxisLineColor();
|
||||
this.valueAxisLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)candlestickPlot.getChart(), candlestickPlot.getValueAxisLabelFont());
|
||||
this.valueAxisLabelColor = candlestickPlot.getOwnValueAxisLabelColor();
|
||||
this.valueAxisTickLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)candlestickPlot.getChart(), candlestickPlot.getValueAxisTickLabelFont());
|
||||
this.valueAxisTickLabelColor = candlestickPlot.getOwnValueAxisTickLabelColor();
|
||||
this.valueAxisLineColor = candlestickPlot.getValueAxisTickLabelColor();
|
||||
}
|
||||
|
||||
public JRExpression getTimeAxisLabelExpression() {
|
||||
return ((JRCandlestickPlot)this.parent).getTimeAxisLabelExpression();
|
||||
}
|
||||
|
||||
public JRFont getTimeAxisLabelFont() {
|
||||
return this.timeAxisLabelFont;
|
||||
}
|
||||
|
||||
public void setTimeAxisLabelFont(JRFont font) {}
|
||||
|
||||
public Color getTimeAxisLabelColor() {
|
||||
return JRStyleResolver.getTimeAxisLabelColor((JRTimeAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnTimeAxisLabelColor() {
|
||||
return this.timeAxisLabelColor;
|
||||
}
|
||||
|
||||
public void setTimeAxisLabelColor(Color color) {}
|
||||
|
||||
public JRFont getTimeAxisTickLabelFont() {
|
||||
return this.timeAxisTickLabelFont;
|
||||
}
|
||||
|
||||
public void setTimeAxisTickLabelFont(JRFont font) {}
|
||||
|
||||
public Color getTimeAxisTickLabelColor() {
|
||||
return JRStyleResolver.getTimeAxisTickLabelColor((JRTimeAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnTimeAxisTickLabelColor() {
|
||||
return this.timeAxisTickLabelColor;
|
||||
}
|
||||
|
||||
public void setTimeAxisTickLabelColor(Color color) {}
|
||||
|
||||
public String getTimeAxisTickLabelMask() {
|
||||
return ((JRCandlestickPlot)this.parent).getTimeAxisTickLabelMask();
|
||||
}
|
||||
|
||||
public void setTimeAxisTickLabelMask(String mask) {}
|
||||
|
||||
public Color getTimeAxisLineColor() {
|
||||
return JRStyleResolver.getTimeAxisLineColor((JRTimeAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnTimeAxisLineColor() {
|
||||
return this.timeAxisLineColor;
|
||||
}
|
||||
|
||||
public void setTimeAxisLineColor(Color color) {}
|
||||
|
||||
public JRExpression getValueAxisLabelExpression() {
|
||||
return ((JRCandlestickPlot)this.parent).getValueAxisLabelExpression();
|
||||
}
|
||||
|
||||
public JRFont getValueAxisLabelFont() {
|
||||
return this.valueAxisLabelFont;
|
||||
}
|
||||
|
||||
public void setValueAxisLabelFont(JRFont font) {}
|
||||
|
||||
public Color getValueAxisLabelColor() {
|
||||
return JRStyleResolver.getValueAxisLabelColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisLabelColor() {
|
||||
return this.valueAxisLabelColor;
|
||||
}
|
||||
|
||||
public void setValueAxisLabelColor(Color color) {}
|
||||
|
||||
public JRFont getValueAxisTickLabelFont() {
|
||||
return this.valueAxisTickLabelFont;
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelFont(JRFont font) {}
|
||||
|
||||
public Color getValueAxisTickLabelColor() {
|
||||
return JRStyleResolver.getValueAxisTickLabelColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisTickLabelColor() {
|
||||
return this.valueAxisTickLabelColor;
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelColor(Color color) {}
|
||||
|
||||
public String getValueAxisTickLabelMask() {
|
||||
return ((JRCandlestickPlot)this.parent).getValueAxisTickLabelMask();
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelMask(String mask) {}
|
||||
|
||||
public Color getValueAxisLineColor() {
|
||||
return JRStyleResolver.getValueAxisLineColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisLineColor() {
|
||||
return this.valueAxisLineColor;
|
||||
}
|
||||
|
||||
public void setValueAxisLineColor(Color color) {}
|
||||
|
||||
public boolean isShowVolume() {
|
||||
return ((JRCandlestickPlot)this.parent).isShowVolume();
|
||||
}
|
||||
}
|
@@ -0,0 +1,120 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import net.sf.jasperreports.charts.JRCategoryDataset;
|
||||
import net.sf.jasperreports.charts.JRCategorySeries;
|
||||
import net.sf.jasperreports.charts.util.CategoryLabelGenerator;
|
||||
import net.sf.jasperreports.engine.JRChartDataset;
|
||||
import net.sf.jasperreports.engine.JRExpressionCollector;
|
||||
import net.sf.jasperreports.engine.JRRuntimeException;
|
||||
import net.sf.jasperreports.engine.design.JRVerifier;
|
||||
import net.sf.jasperreports.engine.fill.JRCalculator;
|
||||
import net.sf.jasperreports.engine.fill.JRExpressionEvalException;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartDataset;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
import org.jfree.data.category.DefaultCategoryDataset;
|
||||
import org.jfree.data.general.Dataset;
|
||||
|
||||
public class JRFillCategoryDataset extends JRFillChartDataset implements JRCategoryDataset {
|
||||
protected JRFillCategorySeries[] categorySeries = null;
|
||||
|
||||
private DefaultCategoryDataset dataset = null;
|
||||
|
||||
private Map labelsMap = null;
|
||||
|
||||
private Map itemHyperlinks;
|
||||
|
||||
public JRFillCategoryDataset(JRCategoryDataset categoryDataset, JRFillObjectFactory factory) {
|
||||
super((JRChartDataset)categoryDataset, factory);
|
||||
JRCategorySeries[] srcCategorySeries = categoryDataset.getSeries();
|
||||
if (srcCategorySeries != null && srcCategorySeries.length > 0) {
|
||||
this.categorySeries = new JRFillCategorySeries[srcCategorySeries.length];
|
||||
for (int i = 0; i < this.categorySeries.length; i++)
|
||||
this.categorySeries[i] = (JRFillCategorySeries)factory.getCategorySeries(srcCategorySeries[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public JRCategorySeries[] getSeries() {
|
||||
return (JRCategorySeries[])this.categorySeries;
|
||||
}
|
||||
|
||||
protected void customInitialize() {
|
||||
this.dataset = null;
|
||||
this.labelsMap = null;
|
||||
this.itemHyperlinks = null;
|
||||
}
|
||||
|
||||
protected void customEvaluate(JRCalculator calculator) throws JRExpressionEvalException {
|
||||
if (this.categorySeries != null && this.categorySeries.length > 0)
|
||||
for (int i = 0; i < this.categorySeries.length; i++)
|
||||
this.categorySeries[i].evaluate(calculator);
|
||||
}
|
||||
|
||||
protected void customIncrement() {
|
||||
if (this.categorySeries != null && this.categorySeries.length > 0) {
|
||||
if (this.dataset == null) {
|
||||
this.dataset = new DefaultCategoryDataset();
|
||||
this.labelsMap = new HashMap();
|
||||
this.itemHyperlinks = new HashMap();
|
||||
}
|
||||
for (int i = 0; i < this.categorySeries.length; i++) {
|
||||
JRFillCategorySeries crtCategorySeries = this.categorySeries[i];
|
||||
Comparable seriesName = crtCategorySeries.getSeries();
|
||||
if (seriesName == null)
|
||||
throw new JRRuntimeException("Category series name is null.");
|
||||
this.dataset.addValue(crtCategorySeries.getValue(), crtCategorySeries.getSeries(), crtCategorySeries.getCategory());
|
||||
if (crtCategorySeries.getLabelExpression() != null) {
|
||||
Map seriesLabels = (Map)this.labelsMap.get(seriesName);
|
||||
if (seriesLabels == null) {
|
||||
seriesLabels = new HashMap();
|
||||
this.labelsMap.put(seriesName, seriesLabels);
|
||||
}
|
||||
seriesLabels.put(crtCategorySeries.getCategory(), crtCategorySeries.getLabel());
|
||||
}
|
||||
if (crtCategorySeries.hasItemHyperlinks()) {
|
||||
Map seriesLinks = (Map)this.itemHyperlinks.get(seriesName);
|
||||
if (seriesLinks == null) {
|
||||
seriesLinks = new HashMap();
|
||||
this.itemHyperlinks.put(seriesName, seriesLinks);
|
||||
}
|
||||
seriesLinks.put(crtCategorySeries.getCategory(), crtCategorySeries.getPrintItemHyperlink());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Dataset getCustomDataset() {
|
||||
return (Dataset)this.dataset;
|
||||
}
|
||||
|
||||
public byte getDatasetType() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
public CategoryLabelGenerator getLabelGenerator() {
|
||||
return new CategoryLabelGenerator(this.labelsMap);
|
||||
}
|
||||
|
||||
public void collectExpressions(JRExpressionCollector collector) {
|
||||
collector.collect(this);
|
||||
}
|
||||
|
||||
public Map getItemHyperlinks() {
|
||||
return this.itemHyperlinks;
|
||||
}
|
||||
|
||||
public boolean hasItemHyperlinks() {
|
||||
boolean foundLinks = false;
|
||||
if (this.categorySeries != null && this.categorySeries.length > 0)
|
||||
for (int i = 0; i < this.categorySeries.length && !foundLinks; i++) {
|
||||
JRFillCategorySeries serie = this.categorySeries[i];
|
||||
foundLinks = serie.hasItemHyperlinks();
|
||||
}
|
||||
return foundLinks;
|
||||
}
|
||||
|
||||
public void validate(JRVerifier verifier) {
|
||||
verifier.verify(this);
|
||||
}
|
||||
}
|
@@ -0,0 +1,100 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import net.sf.jasperreports.charts.JRCategorySeries;
|
||||
import net.sf.jasperreports.engine.JRException;
|
||||
import net.sf.jasperreports.engine.JRExpression;
|
||||
import net.sf.jasperreports.engine.JRHyperlink;
|
||||
import net.sf.jasperreports.engine.JRHyperlinkHelper;
|
||||
import net.sf.jasperreports.engine.JRPrintHyperlink;
|
||||
import net.sf.jasperreports.engine.JRRuntimeException;
|
||||
import net.sf.jasperreports.engine.fill.JRCalculator;
|
||||
import net.sf.jasperreports.engine.fill.JRExpressionEvalException;
|
||||
import net.sf.jasperreports.engine.fill.JRFillExpressionEvaluator;
|
||||
import net.sf.jasperreports.engine.fill.JRFillHyperlinkHelper;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
|
||||
public class JRFillCategorySeries implements JRCategorySeries {
|
||||
protected JRCategorySeries parent = null;
|
||||
|
||||
private Comparable series = null;
|
||||
|
||||
private Comparable category = null;
|
||||
|
||||
private Number value = null;
|
||||
|
||||
private String label = null;
|
||||
|
||||
private JRPrintHyperlink itemHyperlink;
|
||||
|
||||
public JRFillCategorySeries(JRCategorySeries categorySeries, JRFillObjectFactory factory) {
|
||||
factory.put(categorySeries, this);
|
||||
this.parent = categorySeries;
|
||||
}
|
||||
|
||||
public JRExpression getSeriesExpression() {
|
||||
return this.parent.getSeriesExpression();
|
||||
}
|
||||
|
||||
public JRExpression getCategoryExpression() {
|
||||
return this.parent.getCategoryExpression();
|
||||
}
|
||||
|
||||
public JRExpression getValueExpression() {
|
||||
return this.parent.getValueExpression();
|
||||
}
|
||||
|
||||
public JRExpression getLabelExpression() {
|
||||
return this.parent.getLabelExpression();
|
||||
}
|
||||
|
||||
protected Comparable getSeries() {
|
||||
return this.series;
|
||||
}
|
||||
|
||||
protected Comparable getCategory() {
|
||||
return this.category;
|
||||
}
|
||||
|
||||
protected Number getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
protected String getLabel() {
|
||||
return this.label;
|
||||
}
|
||||
|
||||
protected JRPrintHyperlink getPrintItemHyperlink() {
|
||||
return this.itemHyperlink;
|
||||
}
|
||||
|
||||
protected void evaluate(JRCalculator calculator) throws JRExpressionEvalException {
|
||||
this.series = (Comparable)calculator.evaluate(getSeriesExpression());
|
||||
this.category = (Comparable)calculator.evaluate(getCategoryExpression());
|
||||
this.value = (Number)calculator.evaluate(getValueExpression());
|
||||
this.label = (String)calculator.evaluate(getLabelExpression());
|
||||
if (hasItemHyperlinks())
|
||||
evaluateItemHyperlink(calculator);
|
||||
}
|
||||
|
||||
protected void evaluateItemHyperlink(JRCalculator calculator) throws JRExpressionEvalException {
|
||||
try {
|
||||
this.itemHyperlink = JRFillHyperlinkHelper.evaluateHyperlink(getItemHyperlink(), (JRFillExpressionEvaluator)calculator, (byte)3);
|
||||
} catch (JRExpressionEvalException e) {
|
||||
throw e;
|
||||
} catch (JRException e) {
|
||||
throw new JRRuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasItemHyperlinks() {
|
||||
return !JRHyperlinkHelper.isEmpty(getItemHyperlink());
|
||||
}
|
||||
|
||||
public JRHyperlink getItemHyperlink() {
|
||||
return this.parent.getItemHyperlink();
|
||||
}
|
||||
|
||||
public Object clone() {
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,37 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import net.sf.jasperreports.charts.JRChartAxis;
|
||||
import net.sf.jasperreports.engine.JRChart;
|
||||
import net.sf.jasperreports.engine.JRVisitable;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChart;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
|
||||
public class JRFillChartAxis implements JRChartAxis {
|
||||
protected JRChartAxis parent;
|
||||
|
||||
protected JRFillChart fillChart = null;
|
||||
|
||||
private static final long serialVersionUID = 10200L;
|
||||
|
||||
public JRFillChartAxis(JRChartAxis axis, JRFillObjectFactory factory) {
|
||||
factory.put(axis, this);
|
||||
this.parent = axis;
|
||||
this.fillChart = (JRFillChart)factory.getVisitResult((JRVisitable)axis.getChart());
|
||||
}
|
||||
|
||||
public JRFillChart getFillChart() {
|
||||
return this.fillChart;
|
||||
}
|
||||
|
||||
public JRChart getChart() {
|
||||
return this.parent.getChart();
|
||||
}
|
||||
|
||||
public byte getPosition() {
|
||||
return this.parent.getPosition();
|
||||
}
|
||||
|
||||
public Object clone(JRChart parentChart) {
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,240 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import net.sf.jasperreports.charts.JRHighLowDataset;
|
||||
import net.sf.jasperreports.engine.JRChartDataset;
|
||||
import net.sf.jasperreports.engine.JRException;
|
||||
import net.sf.jasperreports.engine.JRExpression;
|
||||
import net.sf.jasperreports.engine.JRExpressionCollector;
|
||||
import net.sf.jasperreports.engine.JRHyperlink;
|
||||
import net.sf.jasperreports.engine.JRHyperlinkHelper;
|
||||
import net.sf.jasperreports.engine.JRPrintHyperlink;
|
||||
import net.sf.jasperreports.engine.JRRuntimeException;
|
||||
import net.sf.jasperreports.engine.design.JRVerifier;
|
||||
import net.sf.jasperreports.engine.fill.JRCalculator;
|
||||
import net.sf.jasperreports.engine.fill.JRExpressionEvalException;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartDataset;
|
||||
import net.sf.jasperreports.engine.fill.JRFillExpressionEvaluator;
|
||||
import net.sf.jasperreports.engine.fill.JRFillHyperlinkHelper;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
import org.jfree.data.general.Dataset;
|
||||
import org.jfree.data.xy.DefaultHighLowDataset;
|
||||
|
||||
public class JRFillHighLowDataset extends JRFillChartDataset implements JRHighLowDataset {
|
||||
private String series = null;
|
||||
|
||||
private List elements = new ArrayList();
|
||||
|
||||
private Date date = null;
|
||||
|
||||
private Number high = null;
|
||||
|
||||
private Number low = null;
|
||||
|
||||
private Number open = null;
|
||||
|
||||
private Number close = null;
|
||||
|
||||
private Number volume = null;
|
||||
|
||||
private JRPrintHyperlink itemHyperlink;
|
||||
|
||||
private List itemHyperlinks;
|
||||
|
||||
public JRFillHighLowDataset(JRHighLowDataset dataset, JRFillObjectFactory factory) {
|
||||
super((JRChartDataset)dataset, factory);
|
||||
}
|
||||
|
||||
protected void customInitialize() {
|
||||
this.elements = new ArrayList();
|
||||
this.itemHyperlinks = new ArrayList();
|
||||
}
|
||||
|
||||
protected void customEvaluate(JRCalculator calculator) throws JRExpressionEvalException {
|
||||
this.series = (String)calculator.evaluate(getSeriesExpression());
|
||||
this.date = (Date)calculator.evaluate(getDateExpression());
|
||||
this.high = (Number)calculator.evaluate(getHighExpression());
|
||||
this.low = (Number)calculator.evaluate(getLowExpression());
|
||||
this.open = (Number)calculator.evaluate(getOpenExpression());
|
||||
this.close = (Number)calculator.evaluate(getCloseExpression());
|
||||
this.volume = (Number)calculator.evaluate(getVolumeExpression());
|
||||
if (hasItemHyperlink())
|
||||
evaluateSectionHyperlink(calculator);
|
||||
}
|
||||
|
||||
protected void evaluateSectionHyperlink(JRCalculator calculator) throws JRExpressionEvalException {
|
||||
try {
|
||||
this.itemHyperlink = JRFillHyperlinkHelper.evaluateHyperlink(getItemHyperlink(), (JRFillExpressionEvaluator)calculator, (byte)3);
|
||||
} catch (JRExpressionEvalException e) {
|
||||
throw e;
|
||||
} catch (JRException e) {
|
||||
throw new JRRuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
protected void customIncrement() {
|
||||
this.elements.add(new HighLowElement(this.date, this.high, this.low, this.open, this.close, this.volume));
|
||||
if (hasItemHyperlink())
|
||||
this.itemHyperlinks.add(this.itemHyperlink);
|
||||
}
|
||||
|
||||
public Dataset getCustomDataset() {
|
||||
int size = this.elements.size();
|
||||
if (size > 0) {
|
||||
Date[] dateArray = new Date[size];
|
||||
double[] highArray = new double[size];
|
||||
double[] lowArray = new double[size];
|
||||
double[] openArray = new double[size];
|
||||
double[] closeArray = new double[size];
|
||||
double[] volumeArray = new double[size];
|
||||
for (int i = 0; i < this.elements.size(); i++) {
|
||||
HighLowElement bean = this.elements.get(i);
|
||||
dateArray[i] = new Date(bean.getDate().getTime());
|
||||
highArray[i] = bean.getHigh().doubleValue();
|
||||
lowArray[i] = bean.getLow().doubleValue();
|
||||
openArray[i] = bean.getOpen().doubleValue();
|
||||
closeArray[i] = bean.getClose().doubleValue();
|
||||
volumeArray[i] = bean.getVolume().doubleValue();
|
||||
}
|
||||
return (Dataset)new DefaultHighLowDataset(this.series, dateArray, highArray, lowArray, openArray, closeArray, volumeArray);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public JRExpression getSeriesExpression() {
|
||||
return ((JRHighLowDataset)this.parent).getSeriesExpression();
|
||||
}
|
||||
|
||||
public JRExpression getDateExpression() {
|
||||
return ((JRHighLowDataset)this.parent).getDateExpression();
|
||||
}
|
||||
|
||||
public JRExpression getHighExpression() {
|
||||
return ((JRHighLowDataset)this.parent).getHighExpression();
|
||||
}
|
||||
|
||||
public JRExpression getLowExpression() {
|
||||
return ((JRHighLowDataset)this.parent).getLowExpression();
|
||||
}
|
||||
|
||||
public JRExpression getOpenExpression() {
|
||||
return ((JRHighLowDataset)this.parent).getOpenExpression();
|
||||
}
|
||||
|
||||
public JRExpression getCloseExpression() {
|
||||
return ((JRHighLowDataset)this.parent).getCloseExpression();
|
||||
}
|
||||
|
||||
public JRExpression getVolumeExpression() {
|
||||
return ((JRHighLowDataset)this.parent).getVolumeExpression();
|
||||
}
|
||||
|
||||
private static class HighLowElement {
|
||||
Date date;
|
||||
|
||||
Number high;
|
||||
|
||||
Number low;
|
||||
|
||||
Number open;
|
||||
|
||||
Number close;
|
||||
|
||||
Number volume;
|
||||
|
||||
public HighLowElement(Date date, Number high, Number low, Number open, Number close, Number volume) {
|
||||
if (date == null)
|
||||
throw new JRRuntimeException("Date value is null in high-low series.");
|
||||
this.date = date;
|
||||
if (high == null)
|
||||
throw new JRRuntimeException("High value is null in high-low series.");
|
||||
this.high = high;
|
||||
if (low == null)
|
||||
throw new JRRuntimeException("Low value is null in high-low series.");
|
||||
this.low = low;
|
||||
if (open == null)
|
||||
throw new JRRuntimeException("Open value is null in high-low series.");
|
||||
this.open = open;
|
||||
if (close == null)
|
||||
throw new JRRuntimeException("Close value is null in high-low series.");
|
||||
this.close = close;
|
||||
if (volume == null)
|
||||
throw new JRRuntimeException("Volume value is null in high-low series.");
|
||||
this.volume = volume;
|
||||
}
|
||||
|
||||
public Date getDate() {
|
||||
return this.date;
|
||||
}
|
||||
|
||||
public void setDate(Date date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public Number getHigh() {
|
||||
return this.high;
|
||||
}
|
||||
|
||||
public void setHigh(Number high) {
|
||||
this.high = high;
|
||||
}
|
||||
|
||||
public Number getLow() {
|
||||
return this.low;
|
||||
}
|
||||
|
||||
public void setLow(Number low) {
|
||||
this.low = low;
|
||||
}
|
||||
|
||||
public Number getOpen() {
|
||||
return this.open;
|
||||
}
|
||||
|
||||
public void setOpen(Number open) {
|
||||
this.open = open;
|
||||
}
|
||||
|
||||
public Number getClose() {
|
||||
return this.close;
|
||||
}
|
||||
|
||||
public void setClose(Number close) {
|
||||
this.close = close;
|
||||
}
|
||||
|
||||
public Number getVolume() {
|
||||
return this.volume;
|
||||
}
|
||||
|
||||
public void setVolume(Number volume) {
|
||||
this.volume = volume;
|
||||
}
|
||||
}
|
||||
|
||||
public byte getDatasetType() {
|
||||
return 7;
|
||||
}
|
||||
|
||||
public void collectExpressions(JRExpressionCollector collector) {
|
||||
collector.collect(this);
|
||||
}
|
||||
|
||||
public JRHyperlink getItemHyperlink() {
|
||||
return ((JRHighLowDataset)this.parent).getItemHyperlink();
|
||||
}
|
||||
|
||||
public boolean hasItemHyperlink() {
|
||||
return !JRHyperlinkHelper.isEmpty(getItemHyperlink());
|
||||
}
|
||||
|
||||
public List getItemHyperlinks() {
|
||||
return this.itemHyperlinks;
|
||||
}
|
||||
|
||||
public void validate(JRVerifier verifier) {
|
||||
verifier.verify(this);
|
||||
}
|
||||
}
|
162
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillHighLowPlot.java
Normal file
162
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillHighLowPlot.java
Normal file
@@ -0,0 +1,162 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.awt.Color;
|
||||
import net.sf.jasperreports.charts.JRHighLowPlot;
|
||||
import net.sf.jasperreports.charts.JRTimeAxisFormat;
|
||||
import net.sf.jasperreports.charts.JRValueAxisFormat;
|
||||
import net.sf.jasperreports.engine.JRChartPlot;
|
||||
import net.sf.jasperreports.engine.JRExpression;
|
||||
import net.sf.jasperreports.engine.JRFont;
|
||||
import net.sf.jasperreports.engine.JRStyleContainer;
|
||||
import net.sf.jasperreports.engine.base.JRBaseFont;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartPlot;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
import net.sf.jasperreports.engine.util.JRStyleResolver;
|
||||
|
||||
public class JRFillHighLowPlot extends JRFillChartPlot implements JRHighLowPlot {
|
||||
protected JRFont timeAxisLabelFont = null;
|
||||
|
||||
protected Color timeAxisLabelColor = null;
|
||||
|
||||
protected JRFont timeAxisTickLabelFont = null;
|
||||
|
||||
protected Color timeAxisTickLabelColor = null;
|
||||
|
||||
protected Color timeAxisLineColor = null;
|
||||
|
||||
protected JRFont valueAxisLabelFont = null;
|
||||
|
||||
protected Color valueAxisLabelColor = null;
|
||||
|
||||
protected JRFont valueAxisTickLabelFont = null;
|
||||
|
||||
protected Color valueAxisTickLabelColor = null;
|
||||
|
||||
protected Color valueAxisLineColor = null;
|
||||
|
||||
public JRFillHighLowPlot(JRHighLowPlot highLowPlot, JRFillObjectFactory factory) {
|
||||
super((JRChartPlot)highLowPlot, factory);
|
||||
this.timeAxisLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)highLowPlot.getChart(), highLowPlot.getTimeAxisLabelFont());
|
||||
this.timeAxisLabelColor = highLowPlot.getOwnTimeAxisLabelColor();
|
||||
this.timeAxisTickLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)highLowPlot.getChart(), highLowPlot.getTimeAxisTickLabelFont());
|
||||
this.timeAxisTickLabelColor = highLowPlot.getOwnTimeAxisTickLabelColor();
|
||||
this.timeAxisLineColor = highLowPlot.getTimeAxisLineColor();
|
||||
this.valueAxisLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)highLowPlot.getChart(), highLowPlot.getValueAxisLabelFont());
|
||||
this.valueAxisLabelColor = highLowPlot.getOwnValueAxisLabelColor();
|
||||
this.valueAxisTickLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)highLowPlot.getChart(), highLowPlot.getValueAxisTickLabelFont());
|
||||
this.valueAxisTickLabelColor = highLowPlot.getOwnValueAxisTickLabelColor();
|
||||
this.valueAxisLineColor = highLowPlot.getValueAxisTickLabelColor();
|
||||
}
|
||||
|
||||
public JRExpression getTimeAxisLabelExpression() {
|
||||
return ((JRHighLowPlot)this.parent).getTimeAxisLabelExpression();
|
||||
}
|
||||
|
||||
public JRFont getTimeAxisLabelFont() {
|
||||
return this.timeAxisLabelFont;
|
||||
}
|
||||
|
||||
public void setTimeAxisLabelFont(JRFont font) {}
|
||||
|
||||
public Color getTimeAxisLabelColor() {
|
||||
return JRStyleResolver.getTimeAxisLabelColor((JRTimeAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnTimeAxisLabelColor() {
|
||||
return this.timeAxisLabelColor;
|
||||
}
|
||||
|
||||
public void setTimeAxisLabelColor(Color color) {}
|
||||
|
||||
public JRFont getTimeAxisTickLabelFont() {
|
||||
return this.timeAxisTickLabelFont;
|
||||
}
|
||||
|
||||
public void setTimeAxisTickLabelFont(JRFont font) {}
|
||||
|
||||
public Color getTimeAxisTickLabelColor() {
|
||||
return JRStyleResolver.getTimeAxisTickLabelColor((JRTimeAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnTimeAxisTickLabelColor() {
|
||||
return this.timeAxisTickLabelColor;
|
||||
}
|
||||
|
||||
public void setTimeAxisTickLabelColor(Color color) {}
|
||||
|
||||
public String getTimeAxisTickLabelMask() {
|
||||
return ((JRHighLowPlot)this.parent).getTimeAxisTickLabelMask();
|
||||
}
|
||||
|
||||
public void setTimeAxisTickLabelMask(String mask) {}
|
||||
|
||||
public Color getTimeAxisLineColor() {
|
||||
return JRStyleResolver.getTimeAxisLineColor((JRTimeAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnTimeAxisLineColor() {
|
||||
return this.timeAxisLineColor;
|
||||
}
|
||||
|
||||
public void setTimeAxisLineColor(Color color) {}
|
||||
|
||||
public JRExpression getValueAxisLabelExpression() {
|
||||
return ((JRHighLowPlot)this.parent).getValueAxisLabelExpression();
|
||||
}
|
||||
|
||||
public JRFont getValueAxisLabelFont() {
|
||||
return this.valueAxisLabelFont;
|
||||
}
|
||||
|
||||
public void setValueAxisLabelFont(JRFont font) {}
|
||||
|
||||
public Color getValueAxisLabelColor() {
|
||||
return JRStyleResolver.getValueAxisLabelColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisLabelColor() {
|
||||
return this.valueAxisLabelColor;
|
||||
}
|
||||
|
||||
public void setValueAxisLabelColor(Color color) {}
|
||||
|
||||
public JRFont getValueAxisTickLabelFont() {
|
||||
return this.valueAxisTickLabelFont;
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelFont(JRFont font) {}
|
||||
|
||||
public Color getValueAxisTickLabelColor() {
|
||||
return JRStyleResolver.getValueAxisTickLabelColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisTickLabelColor() {
|
||||
return this.valueAxisTickLabelColor;
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelColor(Color color) {}
|
||||
|
||||
public String getValueAxisTickLabelMask() {
|
||||
return ((JRHighLowPlot)this.parent).getValueAxisTickLabelMask();
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelMask(String mask) {}
|
||||
|
||||
public Color getValueAxisLineColor() {
|
||||
return JRStyleResolver.getValueAxisLineColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisLineColor() {
|
||||
return this.valueAxisLineColor;
|
||||
}
|
||||
|
||||
public void setValueAxisLineColor(Color color) {}
|
||||
|
||||
public boolean isShowOpenTicks() {
|
||||
return ((JRHighLowPlot)this.parent).isShowOpenTicks();
|
||||
}
|
||||
|
||||
public boolean isShowCloseTicks() {
|
||||
return ((JRHighLowPlot)this.parent).isShowCloseTicks();
|
||||
}
|
||||
}
|
166
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillLinePlot.java
Normal file
166
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillLinePlot.java
Normal file
@@ -0,0 +1,166 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.awt.Color;
|
||||
import net.sf.jasperreports.charts.JRCategoryAxisFormat;
|
||||
import net.sf.jasperreports.charts.JRLinePlot;
|
||||
import net.sf.jasperreports.charts.JRValueAxisFormat;
|
||||
import net.sf.jasperreports.engine.JRChartPlot;
|
||||
import net.sf.jasperreports.engine.JRExpression;
|
||||
import net.sf.jasperreports.engine.JRFont;
|
||||
import net.sf.jasperreports.engine.JRStyleContainer;
|
||||
import net.sf.jasperreports.engine.base.JRBaseFont;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartPlot;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
import net.sf.jasperreports.engine.util.JRStyleResolver;
|
||||
|
||||
public class JRFillLinePlot extends JRFillChartPlot implements JRLinePlot {
|
||||
protected JRFont categoryAxisLabelFont = null;
|
||||
|
||||
protected Color categoryAxisLabelColor = null;
|
||||
|
||||
protected JRFont categoryAxisTickLabelFont = null;
|
||||
|
||||
protected Color categoryAxisTickLabelColor = null;
|
||||
|
||||
protected Color categoryAxisLineColor = null;
|
||||
|
||||
protected JRFont valueAxisLabelFont = null;
|
||||
|
||||
protected Color valueAxisLabelColor = null;
|
||||
|
||||
protected JRFont valueAxisTickLabelFont = null;
|
||||
|
||||
protected Color valueAxisTickLabelColor = null;
|
||||
|
||||
protected Color valueAxisLineColor = null;
|
||||
|
||||
public JRFillLinePlot(JRLinePlot plot, JRFillObjectFactory factory) {
|
||||
super((JRChartPlot)plot, factory);
|
||||
this.categoryAxisLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)plot.getChart(), plot.getCategoryAxisLabelFont());
|
||||
this.categoryAxisLabelColor = plot.getOwnCategoryAxisLabelColor();
|
||||
this.categoryAxisTickLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)plot.getChart(), plot.getCategoryAxisTickLabelFont());
|
||||
this.categoryAxisTickLabelColor = plot.getOwnCategoryAxisTickLabelColor();
|
||||
this.categoryAxisLineColor = plot.getOwnCategoryAxisLineColor();
|
||||
this.valueAxisLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)plot.getChart(), plot.getValueAxisLabelFont());
|
||||
this.valueAxisLabelColor = plot.getOwnValueAxisLabelColor();
|
||||
this.valueAxisTickLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)plot.getChart(), plot.getValueAxisTickLabelFont());
|
||||
this.valueAxisTickLabelColor = plot.getOwnValueAxisTickLabelColor();
|
||||
this.valueAxisLineColor = plot.getOwnValueAxisLineColor();
|
||||
}
|
||||
|
||||
public JRExpression getCategoryAxisLabelExpression() {
|
||||
return ((JRLinePlot)this.parent).getCategoryAxisLabelExpression();
|
||||
}
|
||||
|
||||
public JRFont getCategoryAxisLabelFont() {
|
||||
return this.categoryAxisLabelFont;
|
||||
}
|
||||
|
||||
public void setCategoryAxisLabelFont(JRFont font) {}
|
||||
|
||||
public Color getCategoryAxisLabelColor() {
|
||||
return JRStyleResolver.getCategoryAxisLabelColor((JRCategoryAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnCategoryAxisLabelColor() {
|
||||
return this.categoryAxisLabelColor;
|
||||
}
|
||||
|
||||
public void setCategoryAxisLabelColor(Color color) {}
|
||||
|
||||
public JRFont getCategoryAxisTickLabelFont() {
|
||||
return this.categoryAxisTickLabelFont;
|
||||
}
|
||||
|
||||
public void setCategoryAxisTickLabelFont(JRFont font) {}
|
||||
|
||||
public Color getCategoryAxisTickLabelColor() {
|
||||
return JRStyleResolver.getCategoryAxisTickLabelColor((JRCategoryAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnCategoryAxisTickLabelColor() {
|
||||
return this.categoryAxisTickLabelColor;
|
||||
}
|
||||
|
||||
public void setCategoryAxisTickLabelColor(Color color) {}
|
||||
|
||||
public String getCategoryAxisTickLabelMask() {
|
||||
return ((JRLinePlot)this.parent).getCategoryAxisTickLabelMask();
|
||||
}
|
||||
|
||||
public void setCategoryAxisTickLabelMask(String mask) {}
|
||||
|
||||
public Color getCategoryAxisLineColor() {
|
||||
return JRStyleResolver.getCategoryAxisLineColor((JRCategoryAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnCategoryAxisLineColor() {
|
||||
return this.categoryAxisLineColor;
|
||||
}
|
||||
|
||||
public void setCategoryAxisLineColor(Color color) {}
|
||||
|
||||
public JRExpression getValueAxisLabelExpression() {
|
||||
return ((JRLinePlot)this.parent).getValueAxisLabelExpression();
|
||||
}
|
||||
|
||||
public JRFont getValueAxisLabelFont() {
|
||||
return this.valueAxisLabelFont;
|
||||
}
|
||||
|
||||
public void setValueAxisLabelFont(JRFont font) {}
|
||||
|
||||
public Color getValueAxisLabelColor() {
|
||||
return JRStyleResolver.getValueAxisLabelColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisLabelColor() {
|
||||
return this.valueAxisLabelColor;
|
||||
}
|
||||
|
||||
public void setValueAxisLabelColor(Color color) {}
|
||||
|
||||
public JRFont getValueAxisTickLabelFont() {
|
||||
return this.valueAxisTickLabelFont;
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelFont(JRFont font) {}
|
||||
|
||||
public Color getValueAxisTickLabelColor() {
|
||||
return JRStyleResolver.getValueAxisTickLabelColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisTickLabelColor() {
|
||||
return this.valueAxisTickLabelColor;
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelColor(Color color) {}
|
||||
|
||||
public String getValueAxisTickLabelMask() {
|
||||
return ((JRLinePlot)this.parent).getValueAxisTickLabelMask();
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelMask(String mask) {}
|
||||
|
||||
public Color getValueAxisLineColor() {
|
||||
return JRStyleResolver.getValueAxisLineColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisLineColor() {
|
||||
return this.valueAxisLineColor;
|
||||
}
|
||||
|
||||
public void setValueAxisLineColor(Color color) {}
|
||||
|
||||
public boolean isShowShapes() {
|
||||
return ((JRLinePlot)this.parent).isShowShapes();
|
||||
}
|
||||
|
||||
public void setShowShapes(boolean value) {}
|
||||
|
||||
public boolean isShowLines() {
|
||||
return ((JRLinePlot)this.parent).isShowLines();
|
||||
}
|
||||
|
||||
public void setShowLines(boolean value) {}
|
||||
}
|
@@ -0,0 +1,56 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.List;
|
||||
import net.sf.jasperreports.charts.JRDataRange;
|
||||
import net.sf.jasperreports.charts.JRMeterPlot;
|
||||
import net.sf.jasperreports.charts.JRValueDisplay;
|
||||
import net.sf.jasperreports.engine.JRChartPlot;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartPlot;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
|
||||
public class JRFillMeterPlot extends JRFillChartPlot implements JRMeterPlot {
|
||||
public JRFillMeterPlot(JRMeterPlot meterPlot, JRFillObjectFactory factory) {
|
||||
super((JRChartPlot)meterPlot, factory);
|
||||
}
|
||||
|
||||
public JRDataRange getDataRange() {
|
||||
return ((JRMeterPlot)this.parent).getDataRange();
|
||||
}
|
||||
|
||||
public JRValueDisplay getValueDisplay() {
|
||||
return ((JRMeterPlot)this.parent).getValueDisplay();
|
||||
}
|
||||
|
||||
public byte getShape() {
|
||||
return ((JRMeterPlot)this.parent).getShape();
|
||||
}
|
||||
|
||||
public List getIntervals() {
|
||||
return ((JRMeterPlot)this.parent).getIntervals();
|
||||
}
|
||||
|
||||
public int getMeterAngle() {
|
||||
return ((JRMeterPlot)this.parent).getMeterAngle();
|
||||
}
|
||||
|
||||
public String getUnits() {
|
||||
return ((JRMeterPlot)this.parent).getUnits();
|
||||
}
|
||||
|
||||
public double getTickInterval() {
|
||||
return ((JRMeterPlot)this.parent).getTickInterval();
|
||||
}
|
||||
|
||||
public Color getMeterBackgroundColor() {
|
||||
return ((JRMeterPlot)this.parent).getMeterBackgroundColor();
|
||||
}
|
||||
|
||||
public Color getNeedleColor() {
|
||||
return ((JRMeterPlot)this.parent).getNeedleColor();
|
||||
}
|
||||
|
||||
public Color getTickColor() {
|
||||
return ((JRMeterPlot)this.parent).getTickColor();
|
||||
}
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import net.sf.jasperreports.charts.JRChartAxis;
|
||||
import net.sf.jasperreports.charts.JRMultiAxisPlot;
|
||||
import net.sf.jasperreports.engine.JRChartPlot;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartDataset;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartPlot;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
|
||||
public class JRFillMultiAxisPlot extends JRFillChartPlot implements JRMultiAxisPlot {
|
||||
private List axes;
|
||||
|
||||
public JRFillMultiAxisPlot(JRMultiAxisPlot multiAxisPlot, JRFillObjectFactory factory) {
|
||||
super((JRChartPlot)multiAxisPlot, factory);
|
||||
List parentAxes = multiAxisPlot.getAxes();
|
||||
this.axes = new ArrayList(parentAxes.size());
|
||||
Iterator iter = parentAxes.iterator();
|
||||
while (iter.hasNext()) {
|
||||
JRChartAxis axis = iter.next();
|
||||
this.axes.add(factory.getChartAxis(axis));
|
||||
}
|
||||
}
|
||||
|
||||
public List getAxes() {
|
||||
return this.axes;
|
||||
}
|
||||
|
||||
public JRFillChartDataset getMainDataset() {
|
||||
return (JRFillChartDataset)((JRFillChartAxis)this.axes.get(0)).getFillChart().getDataset();
|
||||
}
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import net.sf.jasperreports.charts.JRPie3DPlot;
|
||||
import net.sf.jasperreports.engine.JRChartPlot;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartPlot;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
|
||||
public class JRFillPie3DPlot extends JRFillChartPlot implements JRPie3DPlot {
|
||||
public JRFillPie3DPlot(JRPie3DPlot pie3DPlot, JRFillObjectFactory factory) {
|
||||
super((JRChartPlot)pie3DPlot, factory);
|
||||
}
|
||||
|
||||
public double getDepthFactor() {
|
||||
return ((JRPie3DPlot)this.parent).getDepthFactor();
|
||||
}
|
||||
|
||||
public boolean isCircular() {
|
||||
return ((JRPie3DPlot)this.parent).isCircular();
|
||||
}
|
||||
}
|
118
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillPieDataset.java
Normal file
118
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillPieDataset.java
Normal file
@@ -0,0 +1,118 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import net.sf.jasperreports.charts.JRPieDataset;
|
||||
import net.sf.jasperreports.charts.util.PieLabelGenerator;
|
||||
import net.sf.jasperreports.engine.JRChartDataset;
|
||||
import net.sf.jasperreports.engine.JRException;
|
||||
import net.sf.jasperreports.engine.JRExpression;
|
||||
import net.sf.jasperreports.engine.JRExpressionCollector;
|
||||
import net.sf.jasperreports.engine.JRHyperlink;
|
||||
import net.sf.jasperreports.engine.JRHyperlinkHelper;
|
||||
import net.sf.jasperreports.engine.JRPrintHyperlink;
|
||||
import net.sf.jasperreports.engine.JRRuntimeException;
|
||||
import net.sf.jasperreports.engine.design.JRVerifier;
|
||||
import net.sf.jasperreports.engine.fill.JRCalculator;
|
||||
import net.sf.jasperreports.engine.fill.JRExpressionEvalException;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartDataset;
|
||||
import net.sf.jasperreports.engine.fill.JRFillExpressionEvaluator;
|
||||
import net.sf.jasperreports.engine.fill.JRFillHyperlinkHelper;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
import org.jfree.data.general.Dataset;
|
||||
import org.jfree.data.general.DefaultPieDataset;
|
||||
|
||||
public class JRFillPieDataset extends JRFillChartDataset implements JRPieDataset {
|
||||
private DefaultPieDataset dataset = new DefaultPieDataset();
|
||||
|
||||
private Map labels = null;
|
||||
|
||||
private Comparable key = null;
|
||||
|
||||
private Number value = null;
|
||||
|
||||
private String label = null;
|
||||
|
||||
private Map sectionHyperlinks;
|
||||
|
||||
private JRPrintHyperlink sectionHyperlink;
|
||||
|
||||
public JRFillPieDataset(JRPieDataset pieDataset, JRFillObjectFactory factory) {
|
||||
super((JRChartDataset)pieDataset, factory);
|
||||
}
|
||||
|
||||
public JRExpression getKeyExpression() {
|
||||
return ((JRPieDataset)this.parent).getKeyExpression();
|
||||
}
|
||||
|
||||
public JRExpression getValueExpression() {
|
||||
return ((JRPieDataset)this.parent).getValueExpression();
|
||||
}
|
||||
|
||||
public JRExpression getLabelExpression() {
|
||||
return ((JRPieDataset)this.parent).getLabelExpression();
|
||||
}
|
||||
|
||||
protected void customInitialize() {
|
||||
this.dataset = new DefaultPieDataset();
|
||||
this.labels = new HashMap();
|
||||
this.sectionHyperlinks = new HashMap();
|
||||
}
|
||||
|
||||
protected void customEvaluate(JRCalculator calculator) throws JRExpressionEvalException {
|
||||
this.key = (Comparable)calculator.evaluate(getKeyExpression());
|
||||
this.value = (Number)calculator.evaluate(getValueExpression());
|
||||
this.label = (String)calculator.evaluate(getLabelExpression());
|
||||
if (hasSectionHyperlinks())
|
||||
evaluateSectionHyperlink(calculator);
|
||||
}
|
||||
|
||||
protected void evaluateSectionHyperlink(JRCalculator calculator) throws JRExpressionEvalException {
|
||||
try {
|
||||
this.sectionHyperlink = JRFillHyperlinkHelper.evaluateHyperlink(getSectionHyperlink(), (JRFillExpressionEvaluator)calculator, (byte)3);
|
||||
} catch (JRExpressionEvalException e) {
|
||||
throw e;
|
||||
} catch (JRException e) {
|
||||
throw new JRRuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
protected void customIncrement() {
|
||||
this.dataset.setValue(this.key, this.value);
|
||||
this.labels.put(this.key, this.label);
|
||||
if (hasSectionHyperlinks())
|
||||
this.sectionHyperlinks.put(this.key, this.sectionHyperlink);
|
||||
}
|
||||
|
||||
public Dataset getCustomDataset() {
|
||||
return (Dataset)this.dataset;
|
||||
}
|
||||
|
||||
public byte getDatasetType() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public PieLabelGenerator getLabelGenerator() {
|
||||
return (getLabelExpression() == null) ? null : new PieLabelGenerator(this.labels);
|
||||
}
|
||||
|
||||
public void collectExpressions(JRExpressionCollector collector) {
|
||||
collector.collect(this);
|
||||
}
|
||||
|
||||
public JRHyperlink getSectionHyperlink() {
|
||||
return ((JRPieDataset)this.parent).getSectionHyperlink();
|
||||
}
|
||||
|
||||
public boolean hasSectionHyperlinks() {
|
||||
return !JRHyperlinkHelper.isEmpty(getSectionHyperlink());
|
||||
}
|
||||
|
||||
public Map getSectionHyperlinks() {
|
||||
return this.sectionHyperlinks;
|
||||
}
|
||||
|
||||
public void validate(JRVerifier verifier) {
|
||||
verifier.verify(this);
|
||||
}
|
||||
}
|
16
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillPiePlot.java
Normal file
16
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillPiePlot.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import net.sf.jasperreports.charts.JRPiePlot;
|
||||
import net.sf.jasperreports.engine.JRChartPlot;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartPlot;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
|
||||
public class JRFillPiePlot extends JRFillChartPlot implements JRPiePlot {
|
||||
public JRFillPiePlot(JRPiePlot piePlot, JRFillObjectFactory factory) {
|
||||
super((JRChartPlot)piePlot, factory);
|
||||
}
|
||||
|
||||
public boolean isCircular() {
|
||||
return ((JRPiePlot)this.parent).isCircular();
|
||||
}
|
||||
}
|
146
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillScatterPlot.java
Normal file
146
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillScatterPlot.java
Normal file
@@ -0,0 +1,146 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.awt.Color;
|
||||
import net.sf.jasperreports.charts.JRScatterPlot;
|
||||
import net.sf.jasperreports.charts.JRXAxisFormat;
|
||||
import net.sf.jasperreports.charts.JRYAxisFormat;
|
||||
import net.sf.jasperreports.engine.JRChartPlot;
|
||||
import net.sf.jasperreports.engine.JRExpression;
|
||||
import net.sf.jasperreports.engine.JRFont;
|
||||
import net.sf.jasperreports.engine.JRStyleContainer;
|
||||
import net.sf.jasperreports.engine.base.JRBaseFont;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartPlot;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
import net.sf.jasperreports.engine.util.JRStyleResolver;
|
||||
|
||||
public class JRFillScatterPlot extends JRFillChartPlot implements JRScatterPlot {
|
||||
protected JRFont xAxisLabelFont = null;
|
||||
|
||||
protected Color xAxisLabelColor = null;
|
||||
|
||||
protected JRFont xAxisTickLabelFont = null;
|
||||
|
||||
protected Color xAxisTickLabelColor = null;
|
||||
|
||||
protected Color xAxisLineColor = null;
|
||||
|
||||
protected JRFont yAxisLabelFont = null;
|
||||
|
||||
protected Color yAxisLabelColor = null;
|
||||
|
||||
protected JRFont yAxisTickLabelFont = null;
|
||||
|
||||
protected Color yAxisTickLabelColor = null;
|
||||
|
||||
protected Color yAxisLineColor = null;
|
||||
|
||||
public JRFillScatterPlot(JRScatterPlot plot, JRFillObjectFactory factory) {
|
||||
super((JRChartPlot)plot, factory);
|
||||
this.xAxisLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)plot.getChart(), plot.getXAxisLabelFont());
|
||||
this.xAxisLabelColor = plot.getOwnXAxisLabelColor();
|
||||
this.xAxisTickLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)plot.getChart(), plot.getXAxisTickLabelFont());
|
||||
this.xAxisTickLabelColor = plot.getOwnXAxisTickLabelColor();
|
||||
this.xAxisLineColor = plot.getXAxisLineColor();
|
||||
this.yAxisLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)plot.getChart(), plot.getYAxisLabelFont());
|
||||
this.yAxisLabelColor = plot.getOwnYAxisLabelColor();
|
||||
this.yAxisTickLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)plot.getChart(), plot.getYAxisTickLabelFont());
|
||||
this.yAxisTickLabelColor = plot.getOwnYAxisTickLabelColor();
|
||||
this.yAxisLineColor = plot.getYAxisLineColor();
|
||||
}
|
||||
|
||||
public JRExpression getXAxisLabelExpression() {
|
||||
return ((JRScatterPlot)this.parent).getXAxisLabelExpression();
|
||||
}
|
||||
|
||||
public JRFont getXAxisLabelFont() {
|
||||
return this.xAxisLabelFont;
|
||||
}
|
||||
|
||||
public Color getXAxisLabelColor() {
|
||||
return JRStyleResolver.getXAxisLabelColor((JRXAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnXAxisLabelColor() {
|
||||
return this.xAxisLabelColor;
|
||||
}
|
||||
|
||||
public JRFont getXAxisTickLabelFont() {
|
||||
return this.xAxisTickLabelFont;
|
||||
}
|
||||
|
||||
public Color getXAxisTickLabelColor() {
|
||||
return JRStyleResolver.getXAxisTickLabelColor((JRXAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnXAxisTickLabelColor() {
|
||||
return this.xAxisTickLabelColor;
|
||||
}
|
||||
|
||||
public String getXAxisTickLabelMask() {
|
||||
return ((JRScatterPlot)this.parent).getXAxisTickLabelMask();
|
||||
}
|
||||
|
||||
public void setXAxisTickLabelMask(String mask) {}
|
||||
|
||||
public Color getXAxisLineColor() {
|
||||
return JRStyleResolver.getXAxisLineColor((JRXAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnXAxisLineColor() {
|
||||
return this.xAxisLineColor;
|
||||
}
|
||||
|
||||
public JRExpression getYAxisLabelExpression() {
|
||||
return ((JRScatterPlot)this.parent).getYAxisLabelExpression();
|
||||
}
|
||||
|
||||
public JRFont getYAxisLabelFont() {
|
||||
return this.yAxisLabelFont;
|
||||
}
|
||||
|
||||
public Color getYAxisLabelColor() {
|
||||
return JRStyleResolver.getYAxisLabelColor((JRYAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnYAxisLabelColor() {
|
||||
return this.yAxisLabelColor;
|
||||
}
|
||||
|
||||
public JRFont getYAxisTickLabelFont() {
|
||||
return this.yAxisTickLabelFont;
|
||||
}
|
||||
|
||||
public Color getYAxisTickLabelColor() {
|
||||
return JRStyleResolver.getYAxisTickLabelColor((JRYAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnYAxisTickLabelColor() {
|
||||
return this.yAxisTickLabelColor;
|
||||
}
|
||||
|
||||
public String getYAxisTickLabelMask() {
|
||||
return ((JRScatterPlot)this.parent).getYAxisTickLabelMask();
|
||||
}
|
||||
|
||||
public void setYAxisTickLabelMask(String mask) {}
|
||||
|
||||
public Color getYAxisLineColor() {
|
||||
return JRStyleResolver.getYAxisLineColor((JRYAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnYAxisLineColor() {
|
||||
return this.yAxisLineColor;
|
||||
}
|
||||
|
||||
public boolean isShowShapes() {
|
||||
return ((JRScatterPlot)this.parent).isShowShapes();
|
||||
}
|
||||
|
||||
public void setShowShapes(boolean value) {}
|
||||
|
||||
public boolean isShowLines() {
|
||||
return ((JRScatterPlot)this.parent).isShowLines();
|
||||
}
|
||||
|
||||
public void setShowLines(boolean value) {}
|
||||
}
|
@@ -0,0 +1,47 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.awt.Color;
|
||||
import net.sf.jasperreports.charts.JRDataRange;
|
||||
import net.sf.jasperreports.charts.JRThermometerPlot;
|
||||
import net.sf.jasperreports.charts.JRValueDisplay;
|
||||
import net.sf.jasperreports.engine.JRChartPlot;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartPlot;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
|
||||
public class JRFillThermometerPlot extends JRFillChartPlot implements JRThermometerPlot {
|
||||
public JRFillThermometerPlot(JRThermometerPlot thermoPlot, JRFillObjectFactory factory) {
|
||||
super((JRChartPlot)thermoPlot, factory);
|
||||
}
|
||||
|
||||
public JRDataRange getDataRange() {
|
||||
return ((JRThermometerPlot)this.parent).getDataRange();
|
||||
}
|
||||
|
||||
public JRValueDisplay getValueDisplay() {
|
||||
return ((JRThermometerPlot)this.parent).getValueDisplay();
|
||||
}
|
||||
|
||||
public boolean isShowValueLines() {
|
||||
return ((JRThermometerPlot)this.parent).isShowValueLines();
|
||||
}
|
||||
|
||||
public byte getValueLocation() {
|
||||
return ((JRThermometerPlot)this.parent).getValueLocation();
|
||||
}
|
||||
|
||||
public Color getMercuryColor() {
|
||||
return ((JRThermometerPlot)this.parent).getMercuryColor();
|
||||
}
|
||||
|
||||
public JRDataRange getLowRange() {
|
||||
return ((JRThermometerPlot)this.parent).getLowRange();
|
||||
}
|
||||
|
||||
public JRDataRange getMediumRange() {
|
||||
return ((JRThermometerPlot)this.parent).getMediumRange();
|
||||
}
|
||||
|
||||
public JRDataRange getHighRange() {
|
||||
return ((JRThermometerPlot)this.parent).getHighRange();
|
||||
}
|
||||
}
|
@@ -0,0 +1,140 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import net.sf.jasperreports.charts.JRTimePeriodDataset;
|
||||
import net.sf.jasperreports.charts.JRTimePeriodSeries;
|
||||
import net.sf.jasperreports.charts.util.TimePeriodDatasetLabelGenerator;
|
||||
import net.sf.jasperreports.engine.JRChartDataset;
|
||||
import net.sf.jasperreports.engine.JRExpressionCollector;
|
||||
import net.sf.jasperreports.engine.JRRuntimeException;
|
||||
import net.sf.jasperreports.engine.design.JRVerifier;
|
||||
import net.sf.jasperreports.engine.fill.JRCalculator;
|
||||
import net.sf.jasperreports.engine.fill.JRExpressionEvalException;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartDataset;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
import org.jfree.data.general.Dataset;
|
||||
import org.jfree.data.time.SimpleTimePeriod;
|
||||
import org.jfree.data.time.TimePeriod;
|
||||
import org.jfree.data.time.TimePeriodValues;
|
||||
import org.jfree.data.time.TimePeriodValuesCollection;
|
||||
|
||||
public class JRFillTimePeriodDataset extends JRFillChartDataset implements JRTimePeriodDataset {
|
||||
protected JRFillTimePeriodSeries[] timePeriodSeries = null;
|
||||
|
||||
private List seriesNames = null;
|
||||
|
||||
private Map seriesMap = null;
|
||||
|
||||
private Map labelsMap = null;
|
||||
|
||||
private Map itemHyperlinks;
|
||||
|
||||
public JRFillTimePeriodDataset(JRTimePeriodDataset timePeriodDataset, JRFillObjectFactory factory) {
|
||||
super((JRChartDataset)timePeriodDataset, factory);
|
||||
JRTimePeriodSeries[] srcTimePeriodSeries = timePeriodDataset.getSeries();
|
||||
if (srcTimePeriodSeries != null && srcTimePeriodSeries.length > 0) {
|
||||
this.timePeriodSeries = new JRFillTimePeriodSeries[srcTimePeriodSeries.length];
|
||||
for (int i = 0; i < this.timePeriodSeries.length; i++)
|
||||
this.timePeriodSeries[i] = (JRFillTimePeriodSeries)factory.getTimePeriodSeries(srcTimePeriodSeries[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public JRTimePeriodSeries[] getSeries() {
|
||||
return (JRTimePeriodSeries[])this.timePeriodSeries;
|
||||
}
|
||||
|
||||
protected void customInitialize() {
|
||||
this.seriesNames = null;
|
||||
this.seriesMap = null;
|
||||
this.labelsMap = null;
|
||||
this.itemHyperlinks = null;
|
||||
}
|
||||
|
||||
protected void customEvaluate(JRCalculator calculator) throws JRExpressionEvalException {
|
||||
if (this.timePeriodSeries != null && this.timePeriodSeries.length > 0)
|
||||
for (int i = 0; i < this.timePeriodSeries.length; i++)
|
||||
this.timePeriodSeries[i].evaluate(calculator);
|
||||
}
|
||||
|
||||
protected void customIncrement() {
|
||||
if (this.timePeriodSeries != null && this.timePeriodSeries.length > 0) {
|
||||
if (this.seriesNames == null) {
|
||||
this.seriesNames = new ArrayList();
|
||||
this.seriesMap = new HashMap();
|
||||
this.labelsMap = new HashMap();
|
||||
this.itemHyperlinks = new HashMap();
|
||||
}
|
||||
for (int i = 0; i < this.timePeriodSeries.length; i++) {
|
||||
JRFillTimePeriodSeries crtTimePeriodSeries = this.timePeriodSeries[i];
|
||||
Comparable seriesName = crtTimePeriodSeries.getSeries();
|
||||
if (seriesName == null)
|
||||
throw new JRRuntimeException("Time period series name is null.");
|
||||
TimePeriodValues timePeriodValues = (TimePeriodValues)this.seriesMap.get(seriesName);
|
||||
if (timePeriodValues == null) {
|
||||
timePeriodValues = new TimePeriodValues(seriesName.toString());
|
||||
this.seriesNames.add(seriesName);
|
||||
this.seriesMap.put(seriesName, timePeriodValues);
|
||||
}
|
||||
SimpleTimePeriod stp = new SimpleTimePeriod(crtTimePeriodSeries.getStartDate(), crtTimePeriodSeries.getEndDate());
|
||||
timePeriodValues.add((TimePeriod)stp, crtTimePeriodSeries.getValue());
|
||||
if (crtTimePeriodSeries.getLabelExpression() != null) {
|
||||
Map seriesLabels = (Map)this.labelsMap.get(seriesName);
|
||||
if (seriesLabels == null) {
|
||||
seriesLabels = new HashMap();
|
||||
this.labelsMap.put(seriesName, seriesLabels);
|
||||
}
|
||||
seriesLabels.put(stp, crtTimePeriodSeries.getLabel());
|
||||
}
|
||||
if (crtTimePeriodSeries.hasItemHyperlink()) {
|
||||
Map seriesLinks = (Map)this.itemHyperlinks.get(seriesName);
|
||||
if (seriesLinks == null) {
|
||||
seriesLinks = new HashMap();
|
||||
this.itemHyperlinks.put(seriesName, seriesLinks);
|
||||
}
|
||||
seriesLinks.put(stp, crtTimePeriodSeries.getPrintItemHyperlink());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Dataset getCustomDataset() {
|
||||
TimePeriodValuesCollection dataset = new TimePeriodValuesCollection();
|
||||
if (this.seriesNames != null)
|
||||
for (int i = 0; i < this.seriesNames.size(); i++) {
|
||||
Comparable seriesName = this.seriesNames.get(i);
|
||||
dataset.addSeries((TimePeriodValues)this.seriesMap.get(seriesName));
|
||||
}
|
||||
return (Dataset)dataset;
|
||||
}
|
||||
|
||||
public byte getDatasetType() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
public TimePeriodDatasetLabelGenerator getLabelGenerator() {
|
||||
return new TimePeriodDatasetLabelGenerator(this.labelsMap);
|
||||
}
|
||||
|
||||
public void collectExpressions(JRExpressionCollector collector) {
|
||||
collector.collect(this);
|
||||
}
|
||||
|
||||
public boolean hasItemHyperlinks() {
|
||||
boolean foundLinks = false;
|
||||
if (this.timePeriodSeries != null && this.timePeriodSeries.length > 0)
|
||||
for (int i = 0; i < this.timePeriodSeries.length && !foundLinks; i++)
|
||||
foundLinks = this.timePeriodSeries[i].hasItemHyperlink();
|
||||
return foundLinks;
|
||||
}
|
||||
|
||||
public Map getItemHyperlinks() {
|
||||
return this.itemHyperlinks;
|
||||
}
|
||||
|
||||
public void validate(JRVerifier verifier) {
|
||||
verifier.verify(this);
|
||||
}
|
||||
}
|
@@ -0,0 +1,112 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.util.Date;
|
||||
import net.sf.jasperreports.charts.JRTimePeriodSeries;
|
||||
import net.sf.jasperreports.engine.JRException;
|
||||
import net.sf.jasperreports.engine.JRExpression;
|
||||
import net.sf.jasperreports.engine.JRHyperlink;
|
||||
import net.sf.jasperreports.engine.JRHyperlinkHelper;
|
||||
import net.sf.jasperreports.engine.JRPrintHyperlink;
|
||||
import net.sf.jasperreports.engine.JRRuntimeException;
|
||||
import net.sf.jasperreports.engine.fill.JRCalculator;
|
||||
import net.sf.jasperreports.engine.fill.JRExpressionEvalException;
|
||||
import net.sf.jasperreports.engine.fill.JRFillExpressionEvaluator;
|
||||
import net.sf.jasperreports.engine.fill.JRFillHyperlinkHelper;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
|
||||
public class JRFillTimePeriodSeries implements JRTimePeriodSeries {
|
||||
protected JRTimePeriodSeries parent = null;
|
||||
|
||||
private Comparable series = null;
|
||||
|
||||
private Date startDate = null;
|
||||
|
||||
private Date endDate = null;
|
||||
|
||||
private Number value = null;
|
||||
|
||||
private String label = null;
|
||||
|
||||
private JRPrintHyperlink itemHyperlink;
|
||||
|
||||
public JRFillTimePeriodSeries(JRTimePeriodSeries timePeriodSeries, JRFillObjectFactory factory) {
|
||||
factory.put(timePeriodSeries, this);
|
||||
this.parent = timePeriodSeries;
|
||||
}
|
||||
|
||||
public JRExpression getSeriesExpression() {
|
||||
return this.parent.getSeriesExpression();
|
||||
}
|
||||
|
||||
public JRExpression getStartDateExpression() {
|
||||
return this.parent.getStartDateExpression();
|
||||
}
|
||||
|
||||
public JRExpression getEndDateExpression() {
|
||||
return this.parent.getEndDateExpression();
|
||||
}
|
||||
|
||||
public JRExpression getValueExpression() {
|
||||
return this.parent.getValueExpression();
|
||||
}
|
||||
|
||||
public JRExpression getLabelExpression() {
|
||||
return this.parent.getLabelExpression();
|
||||
}
|
||||
|
||||
protected Comparable getSeries() {
|
||||
return this.series;
|
||||
}
|
||||
|
||||
protected Date getStartDate() {
|
||||
return this.startDate;
|
||||
}
|
||||
|
||||
protected Date getEndDate() {
|
||||
return this.endDate;
|
||||
}
|
||||
|
||||
protected Number getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
protected String getLabel() {
|
||||
return this.label;
|
||||
}
|
||||
|
||||
protected void evaluate(JRCalculator calculator) throws JRExpressionEvalException {
|
||||
this.series = (Comparable)calculator.evaluate(getSeriesExpression());
|
||||
this.startDate = (Date)calculator.evaluate(getStartDateExpression());
|
||||
this.endDate = (Date)calculator.evaluate(getEndDateExpression());
|
||||
this.value = (Number)calculator.evaluate(getValueExpression());
|
||||
this.label = (String)calculator.evaluate(getLabelExpression());
|
||||
if (hasItemHyperlink())
|
||||
evaluateItemHyperlink(calculator);
|
||||
}
|
||||
|
||||
protected void evaluateItemHyperlink(JRCalculator calculator) throws JRExpressionEvalException {
|
||||
try {
|
||||
this.itemHyperlink = JRFillHyperlinkHelper.evaluateHyperlink(getItemHyperlink(), (JRFillExpressionEvaluator)calculator, (byte)3);
|
||||
} catch (JRExpressionEvalException e) {
|
||||
throw e;
|
||||
} catch (JRException e) {
|
||||
throw new JRRuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public JRHyperlink getItemHyperlink() {
|
||||
return this.parent.getItemHyperlink();
|
||||
}
|
||||
|
||||
public boolean hasItemHyperlink() {
|
||||
return !JRHyperlinkHelper.isEmpty(getItemHyperlink());
|
||||
}
|
||||
|
||||
public JRPrintHyperlink getPrintItemHyperlink() {
|
||||
return this.itemHyperlink;
|
||||
}
|
||||
|
||||
public Object clone() {
|
||||
return null;
|
||||
}
|
||||
}
|
101
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillTimeSeries.java
Normal file
101
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillTimeSeries.java
Normal file
@@ -0,0 +1,101 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.util.Date;
|
||||
import net.sf.jasperreports.charts.JRTimeSeries;
|
||||
import net.sf.jasperreports.engine.JRException;
|
||||
import net.sf.jasperreports.engine.JRExpression;
|
||||
import net.sf.jasperreports.engine.JRHyperlink;
|
||||
import net.sf.jasperreports.engine.JRHyperlinkHelper;
|
||||
import net.sf.jasperreports.engine.JRPrintHyperlink;
|
||||
import net.sf.jasperreports.engine.JRRuntimeException;
|
||||
import net.sf.jasperreports.engine.fill.JRCalculator;
|
||||
import net.sf.jasperreports.engine.fill.JRExpressionEvalException;
|
||||
import net.sf.jasperreports.engine.fill.JRFillExpressionEvaluator;
|
||||
import net.sf.jasperreports.engine.fill.JRFillHyperlinkHelper;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
|
||||
public class JRFillTimeSeries implements JRTimeSeries {
|
||||
protected JRTimeSeries parent = null;
|
||||
|
||||
private Comparable series = null;
|
||||
|
||||
private Date timePeriod = null;
|
||||
|
||||
private Number value = null;
|
||||
|
||||
private String label = null;
|
||||
|
||||
private JRPrintHyperlink itemHyperlink;
|
||||
|
||||
public JRFillTimeSeries(JRTimeSeries timeSeries, JRFillObjectFactory factory) {
|
||||
factory.put(timeSeries, this);
|
||||
this.parent = timeSeries;
|
||||
}
|
||||
|
||||
public JRExpression getSeriesExpression() {
|
||||
return this.parent.getSeriesExpression();
|
||||
}
|
||||
|
||||
public JRExpression getTimePeriodExpression() {
|
||||
return this.parent.getTimePeriodExpression();
|
||||
}
|
||||
|
||||
public JRExpression getValueExpression() {
|
||||
return this.parent.getValueExpression();
|
||||
}
|
||||
|
||||
public JRExpression getLabelExpression() {
|
||||
return this.parent.getLabelExpression();
|
||||
}
|
||||
|
||||
protected Comparable getSeries() {
|
||||
return this.series;
|
||||
}
|
||||
|
||||
protected Date getTimePeriod() {
|
||||
return this.timePeriod;
|
||||
}
|
||||
|
||||
protected Number getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
protected String getLabel() {
|
||||
return this.label;
|
||||
}
|
||||
|
||||
protected void evaluate(JRCalculator calculator) throws JRExpressionEvalException {
|
||||
this.series = (Comparable)calculator.evaluate(getSeriesExpression());
|
||||
this.timePeriod = (Date)calculator.evaluate(getTimePeriodExpression());
|
||||
this.value = (Number)calculator.evaluate(getValueExpression());
|
||||
this.label = (String)calculator.evaluate(getLabelExpression());
|
||||
if (hasItemHyperlink())
|
||||
evaluateItemHyperlink(calculator);
|
||||
}
|
||||
|
||||
protected void evaluateItemHyperlink(JRCalculator calculator) throws JRExpressionEvalException {
|
||||
try {
|
||||
this.itemHyperlink = JRFillHyperlinkHelper.evaluateHyperlink(getItemHyperlink(), (JRFillExpressionEvaluator)calculator, (byte)3);
|
||||
} catch (JRExpressionEvalException e) {
|
||||
throw e;
|
||||
} catch (JRException e) {
|
||||
throw new JRRuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public JRHyperlink getItemHyperlink() {
|
||||
return this.parent.getItemHyperlink();
|
||||
}
|
||||
|
||||
public boolean hasItemHyperlink() {
|
||||
return !JRHyperlinkHelper.isEmpty(getItemHyperlink());
|
||||
}
|
||||
|
||||
public JRPrintHyperlink getPrintItemHyperlink() {
|
||||
return this.itemHyperlink;
|
||||
}
|
||||
|
||||
public Object clone() {
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,145 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import net.sf.jasperreports.charts.JRTimeSeries;
|
||||
import net.sf.jasperreports.charts.JRTimeSeriesDataset;
|
||||
import net.sf.jasperreports.charts.util.TimeSeriesLabelGenerator;
|
||||
import net.sf.jasperreports.engine.JRChartDataset;
|
||||
import net.sf.jasperreports.engine.JRExpressionCollector;
|
||||
import net.sf.jasperreports.engine.JRRuntimeException;
|
||||
import net.sf.jasperreports.engine.design.JRVerifier;
|
||||
import net.sf.jasperreports.engine.fill.JRCalculator;
|
||||
import net.sf.jasperreports.engine.fill.JRExpressionEvalException;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartDataset;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
import org.jfree.data.general.Dataset;
|
||||
import org.jfree.data.time.RegularTimePeriod;
|
||||
import org.jfree.data.time.TimeSeries;
|
||||
import org.jfree.data.time.TimeSeriesCollection;
|
||||
|
||||
public class JRFillTimeSeriesDataset extends JRFillChartDataset implements JRTimeSeriesDataset {
|
||||
protected JRFillTimeSeries[] timeSeries = null;
|
||||
|
||||
private List seriesNames = null;
|
||||
|
||||
private Map seriesMap = null;
|
||||
|
||||
private Map labelsMap = null;
|
||||
|
||||
private Map itemHyperlinks;
|
||||
|
||||
public JRFillTimeSeriesDataset(JRTimeSeriesDataset timeSeriesDataset, JRFillObjectFactory factory) {
|
||||
super((JRChartDataset)timeSeriesDataset, factory);
|
||||
JRTimeSeries[] srcTimeSeries = timeSeriesDataset.getSeries();
|
||||
if (srcTimeSeries != null && srcTimeSeries.length > 0) {
|
||||
this.timeSeries = new JRFillTimeSeries[srcTimeSeries.length];
|
||||
for (int i = 0; i < this.timeSeries.length; i++)
|
||||
this.timeSeries[i] = (JRFillTimeSeries)factory.getTimeSeries(srcTimeSeries[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public JRTimeSeries[] getSeries() {
|
||||
return (JRTimeSeries[])this.timeSeries;
|
||||
}
|
||||
|
||||
protected void customInitialize() {
|
||||
this.seriesNames = null;
|
||||
this.seriesMap = null;
|
||||
this.labelsMap = null;
|
||||
this.itemHyperlinks = null;
|
||||
}
|
||||
|
||||
protected void customEvaluate(JRCalculator calculator) throws JRExpressionEvalException {
|
||||
if (this.timeSeries != null && this.timeSeries.length > 0)
|
||||
for (int i = 0; i < this.timeSeries.length; i++)
|
||||
this.timeSeries[i].evaluate(calculator);
|
||||
}
|
||||
|
||||
protected void customIncrement() {
|
||||
if (this.timeSeries != null && this.timeSeries.length > 0) {
|
||||
if (this.seriesNames == null) {
|
||||
this.seriesNames = new ArrayList();
|
||||
this.seriesMap = new HashMap();
|
||||
this.labelsMap = new HashMap();
|
||||
this.itemHyperlinks = new HashMap();
|
||||
}
|
||||
for (int i = 0; i < this.timeSeries.length; i++) {
|
||||
JRFillTimeSeries crtTimeSeries = this.timeSeries[i];
|
||||
Comparable seriesName = crtTimeSeries.getSeries();
|
||||
if (seriesName == null)
|
||||
throw new JRRuntimeException("Time series name is null.");
|
||||
TimeSeries series = (TimeSeries)this.seriesMap.get(seriesName);
|
||||
if (series == null) {
|
||||
series = new TimeSeries(seriesName.toString(), getTimePeriod());
|
||||
this.seriesNames.add(seriesName);
|
||||
this.seriesMap.put(seriesName, series);
|
||||
}
|
||||
RegularTimePeriod tp = RegularTimePeriod.createInstance(getTimePeriod(), crtTimeSeries.getTimePeriod(), getTimeZone());
|
||||
series.addOrUpdate(tp, crtTimeSeries.getValue());
|
||||
if (crtTimeSeries.getLabelExpression() != null) {
|
||||
Map seriesLabels = (Map)this.labelsMap.get(seriesName);
|
||||
if (seriesLabels == null) {
|
||||
seriesLabels = new HashMap();
|
||||
this.labelsMap.put(seriesName, seriesLabels);
|
||||
}
|
||||
seriesLabels.put(tp, crtTimeSeries.getLabel());
|
||||
}
|
||||
if (crtTimeSeries.hasItemHyperlink()) {
|
||||
Map seriesLinks = (Map)this.itemHyperlinks.get(seriesName);
|
||||
if (seriesLinks == null) {
|
||||
seriesLinks = new HashMap();
|
||||
this.itemHyperlinks.put(seriesName, seriesLinks);
|
||||
}
|
||||
seriesLinks.put(tp, crtTimeSeries.getPrintItemHyperlink());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Dataset getCustomDataset() {
|
||||
TimeSeriesCollection dataset = new TimeSeriesCollection();
|
||||
if (this.seriesNames != null)
|
||||
for (int i = 0; i < this.seriesNames.size(); i++) {
|
||||
Comparable seriesName = this.seriesNames.get(i);
|
||||
dataset.addSeries((TimeSeries)this.seriesMap.get(seriesName));
|
||||
}
|
||||
return (Dataset)dataset;
|
||||
}
|
||||
|
||||
public Class getTimePeriod() {
|
||||
return ((JRTimeSeriesDataset)this.parent).getTimePeriod();
|
||||
}
|
||||
|
||||
public void setTimePeriod(Class timePeriod) {}
|
||||
|
||||
public byte getDatasetType() {
|
||||
return 6;
|
||||
}
|
||||
|
||||
public TimeSeriesLabelGenerator getLabelGenerator() {
|
||||
return new TimeSeriesLabelGenerator(this.labelsMap);
|
||||
}
|
||||
|
||||
public void collectExpressions(JRExpressionCollector collector) {
|
||||
collector.collect(this);
|
||||
}
|
||||
|
||||
public Map getItemHyperlinks() {
|
||||
return this.itemHyperlinks;
|
||||
}
|
||||
|
||||
public boolean hasItemHyperlinks() {
|
||||
boolean foundLinks = false;
|
||||
if (this.timeSeries != null && this.timeSeries.length > 0)
|
||||
for (int i = 0; i < this.timeSeries.length && !foundLinks; i++)
|
||||
foundLinks = this.timeSeries[i].hasItemHyperlink();
|
||||
return foundLinks;
|
||||
}
|
||||
|
||||
public void validate(JRVerifier verifier) {
|
||||
verifier.verify(this);
|
||||
}
|
||||
}
|
@@ -0,0 +1,164 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.awt.Color;
|
||||
import net.sf.jasperreports.charts.JRTimeAxisFormat;
|
||||
import net.sf.jasperreports.charts.JRTimeSeriesPlot;
|
||||
import net.sf.jasperreports.charts.JRValueAxisFormat;
|
||||
import net.sf.jasperreports.engine.JRChartPlot;
|
||||
import net.sf.jasperreports.engine.JRExpression;
|
||||
import net.sf.jasperreports.engine.JRFont;
|
||||
import net.sf.jasperreports.engine.JRStyleContainer;
|
||||
import net.sf.jasperreports.engine.base.JRBaseFont;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartPlot;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
import net.sf.jasperreports.engine.util.JRStyleResolver;
|
||||
|
||||
public class JRFillTimeSeriesPlot extends JRFillChartPlot implements JRTimeSeriesPlot {
|
||||
protected JRFont timeAxisLabelFont = null;
|
||||
|
||||
protected Color timeAxisLabelColor = null;
|
||||
|
||||
protected JRFont timeAxisTickLabelFont = null;
|
||||
|
||||
protected Color timeAxisTickLabelColor = null;
|
||||
|
||||
protected Color timeAxisLineColor = null;
|
||||
|
||||
protected JRFont valueAxisLabelFont = null;
|
||||
|
||||
protected Color valueAxisLabelColor = null;
|
||||
|
||||
protected JRFont valueAxisTickLabelFont = null;
|
||||
|
||||
protected Color valueAxisTickLabelColor = null;
|
||||
|
||||
protected Color valueAxisLineColor = null;
|
||||
|
||||
public JRFillTimeSeriesPlot(JRTimeSeriesPlot plot, JRFillObjectFactory factory) {
|
||||
super((JRChartPlot)plot, factory);
|
||||
this.timeAxisLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)plot.getChart(), plot.getTimeAxisLabelFont());
|
||||
this.timeAxisLabelColor = plot.getOwnTimeAxisLabelColor();
|
||||
this.timeAxisTickLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)plot.getChart(), plot.getTimeAxisTickLabelFont());
|
||||
this.timeAxisTickLabelColor = plot.getOwnTimeAxisTickLabelColor();
|
||||
this.timeAxisLineColor = plot.getTimeAxisLineColor();
|
||||
this.valueAxisLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)plot.getChart(), plot.getValueAxisLabelFont());
|
||||
this.valueAxisLabelColor = plot.getOwnValueAxisLabelColor();
|
||||
this.valueAxisTickLabelFont = (JRFont)new JRBaseFont(null, null, (JRStyleContainer)plot.getChart(), plot.getValueAxisTickLabelFont());
|
||||
this.valueAxisTickLabelColor = plot.getOwnValueAxisTickLabelColor();
|
||||
this.valueAxisLineColor = plot.getValueAxisTickLabelColor();
|
||||
}
|
||||
|
||||
public JRExpression getTimeAxisLabelExpression() {
|
||||
return ((JRTimeSeriesPlot)this.parent).getTimeAxisLabelExpression();
|
||||
}
|
||||
|
||||
public JRFont getTimeAxisLabelFont() {
|
||||
return this.timeAxisLabelFont;
|
||||
}
|
||||
|
||||
public void setTimeAxisLabelFont(JRFont font) {}
|
||||
|
||||
public Color getTimeAxisLabelColor() {
|
||||
return JRStyleResolver.getTimeAxisLabelColor((JRTimeAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnTimeAxisLabelColor() {
|
||||
return this.timeAxisLabelColor;
|
||||
}
|
||||
|
||||
public void setTimeAxisLabelColor(Color color) {}
|
||||
|
||||
public JRFont getTimeAxisTickLabelFont() {
|
||||
return this.timeAxisTickLabelFont;
|
||||
}
|
||||
|
||||
public void setTimeAxisTickLabelFont(JRFont font) {}
|
||||
|
||||
public Color getTimeAxisTickLabelColor() {
|
||||
return JRStyleResolver.getTimeAxisTickLabelColor((JRTimeAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnTimeAxisTickLabelColor() {
|
||||
return this.timeAxisTickLabelColor;
|
||||
}
|
||||
|
||||
public void setTimeAxisTickLabelColor(Color color) {}
|
||||
|
||||
public String getTimeAxisTickLabelMask() {
|
||||
return ((JRTimeSeriesPlot)this.parent).getTimeAxisTickLabelMask();
|
||||
}
|
||||
|
||||
public void setTimeAxisTickLabelMask(String mask) {}
|
||||
|
||||
public Color getTimeAxisLineColor() {
|
||||
return JRStyleResolver.getTimeAxisLineColor((JRTimeAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnTimeAxisLineColor() {
|
||||
return this.timeAxisLineColor;
|
||||
}
|
||||
|
||||
public void setTimeAxisLineColor(Color color) {}
|
||||
|
||||
public JRExpression getValueAxisLabelExpression() {
|
||||
return ((JRTimeSeriesPlot)this.parent).getValueAxisLabelExpression();
|
||||
}
|
||||
|
||||
public JRFont getValueAxisLabelFont() {
|
||||
return this.valueAxisLabelFont;
|
||||
}
|
||||
|
||||
public void setValueAxisLabelFont(JRFont font) {}
|
||||
|
||||
public Color getValueAxisLabelColor() {
|
||||
return JRStyleResolver.getValueAxisLabelColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisLabelColor() {
|
||||
return this.valueAxisLabelColor;
|
||||
}
|
||||
|
||||
public void setValueAxisLabelColor(Color color) {}
|
||||
|
||||
public JRFont getValueAxisTickLabelFont() {
|
||||
return this.valueAxisTickLabelFont;
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelFont(JRFont font) {}
|
||||
|
||||
public Color getValueAxisTickLabelColor() {
|
||||
return JRStyleResolver.getValueAxisTickLabelColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisTickLabelColor() {
|
||||
return this.valueAxisTickLabelColor;
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelColor(Color color) {}
|
||||
|
||||
public String getValueAxisTickLabelMask() {
|
||||
return ((JRTimeSeriesPlot)this.parent).getValueAxisTickLabelMask();
|
||||
}
|
||||
|
||||
public void setValueAxisTickLabelMask(String mask) {}
|
||||
|
||||
public Color getValueAxisLineColor() {
|
||||
return JRStyleResolver.getValueAxisLineColor((JRValueAxisFormat)this, (JRChartPlot)this);
|
||||
}
|
||||
|
||||
public Color getOwnValueAxisLineColor() {
|
||||
return this.valueAxisLineColor;
|
||||
}
|
||||
|
||||
public boolean isShowLines() {
|
||||
return ((JRTimeSeriesPlot)this.parent).isShowLines();
|
||||
}
|
||||
|
||||
public void setShowLines() {}
|
||||
|
||||
public boolean isShowShapes() {
|
||||
return ((JRTimeSeriesPlot)this.parent).isShowShapes();
|
||||
}
|
||||
|
||||
public void setShowShapes() {}
|
||||
}
|
@@ -0,0 +1,55 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import net.sf.jasperreports.charts.JRValueDataset;
|
||||
import net.sf.jasperreports.engine.JRChartDataset;
|
||||
import net.sf.jasperreports.engine.JRExpression;
|
||||
import net.sf.jasperreports.engine.JRExpressionCollector;
|
||||
import net.sf.jasperreports.engine.design.JRVerifier;
|
||||
import net.sf.jasperreports.engine.fill.JRCalculator;
|
||||
import net.sf.jasperreports.engine.fill.JRExpressionEvalException;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartDataset;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
import org.jfree.data.general.Dataset;
|
||||
import org.jfree.data.general.DefaultValueDataset;
|
||||
|
||||
public class JRFillValueDataset extends JRFillChartDataset implements JRValueDataset {
|
||||
private Number value = null;
|
||||
|
||||
private DefaultValueDataset valueDataset = new DefaultValueDataset();
|
||||
|
||||
public JRFillValueDataset(JRValueDataset valueDataset, JRFillObjectFactory factory) {
|
||||
super((JRChartDataset)valueDataset, factory);
|
||||
}
|
||||
|
||||
public JRExpression getValueExpression() {
|
||||
return ((JRValueDataset)this.parent).getValueExpression();
|
||||
}
|
||||
|
||||
protected void customInitialize() {
|
||||
this.valueDataset = new DefaultValueDataset();
|
||||
}
|
||||
|
||||
protected void customEvaluate(JRCalculator calculator) throws JRExpressionEvalException {
|
||||
this.value = (Number)calculator.evaluate(getValueExpression());
|
||||
}
|
||||
|
||||
protected void customIncrement() {
|
||||
this.valueDataset.setValue(this.value);
|
||||
}
|
||||
|
||||
public Dataset getCustomDataset() {
|
||||
return (Dataset)this.valueDataset;
|
||||
}
|
||||
|
||||
public byte getDatasetType() {
|
||||
return 8;
|
||||
}
|
||||
|
||||
public void collectExpressions(JRExpressionCollector collector) {
|
||||
collector.collect(this);
|
||||
}
|
||||
|
||||
public void validate(JRVerifier verifier) {
|
||||
verifier.verify(this);
|
||||
}
|
||||
}
|
138
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillXyDataset.java
Normal file
138
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillXyDataset.java
Normal file
@@ -0,0 +1,138 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import net.sf.jasperreports.charts.JRXyDataset;
|
||||
import net.sf.jasperreports.charts.JRXySeries;
|
||||
import net.sf.jasperreports.charts.util.XYDatasetLabelGenerator;
|
||||
import net.sf.jasperreports.engine.JRChartDataset;
|
||||
import net.sf.jasperreports.engine.JRExpressionCollector;
|
||||
import net.sf.jasperreports.engine.design.JRVerifier;
|
||||
import net.sf.jasperreports.engine.fill.JRCalculator;
|
||||
import net.sf.jasperreports.engine.fill.JRExpressionEvalException;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartDataset;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
import net.sf.jasperreports.engine.util.Pair;
|
||||
import org.jfree.data.general.Dataset;
|
||||
import org.jfree.data.xy.XYSeries;
|
||||
import org.jfree.data.xy.XYSeriesCollection;
|
||||
|
||||
public class JRFillXyDataset extends JRFillChartDataset implements JRXyDataset {
|
||||
protected JRFillXySeries[] xySeries = null;
|
||||
|
||||
private List seriesNames = null;
|
||||
|
||||
private Map seriesMap = null;
|
||||
|
||||
private Map labelsMap = null;
|
||||
|
||||
private Map itemHyperlinks;
|
||||
|
||||
public JRFillXyDataset(JRXyDataset xyDataset, JRFillObjectFactory factory) {
|
||||
super((JRChartDataset)xyDataset, factory);
|
||||
JRXySeries[] srcXySeries = xyDataset.getSeries();
|
||||
if (srcXySeries != null && srcXySeries.length > 0) {
|
||||
this.xySeries = new JRFillXySeries[srcXySeries.length];
|
||||
for (int i = 0; i < this.xySeries.length; i++)
|
||||
this.xySeries[i] = (JRFillXySeries)factory.getXySeries(srcXySeries[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public JRXySeries[] getSeries() {
|
||||
return (JRXySeries[])this.xySeries;
|
||||
}
|
||||
|
||||
protected void customInitialize() {
|
||||
this.seriesNames = null;
|
||||
this.seriesMap = null;
|
||||
this.labelsMap = null;
|
||||
this.itemHyperlinks = null;
|
||||
}
|
||||
|
||||
protected void customEvaluate(JRCalculator calculator) throws JRExpressionEvalException {
|
||||
if (this.xySeries != null && this.xySeries.length > 0)
|
||||
for (int i = 0; i < this.xySeries.length; i++)
|
||||
this.xySeries[i].evaluate(calculator);
|
||||
}
|
||||
|
||||
protected void customIncrement() {
|
||||
if (this.xySeries != null && this.xySeries.length > 0) {
|
||||
if (this.seriesNames == null) {
|
||||
this.seriesNames = new ArrayList();
|
||||
this.seriesMap = new HashMap();
|
||||
this.labelsMap = new HashMap();
|
||||
this.itemHyperlinks = new HashMap();
|
||||
}
|
||||
for (int i = 0; i < this.xySeries.length; i++) {
|
||||
JRFillXySeries crtXySeries = this.xySeries[i];
|
||||
Comparable seriesName = crtXySeries.getSeries();
|
||||
XYSeries xySrs = (XYSeries)this.seriesMap.get(seriesName);
|
||||
if (xySrs == null) {
|
||||
xySrs = new XYSeries(seriesName);
|
||||
this.seriesNames.add(seriesName);
|
||||
this.seriesMap.put(seriesName, xySrs);
|
||||
}
|
||||
xySrs.addOrUpdate(crtXySeries.getXValue(), crtXySeries.getYValue());
|
||||
if (crtXySeries.getLabelExpression() != null) {
|
||||
Map seriesLabels = (Map)this.labelsMap.get(seriesName);
|
||||
if (seriesLabels == null) {
|
||||
seriesLabels = new HashMap();
|
||||
this.labelsMap.put(seriesName, seriesLabels);
|
||||
}
|
||||
seriesLabels.put(crtXySeries.getXValue(), crtXySeries.getLabel());
|
||||
}
|
||||
if (crtXySeries.hasItemHyperlinks()) {
|
||||
Map seriesLinks = (Map)this.itemHyperlinks.get(seriesName);
|
||||
if (seriesLinks == null) {
|
||||
seriesLinks = new HashMap();
|
||||
this.itemHyperlinks.put(seriesName, seriesLinks);
|
||||
}
|
||||
Pair xyKey = new Pair(crtXySeries.getXValue(), crtXySeries.getYValue());
|
||||
seriesLinks.put(xyKey, crtXySeries.getPrintItemHyperlink());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Dataset getCustomDataset() {
|
||||
XYSeriesCollection dataset = new XYSeriesCollection();
|
||||
if (this.seriesNames != null)
|
||||
for (int i = 0; i < this.seriesNames.size(); i++) {
|
||||
Comparable seriesName = this.seriesNames.get(i);
|
||||
dataset.addSeries((XYSeries)this.seriesMap.get(seriesName));
|
||||
}
|
||||
return (Dataset)dataset;
|
||||
}
|
||||
|
||||
public byte getDatasetType() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
public XYDatasetLabelGenerator getLabelGenerator() {
|
||||
return new XYDatasetLabelGenerator(this.labelsMap);
|
||||
}
|
||||
|
||||
public void collectExpressions(JRExpressionCollector collector) {
|
||||
collector.collect(this);
|
||||
}
|
||||
|
||||
public Map getItemHyperlinks() {
|
||||
return this.itemHyperlinks;
|
||||
}
|
||||
|
||||
public boolean hasItemHyperlinks() {
|
||||
boolean foundLinks = false;
|
||||
if (this.xySeries != null && this.xySeries.length > 0)
|
||||
for (int i = 0; i < this.xySeries.length && !foundLinks; i++) {
|
||||
JRFillXySeries serie = this.xySeries[i];
|
||||
foundLinks = serie.hasItemHyperlinks();
|
||||
}
|
||||
return foundLinks;
|
||||
}
|
||||
|
||||
public void validate(JRVerifier verifier) {
|
||||
verifier.verify(this);
|
||||
}
|
||||
}
|
100
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillXySeries.java
Normal file
100
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillXySeries.java
Normal file
@@ -0,0 +1,100 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import net.sf.jasperreports.charts.JRXySeries;
|
||||
import net.sf.jasperreports.engine.JRException;
|
||||
import net.sf.jasperreports.engine.JRExpression;
|
||||
import net.sf.jasperreports.engine.JRHyperlink;
|
||||
import net.sf.jasperreports.engine.JRHyperlinkHelper;
|
||||
import net.sf.jasperreports.engine.JRPrintHyperlink;
|
||||
import net.sf.jasperreports.engine.JRRuntimeException;
|
||||
import net.sf.jasperreports.engine.fill.JRCalculator;
|
||||
import net.sf.jasperreports.engine.fill.JRExpressionEvalException;
|
||||
import net.sf.jasperreports.engine.fill.JRFillExpressionEvaluator;
|
||||
import net.sf.jasperreports.engine.fill.JRFillHyperlinkHelper;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
|
||||
public class JRFillXySeries implements JRXySeries {
|
||||
protected JRXySeries parent = null;
|
||||
|
||||
private Comparable series = null;
|
||||
|
||||
private Number xValue = null;
|
||||
|
||||
private Number yValue = null;
|
||||
|
||||
private String label = null;
|
||||
|
||||
private JRPrintHyperlink itemHyperlink;
|
||||
|
||||
public JRFillXySeries(JRXySeries xySeries, JRFillObjectFactory factory) {
|
||||
factory.put(xySeries, this);
|
||||
this.parent = xySeries;
|
||||
}
|
||||
|
||||
public JRExpression getSeriesExpression() {
|
||||
return this.parent.getSeriesExpression();
|
||||
}
|
||||
|
||||
public JRExpression getXValueExpression() {
|
||||
return this.parent.getXValueExpression();
|
||||
}
|
||||
|
||||
public JRExpression getYValueExpression() {
|
||||
return this.parent.getYValueExpression();
|
||||
}
|
||||
|
||||
public JRExpression getLabelExpression() {
|
||||
return this.parent.getLabelExpression();
|
||||
}
|
||||
|
||||
protected Comparable getSeries() {
|
||||
return this.series;
|
||||
}
|
||||
|
||||
protected Number getXValue() {
|
||||
return this.xValue;
|
||||
}
|
||||
|
||||
protected Number getYValue() {
|
||||
return this.yValue;
|
||||
}
|
||||
|
||||
protected String getLabel() {
|
||||
return this.label;
|
||||
}
|
||||
|
||||
protected JRPrintHyperlink getPrintItemHyperlink() {
|
||||
return this.itemHyperlink;
|
||||
}
|
||||
|
||||
protected void evaluate(JRCalculator calculator) throws JRExpressionEvalException {
|
||||
this.series = (Comparable)calculator.evaluate(getSeriesExpression());
|
||||
this.xValue = (Number)calculator.evaluate(getXValueExpression());
|
||||
this.yValue = (Number)calculator.evaluate(getYValueExpression());
|
||||
this.label = (String)calculator.evaluate(getLabelExpression());
|
||||
if (hasItemHyperlinks())
|
||||
evaluateItemHyperlink(calculator);
|
||||
}
|
||||
|
||||
protected void evaluateItemHyperlink(JRCalculator calculator) throws JRExpressionEvalException {
|
||||
try {
|
||||
this.itemHyperlink = JRFillHyperlinkHelper.evaluateHyperlink(getItemHyperlink(), (JRFillExpressionEvaluator)calculator, (byte)3);
|
||||
} catch (JRExpressionEvalException e) {
|
||||
throw e;
|
||||
} catch (JRException e) {
|
||||
throw new JRRuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public JRHyperlink getItemHyperlink() {
|
||||
return this.parent.getItemHyperlink();
|
||||
}
|
||||
|
||||
public boolean hasItemHyperlinks() {
|
||||
return !JRHyperlinkHelper.isEmpty(getItemHyperlink());
|
||||
}
|
||||
|
||||
public Object clone() {
|
||||
return null;
|
||||
}
|
||||
}
|
100
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillXyzDataset.java
Normal file
100
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillXyzDataset.java
Normal file
@@ -0,0 +1,100 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import net.sf.jasperreports.charts.JRXyzDataset;
|
||||
import net.sf.jasperreports.charts.JRXyzSeries;
|
||||
import net.sf.jasperreports.charts.util.DefaultXYZDataset;
|
||||
import net.sf.jasperreports.engine.JRChartDataset;
|
||||
import net.sf.jasperreports.engine.JRExpressionCollector;
|
||||
import net.sf.jasperreports.engine.JRRuntimeException;
|
||||
import net.sf.jasperreports.engine.design.JRVerifier;
|
||||
import net.sf.jasperreports.engine.fill.JRCalculator;
|
||||
import net.sf.jasperreports.engine.fill.JRExpressionEvalException;
|
||||
import net.sf.jasperreports.engine.fill.JRFillChartDataset;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
import net.sf.jasperreports.engine.util.Pair;
|
||||
import org.jfree.data.general.Dataset;
|
||||
|
||||
public class JRFillXyzDataset extends JRFillChartDataset implements JRXyzDataset {
|
||||
protected JRFillXyzSeries[] xyzSeries = null;
|
||||
|
||||
private DefaultXYZDataset dataset = null;
|
||||
|
||||
private Map itemHyperlinks;
|
||||
|
||||
public JRFillXyzDataset(JRXyzDataset xyzDataset, JRFillObjectFactory factory) {
|
||||
super((JRChartDataset)xyzDataset, factory);
|
||||
JRXyzSeries[] srcXyzSeries = xyzDataset.getSeries();
|
||||
if (srcXyzSeries != null && srcXyzSeries.length > 0) {
|
||||
this.xyzSeries = new JRFillXyzSeries[srcXyzSeries.length];
|
||||
for (int i = 0; i < this.xyzSeries.length; i++)
|
||||
this.xyzSeries[i] = (JRFillXyzSeries)factory.getXyzSeries(srcXyzSeries[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public JRXyzSeries[] getSeries() {
|
||||
return (JRXyzSeries[])this.xyzSeries;
|
||||
}
|
||||
|
||||
protected void customInitialize() {
|
||||
this.dataset = new DefaultXYZDataset();
|
||||
this.itemHyperlinks = new HashMap();
|
||||
}
|
||||
|
||||
protected void customEvaluate(JRCalculator calculator) throws JRExpressionEvalException {
|
||||
if (this.xyzSeries != null && this.xyzSeries.length > 0)
|
||||
for (int i = 0; i < this.xyzSeries.length; i++)
|
||||
this.xyzSeries[i].evaluate(calculator);
|
||||
}
|
||||
|
||||
protected void customIncrement() {
|
||||
if (this.xyzSeries != null && this.xyzSeries.length > 0)
|
||||
for (int i = 0; i < this.xyzSeries.length; i++) {
|
||||
JRFillXyzSeries crtXyzSeries = this.xyzSeries[i];
|
||||
Comparable seriesName = crtXyzSeries.getSeries();
|
||||
if (seriesName == null)
|
||||
throw new JRRuntimeException("XYZ series name is null.");
|
||||
this.dataset.addValue(crtXyzSeries.getSeries(), crtXyzSeries.getXValue(), crtXyzSeries.getYValue(), crtXyzSeries.getZValue());
|
||||
if (crtXyzSeries.hasItemHyperlinks()) {
|
||||
Map seriesLinks = (Map)this.itemHyperlinks.get(crtXyzSeries.getSeries());
|
||||
if (seriesLinks == null) {
|
||||
seriesLinks = new HashMap();
|
||||
this.itemHyperlinks.put(crtXyzSeries.getSeries(), seriesLinks);
|
||||
}
|
||||
Pair xyKey = new Pair(crtXyzSeries.getXValue(), crtXyzSeries.getYValue());
|
||||
seriesLinks.put(xyKey, crtXyzSeries.getPrintItemHyperlink());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Dataset getCustomDataset() {
|
||||
return (Dataset)this.dataset;
|
||||
}
|
||||
|
||||
public byte getDatasetType() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
public void collectExpressions(JRExpressionCollector collector) {
|
||||
collector.collect(this);
|
||||
}
|
||||
|
||||
public boolean hasItemHyperlinks() {
|
||||
boolean foundLinks = false;
|
||||
if (this.xyzSeries != null && this.xyzSeries.length > 0)
|
||||
for (int i = 0; i < this.xyzSeries.length && !foundLinks; i++) {
|
||||
JRFillXyzSeries serie = this.xyzSeries[i];
|
||||
foundLinks = serie.hasItemHyperlinks();
|
||||
}
|
||||
return foundLinks;
|
||||
}
|
||||
|
||||
public Map getItemHyperlinks() {
|
||||
return this.itemHyperlinks;
|
||||
}
|
||||
|
||||
public void validate(JRVerifier verifier) {
|
||||
verifier.verify(this);
|
||||
}
|
||||
}
|
100
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillXyzSeries.java
Normal file
100
hrmsEjb/net/sf/jasperreports/charts/fill/JRFillXyzSeries.java
Normal file
@@ -0,0 +1,100 @@
|
||||
package net.sf.jasperreports.charts.fill;
|
||||
|
||||
import net.sf.jasperreports.charts.JRXyzSeries;
|
||||
import net.sf.jasperreports.engine.JRException;
|
||||
import net.sf.jasperreports.engine.JRExpression;
|
||||
import net.sf.jasperreports.engine.JRHyperlink;
|
||||
import net.sf.jasperreports.engine.JRHyperlinkHelper;
|
||||
import net.sf.jasperreports.engine.JRPrintHyperlink;
|
||||
import net.sf.jasperreports.engine.JRRuntimeException;
|
||||
import net.sf.jasperreports.engine.fill.JRCalculator;
|
||||
import net.sf.jasperreports.engine.fill.JRExpressionEvalException;
|
||||
import net.sf.jasperreports.engine.fill.JRFillExpressionEvaluator;
|
||||
import net.sf.jasperreports.engine.fill.JRFillHyperlinkHelper;
|
||||
import net.sf.jasperreports.engine.fill.JRFillObjectFactory;
|
||||
|
||||
public class JRFillXyzSeries implements JRXyzSeries {
|
||||
JRXyzSeries parent = null;
|
||||
|
||||
private Comparable series = null;
|
||||
|
||||
private Number xValue = null;
|
||||
|
||||
private Number yValue = null;
|
||||
|
||||
private Number zValue = null;
|
||||
|
||||
private JRPrintHyperlink itemHyperlink;
|
||||
|
||||
public JRFillXyzSeries(JRXyzSeries xyzSeries, JRFillObjectFactory factory) {
|
||||
factory.put(xyzSeries, this);
|
||||
this.parent = xyzSeries;
|
||||
}
|
||||
|
||||
public JRExpression getSeriesExpression() {
|
||||
return this.parent.getSeriesExpression();
|
||||
}
|
||||
|
||||
public JRExpression getXValueExpression() {
|
||||
return this.parent.getXValueExpression();
|
||||
}
|
||||
|
||||
public JRExpression getYValueExpression() {
|
||||
return this.parent.getYValueExpression();
|
||||
}
|
||||
|
||||
public JRExpression getZValueExpression() {
|
||||
return this.parent.getZValueExpression();
|
||||
}
|
||||
|
||||
protected Comparable getSeries() {
|
||||
return this.series;
|
||||
}
|
||||
|
||||
protected Number getXValue() {
|
||||
return this.xValue;
|
||||
}
|
||||
|
||||
protected Number getYValue() {
|
||||
return this.yValue;
|
||||
}
|
||||
|
||||
protected Number getZValue() {
|
||||
return this.zValue;
|
||||
}
|
||||
|
||||
protected JRPrintHyperlink getPrintItemHyperlink() {
|
||||
return this.itemHyperlink;
|
||||
}
|
||||
|
||||
protected void evaluate(JRCalculator calculator) throws JRExpressionEvalException {
|
||||
this.series = (Comparable)calculator.evaluate(getSeriesExpression());
|
||||
this.xValue = (Number)calculator.evaluate(getXValueExpression());
|
||||
this.yValue = (Number)calculator.evaluate(getYValueExpression());
|
||||
this.zValue = (Number)calculator.evaluate(getZValueExpression());
|
||||
if (hasItemHyperlinks())
|
||||
evaluateItemHyperlink(calculator);
|
||||
}
|
||||
|
||||
protected void evaluateItemHyperlink(JRCalculator calculator) throws JRExpressionEvalException {
|
||||
try {
|
||||
this.itemHyperlink = JRFillHyperlinkHelper.evaluateHyperlink(getItemHyperlink(), (JRFillExpressionEvaluator)calculator, (byte)3);
|
||||
} catch (JRExpressionEvalException e) {
|
||||
throw e;
|
||||
} catch (JRException e) {
|
||||
throw new JRRuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public JRHyperlink getItemHyperlink() {
|
||||
return this.parent.getItemHyperlink();
|
||||
}
|
||||
|
||||
public boolean hasItemHyperlinks() {
|
||||
return !JRHyperlinkHelper.isEmpty(getItemHyperlink());
|
||||
}
|
||||
|
||||
public Object clone() {
|
||||
return null;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user