Skip to content

Commit 30420fd

Browse files
committed
Rename AbstractPlot to Plot
This is done because AbstractPlot is not an abstract class but an interface, and should therefor not be named abstract.
1 parent 115e3d8 commit 30420fd

20 files changed

Lines changed: 68 additions & 67 deletions

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
*
4141
* @author Matthias Arzt
4242
*/
43-
public interface CategoryChart<C> extends AbstractPlot {
43+
public interface CategoryChart<C> extends Plot {
4444

4545
SeriesStyle newSeriesStyle(ColorRGB color, LineStyle lineStyle, MarkerStyle markerStyle);
4646

src/main/java/net/imagej/plot/AbstractPlot.java renamed to src/main/java/net/imagej/plot/Plot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
*
3737
* @author Matthias Arzt
3838
*/
39-
public interface AbstractPlot {
39+
public interface Plot {
4040

4141
void setTitle(String title);
4242

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import net.imagej.ImageJService;
3535

3636
/**
37-
* An ImageJService that provides factory methods for supported {@link AbstractPlot}s,
37+
* An ImageJService that provides factory methods for supported {@link Plot}s,
3838
* e.g. {@link XYPlot} and {@link CategoryChart}.
3939
*
4040
* @author Matthias Arzt

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
*
4141
* @author Matthias Arzt
4242
*/
43-
public interface XYPlot extends AbstractPlot {
43+
public interface XYPlot extends Plot {
4444

4545
SeriesStyle newSeriesStyle(ColorRGB color, LineStyle lineStyle, MarkerStyle markerStyle);
4646

src/main/java/net/imagej/plot/convert/PlotToImagePlusConverter.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import ij.IJ;
44
import ij.ImagePlus;
5-
import net.imagej.plot.AbstractPlot;
5+
import net.imagej.plot.Plot;
66
import org.jfree.chart.JFreeChart;
77
import org.scijava.Priority;
88
import org.scijava.convert.AbstractConverter;
@@ -16,36 +16,36 @@
1616
import java.awt.image.BufferedImage;
1717

1818
/**
19-
* Converter plugin, that converts an {@link AbstractPlot} to {@link ImagePlus}.
19+
* Converter plugin, that converts an {@link Plot} to {@link ImagePlus}.
2020
*
2121
* @author Matthias Arzt
2222
* @see ConvertService
2323
*/
2424
@Plugin(type = Converter.class, priority = Priority.NORMAL_PRIORITY)
25-
public class PlotToImagePlusConverter extends AbstractConverter<AbstractPlot, ImagePlus> {
25+
public class PlotToImagePlusConverter extends AbstractConverter<Plot, ImagePlus> {
2626

2727
@Parameter
2828
ConvertService convertService;
2929

3030
@Override
3131
public boolean canConvert(ConversionRequest request) {
3232
return ImagePlus.class.equals(request.destClass()) &&
33-
AbstractPlot.class.isAssignableFrom(request.sourceClass()) &&
33+
Plot.class.isAssignableFrom(request.sourceClass()) &&
3434
convertService.supports(new ConversionRequest(
3535
request.sourceObject(), request.sourceType(), JFreeChart.class));
3636
}
3737

3838
@Override
3939
public <T> T convert(Object o, Class<T> aClass) {
40-
if(o instanceof AbstractPlot && ImagePlus.class.equals(aClass)) {
40+
if(o instanceof Plot && ImagePlus.class.equals(aClass)) {
4141
@SuppressWarnings("unchecked")
42-
T t = (T) toImagePlus((AbstractPlot) o);
42+
T t = (T) toImagePlus((Plot) o);
4343
return t;
4444
}
4545
return null;
4646
}
4747

48-
private ImagePlus toImagePlus(AbstractPlot plot) {
48+
private ImagePlus toImagePlus(Plot plot) {
4949
JFreeChart chart = convertService.convert(plot, JFreeChart.class);
5050
ImagePlus imp = IJ.createImage(plot.getTitle(), "RGB", plot.getPreferredWidth(), plot.getPreferredHeight(), 1);
5151
BufferedImage image = imp.getBufferedImage();
@@ -60,7 +60,7 @@ public Class<ImagePlus> getOutputType() {
6060
}
6161

6262
@Override
63-
public Class<AbstractPlot> getInputType() {
64-
return AbstractPlot.class;
63+
public Class<Plot> getInputType() {
64+
return Plot.class;
6565
}
6666
}

src/main/java/net/imagej/plot/convert/PlotToImgConverter.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package net.imagej.plot.convert;
22

33
import ij.ImagePlus;
4-
import net.imagej.plot.AbstractPlot;
4+
import net.imagej.plot.Plot;
55
import net.imglib2.img.Img;
66
import net.imglib2.img.display.imagej.ImageJFunctions;
77
import org.scijava.Priority;
@@ -13,21 +13,21 @@
1313
import org.scijava.plugin.Plugin;
1414

1515
/**
16-
* Converter plugin, that converts {@link AbstractPlot} to {@link Img}.
16+
* Converter plugin, that converts {@link Plot} to {@link Img}.
1717
*
1818
* @author Matthias Arzt
1919
* @see ConvertService
2020
*/
2121
@Plugin(type = Converter.class, priority = Priority.NORMAL_PRIORITY)
22-
public class PlotToImgConverter extends AbstractConverter<AbstractPlot, Img> {
22+
public class PlotToImgConverter extends AbstractConverter<Plot, Img> {
2323

2424
@Parameter
2525
ConvertService convertService;
2626

2727
@Override
2828
public boolean canConvert(ConversionRequest request) {
2929
return Img.class.equals(request.destClass()) &&
30-
AbstractPlot.class.isAssignableFrom(request.sourceClass()) &&
30+
Plot.class.isAssignableFrom(request.sourceClass()) &&
3131
convertService.supports(new ConversionRequest(
3232
request.sourceObject(), request.sourceType(), ImagePlus.class));
3333
}
@@ -46,7 +46,7 @@ public Class<Img> getOutputType() {
4646
}
4747

4848
@Override
49-
public Class<AbstractPlot> getInputType() {
50-
return AbstractPlot.class;
49+
public Class<Plot> getInputType() {
50+
return Plot.class;
5151
}
5252
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@
3131

3232
package net.imagej.plot.defaultplot;
3333

34-
import net.imagej.plot.AbstractPlot;
34+
import net.imagej.plot.Plot;
3535

3636
import java.util.Objects;
3737

3838
/**
39-
* An abstract class with default behavior for the {@link AbstractPlot} interface.
39+
* An abstract class with default behavior for the {@link Plot} interface.
4040
*
4141
* @author Matthias Arzt
4242
*/
4343

44-
abstract class DefaultAbstractPlot implements AbstractPlot {
44+
abstract class DefaultAbstractPlot implements Plot {
4545

4646
private String title;
4747

@@ -55,7 +55,7 @@ abstract class DefaultAbstractPlot implements AbstractPlot {
5555
preferredHeight = 400;
5656
}
5757

58-
// -- AbstractPlot methods --
58+
// -- Plot methods --
5959

6060
@Override
6161
public void setTitle(String title) {

src/main/java/net/imagej/plot/io/AbstractPlotSvgIOPlugin.java renamed to src/main/java/net/imagej/plot/io/PlotSvgIOPlugin.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package net.imagej.plot.io;
22

3-
import net.imagej.plot.AbstractPlot;
3+
import net.imagej.plot.Plot;
44
import org.jfree.chart.JFreeChart;
55
import org.jfree.graphics2d.svg.SVGGraphics2D;
66
import org.jfree.graphics2d.svg.SVGUtils;
@@ -15,12 +15,12 @@
1515
import java.io.IOException;
1616

1717
/**
18-
* Plugin that can write {@link AbstractPlot} as SVG file.
18+
* Plugin that can write {@link Plot} as SVG file.
1919
*
2020
* @author Matthias Arzt
2121
*/
2222
@Plugin(type = IOPlugin.class)
23-
public class AbstractPlotSvgIOPlugin extends AbstractIOPlugin<AbstractPlot> {
23+
public class PlotSvgIOPlugin extends AbstractIOPlugin<Plot> {
2424

2525
@Parameter
2626
ConvertService convertService;
@@ -38,17 +38,17 @@ public boolean supportsSave(String destination) {
3838
@Override
3939
public boolean supportsSave(Object data, String destination) {
4040
return supportsSave(destination) &&
41-
data instanceof AbstractPlot &&
41+
data instanceof Plot &&
4242
convertService.supports(data, JFreeChart.class);
4343
}
4444

4545
@Override
46-
public AbstractPlot open(String source) throws IOException {
46+
public Plot open(String source) throws IOException {
4747
throw new UnsupportedOperationException();
4848
}
4949

5050
@Override
51-
public void save(AbstractPlot data, String destination) throws IOException {
51+
public void save(Plot data, String destination) throws IOException {
5252
if(!supportsSave(data, destination))
5353
throw new IllegalArgumentException();
5454
JFreeChart chart = convertService.convert(data, JFreeChart.class);
@@ -58,7 +58,7 @@ public void save(AbstractPlot data, String destination) throws IOException {
5858
}
5959

6060
@Override
61-
public Class<AbstractPlot> getDataType() {
62-
return AbstractPlot.class;
61+
public Class<Plot> getDataType() {
62+
return Plot.class;
6363
}
6464
}

src/main/java/net/imagej/ui/swing/viewer/plot/DefaultPlotDisplay.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,21 @@
3131

3232
package net.imagej.ui.swing.viewer.plot;
3333

34-
import net.imagej.plot.AbstractPlot;
34+
import net.imagej.plot.Plot;
3535
import org.scijava.display.AbstractDisplay;
3636
import org.scijava.display.Display;
3737
import org.scijava.plugin.Plugin;
3838

3939
/**
40-
* Default display for {@link AbstractPlot}s.
40+
* Default display for {@link Plot}s.
4141
*
4242
* @author Curtis Rueden
4343
*/
4444
@Plugin(type = Display.class)
45-
public class DefaultPlotDisplay extends AbstractDisplay<AbstractPlot> implements
45+
public class DefaultPlotDisplay extends AbstractDisplay<Plot> implements
4646
PlotDisplay
4747
{
4848
public DefaultPlotDisplay() {
49-
super(AbstractPlot.class);
49+
super(Plot.class);
5050
}
5151
}

src/main/java/net/imagej/ui/swing/viewer/plot/PlotDisplay.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131

3232
package net.imagej.ui.swing.viewer.plot;
3333

34-
import net.imagej.plot.AbstractPlot;
34+
import net.imagej.plot.Plot;
3535
import org.scijava.display.Display;
3636

3737
/**
38-
* Interface for {@link AbstractPlot} {@link Display}s.
38+
* Interface for {@link Plot} {@link Display}s.
3939
*
4040
* @author Curtis Rueden
4141
*/
42-
public interface PlotDisplay extends Display<AbstractPlot> {
42+
public interface PlotDisplay extends Display<Plot> {
4343
// This interface intentionally left blank.
4444
}

0 commit comments

Comments
 (0)