Skip to content
Snippets Groups Projects
Commit ffc45e50 authored by Carlos Lopez-Camey's avatar Carlos Lopez-Camey
Browse files

Add type parameter to XChartPanel

parent 31bea2a4
Branches
No related tags found
No related merge requests found
...@@ -52,9 +52,9 @@ import org.knowm.xchart.internal.chartpart.Chart; ...@@ -52,9 +52,9 @@ import org.knowm.xchart.internal.chartpart.Chart;
* *
* @author timmolter * @author timmolter
*/ */
public class XChartPanel extends JPanel { public class XChartPanel<T extends Chart> extends JPanel {
private final Chart chart; private final T chart;
private final Dimension preferredSize; private final Dimension preferredSize;
private String saveAsString = "Save As..."; private String saveAsString = "Save As...";
...@@ -63,7 +63,7 @@ public class XChartPanel extends JPanel { ...@@ -63,7 +63,7 @@ public class XChartPanel extends JPanel {
* *
* @param chart * @param chart
*/ */
public XChartPanel(final Chart chart) { public XChartPanel(final T chart) {
this.chart = chart; this.chart = chart;
preferredSize = new Dimension(chart.getWidth(), chart.getHeight()); preferredSize = new Dimension(chart.getWidth(), chart.getHeight());
...@@ -97,7 +97,7 @@ public class XChartPanel extends JPanel { ...@@ -97,7 +97,7 @@ public class XChartPanel extends JPanel {
g2d.dispose(); g2d.dispose();
} }
public Chart getChart() { public T getChart() {
return this.chart; return this.chart;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment