From 5e2d0738861e2ce24208999f7c2d2a55903df377 Mon Sep 17 00:00:00 2001
From: Leonard Kupper <leonard.kupper@mailbox.tu-dresden.de>
Date: Sat, 20 Jul 2019 14:23:16 +0200
Subject: [PATCH] Make AbstractRasterCanvas concrete. (now RasterCanvas)

---
 .../de/tudresden/inf/mci/brailleplot/App.java |  6 +++---
 .../brailleplot/rendering/AbstractCanvas.java | 19 +++++++++++++++++--
 .../rendering/BrailleTextRasterizer.java      |  8 ++++----
 .../rendering/FunctionalRasterizer.java       | 10 +++++-----
 .../rendering/FunctionalRenderingBase.java    |  8 ++++----
 .../rendering/ImageRasterizer.java            |  8 +++++---
 .../InsufficientRenderingAreaException.java   |  4 ++--
 .../LinearMappingAxisRasterizer.java          | 10 ++++++++--
 .../brailleplot/rendering/MasterRenderer.java |  8 ++++----
 .../brailleplot/rendering/RasterCanvas.java   |  8 ++++----
 .../mci/brailleplot/rendering/Rasterizer.java |  4 ++--
 .../rendering/SixDotBrailleRasterCanvas.java  |  4 ++--
 .../UniformTextureBarChartRasterizer.java     |  9 +++++----
 .../rendering/FunctionalRasterizerTest.java   |  3 +--
 .../rendering/MasterRendererTest.java         |  3 +--
 .../rendering/RasterCanvasTest.java           | 17 +++++++----------
 src/test/resources/base_format.properties     |  2 +-
 src/test/resources/constraint_only.properties |  2 +-
 src/test/resources/default.properties         |  2 +-
 .../margins_and_constraint.properties         |  2 +-
 src/test/resources/margins_only.properties    |  2 +-
 21 files changed, 79 insertions(+), 60 deletions(-)

diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/App.java b/src/main/java/de/tudresden/inf/mci/brailleplot/App.java
index 632d70f0..4b6f29c5 100644
--- a/src/main/java/de/tudresden/inf/mci/brailleplot/App.java
+++ b/src/main/java/de/tudresden/inf/mci/brailleplot/App.java
@@ -13,7 +13,7 @@ import de.tudresden.inf.mci.brailleplot.commandline.SettingType;
 import de.tudresden.inf.mci.brailleplot.commandline.SettingsReader;
 import de.tudresden.inf.mci.brailleplot.commandline.SettingsWriter;
 
-import de.tudresden.inf.mci.brailleplot.rendering.AbstractRasterCanvas;
+import de.tudresden.inf.mci.brailleplot.rendering.RasterCanvas;
 import de.tudresden.inf.mci.brailleplot.rendering.Image;
 import de.tudresden.inf.mci.brailleplot.rendering.MasterRenderer;
 import diagrams.BarChart;
@@ -169,10 +169,10 @@ public final class App {
 
             // Rasterizing
             MasterRenderer renderer = new MasterRenderer(printerConfig, formatConfig);
-            //AbstractRasterCanvas canvas = renderer.rasterize(exampleBarChart);
+            //RasterCanvas canvas = renderer.rasterize(exampleBarChart);
             File imageFile = new File(getClass().getClassLoader().getResource("2_image_chart.png").getFile());
             Image image = new Image(imageFile);
-            AbstractRasterCanvas canvas = renderer.rasterize(image);
+            RasterCanvas canvas = renderer.rasterize(image);
             System.out.println(canvas.getCurrentPage());
 
 
diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/AbstractCanvas.java b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/AbstractCanvas.java
index b7e73c37..245dac87 100644
--- a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/AbstractCanvas.java
+++ b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/AbstractCanvas.java
@@ -5,7 +5,9 @@ import de.tudresden.inf.mci.brailleplot.configparser.Printer;
 import de.tudresden.inf.mci.brailleplot.printabledata.PrintableData;
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
+import java.util.ListIterator;
 
 import static java.lang.Math.max;
 import static java.lang.Math.min;
@@ -13,7 +15,7 @@ import static java.lang.Math.min;
 /**
  * Representation of a target onto which can be drawn. It wraps a {@link PrintableData} instance and specifies the size of the drawing area (in mm).
  * @author Leonard Kupper
- * @version 2019.07.12
+ * @version 2019.07.20
  */
 public abstract class AbstractCanvas {
 
@@ -86,8 +88,21 @@ public abstract class AbstractCanvas {
         return mMillimeterHeight - (mMarginTop + mMarginBottom);
     }
 
-    public final int getPageCount() {
+    /**
+     * Get the number of pages in the canvas.
+     * @return The number of pages.
+     */
+    public int getPageCount() {
         return mPageContainer.size();
     }
 
+    /**
+     * Get an Iterator for the PrintableData instances representing the canvas pages. The single instances should be
+     * casted to the regarding concrete type depending on the canvas implementation.
+     * @return A {@link ListIterator}&lt;{@link PrintableData}&gt;.
+     */
+    public ListIterator<PrintableData> getPageIterator() {
+        return mPageContainer.listIterator();
+    }
+
 }
diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/BrailleTextRasterizer.java b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/BrailleTextRasterizer.java
index 0ac6fc8e..5f049629 100644
--- a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/BrailleTextRasterizer.java
+++ b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/BrailleTextRasterizer.java
@@ -2,12 +2,12 @@ package de.tudresden.inf.mci.brailleplot.rendering;
 
 /**
  * A rasterizer for text on braille grids.
- * @version 2019.07.09
+ * @version 2019.07.20
  * @author Leonard Kupper
  */
 public class BrailleTextRasterizer implements Rasterizer<Text> {
     @Override
-    public void rasterize(final Text data, final AbstractRasterCanvas canvas) throws InsufficientRenderingAreaException {
+    public void rasterize(final Text data, final RasterCanvas canvas) throws InsufficientRenderingAreaException {
         // TODO: rasterize the text (Take different grids into consideration! 6-dot / 8-dot)
         // Until then, we just display dummy characters
         int x = data.getArea().intWrapper().getX();
@@ -23,13 +23,13 @@ public class BrailleTextRasterizer implements Rasterizer<Text> {
 
     // TODO: Completely replace with help methods to calculate suited area for left or right alignment of given text.
     public int calculateRequiredHeight(final String text, final int xPos, final int yPos, final int maxWidth,
-                                           final AbstractRasterCanvas canvas) {
+                                           final RasterCanvas canvas) {
         // TODO: Add calculations for required height to fit the given text into the given canvas. (Linebreaks!)
         // Until then we use a dummy value assuming one line of text:
         return canvas.getCellHeight();
     }
 
-    public int calculateRequiredWidth(final String text, final int xPos, final int yPos, final AbstractRasterCanvas canvas) {
+    public int calculateRequiredWidth(final String text, final int xPos, final int yPos, final RasterCanvas canvas) {
         // TODO: Add calculations for required width to fit the given text into the given canvas. (Extra spacing for equidistant grid!)
         // Until then we use a dummy value assuming single character on braille grid:
         return canvas.getCellWidth();
diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/FunctionalRasterizer.java b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/FunctionalRasterizer.java
index 5ea59921..3c2eb847 100644
--- a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/FunctionalRasterizer.java
+++ b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/FunctionalRasterizer.java
@@ -5,16 +5,16 @@ package de.tudresden.inf.mci.brailleplot.rendering;
  * The rasterizing algorithm to be used is passed to the constructor as lambda function, method reference or rasterizer implementation.
  * @param <T> The concrete diagram class which can be rasterized with the rasterizer.
  * @author Leonard Kupper
- * @version 2019.07.01
+ * @version 2019.07.20
  */
 public class FunctionalRasterizer<T extends Renderable> implements Rasterizer {
 
     private Class<? extends T> mSupportedDiagramClass;
-    private ThrowingBiConsumer<T, AbstractRasterCanvas, InsufficientRenderingAreaException> mRasterizingAlgorithm;
+    private ThrowingBiConsumer<T, RasterCanvas, InsufficientRenderingAreaException> mRasterizingAlgorithm;
 
     /**
      * Constructor. Creates a new rasterizer from either a given rasterizer implementation or (keep in mind that
-     * Rasterizer is a functional interface) from a ThrowingBiConsumer&lt;T, AbstractRasterCanvas, InsufficientRenderingAreaException&gt; method reference.
+     * Rasterizer is a functional interface) from a ThrowingBiConsumer&lt;T, RasterCanvas, InsufficientRenderingAreaException&gt; method reference.
      * @param supportedDiagramClass A reference to the accepted diagram class (e.g. 'BarChart.class')
      * @param rasterizer A reference to a Rasterizer instance.
      */
@@ -28,7 +28,7 @@ public class FunctionalRasterizer<T extends Renderable> implements Rasterizer {
     /*
     public FunctionalRasterizer(
             final Class<? extends T> supportedDiagramClass,
-            final ThrowingBiConsumer<T, AbstractRasterCanvas, InsufficientRenderingAreaException> rasterizingAlgorithm)
+            final ThrowingBiConsumer<T, RasterCanvas, InsufficientRenderingAreaException> rasterizingAlgorithm)
     {
         mSupportedDiagramClass = supportedDiagramClass;
         mRasterizingAlgorithm = rasterizingAlgorithm;
@@ -36,7 +36,7 @@ public class FunctionalRasterizer<T extends Renderable> implements Rasterizer {
      */
 
     @Override
-    public void rasterize(final Renderable data, final AbstractRasterCanvas canvas) throws InsufficientRenderingAreaException {
+    public void rasterize(final Renderable data, final RasterCanvas canvas) throws InsufficientRenderingAreaException {
         // invoke the given rasterizing algorithm
         T diagram = safeCast(data);
         mRasterizingAlgorithm.accept(diagram, canvas);
diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/FunctionalRenderingBase.java b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/FunctionalRenderingBase.java
index fd6e5e59..d0f328bf 100644
--- a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/FunctionalRenderingBase.java
+++ b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/FunctionalRenderingBase.java
@@ -7,12 +7,12 @@ import java.util.Objects;
  * FunctionalRenderingBase. This class acts as a wrapper for multiple {@link FunctionalRasterizer} instances.
  * The rasterizer instances can be registered at runtime. The main purpose of the class is to take diagram representations of any type and select the correct concrete rasterizer.
  * @author Leonard Kupper
- * @version 2019.07.01
+ * @version 2019.07.20
  */
 public class FunctionalRenderingBase {
 
     private HashMap<Class<? extends Renderable>, FunctionalRasterizer> mRasterizingAlgorithms;
-    private AbstractRasterCanvas mRaster;
+    private RasterCanvas mRaster;
 
     public FunctionalRenderingBase() {
         mRasterizingAlgorithms = new HashMap<>();
@@ -43,10 +43,10 @@ public class FunctionalRenderingBase {
         mRasterizingAlgorithms.put(rasterizer.getSupportedDiagramClass(), rasterizer);
     }
 
-    public final void setRasterCanvas(final AbstractRasterCanvas raster) {
+    public final void setRasterCanvas(final RasterCanvas raster) {
         mRaster = Objects.requireNonNull(raster);
     }
-    public final AbstractRasterCanvas getRaster() {
+    public final RasterCanvas getRaster() {
         return mRaster;
     }
 }
diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/ImageRasterizer.java b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/ImageRasterizer.java
index 5981983e..ddee318e 100644
--- a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/ImageRasterizer.java
+++ b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/ImageRasterizer.java
@@ -8,6 +8,8 @@ import static java.lang.Math.*;
 
 /**
  * A rasterizer that is able to re-raster a raster graphics onto a canvas.
+ * @author Leonard Kupper
+ * @version 2019.07.20
  */
 public class ImageRasterizer implements Rasterizer<Image> {
 
@@ -44,7 +46,7 @@ public class ImageRasterizer implements Rasterizer<Image> {
     }
 
     @Override
-    public void rasterize(final Image imgData, final AbstractRasterCanvas canvas) throws InsufficientRenderingAreaException {
+    public void rasterize(final Image imgData, final RasterCanvas canvas) throws InsufficientRenderingAreaException {
 
         // Each rasterizer essentially works by taking an instance of a Renderable (in this case Image) and then
         // creating a graphical representation of the object on the raster canvas.
@@ -73,7 +75,7 @@ public class ImageRasterizer implements Rasterizer<Image> {
         }
     }
 
-    private void linearMapping(final BufferedImage imgBuf, final AbstractRasterCanvas canvas) {
+    private void linearMapping(final BufferedImage imgBuf, final RasterCanvas canvas) {
 
         // A canvas is basically a wrapper for multiple representations of printable data, each representing a page.
         // These representations can be acquired by either requesting the current page or creating a new page.
@@ -128,7 +130,7 @@ public class ImageRasterizer implements Rasterizer<Image> {
         }
     }
 
-    private void quantifiedPositionMapping(final BufferedImage imgBuf, final AbstractRasterCanvas canvas) {
+    private void quantifiedPositionMapping(final BufferedImage imgBuf, final RasterCanvas canvas) {
 
         MatrixData<Boolean> data = canvas.getNewPage();
 
diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/InsufficientRenderingAreaException.java b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/InsufficientRenderingAreaException.java
index 26d9eec0..a422a1c6 100644
--- a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/InsufficientRenderingAreaException.java
+++ b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/InsufficientRenderingAreaException.java
@@ -1,11 +1,11 @@
 package de.tudresden.inf.mci.brailleplot.rendering;
 
 /**
- * Exception that indicates too few space available to display the amount of data contained in the given diagram representation.
+ * Exception that indicates too few space available to display the amount of data contained in the given renderable representation.
  * Typical circumstances that lead the rasterizer/plotter to throw this exception are that there are simply too much elements to
  * display them physically in the given raster/area or that the value range cannot be mapped to the given output resolution.
  * @author Leonard Kupper
- * @version 2019.07.01
+ * @version 2019.07.20
  */
 public class InsufficientRenderingAreaException extends Exception {
 
diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/LinearMappingAxisRasterizer.java b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/LinearMappingAxisRasterizer.java
index 67381bcf..68c0a9db 100644
--- a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/LinearMappingAxisRasterizer.java
+++ b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/LinearMappingAxisRasterizer.java
@@ -6,13 +6,19 @@ import static de.tudresden.inf.mci.brailleplot.rendering.Axis.Type.X_AXIS;
 import static de.tudresden.inf.mci.brailleplot.rendering.Axis.Type.Y_AXIS;
 import static java.lang.Math.abs;
 
+/**
+ * A rasterizer for instances of {@link Axis} which is using a simple approach by linear mapping.
+ * @author Leonard Kupper
+ * @version 2019.07.20
+ */
+
 public class LinearMappingAxisRasterizer implements Rasterizer<Axis> {
 
     private BrailleTextRasterizer mTextRasterizer = new BrailleTextRasterizer();
-    private AbstractRasterCanvas mCanvas;
+    private RasterCanvas mCanvas;
 
     @Override
-    public void rasterize(final Axis axis, final AbstractRasterCanvas canvas) throws InsufficientRenderingAreaException {
+    public void rasterize(final Axis axis, final RasterCanvas canvas) throws InsufficientRenderingAreaException {
 
         mCanvas = canvas;
         MatrixData<Boolean> data = mCanvas.getCurrentPage();
diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/MasterRenderer.java b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/MasterRenderer.java
index dcad84dc..bb002a5d 100644
--- a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/MasterRenderer.java
+++ b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/MasterRenderer.java
@@ -11,7 +11,7 @@ import java.util.Objects;
  * The MasterRenderer takes representations of any diagram type, calculates the available raster/area from the given printer and format configuration and dispatches
  * any calls to the 'rasterize' and 'plot' methods to the given {@link FunctionalRenderingBase}.
  * @author Leonard Kupper
- * @version 2019.07.12
+ * @version 2019.07.20
  */
 public final class MasterRenderer {
 
@@ -40,14 +40,14 @@ public final class MasterRenderer {
         setRenderingContext(printer, format, renderingBase);
     }
 
-    public AbstractRasterCanvas rasterize(final Renderable data) throws InsufficientRenderingAreaException {
-        AbstractRasterCanvas canvas = createCompatibleRasterCanvas();
+    public RasterCanvas rasterize(final Renderable data) throws InsufficientRenderingAreaException {
+        RasterCanvas canvas = createCompatibleRasterCanvas();
         mRenderingBase.setRasterCanvas(canvas);
         mRenderingBase.rasterize(data);
         return canvas;
     }
 
-    private AbstractRasterCanvas createCompatibleRasterCanvas() throws InsufficientRenderingAreaException {
+    private RasterCanvas createCompatibleRasterCanvas() throws InsufficientRenderingAreaException {
 
         return new SixDotBrailleRasterCanvas(mPrinter, mFormat);
 
diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/RasterCanvas.java b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/RasterCanvas.java
index 0a118fd6..6ca20024 100644
--- a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/RasterCanvas.java
+++ b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/RasterCanvas.java
@@ -14,9 +14,9 @@ import static java.lang.Math.*;
  * Representation of a target onto which an image can be rasterized.
  * It wraps a {@link de.tudresden.inf.mci.brailleplot.printabledata.MatrixData} instance and describes the raster size and its (not necessarily equidistant) layout.
  * @author Leonard Kupper
- * @version 2019.07.12
+ * @version 2019.07.20
  */
-public class AbstractRasterCanvas extends AbstractCanvas {
+public class RasterCanvas extends AbstractCanvas {
 
     private ArrayList<Double> mXPositions;
     private ArrayList<Double> mYPositions;
@@ -44,7 +44,7 @@ public class AbstractRasterCanvas extends AbstractCanvas {
     private Rectangle mPrintingAreaCells;
 
     /**
-     * Constructor. Creates a new AbstractRasterCanvas, which is a canvas that represents it pages as instances of
+     * Constructor. Creates a new RasterCanvas, which is a canvas that represents it pages as instances of
      * {@link MatrixData} and holds information about the layout and spacing of the underlying raster grid.
      * The described grid is build from uniform 'cells' consisting of a variable amount of dots.
      * It is used as a target on which can be drawn by a {@link Rasterizer}.
@@ -55,7 +55,7 @@ public class AbstractRasterCanvas extends AbstractCanvas {
      * @throws InsufficientRenderingAreaException If the given configuration leads to an printable area of negative
      * size or zero size, e.g. if the sum of defined margins and constraints adds up to be greater than the original page size.
      */
-    AbstractRasterCanvas(final Printer printer, final Format format, final int cellWidth, final int cellHeight)
+    RasterCanvas(final Printer printer, final Format format, final int cellWidth, final int cellHeight)
             throws InsufficientRenderingAreaException {
 
         super(printer, format);
diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/Rasterizer.java b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/Rasterizer.java
index 7130aa12..d43e40d5 100644
--- a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/Rasterizer.java
+++ b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/Rasterizer.java
@@ -10,12 +10,12 @@ import static java.lang.Math.min;
  * Rasterizer. A functional interface for anything that is able to rasterize a diagram to a raster.
  * @param <T> The concrete diagram class which can be rasterized with the rasterizer.
  * @author Leonard Kupper
- * @version 2019.07.01
+ * @version 2019.07.20
  */
 @FunctionalInterface
 public interface Rasterizer<T extends Renderable> {
 
-    void rasterize(T data, AbstractRasterCanvas canvas) throws InsufficientRenderingAreaException;
+    void rasterize(T data, RasterCanvas canvas) throws InsufficientRenderingAreaException;
 
     // Basic geometric rasterizing toolset:
 
diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/SixDotBrailleRasterCanvas.java b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/SixDotBrailleRasterCanvas.java
index cd24c2ac..10529b15 100644
--- a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/SixDotBrailleRasterCanvas.java
+++ b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/SixDotBrailleRasterCanvas.java
@@ -6,9 +6,9 @@ import de.tudresden.inf.mci.brailleplot.configparser.Printer;
 /**
  * Represents a raster consisting of 6-dot braille cells.
  * @author Leonard Kupper
- * @version 2019.07.12
+ * @version 2019.07.20
  */
-class SixDotBrailleRasterCanvas extends AbstractRasterCanvas {
+class SixDotBrailleRasterCanvas extends RasterCanvas {
 
     SixDotBrailleRasterCanvas(final Printer printer, final Format format) throws InsufficientRenderingAreaException {
         super(printer, format, 2, 3);
diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/UniformTextureBarChartRasterizer.java b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/UniformTextureBarChartRasterizer.java
index 25b1e67c..9471d452 100644
--- a/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/UniformTextureBarChartRasterizer.java
+++ b/src/main/java/de/tudresden/inf/mci/brailleplot/rendering/UniformTextureBarChartRasterizer.java
@@ -10,14 +10,15 @@ import java.util.Objects;
 import static java.lang.Math.*;
 
 /**
- * UniformTextureBarChartRasterizer. I will write an explanation when finished, this class has changed like over 9000 times...
+ * A rasterizer for instances of {@link BarChart} which is based on an algorithm that constructs horizontal category
+ * bars that are filled with a uniform texture. The rasterizer is 'cell' based, working on 6-dot or 8-dot layouts.
  * @author Leonard Kupper
- * @version 2019.07.12
+ * @version 2019.07.20
  */
 final class UniformTextureBarChartRasterizer implements Rasterizer<BarChart> {
 
     BarChart mDiagram;
-    AbstractRasterCanvas mCanvas;
+    RasterCanvas mCanvas;
     MatrixData<Boolean> mData;
 
     // TODO: move some of these into the format config.
@@ -45,7 +46,7 @@ final class UniformTextureBarChartRasterizer implements Rasterizer<BarChart> {
 
 
     @Override
-    public void rasterize(final BarChart diagram, final AbstractRasterCanvas canvas)
+    public void rasterize(final BarChart diagram, final RasterCanvas canvas)
             throws InsufficientRenderingAreaException {
 
         // The comments here can only give a very short overview, please see the wiki for a full explanation.
diff --git a/src/test/java/de/tudresden/inf/mci/brailleplot/rendering/FunctionalRasterizerTest.java b/src/test/java/de/tudresden/inf/mci/brailleplot/rendering/FunctionalRasterizerTest.java
index cdf6485c..b7ab3ebb 100644
--- a/src/test/java/de/tudresden/inf/mci/brailleplot/rendering/FunctionalRasterizerTest.java
+++ b/src/test/java/de/tudresden/inf/mci/brailleplot/rendering/FunctionalRasterizerTest.java
@@ -4,7 +4,6 @@ import de.tudresden.inf.mci.brailleplot.configparser.ConfigurationParser;
 import de.tudresden.inf.mci.brailleplot.configparser.Format;
 import de.tudresden.inf.mci.brailleplot.configparser.JavaPropertiesConfigurationParser;
 import de.tudresden.inf.mci.brailleplot.configparser.Printer;
-import diagrams.BarChart;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
@@ -49,7 +48,7 @@ public class FunctionalRasterizerTest {
         // which decides which rasterizer to use based on the Renderable type.
         // Directly passing the wrong Renderable type must cause exception:
         Assertions.assertThrows(IllegalArgumentException.class, () -> {
-            AbstractRasterCanvas testCanvas = new SixDotBrailleRasterCanvas(mPrinter, mFormat);
+            RasterCanvas testCanvas = new SixDotBrailleRasterCanvas(mPrinter, mFormat);
             // Pass Image to Text rasterizer.
             textRasterizer.rasterize(new Image(getResource("dummy.bmp")), testCanvas);
         });
diff --git a/src/test/java/de/tudresden/inf/mci/brailleplot/rendering/MasterRendererTest.java b/src/test/java/de/tudresden/inf/mci/brailleplot/rendering/MasterRendererTest.java
index 33ddf6a0..3d4a6224 100644
--- a/src/test/java/de/tudresden/inf/mci/brailleplot/rendering/MasterRendererTest.java
+++ b/src/test/java/de/tudresden/inf/mci/brailleplot/rendering/MasterRendererTest.java
@@ -4,7 +4,6 @@ import de.tudresden.inf.mci.brailleplot.configparser.ConfigurationParser;
 import de.tudresden.inf.mci.brailleplot.configparser.Format;
 import de.tudresden.inf.mci.brailleplot.configparser.JavaPropertiesConfigurationParser;
 import de.tudresden.inf.mci.brailleplot.configparser.Printer;
-import diagrams.BarChart;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
@@ -64,7 +63,7 @@ public class MasterRendererTest {
                     MasterRenderer renderer = new MasterRenderer(mPrinter, mFormat, renderingBase);
 
                     // Test rasterizer selection
-                    AbstractRasterCanvas result;
+                    RasterCanvas result;
 
                     result= renderer.rasterize(new Text("dummy text", new Rectangle(0,0,1,1)));
                     Assertions.assertEquals(1, result.getPageCount());
diff --git a/src/test/java/de/tudresden/inf/mci/brailleplot/rendering/RasterCanvasTest.java b/src/test/java/de/tudresden/inf/mci/brailleplot/rendering/RasterCanvasTest.java
index d54362bf..3b7fdf56 100644
--- a/src/test/java/de/tudresden/inf/mci/brailleplot/rendering/RasterCanvasTest.java
+++ b/src/test/java/de/tudresden/inf/mci/brailleplot/rendering/RasterCanvasTest.java
@@ -1,19 +1,16 @@
 package de.tudresden.inf.mci.brailleplot.rendering;
 
 import de.tudresden.inf.mci.brailleplot.configparser.ConfigurationParser;
-import de.tudresden.inf.mci.brailleplot.configparser.Format;
 import de.tudresden.inf.mci.brailleplot.configparser.JavaPropertiesConfigurationParser;
-import de.tudresden.inf.mci.brailleplot.configparser.Printer;
 import de.tudresden.inf.mci.brailleplot.printabledata.MatrixData;
 import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
 
 import java.io.File;
 import java.util.ListIterator;
 
 
-public class AbstractRasterCanvasTest {
+public class RasterCanvasTest {
 
     public static final String mDefaultConfig = getResource("default.properties").getAbsolutePath();
     public static final String mBaseConfig = getResource("base_format.properties").getAbsolutePath();
@@ -32,7 +29,7 @@ public class AbstractRasterCanvasTest {
         Assertions.assertDoesNotThrow(
                 () -> {
                     ConfigurationParser parser = new JavaPropertiesConfigurationParser(mBaseConfig, mDefaultConfig);
-                    AbstractRasterCanvas canvas = new SixDotBrailleRasterCanvas(parser.getPrinter(), parser.getFormat("test"));
+                    RasterCanvas canvas = new SixDotBrailleRasterCanvas(parser.getPrinter(), parser.getFormat("test"));
 
                     // pre-calculated and measured correct values:
                     int x = 0;
@@ -78,7 +75,7 @@ public class AbstractRasterCanvasTest {
         Assertions.assertDoesNotThrow(
                 () -> {
                     ConfigurationParser parser = new JavaPropertiesConfigurationParser(mMarginsOnlyConfig, mDefaultConfig);
-                    AbstractRasterCanvas canvas = new SixDotBrailleRasterCanvas(parser.getPrinter(), parser.getFormat("test"));
+                    RasterCanvas canvas = new SixDotBrailleRasterCanvas(parser.getPrinter(), parser.getFormat("test"));
 
                     // pre-calculated and measured correct values:
                     // 6 mm left margin -> 1 cell border
@@ -112,7 +109,7 @@ public class AbstractRasterCanvasTest {
         Assertions.assertDoesNotThrow(
                 () -> {
                     ConfigurationParser parser = new JavaPropertiesConfigurationParser(mConstraintOnlyConfig, mDefaultConfig);
-                    AbstractRasterCanvas canvas = new SixDotBrailleRasterCanvas(parser.getPrinter(), parser.getFormat("test"));
+                    RasterCanvas canvas = new SixDotBrailleRasterCanvas(parser.getPrinter(), parser.getFormat("test"));
 
                     // pre-calculated and measured correct values:
                     // width-constraint: 190.0 mm -> fits 32 cells h.
@@ -145,7 +142,7 @@ public class AbstractRasterCanvasTest {
         Assertions.assertDoesNotThrow(
                 () -> {
                     ConfigurationParser parser = new JavaPropertiesConfigurationParser(mBothConfig, mDefaultConfig);
-                    AbstractRasterCanvas canvas = new SixDotBrailleRasterCanvas(parser.getPrinter(), parser.getFormat("test"));
+                    RasterCanvas canvas = new SixDotBrailleRasterCanvas(parser.getPrinter(), parser.getFormat("test"));
 
                     // pre-calculated and measured correct values:
                     // width-constraint: 190.0 mm -> fits 32 cells h.
@@ -174,13 +171,13 @@ public class AbstractRasterCanvasTest {
     }
 
     @Test @SuppressWarnings("unchecked")
-    // AbstractRasterCanvas is guaranteed to create MatrixData instances for its pages
+    // RasterCanvas is guaranteed to create MatrixData instances for its pages
     public void testPageIterator() {
         Assertions.assertDoesNotThrow(
                 () -> {
                     ConfigurationParser parser = new JavaPropertiesConfigurationParser(mBaseConfig, mDefaultConfig);
                     MasterRenderer renderer = new MasterRenderer(parser.getPrinter(), parser.getFormat("test"));
-                    AbstractRasterCanvas result = renderer.rasterize(new Image(getResource("dummy.bmp")));
+                    RasterCanvas result = renderer.rasterize(new Image(getResource("dummy.bmp")));
                     ListIterator iter = result.getPageIterator();
                     while (iter.hasNext()) {
                         MatrixData<Boolean> page = (MatrixData<Boolean>) iter.next();
diff --git a/src/test/resources/base_format.properties b/src/test/resources/base_format.properties
index be74f9c8..ee3e7c4d 100644
--- a/src/test/resources/base_format.properties
+++ b/src/test/resources/base_format.properties
@@ -5,7 +5,7 @@
 #
 # Description:
 # This is a test configuration file for the AbstractCanvas and
-# AbstractRasterCanvas printing area calculation tests.
+# RasterCanvas printing area calculation tests.
 # =============================================================================
 
 ### General Printer Properties
diff --git a/src/test/resources/constraint_only.properties b/src/test/resources/constraint_only.properties
index 3cbc2910..35b2e55f 100644
--- a/src/test/resources/constraint_only.properties
+++ b/src/test/resources/constraint_only.properties
@@ -5,7 +5,7 @@
 #
 # Description:
 # This is a test configuration file for the AbstractCanvas and
-# AbstractRasterCanvas printing area calculation tests.
+# RasterCanvas printing area calculation tests.
 # =============================================================================
 
 ### General Printer Properties
diff --git a/src/test/resources/default.properties b/src/test/resources/default.properties
index 99f53b87..12d237ff 100644
--- a/src/test/resources/default.properties
+++ b/src/test/resources/default.properties
@@ -5,7 +5,7 @@
 #
 # Description:
 # This is a test configuration file for the AbstractCanvas and
-# AbstractRasterCanvas printing area calculation tests.
+# RasterCanvas printing area calculation tests.
 # =============================================================================
 
 # Define these here to have neat small concrete test configs.
diff --git a/src/test/resources/margins_and_constraint.properties b/src/test/resources/margins_and_constraint.properties
index f20c53e4..a73b7dab 100644
--- a/src/test/resources/margins_and_constraint.properties
+++ b/src/test/resources/margins_and_constraint.properties
@@ -5,7 +5,7 @@
 #
 # Description:
 # This is a test configuration file for the AbstractCanvas and
-# AbstractRasterCanvas printing area calculation tests.
+# RasterCanvas printing area calculation tests.
 # =============================================================================
 
 ### General Printer Properties
diff --git a/src/test/resources/margins_only.properties b/src/test/resources/margins_only.properties
index 269822cd..bd4cbc70 100644
--- a/src/test/resources/margins_only.properties
+++ b/src/test/resources/margins_only.properties
@@ -5,7 +5,7 @@
 #
 # Description:
 # This is a test configuration file for the AbstractCanvas and
-# AbstractRasterCanvas printing area calculation tests.
+# RasterCanvas printing area calculation tests.
 # =============================================================================
 
 ### General Printer Properties
-- 
GitLab