Skip to content

Commit c501d3a

Browse files
committed
PlotService: add newSeriesStyle method.
It's less confusing to have this method in the PlotService rather than in XYPlot and CategoryChart.
1 parent 2a10e18 commit c501d3a

6 files changed

Lines changed: 13 additions & 16 deletions

File tree

src/main/java/net/imagej/plot/CategoryChart.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@
4242
*/
4343
public interface CategoryChart<C> extends Plot {
4444

45-
SeriesStyle newSeriesStyle(ColorRGB color, LineStyle lineStyle, MarkerStyle markerStyle);
46-
4745
Class<C> getCategoryType();
4846

4947
LineSeries<C> addLineSeries();

src/main/java/net/imagej/plot/PlotService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
package net.imagej.plot;
3333

3434
import net.imagej.ImageJService;
35+
import org.scijava.util.ColorRGB;
3536

3637
/**
3738
* An ImageJService that provides factory methods for supported {@link Plot}s,
@@ -41,6 +42,8 @@
4142
*/
4243
public interface PlotService extends ImageJService {
4344

45+
SeriesStyle newSeriesStyle(ColorRGB color, LineStyle lineStyle, MarkerStyle markerStyle);
46+
4447
XYPlot newXYPlot();
4548

4649
<C> CategoryChart<C> newCategoryChart(Class<C> categoryType);

src/main/java/net/imagej/plot/XYPlot.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@
4242
*/
4343
public interface XYPlot extends Plot {
4444

45-
SeriesStyle newSeriesStyle(ColorRGB color, LineStyle lineStyle, MarkerStyle markerStyle);
46-
4745
XYSeries addXYSeries();
4846

4947
NumberAxis xAxis();

src/main/java/net/imagej/plot/defaultplot/DefaultCategoryChart.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
package net.imagej.plot.defaultplot;
3333

3434
import net.imagej.plot.*;
35-
import org.scijava.util.ColorRGB;
3635

3736
import java.util.Collections;
3837
import java.util.LinkedList;
@@ -63,11 +62,6 @@ class DefaultCategoryChart<C> extends AbstractPlot implements CategoryChart<C> {
6362

6463
// -- CategoryChart methods --
6564

66-
@Override
67-
public SeriesStyle newSeriesStyle(ColorRGB color, LineStyle lineStyle, MarkerStyle markerStyle) {
68-
return new DefaultSeriesStyle(color, lineStyle, markerStyle);
69-
}
70-
7165
@Override
7266
public Class<C> getCategoryType() {
7367
return categoryType;

src/main/java/net/imagej/plot/defaultplot/DefaultPlotService.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,15 @@
3333
package net.imagej.plot.defaultplot;
3434

3535
import net.imagej.plot.CategoryChart;
36+
import net.imagej.plot.LineStyle;
37+
import net.imagej.plot.MarkerStyle;
3638
import net.imagej.plot.PlotService;
39+
import net.imagej.plot.SeriesStyle;
3740
import net.imagej.plot.XYPlot;
3841
import org.scijava.plugin.Plugin;
3942
import org.scijava.service.AbstractService;
4043
import org.scijava.service.Service;
44+
import org.scijava.util.ColorRGB;
4145

4246
/**
4347
* The default implementation of the {@link PlotService} interface.
@@ -49,7 +53,12 @@
4953
public class DefaultPlotService extends AbstractService implements PlotService {
5054

5155
// -- PlotService methods --
52-
56+
57+
@Override
58+
public SeriesStyle newSeriesStyle(ColorRGB color, LineStyle lineStyle, MarkerStyle markerStyle) {
59+
return new DefaultSeriesStyle(color, lineStyle, markerStyle);
60+
}
61+
5362
@Override
5463
public XYPlot newXYPlot() {
5564
return new DefaultXYPlot();

src/main/java/net/imagej/plot/defaultplot/DefaultXYPlot.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ class DefaultXYPlot extends AbstractPlot implements XYPlot {
5959

6060
// -- XYPlot methods --
6161

62-
@Override
63-
public SeriesStyle newSeriesStyle(ColorRGB color, LineStyle lineStyle, MarkerStyle markerStyle) {
64-
return new DefaultSeriesStyle(color, lineStyle, markerStyle);
65-
}
66-
6762
@Override
6863
public XYSeries addXYSeries() {
6964
XYSeries result = new DefaultXYSeries();

0 commit comments

Comments
 (0)