From ef7e4334fee377d27c323e170251ea0df7b36b3a Mon Sep 17 00:00:00 2001 From: Tim Molter <tim.molter@gmail.com> Date: Sat, 7 Sep 2013 17:13:33 +0200 Subject: [PATCH] Issue #45. Setting a series property improvement --- .../main/java/com/xeiam/xchart/Series.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/xchart/src/main/java/com/xeiam/xchart/Series.java b/xchart/src/main/java/com/xeiam/xchart/Series.java index ca5103ba..96b01b3c 100644 --- a/xchart/src/main/java/com/xeiam/xchart/Series.java +++ b/xchart/src/main/java/com/xeiam/xchart/Series.java @@ -172,9 +172,10 @@ public class Series { * * @param seriesLineStyle */ - public void setLineStyle(SeriesLineStyle seriesLineStyle) { + public Series setLineStyle(SeriesLineStyle seriesLineStyle) { stroke = SeriesLineStyle.getBasicStroke(seriesLineStyle); + return this; } /** @@ -182,9 +183,10 @@ public class Series { * * @param basicStroke */ - public void setLineStyle(BasicStroke basicStroke) { + public Series setLineStyle(BasicStroke basicStroke) { stroke = basicStroke; + return this; } /** @@ -192,9 +194,10 @@ public class Series { * * @param seriesColor */ - public void setLineColor(SeriesColor seriesColor) { + public Series setLineColor(SeriesColor seriesColor) { strokeColor = seriesColor.getColor(); + return this; } /** @@ -202,9 +205,10 @@ public class Series { * * @param color */ - public void setLineColor(java.awt.Color color) { + public Series setLineColor(java.awt.Color color) { strokeColor = color; + return this; } /** @@ -212,9 +216,10 @@ public class Series { * * @param seriesMarker */ - public void setMarker(SeriesMarker seriesMarker) { + public Series setMarker(SeriesMarker seriesMarker) { this.marker = seriesMarker.getMarker(); + return this; } /** @@ -222,9 +227,10 @@ public class Series { * * @param seriesColor */ - public void setMarkerColor(SeriesColor seriesColor) { + public Series setMarkerColor(SeriesColor seriesColor) { this.markerColor = seriesColor.getColor(); + return this; } /** @@ -232,9 +238,10 @@ public class Series { * * @param color */ - public void setMarkerColor(java.awt.Color color) { + public Series setMarkerColor(java.awt.Color color) { this.markerColor = color; + return this; } public Collection<?> getXData() { -- GitLab