Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of https://github.com/inaiat/jqplot4java.git

Conflicts:
	src/main/java/br/com/digilabs/jqplot/ChartConfiguration.java
	src/main/java/br/com/digilabs/jqplot/axis/AxisNumber.java
	src/main/java/br/com/digilabs/jqplot/axis/AxisString.java
  • Loading branch information...
commit bc915563531680843f2e4a0768057f3a41153666 2 parents 6239c0d + b8f2d5a
@viniciuspc authored
Showing with 194 additions and 145 deletions.
  1. +1 −1  src/main/java/br/com/digilabs/jqplot/Chart.java
  2. +92 −79 src/main/java/br/com/digilabs/jqplot/ChartConfiguration.java
  3. +13 −10 src/main/java/br/com/digilabs/jqplot/axis/Axis.java
  4. +6 −0 src/main/java/br/com/digilabs/jqplot/axis/AxisNumber.java
  5. +10 −1 src/main/java/br/com/digilabs/jqplot/axis/AxisString.java
  6. +3 −1 src/main/java/br/com/digilabs/jqplot/axis/X2Axis.java
  7. +3 −1 src/main/java/br/com/digilabs/jqplot/axis/XAxis.java
  8. +3 −1 src/main/java/br/com/digilabs/jqplot/axis/Y2Axis.java
  9. +3 −1 src/main/java/br/com/digilabs/jqplot/axis/YAxis.java
  10. +22 −18 src/main/java/br/com/digilabs/jqplot/chart/AbstractChart.java
  11. +2 −2 src/main/java/br/com/digilabs/jqplot/chart/AreaChart.java
  12. +3 −3 src/main/java/br/com/digilabs/jqplot/chart/BarChart.java
  13. +2 −2 src/main/java/br/com/digilabs/jqplot/chart/BubbleChart.java
  14. +2 −2 src/main/java/br/com/digilabs/jqplot/chart/LabeledLineChart.java
  15. +1 −1  src/main/java/br/com/digilabs/jqplot/chart/LineChart.java
  16. +1 −1  src/main/java/br/com/digilabs/jqplot/chart/LineSeriesChart.java
  17. +2 −2 src/main/java/br/com/digilabs/jqplot/chart/MeterGaugeChart.java
  18. +1 −1  src/main/java/br/com/digilabs/jqplot/chart/PieChart.java
  19. +1 −1  src/main/java/br/com/digilabs/jqplot/chart/PieDonutChart.java
  20. +15 −13 src/main/java/br/com/digilabs/jqplot/elements/Axes.java
  21. +8 −4 src/main/java/br/com/digilabs/jqplot/elements/Grid.java
View
2  src/main/java/br/com/digilabs/jqplot/Chart.java
@@ -32,7 +32,7 @@
* Return chart configuration
* @return {@link ChartConfiguration}
*/
- ChartConfiguration getChartConfiguration();
+ ChartConfiguration<?> getChartConfiguration();
/**
* Return chart data.
View
171 src/main/java/br/com/digilabs/jqplot/ChartConfiguration.java
@@ -20,7 +20,6 @@
import java.util.Collection;
import br.com.digilabs.jqplot.axis.Axis;
-import br.com.digilabs.jqplot.axis.AxisString;
import br.com.digilabs.jqplot.axis.XAxis;
import br.com.digilabs.jqplot.axis.YAxis;
import br.com.digilabs.jqplot.elements.*;
@@ -28,13 +27,15 @@
import java.util.ArrayList;
/**
- *
- * Base configuration of JqPlot Chart. See jqplot documention http://www.jqplot.com/docs/files/usage-txt.html
- *
+ *
+ * Base configuration of JqPlot Chart. See jqplot documention
+ * http://www.jqplot.com/docs/files/usage-txt.html
+ *
+ * @param <T> Type of {@link Axis}
+ *
* @author inaiat
*/
-public class ChartConfiguration implements Serializable {
-
+public class ChartConfiguration<T extends Serializable> implements Serializable {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 7082325039222592701L;
@@ -43,13 +44,13 @@
protected Collection<Serie> series;
/** The axes. */
- protected Axes axes;
+ protected Axes<T> axes;
/** The title. */
protected Title title;
/** The axes defaults. */
- protected Axis axesDefaults;
+ protected Axis<T> axesDefaults;
/** The series defaults. */
private SeriesDefaults seriesDefaults;
@@ -68,13 +69,7 @@
/** The series colors. */
private Collection<String> seriesColors;
- /** The cursor. */
- private Cursor cursor;
-
-
- /**
- *
- * @return
+
/** The animate. */
private Boolean animate;
@@ -82,7 +77,11 @@
private Highlighter highlighter;
/** The grid. */
- private Grid grid;
+ private Grid<T> grid;
+
+
+ /** The cursor. */
+ private Cursor cursor;
/**
* Checks if is capture right click.
@@ -94,7 +93,6 @@ public Boolean isCaptureRightClick() {
}
/**
- *
* Sets the capture right click.
*
* @param captureRightClick the new capture right click
@@ -116,7 +114,6 @@ public Legend getLegend() {
* Sets the legend.
*
* @param legend the new legend
-
*/
public void setLegend(Legend legend) {
this.legend = legend;
@@ -136,13 +133,25 @@ public void setSimpleTitle(String title) {
}
/**
+ * Creates the cursor.
+ *
+ * @return the cursor
+ */
+ public Cursor createCursor() {
+ if (cursor == null) {
+ cursor = new Cursor();
+ }
+ return cursor;
+ }
+
+ /**
* Creates the grid.
*
* @return the grid
*/
- public Grid createGrid() {
+ public Grid<T> createGrid() {
if (grid == null) {
- grid = new Grid();
+ grid = new Grid<T>();
}
return grid;
}
@@ -152,9 +161,9 @@ public Grid createGrid() {
*
* @return the axes
*/
- public Axes createAxes() {
+ public Axes<T> createAxes() {
if (axes == null) {
- this.axes = new Axes();
+ this.axes = new Axes<T>();
}
return this.axes;
}
@@ -164,10 +173,10 @@ public Axes createAxes() {
*
* @return the x axis
*/
- public XAxis createXAxis() {
- Axes newAxes = createAxes();
+ public XAxis<T> createXAxis() {
+ Axes<T> newAxes = createAxes();
if (newAxes.getXaxis() == null) {
- XAxis xAxis = new XAxis();
+ XAxis<T> xAxis = new XAxis<T>();
newAxes.setXaxis(xAxis);
}
return newAxes.getXaxis();
@@ -178,25 +187,23 @@ public XAxis createXAxis() {
*
* @return the y axis
*/
- public YAxis createYAxis() {
- Axes newAxes = createAxes();
+ public YAxis<T> createYAxis() {
+ Axes<T> newAxes = createAxes();
if (newAxes.getYaxis() == null) {
- YAxis yAxis = new YAxis();
+ YAxis<T> yAxis = new YAxis<T>();
newAxes.setYaxis(yAxis);
}
return newAxes.getYaxis();
}
-
-
/**
* Creates the axes defaults.
*
* @return the axis
*/
- public Axis createAxesDefaults() {
+ public Axis<T> createAxesDefaults() {
if (axesDefaults == null) {
- axesDefaults = new AxisString();
+ axesDefaults = new Axis<T>();
}
return axesDefaults;
}
@@ -242,8 +249,8 @@ public void setLabelY(String label) {
* @return the series
*/
public Collection<Serie> getSeries() {
- if(series == null)
- series = new ArrayList<Serie>();
+ if (series == null)
+ series = new ArrayList<Serie>();
return series;
}
@@ -288,7 +295,7 @@ public void setTitle(Title title) {
*
* @return the axesDefaults
*/
- public Axis getAxesDefaults() {
+ public Axis<T> getAxesDefaults() {
return axesDefaults;
}
@@ -297,7 +304,7 @@ public Axis getAxesDefaults() {
*
* @param axesDefaults the axesDefaults to set
*/
- public void setAxesDefaults(Axis axesDefaults) {
+ public void setAxesDefaults(Axis<T> axesDefaults) {
this.axesDefaults = axesDefaults;
}
@@ -306,7 +313,7 @@ public void setAxesDefaults(Axis axesDefaults) {
*
* @return the axes
*/
- public Axes getAxes() {
+ public Axes<T> getAxes() {
return axes;
}
@@ -315,7 +322,7 @@ public Axes getAxes() {
*
* @param axes the axes to set
*/
- public void setAxes(Axes axes) {
+ public void setAxes(Axes<T> axes) {
this.axes = axes;
}
@@ -391,11 +398,11 @@ public void setShowMarker(Boolean showMarker) {
* @return the collection
*/
public Collection<String> createSeriesColors() {
- if (this.seriesColors==null) {
- this.seriesColors = new ArrayList<String>();
- }
- return seriesColors;
- }
+ if (this.seriesColors == null) {
+ this.seriesColors = new ArrayList<String>();
+ }
+ return seriesColors;
+ }
/**
* Gets the series colors.
@@ -415,7 +422,6 @@ public void setSeriesColors(Collection<String> seriesColor) {
this.seriesColors = seriesColor;
}
-
/**
* Gets the animate.
*
@@ -425,31 +431,15 @@ public Boolean getAnimate() {
return animate;
}
-
- /** Turns on animation for all series in this plot.
- * @param animate true, false
- */
- public void setAnimate(Boolean animate) {
- this.animate = animate;
- }
-
-
-
- /**
- * @return hightLighter
- */
- public Highlighter getHighlighter() {
- return highlighter;
- }
-
- /**
- * set the highlighter
- * @param highlighter property
- */
- public void setHighlighter(Highlighter highlighter) {
- this.highlighter = highlighter;
- }
-
+ /**
+ * Turns on animation for all series in this plot.
+ *
+ * @param animate
+ * true, false
+ */
+ public void setAnimate(Boolean animate) {
+ this.animate = animate;
+ }
/**
* Creates the highlighter.
@@ -463,14 +453,22 @@ public Highlighter createHighlighter() {
return highlighter;
}
-
+ /**
+ * Gets the highlighter.
+ *
+ * @return hightLighter
+ */
+ public Highlighter getHighlighter() {
+ return highlighter;
+ }
/**
- * Set the cursor
- * @param cursor
+ * set the highlighter.
+ *
+ * @param highlighter property
*/
- public void setCursor(Cursor cursor) {
- this.cursor = cursor;
+ public void setHighlighter(Highlighter highlighter) {
+ this.highlighter = highlighter;
}
/**
@@ -478,7 +476,7 @@ public void setCursor(Cursor cursor) {
*
* @return the grid
*/
- public Grid getGrid() {
+ public Grid<T> getGrid() {
return grid;
}
@@ -487,10 +485,25 @@ public Grid getGrid() {
*
* @param grid the new grid
*/
- public void setGrid(Grid grid) {
+ public void setGrid(Grid<T> grid) {
this.grid = grid;
}
-
-
-
+
+ /**
+ * Gets the cursor.
+ *
+ * @return the cursor
+ */
+ public Cursor getCursor() {
+ return cursor;
+ }
+
+ /**
+ * Sets the cursor.
+ *
+ * @param cursor the new cursor
+ */
+ public void setCursor(Cursor cursor) {
+ this.cursor = cursor;
+ }
}
View
23 src/main/java/br/com/digilabs/jqplot/axis/Axis.java
@@ -27,9 +27,12 @@
*
* @see http://www.jqplot.com/docs/files/jqplot-core-js.html#Axis
*
+ * @param <T> type of Axis, can be String, Number, Date, etc. This is necessary
+ * because min,max and tickInterval can be variants types.
+ *
* @author inaiat
*/
-public class Axis implements Serializable {
+public class Axis<T extends Serializable> implements Serializable {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -5426777530263336010L;
@@ -68,13 +71,13 @@
private Float padMax;
/** The min. */
- private String min;
+ private T min;
/** The max. */
- private String max;
+ private T max;
/** The tick interval. */
- private String tickInterval;
+ private T tickInterval;
/**
@@ -82,7 +85,7 @@
*
* @return the tick interval
*/
- public String getTickInterval() {
+ public T getTickInterval() {
return tickInterval;
}
@@ -91,7 +94,7 @@ public String getTickInterval() {
*
* @param tickInterval the new tick interval
*/
- public void setTickInterval(String tickInterval) {
+ public void setTickInterval(T tickInterval) {
this.tickInterval = tickInterval;
}
@@ -299,7 +302,7 @@ public void setTicks(String[] ticks) {
*
* @return the min
*/
- public String getMin() {
+ public T getMin() {
return min;
}
@@ -308,7 +311,7 @@ public String getMin() {
*
* @param min the new min
*/
- public void setMin(String min) {
+ public void setMin(T min) {
this.min = min;
}
@@ -317,7 +320,7 @@ public void setMin(String min) {
*
* @return the max
*/
- public String getMax() {
+ public T getMax() {
return max;
}
@@ -326,7 +329,7 @@ public String getMax() {
*
* @param max the new max
*/
- public void setMax(String max) {
+ public void setMax(T max) {
this.max = max;
}
View
6 src/main/java/br/com/digilabs/jqplot/axis/AxisNumber.java
@@ -1,5 +1,11 @@
package br.com.digilabs.jqplot.axis;
+/**
+ * The Class AxisNumber.
+ */
public class AxisNumber extends Axis<Number> {
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = -1998708048511810440L;
+
}
View
11 src/main/java/br/com/digilabs/jqplot/axis/AxisString.java
@@ -1,6 +1,15 @@
package br.com.digilabs.jqplot.axis;
+/**
+ *
+ * Default implementation of Axis.
+ *
+ * @author inaiat
+ *
+ */
public class AxisString extends Axis<String> {
-
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 114531921624782727L;
}
View
4 src/main/java/br/com/digilabs/jqplot/axis/X2Axis.java
@@ -16,12 +16,14 @@
*/
package br.com.digilabs.jqplot.axis;
+import java.io.Serializable;
+
/**
* which x axis to use with this series, either ‘xaxis’ or ‘x2axis’.
*
* @author inaiat
*/
-public class X2Axis extends Axis {
+public class X2Axis<T extends Serializable> extends Axis<T> {
private static final long serialVersionUID = 2040916955165481553L;
View
4 src/main/java/br/com/digilabs/jqplot/axis/XAxis.java
@@ -16,13 +16,15 @@
*/
package br.com.digilabs.jqplot.axis;
+import java.io.Serializable;
+
/**
*
* which x axis to use with this series, either ‘xaxis’ or ‘x2axis’.
*
* @author inaiat
*/
-public class XAxis extends Axis {
+public class XAxis<T extends Serializable> extends Axis<T> {
private static final long serialVersionUID = -6656658483757126503L;
View
4 src/main/java/br/com/digilabs/jqplot/axis/Y2Axis.java
@@ -16,13 +16,15 @@
*/
package br.com.digilabs.jqplot.axis;
+import java.io.Serializable;
+
/**
*
* which y axis to use with this series, either ‘yaxis’ or ‘y2axis’.
*
* @author inaiat
*/
-public class Y2Axis extends Axis {
+public class Y2Axis<T extends Serializable> extends Axis<T> {
private static final long serialVersionUID = -8251587500625732531L;
View
4 src/main/java/br/com/digilabs/jqplot/axis/YAxis.java
@@ -16,13 +16,15 @@
*/
package br.com.digilabs.jqplot.axis;
+import java.io.Serializable;
+
/**
*
* which y axis to use with this series, either ‘yaxis’ or ‘y2axis’.
*
* @author inaiat
*/
-public class YAxis extends Axis {
+public class YAxis<T extends Serializable> extends Axis<T> {
private static final long serialVersionUID = 1964421050362233742L;
}
View
40 src/main/java/br/com/digilabs/jqplot/chart/AbstractChart.java
@@ -16,6 +16,7 @@
*/
package br.com.digilabs.jqplot.chart;
+import java.io.Serializable;
import java.util.Collection;
import br.com.digilabs.jqplot.Chart;
@@ -38,19 +39,22 @@
* Abstract class to help build end charts.
*
* @author inaiat
+ *
+ * @param <S> Type of {@link Axis}
+ *
*/
-public abstract class AbstractChart<T extends ChartData<?>> implements Chart<T> {
+public abstract class AbstractChart<T extends ChartData<?>, S extends Serializable> implements Chart<T> {
private static final long serialVersionUID = -5744130130488157491L;
- private final ChartConfiguration configuration;
+ private final ChartConfiguration<S> configuration;
/**
* Construtor
*/
public AbstractChart() {
- this.configuration = new ChartConfiguration();
+ this.configuration = new ChartConfiguration<S>();
}
public void addSeriesColors(String... colors) {
@@ -111,7 +115,7 @@ public void addSeries(Serie... series) {
*
* @return chartConfiguration
*/
- public ChartConfiguration getChartConfiguration() {
+ public ChartConfiguration<S> getChartConfiguration() {
return configuration;
}
@@ -135,7 +139,7 @@ public void setPadMin(Float padMin) {
*
* @return Axes
*/
- public Axes createAxes() {
+ public Axes<S> createAxes() {
return getChartConfiguration().createAxes();
}
@@ -143,7 +147,7 @@ public Axes createAxes() {
*
* @return xAxis
*/
- public XAxis createXAxis() {
+ public XAxis<S> createXAxis() {
return getChartConfiguration().createXAxis();
}
@@ -151,7 +155,7 @@ public XAxis createXAxis() {
*
* @return yAxis
*/
- public YAxis createYAxis() {
+ public YAxis<S> createYAxis() {
return getChartConfiguration().createYAxis();
}
@@ -159,7 +163,7 @@ public YAxis createYAxis() {
*
* @return axis
*/
- public Axis createAxesDefaults() {
+ public Axis<S> createAxesDefaults() {
return getChartConfiguration().createAxesDefaults();
}
@@ -210,28 +214,28 @@ public void setTitle(Title title) {
/**
* @return the axesDefaults
*/
- public Axis getAxesDefaults() {
+ public Axis<S> getAxesDefaults() {
return getChartConfiguration().getAxesDefaults();
}
/**
* @param axesDefaults the axesDefaults to set
*/
- public void setAxesDefaults(Axis axesDefaults) {
+ public void setAxesDefaults(Axis<S> axesDefaults) {
getChartConfiguration().setAxesDefaults(axesDefaults);
}
/**
* @return the axes
*/
- public Axes getAxes() {
+ public Axes<S> getAxes() {
return getChartConfiguration().getAxes();
}
/**
* @param axes the axes to set
*/
- public void setAxes(Axes axes) {
+ public void setAxes(Axes<S> axes) {
getChartConfiguration().setAxes(axes);
}
@@ -358,7 +362,7 @@ public void setFill(Boolean fill) {
* @param alpha
*/
public void setBubbleAlpha(Float alpha) {
- ChartConfiguration chartConfiguration = getChartConfiguration();
+ ChartConfiguration<S> chartConfiguration = getChartConfiguration();
chartConfiguration.getSeriesDefaults().getRendererOptions().setBubbleAlpha(alpha);
}
@@ -367,7 +371,7 @@ public void setBubbleAlpha(Float alpha) {
* @param alpha
*/
public void setHighlightAlpha(Float alpha) {
- ChartConfiguration chartConfiguration = getChartConfiguration();
+ ChartConfiguration<S> chartConfiguration = getChartConfiguration();
chartConfiguration.getSeriesDefaults().getRendererOptions().setHighlightAlpha(alpha);
}
@@ -376,7 +380,7 @@ public void setHighlightAlpha(Float alpha) {
* @param showLabels
*/
public void setShowLabels(Boolean showLabels) {
- ChartConfiguration chartConfiguration = getChartConfiguration();
+ ChartConfiguration<S> chartConfiguration = getChartConfiguration();
chartConfiguration.getSeriesDefaults().getRendererOptions().setShowLables(showLabels);
}
@@ -385,7 +389,7 @@ public void setShowLabels(Boolean showLabels) {
* @param alpha
*/
public void setShadowAlpha(String alpha) {
- ChartConfiguration chartConfiguration = getChartConfiguration();
+ ChartConfiguration<S> chartConfiguration = getChartConfiguration();
chartConfiguration.getSeriesDefaults().setShadowAlpha(alpha);
}
@@ -394,7 +398,7 @@ public void setShadowAlpha(String alpha) {
* @param fillZero
*/
public void setFillZero(Boolean fillZero) {
- ChartConfiguration chartConfiguration = getChartConfiguration();
+ ChartConfiguration<S> chartConfiguration = getChartConfiguration();
chartConfiguration.getSeriesDefaults().getRendererOptions().setFillZero(fillZero);
}
@@ -403,7 +407,7 @@ public void setFillZero(Boolean fillZero) {
* @param shadow
*/
public void setShadow(Boolean shadow) {
- ChartConfiguration chartConfiguration = getChartConfiguration();
+ ChartConfiguration<S> chartConfiguration = getChartConfiguration();
chartConfiguration.getSeriesDefaults().setShadow(shadow);
}
View
4 src/main/java/br/com/digilabs/jqplot/chart/AreaChart.java
@@ -27,7 +27,7 @@
/**
* @author inaiat
*/
-public class AreaChart<T extends Number> extends AbstractChart<AreaFillData<T>> {
+public class AreaChart<T extends Number> extends AbstractChart<AreaFillData<T>,String> {
private static final long serialVersionUID = 6050878600406620553L;
@@ -51,7 +51,7 @@ public AreaChart(String title) {
SeriesDefaults defaults = new SeriesDefaults();
defaults.setFill(true);
setSeriesDefaults(defaults);
- XAxis xAxis = createXAxis();
+ XAxis<String> xAxis = createXAxis();
xAxis.setRenderer(JqPlotResources.CategoryAxisRenderer);
}
View
6 src/main/java/br/com/digilabs/jqplot/chart/BarChart.java
@@ -33,7 +33,7 @@
* @author inaiat
*/
@JqPlotPlugin(values = {JqPlotResources.CategoryAxisRenderer, JqPlotResources.BarRenderer, JqPlotResources.PointLabels})
-public class BarChart<T extends Number> extends AbstractChart<BarData<T>> {
+public class BarChart<T extends Number> extends AbstractChart<BarData<T>, String> {
private static final long serialVersionUID = 3650210485517566138L;
@@ -62,7 +62,7 @@ public BarChart(String title) {
* @param labelY
*/
public BarChart(String title, String labelX, String labelY) {
- ChartConfiguration chartConfiguration = getChartConfiguration();
+ ChartConfiguration<String> chartConfiguration = getChartConfiguration();
chartConfiguration.setTitle(new Title(title));
SeriesDefaults seriesDefaults = new SeriesDefaults();
@@ -77,7 +77,7 @@ public BarChart(String title, String labelX, String labelY) {
chartConfiguration.setLabelX(labelX);
chartConfiguration.setLabelY(labelY);
- XAxis xAxis = getChartConfiguration().createXAxis();
+ XAxis<String> xAxis = getChartConfiguration().createXAxis();
xAxis.setRenderer(JqPlotResources.CategoryAxisRenderer);
getChartConfiguration().createYAxis();
View
4 src/main/java/br/com/digilabs/jqplot/chart/BubbleChart.java
@@ -29,7 +29,7 @@
* @author inaiat
*/
@JqPlotPlugin(values = {JqPlotResources.BubbleRenderer})
-public class BubbleChart extends AbstractChart<BubbleData<BubbleItem>> {
+public class BubbleChart extends AbstractChart<BubbleData<BubbleItem>,String> {
private static final long serialVersionUID = -8122703368130701972L;
@@ -55,7 +55,7 @@ public BubbleChart(String title) {
* @param title
*/
protected final void initialize(String title) {
- ChartConfiguration chartConfiguration = getChartConfiguration();
+ ChartConfiguration<String> chartConfiguration = getChartConfiguration();
chartConfiguration.setTitle(new Title(title));
SeriesDefaults sd = new SeriesDefaults();
RendererOptions ro = new RendererOptions();
View
4 src/main/java/br/com/digilabs/jqplot/chart/LabeledLineChart.java
@@ -37,7 +37,7 @@
JqPlotResources.CanvasAxisLabelRenderer,
JqPlotResources.CanvasAxisTickRenderer
})
-public class LabeledLineChart<T extends Number> extends AbstractChart<LabeledData<T>> {
+public class LabeledLineChart<T extends Number> extends AbstractChart<LabeledData<T>,String> {
private static final long serialVersionUID = -6833884146696085085L;
@@ -71,7 +71,7 @@ public LabeledLineChart(String title, String labelX, String labelY) {
public LabeledLineChart(String title, String labelX, String labelY,
Integer tickAngle) {
getChartConfiguration().setTitle(new Title(title));
- Axis xAxis = getChartConfiguration().createXAxis();
+ Axis<String> xAxis = getChartConfiguration().createXAxis();
xAxis.setRenderer(JqPlotResources.DateAxisRenderer);
xAxis.setLabelRenderer(JqPlotResources.CanvasAxisLabelRenderer);
xAxis.setTickRenderer(JqPlotResources.CanvasAxisTickRenderer);
View
2  src/main/java/br/com/digilabs/jqplot/chart/LineChart.java
@@ -25,7 +25,7 @@
* @author inaiat
*/
@JqPlotPlugin(values = {JqPlotResources.CanvasTextRenderer, JqPlotResources.CategoryAxisRenderer})
-public class LineChart<T extends Number> extends AbstractChart<LinedData<T>> {
+public class LineChart<T extends Number> extends AbstractChart<LinedData<T>,String> {
private static final long serialVersionUID = -643105267124184518L;
View
2  src/main/java/br/com/digilabs/jqplot/chart/LineSeriesChart.java
@@ -34,7 +34,7 @@
* @param <V> type of value of serie
*/
@JqPlotPlugin(values = {JqPlotResources.CanvasTextRenderer, JqPlotResources.CategoryAxisRenderer})
-public class LineSeriesChart <I extends Number, V extends Number> extends AbstractChart<LineSeriesData<I,V>> {
+public class LineSeriesChart <I extends Number, V extends Number> extends AbstractChart<LineSeriesData<I,V>,String> {
private static final long serialVersionUID = -563079287340319412L;
View
4 src/main/java/br/com/digilabs/jqplot/chart/MeterGaugeChart.java
@@ -28,7 +28,7 @@
* @author inaiat
*/
@JqPlotPlugin(values = {JqPlotResources.MeterGaugeRenderer})
-public class MeterGaugeChart extends AbstractChart<MeterData> {
+public class MeterGaugeChart extends AbstractChart<MeterData,String> {
private static final long serialVersionUID = -8122703368130701972L;
private MeterData data = new MeterData(0F);
@@ -54,7 +54,7 @@ public MeterGaugeChart(String title) {
* @param title
*/
protected final void initialize(String title) {
- ChartConfiguration chartConfiguration = getChartConfiguration();
+ ChartConfiguration<String> chartConfiguration = getChartConfiguration();
chartConfiguration.setTitle(new Title(title));
SeriesDefaults sd = new SeriesDefaults();
RendererOptions ro = new RendererOptions();
View
2  src/main/java/br/com/digilabs/jqplot/chart/PieChart.java
@@ -26,7 +26,7 @@
* @author inaiat
*/
@JqPlotPlugin(values = {JqPlotResources.PieRenderer})
-public class PieChart<T extends Number> extends AbstractChart<PieData<T>> {
+public class PieChart<T extends Number> extends AbstractChart<PieData<T>,String> {
private static final long serialVersionUID = -9078771567964143651L;
View
2  src/main/java/br/com/digilabs/jqplot/chart/PieDonutChart.java
@@ -31,7 +31,7 @@
* @author inaiat
*/
@JqPlotPlugin(values = {JqPlotResources.DonutRenderer})
-public class PieDonutChart<T extends Number> extends AbstractChart<PieDonutData<T>> {
+public class PieDonutChart<T extends Number> extends AbstractChart<PieDonutData<T>,String> {
private static final long serialVersionUID = -4671992800819368331L;
View
28 src/main/java/br/com/digilabs/jqplot/elements/Axes.java
@@ -16,6 +16,8 @@
*/
package br.com.digilabs.jqplot.elements;
+import java.io.Serializable;
+
import br.com.digilabs.jqplot.axis.X2Axis;
import br.com.digilabs.jqplot.axis.XAxis;
import br.com.digilabs.jqplot.axis.Y2Axis;
@@ -39,68 +41,68 @@
* @author inaiat
*
*/
-public class Axes implements Element {
+public class Axes<T extends Serializable> implements Element {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -1464182411022493685L;
- private XAxis xaxis;
- private YAxis yaxis;
- private X2Axis x2axis;
- private Y2Axis y2axis;
+ private XAxis<T> xaxis;
+ private YAxis<T> yaxis;
+ private X2Axis<T> x2axis;
+ private Y2Axis<T> y2axis;
/**
* @return the xaxis
*/
- public XAxis getXaxis() {
+ public XAxis<T> getXaxis() {
return xaxis;
}
/**
* @param xaxis the xaxis to set
*/
- public void setXaxis(XAxis xaxis) {
+ public void setXaxis(XAxis<T> xaxis) {
this.xaxis = xaxis;
}
/**
* @return the yaxis
*/
- public YAxis getYaxis() {
+ public YAxis<T> getYaxis() {
return yaxis;
}
/**
* @param yaxis the yaxis to set
*/
- public void setYaxis(YAxis yaxis) {
+ public void setYaxis(YAxis<T> yaxis) {
this.yaxis = yaxis;
}
/**
* @return the x2axis
*/
- public X2Axis getX2axis() {
+ public X2Axis<T> getX2axis() {
return x2axis;
}
/**
* @param x2axis the x2axis to set
*/
- public void setX2axis(X2Axis x2axis) {
+ public void setX2axis(X2Axis<T> x2axis) {
this.x2axis = x2axis;
}
/**
* @return the y2axis
*/
- public Y2Axis getY2axis() {
+ public Y2Axis<T> getY2axis() {
return y2axis;
}
/**
* @param y2axis the y2axis to set
*/
- public void setY2axis(Y2Axis y2axis) {
+ public void setY2axis(Y2Axis<T> y2axis) {
this.y2axis = y2axis;
}
}
View
12 src/main/java/br/com/digilabs/jqplot/elements/Grid.java
@@ -16,6 +16,8 @@
*/
package br.com.digilabs.jqplot.elements;
+import java.io.Serializable;
+
import br.com.digilabs.jqplot.axis.Axis;
/**
@@ -24,9 +26,11 @@
* The Grid object cannot be instantiated directly, but is created by the Plot oject.
* Grid properties can be set or overriden by the options passed in from the user.
*
+ * @param <T> Type of {@link Axis}
+ *
* @author inaiat
*/
-public class Grid implements Element {
+public class Grid<T extends Serializable> implements Element {
private static final long serialVersionUID = 5478580499167992682L;
private Boolean drawGridLines;
@@ -51,14 +55,14 @@
private Float bottom;
private Float width;
private Float height;
- private Axis[] axis;
+ private Axis<T>[] axis;
private String[] rendererOptions;
/**
*
* @return array de Axis
*/
- public Axis[] getAxis() {
+ public Axis<T>[] getAxis() {
return axis;
}
@@ -67,7 +71,7 @@
*
* @param axis the new axis
*/
- public void setAxis(Axis[] axis) {
+ public void setAxis(Axis<T>[] axis) {
this.axis = axis;
}
Please sign in to comment.
Something went wrong with that request. Please try again.