From 81dd537d7b27deffdc7a144b32e771a170e7f9e9 Mon Sep 17 00:00:00 2001 From: Richeeyyy <richard.schmidt@mailbox.tu-dresden.de> Date: Fri, 26 Jul 2019 16:14:47 +0200 Subject: [PATCH] Fix wrong names in comments due to refactoring fault --- .../de/tudresden/inf/mci/brailleplot/App.java | 24 +-- .../commandline/CommandLineParser.java | 2 +- .../configparser/Configurable.java | 6 +- .../configparser/ConfigurationParser.java | 6 +- .../configparser/ConfigurationValidator.java | 4 +- .../mci/brailleplot/configparser/Format.java | 2 +- .../configparser/FormatProperty.java | 8 +- .../JavaPropertiesConfigurationValidator.java | 12 +- .../configparser/PrinterProperty.java | 2 +- .../configparser/ValidProperty.java | 6 +- .../brailleplot/printabledata/MatrixData.java | 2 +- .../brailleplot/printabledata/Point2D.java | 10 +- .../printabledata/Point2DValued.java | 6 +- .../printabledata/SimpleMatrixDataImpl.java | 4 +- src/main/resources/config/default.properties | 54 +++++++ .../resources/config/index_basic_d.properties | 58 +++++++ .../config/index_everest_d_v4.properties | 69 +++++++++ .../resources/examples/csv/0_bar_chart.csv | 2 + .../resources/examples/img/2_image_chart.png | Bin 0 -> 2797 bytes .../resources/mapping/eurobraille.properties | 146 ++++++++++++++++++ ...JavaPropertiesConfigurationParserTest.java | 18 +-- .../resources/config/base_format.properties | 27 ++++ src/test/resources/config/concrete.properties | 50 ++++++ .../config/constraint_only.properties | 31 ++++ src/test/resources/config/default.properties | 55 +++++++ .../illegalPropertyNameExample.properties | 59 +++++++ .../illegalPropertyValueExample.properties | 59 +++++++ .../config/margins_and_constraint.properties | 31 ++++ .../resources/config/margins_only.properties | 27 ++++ .../missingRequiredPropertyExample.properties | 52 +++++++ .../config/rasterizer_test_default.properties | 43 ++++++ src/test/resources/examples/img/dummy.bmp | Bin 0 -> 58 bytes .../resources/mapping/eurobraille.properties | 146 ++++++++++++++++++ src/test/resources/mapping/mapping.properties | 146 ++++++++++++++++++ 34 files changed, 1100 insertions(+), 67 deletions(-) create mode 100644 src/main/resources/config/default.properties create mode 100644 src/main/resources/config/index_basic_d.properties create mode 100644 src/main/resources/config/index_everest_d_v4.properties create mode 100644 src/main/resources/examples/csv/0_bar_chart.csv create mode 100644 src/main/resources/examples/img/2_image_chart.png create mode 100644 src/main/resources/mapping/eurobraille.properties create mode 100644 src/test/resources/config/base_format.properties create mode 100644 src/test/resources/config/concrete.properties create mode 100644 src/test/resources/config/constraint_only.properties create mode 100644 src/test/resources/config/default.properties create mode 100644 src/test/resources/config/illegalPropertyNameExample.properties create mode 100644 src/test/resources/config/illegalPropertyValueExample.properties create mode 100644 src/test/resources/config/margins_and_constraint.properties create mode 100644 src/test/resources/config/margins_only.properties create mode 100644 src/test/resources/config/missingRequiredPropertyExample.properties create mode 100644 src/test/resources/config/rasterizer_test_default.properties create mode 100644 src/test/resources/examples/img/dummy.bmp create mode 100644 src/test/resources/mapping/eurobraille.properties create mode 100644 src/test/resources/mapping/mapping.properties 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 f7bcd565..6b0a9f5c 100644 --- a/src/main/java/de/tudresden/inf/mci/brailleplot/App.java +++ b/src/main/java/de/tudresden/inf/mci/brailleplot/App.java @@ -1,6 +1,5 @@ package de.tudresden.inf.mci.brailleplot; - import de.tudresden.inf.mci.brailleplot.commandline.CommandLineParser; import de.tudresden.inf.mci.brailleplot.commandline.SettingType; import de.tudresden.inf.mci.brailleplot.commandline.SettingsReader; @@ -10,10 +9,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.Optional; -import java.io.IOException; import java.util.concurrent.ConcurrentLinkedDeque; - /** * Main class. * Set up the application and run it. @@ -27,28 +24,9 @@ public final class App { * Main method. * Instantiate application and execute it. * @param args Command line parameters. - * @throws IOException May throw Exception. */ - public static void main(final String[] args) throws IOException { + public static void main(final String[] args) { App app = App.getInstance(); - /**String csvPath = "parser_bar.csv"; - CsvType csvType = CsvType.X_ALIGNED_CATEGORIES; - CsvOrientation csvOrientation = CsvOrientation.HORIZONTAL; - CsvParser parser = new CsvParser(new FileReader(csvPath), ',', '"'); - CategorialPointListList points = (CategorialPointListList) parser.parse(csvType, csvOrientation); - BarChart point = new BarChart(points); - System.out.print(parser.csvData + "\n"); - System.out.print(point.getDataSetName(0) + ": "); - System.out.print(point.getDataSet(0)+ "\n"); - System.out.print(point.getDataSetName(1) + ": "); - System.out.print(point.getDataSet(1)+ "\n"); - System.out.print(point.getDataSetName(2) + ": "); - System.out.print(point.getDataSet(2)+ "\n"); - System.out.print(point.getCategoryName(0)+ "\n"); - System.out.print(point.getCategoryName(1)+ "\n"); - System.out.print(point.getCategoryName(2)+ "\n"); - System.out.print(point.getMinY() + "\n"); - System.out.print(point.getMaxY() + "\n");**/ System.exit(app.run(args)); } diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/commandline/CommandLineParser.java b/src/main/java/de/tudresden/inf/mci/brailleplot/commandline/CommandLineParser.java index d035c228..81e77493 100644 --- a/src/main/java/de/tudresden/inf/mci/brailleplot/commandline/CommandLineParser.java +++ b/src/main/java/de/tudresden/inf/mci/brailleplot/commandline/CommandLineParser.java @@ -24,7 +24,7 @@ public class CommandLineParser { mOptions.addOption("h", SettingType.DISPLAY_HELP.toString(), false, "Print help and exit") .addOption("c", SettingType.CSV_LOCATION.toString(), true, "Path to CSV") .addOption("s", SettingType.SEMANTIC_MAPPING.toString(), true, "Literal for semantic mapping") - .addOption("mP", SettingType.PRINTER_CONFIG_PATH.toString(), true, "path to printer configuration file"); + .addOption("p", SettingType.PRINTER_CONFIG_PATH.toString(), true, "Path to printer configuration file"); } /** diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/Configurable.java b/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/Configurable.java index 4e7a5989..b060ffc2 100644 --- a/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/Configurable.java +++ b/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/Configurable.java @@ -39,10 +39,10 @@ abstract class Configurable { } /** - * Get the property for the given property mName. - * @param propertyName The mName of the property. + * Get the property for the given property name. + * @param propertyName The name of the property. * @return A {@link ValidProperty} object that represents the property. - * @throws NoSuchElementException If no property has the specified mName. + * @throws NoSuchElementException If no property has the specified name. */ public final ValidProperty getProperty(final String propertyName) { // look for property diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/ConfigurationParser.java b/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/ConfigurationParser.java index 28e7976a..4eeaccb9 100644 --- a/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/ConfigurationParser.java +++ b/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/ConfigurationParser.java @@ -63,7 +63,7 @@ public abstract class ConfigurationParser { /** * Get the names of all available format configurations. - * @return A {@link Set}<{@link String}> containing the mName of each format. + * @return A {@link Set}<{@link String}> containing the name of each format. */ public final Set<String> getFormatNames() { return mFormats.keySet(); @@ -71,9 +71,9 @@ public abstract class ConfigurationParser { /** * Get a specific format configuration. - * @param formatName The mName of the format. + * @param formatName The name of the format. * @return A {@link Format} object, representing the formats properties. - * @throws NoSuchElementException If no format has the specified mName. + * @throws NoSuchElementException If no format has the specified name. */ public final Format getFormat(final String formatName) { if (!mFormats.containsKey(formatName)) { diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/ConfigurationValidator.java b/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/ConfigurationValidator.java index 1659a9c8..8235bc28 100644 --- a/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/ConfigurationValidator.java +++ b/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/ConfigurationValidator.java @@ -8,8 +8,8 @@ package de.tudresden.inf.mci.brailleplot.configparser; interface ConfigurationValidator { /** * Check whether a given pair of key and value is valid as a property or not. - * This method should check the key to be a legal property mName and the corresponding type. - * @param key The property key/mName + * This method should check the key to be a legal property name and the corresponding type. + * @param key The property key/name * @param value The property value * @return A {@link ValidProperty} object representing the validated property. * @throws ConfigurationValidationException On any error while checking the parsed properties validity. diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/Format.java b/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/Format.java index 92100a33..da454008 100644 --- a/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/Format.java +++ b/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/Format.java @@ -25,7 +25,7 @@ public final class Format extends Configurable { /** * Constructor. * @param properties A {@link List} of {@link FormatProperty} objects. - * @param formatName The mName of the format. (e.g. 'A4') + * @param formatName The name of the format. (e.g. 'A4') */ public Format(final List<FormatProperty> properties, final String formatName) { mFormatName = Objects.requireNonNull(formatName); diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/FormatProperty.java b/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/FormatProperty.java index 5ff279c7..05700826 100644 --- a/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/FormatProperty.java +++ b/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/FormatProperty.java @@ -11,8 +11,8 @@ public final class FormatProperty extends ValidProperty { /** * Constructor. * - * @param format The mName of the format. - * @param name The mName of the property. + * @param format The name of the format. + * @param name The name of the property. * @param value The value of the property. */ public FormatProperty(final String format, final String name, final String value) { @@ -21,8 +21,8 @@ public final class FormatProperty extends ValidProperty { } /** - * Get the mName of the format. - * @return A {@link String} containing the format mName. + * Get the name of the format. + * @return A {@link String} containing the format name. */ public String getFormat() { return mFormat; diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/JavaPropertiesConfigurationValidator.java b/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/JavaPropertiesConfigurationValidator.java index 1f8e34a4..19d61e8b 100644 --- a/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/JavaPropertiesConfigurationValidator.java +++ b/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/JavaPropertiesConfigurationValidator.java @@ -38,7 +38,7 @@ class JavaPropertiesConfigurationValidator implements ConfigurationValidator { // Definition of valid printer properties Map<String, Predicate<String>> p = new HashMap<>(); - definePrinterProperty("mName", requireNotEmpty); + definePrinterProperty("name", requireNotEmpty); definePrinterProperty("mode", requireNotEmpty); definePrinterProperty("brailletable", requireFileExists); definePrinterProperty("floatingDot.support", requireBoolean); @@ -72,7 +72,7 @@ class JavaPropertiesConfigurationValidator implements ConfigurationValidator { /** * Use this function in the validators constructor to add a printer property definition to the internal validation table. * The property will be treated as 'required'. - * @param propertyName The mName of the property. (The prefix 'printer.' must be omitted.) + * @param propertyName The name of the property. (The prefix 'printer.' must be omitted.) * @param validation The validation predicate. {@link Predicate}<{@link String}> */ private void definePrinterProperty(final String propertyName, final Predicate<String> validation) { @@ -80,7 +80,7 @@ class JavaPropertiesConfigurationValidator implements ConfigurationValidator { } /** * Use this function in the validators constructor to add a printer property definition to the internal validation table. - * @param propertyName The mName of the property. (The prefix 'printer.' must be omitted.) + * @param propertyName The name of the property. (The prefix 'printer.' must be omitted.) * @param validation The validation predicate. {@link Predicate}<{@link String}> * @param required Signals whether this is a required property or not. */ @@ -90,7 +90,7 @@ class JavaPropertiesConfigurationValidator implements ConfigurationValidator { /** * Use this function in the validators constructor to add a format property definition to the internal validation table. * The property will be treated as 'required'. - * @param propertyName The mName of the property. (The prefix 'format.[mName].' must be omitted.) + * @param propertyName The name of the property. (The prefix 'format.[name].' must be omitted.) * @param validation The validation predicate. {@link Predicate}<{@link String}> */ private void defineFormatProperty(final String propertyName, final Predicate<String> validation) { @@ -98,7 +98,7 @@ class JavaPropertiesConfigurationValidator implements ConfigurationValidator { } /** * Use this function in the validators constructor to add a format property definition to the internal validation table. - * @param propertyName The mName of the property. (The prefix 'format.[mName].' must be omitted.) + * @param propertyName The name of the property. (The prefix 'format.[name].' must be omitted.) * @param validation The validation predicate. {@link Predicate}<{@link String}> * @param required Signals whether this is a required property or not. */ @@ -184,7 +184,7 @@ class JavaPropertiesConfigurationValidator implements ConfigurationValidator { ) throws ConfigurationValidationException { // Is the property valid? if (!validation.containsKey(propertyName)) { - throw new ConfigurationValidationException("Invalid property mName: " + propertyName); + throw new ConfigurationValidationException("Invalid property name: " + propertyName); } // Check against its type requirement predicate if (!validation.get(propertyName).test(value)) { diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/PrinterProperty.java b/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/PrinterProperty.java index 65cd7dad..753a81f0 100644 --- a/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/PrinterProperty.java +++ b/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/PrinterProperty.java @@ -10,7 +10,7 @@ public final class PrinterProperty extends ValidProperty { /** * Constructor. * - * @param name The mName of the property. + * @param name The name of the property. * @param value The value of the property. */ public PrinterProperty(final String name, final String value) { diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/ValidProperty.java b/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/ValidProperty.java index 591b2e19..1e6cab25 100644 --- a/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/ValidProperty.java +++ b/src/main/java/de/tudresden/inf/mci/brailleplot/configparser/ValidProperty.java @@ -1,7 +1,7 @@ package de.tudresden.inf.mci.brailleplot.configparser; /** - * Representation of a property consisting of a legal property mName and value. + * Representation of a property consisting of a legal property name and value. * @author Leonard Kupper * @version 2019.06.04 */ @@ -18,8 +18,8 @@ public abstract class ValidProperty { } /** - * Get the mName of the property. - * @return A {@link String} containing the property mName. + * Get the name of the property. + * @return A {@link String} containing the property name. */ public final String getName() { return mName; diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/printabledata/MatrixData.java b/src/main/java/de/tudresden/inf/mci/brailleplot/printabledata/MatrixData.java index 435d7ef3..b01567c7 100644 --- a/src/main/java/de/tudresden/inf/mci/brailleplot/printabledata/MatrixData.java +++ b/src/main/java/de/tudresden/inf/mci/brailleplot/printabledata/MatrixData.java @@ -4,7 +4,7 @@ import java.util.Iterator; /** * This data is used to describe the data for the "Braille" and "Graphics" print modes. - * The data is organized in a matrix structure, which can be queried for its values on integer mX (row) and mY (column) indices. + * The data is organized in a matrix structure, which can be queried for its values on integer x (row) and y (column) indices. * @param <T> The type used for representing the intensity. Could be set to {@link Boolean} for basic Braille support, * but could also by set to {@link Short} if different embossing strengths are required. * @author Georg Graßnick diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/printabledata/Point2D.java b/src/main/java/de/tudresden/inf/mci/brailleplot/printabledata/Point2D.java index bdee0d23..6bcf6401 100644 --- a/src/main/java/de/tudresden/inf/mci/brailleplot/printabledata/Point2D.java +++ b/src/main/java/de/tudresden/inf/mci/brailleplot/printabledata/Point2D.java @@ -6,7 +6,7 @@ import java.util.Objects; /** * Representation of a 2 dimensional point. - * Encapsulates a position on mX and mY axis. + * Encapsulates a position on x and y axis. * @author Georg Graßnick * @version 2019.06.26 */ @@ -17,8 +17,8 @@ public class Point2D { /** * Constructor. - * @param x Position on the mX axis. - * @param y Position on the mY axis. + * @param x Position on the x axis. + * @param y Position on the y axis. */ public Point2D(final Quantity<Length> x, final Quantity<Length> y) { if (x == null || y == null) { @@ -30,7 +30,7 @@ public class Point2D { /** * Getter. - * @return The position on the mX axis. + * @return The position on the x axis. */ public final Quantity<Length> getX() { return mX; @@ -38,7 +38,7 @@ public class Point2D { /** * Getter. - * @return The position on the mY axis. + * @return The position on the y axis. */ public final Quantity<Length> getY() { return mY; diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/printabledata/Point2DValued.java b/src/main/java/de/tudresden/inf/mci/brailleplot/printabledata/Point2DValued.java index 36a6cb2a..8b674c97 100644 --- a/src/main/java/de/tudresden/inf/mci/brailleplot/printabledata/Point2DValued.java +++ b/src/main/java/de/tudresden/inf/mci/brailleplot/printabledata/Point2DValued.java @@ -6,7 +6,7 @@ import java.util.Objects; /** * Representation of a 2 dimensional point with an associated value. - * Encapsulates both the position on mX and mY axis, as well as a value (think of embossing intensity). + * Encapsulates both the position on x and y axis, as well as a value (think of embossing intensity). * @param <T> The type used for representing the intensity. Could be set to {@link Boolean} for basic Braille support, * but could also by set to {@link Short} if different embossing strengths are required. * @author Georg Graßnick @@ -18,8 +18,8 @@ public class Point2DValued<T> extends Point2D { /** * Constructor. - * @param x Position on the mX axis. - * @param y Position on the mY axis. + * @param x Position on the x axis. + * @param y Position on the y axis. * @param val The value of the dot */ public Point2DValued(final Quantity<Length> x, final Quantity<Length> y, final T val) { diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/printabledata/SimpleMatrixDataImpl.java b/src/main/java/de/tudresden/inf/mci/brailleplot/printabledata/SimpleMatrixDataImpl.java index 87f78b7b..64f2c39f 100644 --- a/src/main/java/de/tudresden/inf/mci/brailleplot/printabledata/SimpleMatrixDataImpl.java +++ b/src/main/java/de/tudresden/inf/mci/brailleplot/printabledata/SimpleMatrixDataImpl.java @@ -114,7 +114,7 @@ public class SimpleMatrixDataImpl<T> extends AbstractPrintableData implements Ma private final int mCellWidth; private final int mCellHeight; - // We use indices starting at 1, so that we do not have to check for the mX-index to be 0 in the next() method call + // We use indices starting at 1, so that we do not have to check for the x-index to be 0 in the next() method call private int mCurrentX = 1; private int mCurrentY = 1; @@ -145,7 +145,7 @@ public class SimpleMatrixDataImpl<T> extends AbstractPrintableData implements Ma // Staying in the current cell, move down mCurrentY++; } else if (mCurrentX % mCellWidth != 0) { - // Staying in current cell, move right, set mY to the top most index of the current cell + // Staying in current cell, move right, set y to the top most index of the current cell mCurrentX++; mCurrentY = (((mCurrentY / mCellHeight) - 1) * mCellHeight) + 1; } else if (mCurrentX < mMatrix.getColumnCount()) { // Moving on to the next cell diff --git a/src/main/resources/config/default.properties b/src/main/resources/config/default.properties new file mode 100644 index 00000000..fec2bdb6 --- /dev/null +++ b/src/main/resources/config/default.properties @@ -0,0 +1,54 @@ +# JProperties Printer & Format Configuration +# +# Embosser: Default +# Version 1 Rev. 2 (19-07-23) +# +# Description: +# This is the default configuration file for the braille plot application. +# The configuration specifies the default values of required properties. +# +# https://gitlab.hrz.tu-chemnitz.de/s9444737--tu-dresden.de/brailleplot/wikis/Software%20Design#configuration-files +# ============================================================================= + +# ATTENTION: Changes to this configuration will affect settings for ALL printer and format definitions which +# are not overriding the defaults. + +printer.mode=normal +printer.brailletable=src/main/resources/mapping/eurobraille.properties +printer.floatingDot.support=false + +# The following values represent the fixed indentation and maximum technical printing area of the embosser. +# If the outputs don't fit on the page you might want to tweak this values. (Check the format too.) +printer.constraint.top=0 +printer.constraint.left=0 +# The second constraint in the printer.raster namespace helps to limit the available printing area in steps of +# whole cells, for example if the printer enforces a maximum char per line limit or borders are activated. +printer.raster.constraint.top=0 +printer.raster.constraint.left=0 + +# Overall grid layout / type +printer.raster.type=6-dot + +# The following properties define the exact grid spacing. Standard values based on the +# 'Marburg Medium' publication standard as described in the FFI braille technical guideline: +# https://www.ffi.de/assets/Uploads/Technische-Richtlinie-Blindenschrift.pdf +# See also: # https://codes.iccsafe.org/content/ICCA117_12003/chapter-7-communication-elements-and-features#ICCA117.1_2003_Ch07_Sec703 +printer.raster.cellDistance.horizontal=3.5 +printer.raster.cellDistance.vertical=5.0 +printer.raster.dotDistance.horizontal=2.5 +printer.raster.dotDistance.vertical=2.5 +printer.raster.dotDiameter=1.5 + + +### Format Definitions +### ================== + +# Default Format Definition (assume A4 portrait) +format.default.page.width=210 +format.default.page.height=297 +format.default.margin.top=10 +format.default.margin.left=10 +format.default.margin.bottom=10 +format.default.margin.right=10 + +# This is a template. Do not define concrete formats in this file. Use the specific user config file for this purpose. \ No newline at end of file diff --git a/src/main/resources/config/index_basic_d.properties b/src/main/resources/config/index_basic_d.properties new file mode 100644 index 00000000..0c98fba6 --- /dev/null +++ b/src/main/resources/config/index_basic_d.properties @@ -0,0 +1,58 @@ +# JProperties Printer & Format Configuration +# +# Embosser: Index Basic-D +# Version 1 Rev. 3 (19-07-23) +# +# Description: +# This is the main configuration file for use with the braille plot application +# when embossing with the 'Index Basic-D'. +# The configuration specifies the general printer abilities and defines +# pre-selectable formats for this embosser. +# +# https://gitlab.hrz.tu-chemnitz.de/s9444737--tu-dresden.de/brailleplot/wikis/Software%20Design#configuration-files +# ============================================================================= + +### General Printer Properties +### ========================== + +printer.name=Index Basic-D V3 +printer.mode=normal +printer.brailletable=src/main/resources/mapping/mapping.properties +printer.floatingDot.support=false + +# The following values represent the fixed indentation and maximum technical printing area of the embosser. +# If the outputs don't fit on the page you might want to tweak this values. (Check the format too.) +printer.constraint.top=7.5 +printer.constraint.left=0 +printer.constraint.width=188 +printer.constraint.height=282 +# The second constraint in the printer.raster namespace helps to limit the available printing area in steps of +# whole cells, for example if the printer enforces a maximum char per line limit or borders are activated. +printer.raster.constraint.top=0 +printer.raster.constraint.left=1 +printer.raster.constraint.width=29 +printer.raster.constraint.height=28 + +# The following properties define the exact grid spacing. +printer.raster.cellDistance.horizontal=3.5 +printer.raster.cellDistance.vertical=5.0 +printer.raster.dotDistance.horizontal=2.5 +printer.raster.dotDistance.vertical=2.5 +printer.raster.dotDiameter=1.5 + + +### Format Definitions +### ================== + +# A4 Format +format.A4.page.width=210 +format.A4.page.height=297 +format.A4.margin.top=0 +format.A4.margin.left=0 +format.A4.margin.bottom=0 +format.A4.margin.right=0 + +# B5 Format +format.B5.page.width=176 +format.B5.page.height=250 +format.B5.isPortrait=false \ No newline at end of file diff --git a/src/main/resources/config/index_everest_d_v4.properties b/src/main/resources/config/index_everest_d_v4.properties new file mode 100644 index 00000000..3d6ad7a3 --- /dev/null +++ b/src/main/resources/config/index_everest_d_v4.properties @@ -0,0 +1,69 @@ +# JProperties Printer & Format Configuration +# +# Embosser: Index Everest-D V4 +# Version 1 Rev. 9 (19-07-23) +# +# Description: +# This is the main configuration file for use with the braille plot application +# when embossing with the 'Index Everest-D V4'. +# The configuration specifies the general printer abilities and defines +# pre-selectable formats for this embosser. +# +# https://gitlab.hrz.tu-chemnitz.de/s9444737--tu-dresden.de/brailleplot/wikis/Software%20Design#configuration-files +# ============================================================================= + +### General Printer Properties +### ========================== + +printer.name=Index Everest-D V4 +printer.mode=normal +printer.brailletable=src/main/resources/mapping/eurobraille.properties +printer.floatingDot.support=true +printer.floatingDot.resolution=0.05 + +# The following values represent the fixed indentation and maximum technical printing area of the embosser. +# If the outputs don't fit on the page you might want to tweak this values. (Check the format too.) +printer.constraint.top=5.0 +printer.constraint.left=0 +#printer.constraint.width=? TODO: Check out manual, Conduct printing tests with bigger formats +#printer.constraint.height=? +# The second constraint in the printer.raster namespace helps to limit the available printing area in steps of +# whole cells, for example if the printer enforces a maximum char per line limit or borders are activated. +printer.raster.constraint.top=0 +printer.raster.constraint.left=1 +printer.raster.constraint.width=35 +printer.raster.constraint.height=29 + +# The following properties define the exact grid spacing. +printer.raster.cellDistance.horizontal=3.6 +printer.raster.cellDistance.vertical=4.8 +printer.raster.dotDistance.horizontal=2.5 +printer.raster.dotDistance.vertical=2.5 +printer.raster.dotDiameter=1.5 + +### Format Definitions +### ================== + +# A4 Format +format.A4.page.width=210 +format.A4.page.height=297 +format.A4.margin.top=0 +format.A4.margin.left=0 +format.A4.margin.bottom=0 +format.A4.margin.right=0 + +# A5 Format +format.A5.page.width=148 +format.A5.page.height=210 +format.A5.margin.top=0 +format.A5.margin.left=0 +format.A5.margin.bottom=0 +format.A5.margin.right=0 + +# Wide Format +format.wide.page.width=272 +format.wide.page.height=210 +format.wide.margin.top=0 +format.wide.margin.left=0 +format.wide.margin.bottom=0 +format.wide.margin.right=0 \ No newline at end of file diff --git a/src/main/resources/examples/csv/0_bar_chart.csv b/src/main/resources/examples/csv/0_bar_chart.csv new file mode 100644 index 00000000..b88106bb --- /dev/null +++ b/src/main/resources/examples/csv/0_bar_chart.csv @@ -0,0 +1,2 @@ +,a,b,c,d,e,f,g,h +Wert,500,36,357,473,75,-215,220,356 \ No newline at end of file diff --git a/src/main/resources/examples/img/2_image_chart.png b/src/main/resources/examples/img/2_image_chart.png new file mode 100644 index 0000000000000000000000000000000000000000..e1cf0a4a4526a587675becbfb9e85260a44bdef3 GIT binary patch literal 2797 zcmeAS@N?(olHy`uVBq!ia0y~yVEh8Y9Be?5)7S2I0V&4fAa^H*b?0PW0y!+{j=qiz z3>*8o|0J>k`J4qFk;M!QVyYm_=ozH)fq{Xm$<xI#q$2L^or`^oB19Yl*Z=>2-be6v zqEV`<IGe_uy<twb#FtuTyiX{WJw5$6Z;zpz`Ono12aZ?%`zg%uBcX|pfpH-5<Lu}- z{_WAz?)v{t>nVKkn(@H>BcfIeEF3uSpHo&}O3(gWv-tWh@rd>O2kQTZ+Uo@W_$Xz6 zfcb#+z9RMp21iufu<_25X_@6a&lgU&W_Z8D2~`$dHNE%^AGhkRZ@;a3`rYz6<6{<I zzTVrJB%iJ=!_08JxD`*F?BB#!8|!WR`o-3Ftl?{%&9xiOKWb04I}>_5A&g=E(eQT+ z0tzosvB9+2ci7(OeYbp9H2=9?`GfpNT(S&IEQ0_ayS{CYT;6t_-SdB)m3VyNdiC?J z+Bt7mB^!Wzh0l?7sj|Oz*;QPd__|~JoA2k=MYYEz$Xd-ml|Er@o$8DCF&~u`!rwg3 z372h-Jox^TWQunDPG*OO1*rHy@m}V__iPMznzc(9I0Oa(uIMwAt2SqNAQ!U`)v3r% zKd@^?O{MLfyvT31rKhF7?fqS`d{f!K6EpuDS!2=s{i@C8q}5+#H&@?sKmP5FaQ#uc zb7fZzXNabM*f%RZEa$0qIi^=D)|D%~yUWl}U4Sp;(X*5|Z+I*jZ_Gqop9jxAoAsKl zKSA=(?pG3Lx{TL6U-Dqp`Gm&v4@!ZlA^P45_kEHz4$o$arbpZlpI_&<&WdgGtmpSv zPmkyPWgR}JLViMJ+EK|p>z~a8hF;ajdbIol%1<9+-mkj7n~~xB1ANJno_T6sa?kO5 zybL?o!?8FQ<m3(OY#~K!t^eIkPjcVe-CL=%)w)Q{-cbA8gId$`Yk=N8ZPj{reZiB? zDE|{T)&D^=-|EWObzH#E_`!3|cy*<_O!I<z2~ZG0wAgH(Rer?qhdq|;0!&9&-wx4q zv~PJ{<fm=r^6x{Y-IBGOJbwl-DF8Ff=QCOJBKNKdzVVmKecp<%Epuugt-o>nCO8E_ zWzQO~7ROe+fbuM`i1Dq%n~>>U><}zs4($4t120}CZ3h=GSKfh(7jXUn2g<9|xrg3` zTYPd^tNsL0$RG#Vk5f46mwB&qKM^eBkjpz-vkw&ae7u1-YhT-%e){#pveTR1ubj4r z@xcG@@A>|FU0`fT{)x+z$CBPkGSt}M%9`jkG>AXpr|x&dWAokTzwNr52uXLqlm*Il z_?knwnn{$3_dGp4|2V^e_96l`g8ciBKiF$Or?zU_ZYu{iQ5ig4{an^LB{Ts50R9e$ literal 0 HcmV?d00001 diff --git a/src/main/resources/mapping/eurobraille.properties b/src/main/resources/mapping/eurobraille.properties new file mode 100644 index 00000000..5a20a38b --- /dev/null +++ b/src/main/resources/mapping/eurobraille.properties @@ -0,0 +1,146 @@ +# JProperties Mapping BrailleTable +# +# Table: eurobraille +# Version 1 Rev. 3 (19-07-18) +# +# Description: +# This table contains a mapping from 6-bit-strings to decimal ascii byte values. +# It is used by the printer backend to encode data sent to the embosser. +# The pairs are ordered by ascending ascii byte value. +# +# ============================================================================= + +# 0-31:NUL-US (non visible characters) +# Space +000000=32 +# ! +000010=33 +# " +000100=34 +# # +001111=35 +# $ +000101=36 +# % +111111=37 +# & +111101=38 +# ' +000001=39 +# ( +011001=40 +# ) +001011=41 +# * +001010=42 +# + +011010=43 +# , +010000=44 +# - +001001=45 +# . +001000=46 +# / +010011=47 +# 0 +001101=48 +# 1 +100001=49 +# 2 +110001=50 +# 3 +100101=51 +# 4 +100111=52 +# 5 +100011=53 +# 6 +110101=54 +# 7 +110111=55 +# 8 +110011=56 +# 9 +010101=57 +# : +010010=58 +# ; +011000=59 +# < +000011=60 +# = +011011=61 +# > +000110=62 +# ? +010001=63 +# 64-90:@-Z +# [ +111011=91 +# 92:\ +# 93:] +# 94:^ +# _ +000111=95 +# ` +001110=96 +# a +100000=97 +# b +110000=98 +# c +100100=99 +# d +100110=100 +# e +100010=101 +# f +110100=102 +# g +110110=103 +# h +110010=104 +# i +010100=105 +# j +010110=106 +# k +101000=107 +# l +111000=108 +# m +101100=109 +# n +101110=110 +# o +101010=111 +# p +111100=112 +# q +111110=113 +# r +111010=114 +# s +011100=115 +# t +011110=116 +# u +101001=117 +# v +111001=118 +# w +010111=119 +# x +101101=120 +# y +101111=121 +# z +101011=122 +# { +011111=123 +# | +001100=124 +# ~ +011101=126 +# 127:DEL \ No newline at end of file diff --git a/src/test/java/de/tudresden/inf/mci/brailleplot/configparser/JavaPropertiesConfigurationParserTest.java b/src/test/java/de/tudresden/inf/mci/brailleplot/configparser/JavaPropertiesConfigurationParserTest.java index 886e423c..2f49d599 100644 --- a/src/test/java/de/tudresden/inf/mci/brailleplot/configparser/JavaPropertiesConfigurationParserTest.java +++ b/src/test/java/de/tudresden/inf/mci/brailleplot/configparser/JavaPropertiesConfigurationParserTest.java @@ -13,8 +13,8 @@ import java.util.Set; public class JavaPropertiesConfigurationParserTest { - public static final String mDefaultConfigPath = getResource("default.properties").getAbsolutePath(); - public static final String mConcreteConfigPath = getResource("concrete.properties").getAbsolutePath(); + public static final String mDefaultConfigPath = getResource("config/default.properties").getAbsolutePath(); + public static final String mConcreteConfigPath = getResource("config/concrete.properties").getAbsolutePath(); public static Printer mPrinterConfig; public static Format mFormatConfig; @@ -49,7 +49,7 @@ public class JavaPropertiesConfigurationParserTest { Assertions.assertEquals(0, mFormatConfig.getProperty("margin.left").toInt()); // values without default - Assertions.assertEquals("Dummy Printer", mPrinterConfig.getProperty("mName").toString()); + Assertions.assertEquals("Dummy Printer", mPrinterConfig.getProperty("name").toString()); Assertions.assertEquals(0.05, mPrinterConfig.getProperty("floatingDot.resolution").toDouble()); } @@ -63,7 +63,7 @@ public class JavaPropertiesConfigurationParserTest { @Test public void testFallbackProperties() { - String specifiedByConfig[] = {"mName", "mode", "brailletable", "floatingDot.support", "floatingDot.resolution", "constraint.top", "constraint.left", "raster.dotDistance.horizontal", "raster.dotDistance.vertical", "raster.cellDistance.horizontal", "raster.cellDistance.vertical", "raster.dotDiameter"}; + String specifiedByConfig[] = {"name", "mode", "brailletable", "floatingDot.support", "floatingDot.resolution", "constraint.top", "constraint.left", "raster.dotDistance.horizontal", "raster.dotDistance.vertical", "raster.cellDistance.horizontal", "raster.cellDistance.vertical", "raster.dotDiameter"}; String specifiedByFallback[] = {"mode", "brailletable", "floatingDot.support", "constraint.top", "constraint.left", "raster.constraint.top", "raster.constraint.left", "raster.constraint.width", "raster.constraint.height", "raster.type", "raster.dotDistance.horizontal", "raster.dotDistance.vertical", "raster.cellDistance.horizontal", "raster.cellDistance.vertical", "raster.dotDiameter"}; // config shall extend the fallback @@ -80,12 +80,12 @@ public class JavaPropertiesConfigurationParserTest { public void testIllegalFile() { Assertions.assertThrows( ConfigurationParsingException.class, - () -> new JavaPropertiesConfigurationParser("nonexistent.properties", mDefaultConfigPath) + () -> new JavaPropertiesConfigurationParser("config/nonexistent.properties", mDefaultConfigPath) ); } @Test public void testMissingRequired() { - String configPath = getResource("missingRequiredPropertyExample.properties").getAbsolutePath(); + String configPath = getResource("config/missingRequiredPropertyExample.properties").getAbsolutePath(); Assertions.assertThrows( IllegalStateException.class, () -> new JavaPropertiesConfigurationParser(configPath, mDefaultConfigPath) @@ -93,7 +93,7 @@ public class JavaPropertiesConfigurationParserTest { } @Test public void testIllegalProperty() { - String configPath = getResource("illegalPropertyNameExample.properties").getAbsolutePath(); + String configPath = getResource("config/illegalPropertyNameExample.properties").getAbsolutePath(); Assertions.assertThrows( ConfigurationValidationException.class, () -> new JavaPropertiesConfigurationParser(configPath, mDefaultConfigPath) @@ -101,7 +101,7 @@ public class JavaPropertiesConfigurationParserTest { } @Test public void testIllegalValue() { - String configPath = getResource("illegalPropertyValueExample.properties").getAbsolutePath(); + String configPath = getResource("config/illegalPropertyValueExample.properties").getAbsolutePath(); Assertions.assertThrows( ConfigurationValidationException.class, () -> new JavaPropertiesConfigurationParser(configPath, mDefaultConfigPath) @@ -127,7 +127,7 @@ public class JavaPropertiesConfigurationParserTest { public void testIncompatibleTypeConversion() { Assertions.assertThrows(NumberFormatException.class, () -> mPrinterConfig.getProperty("floatingDot.support").toInt()); Assertions.assertThrows(NumberFormatException.class, () -> mPrinterConfig.getProperty("raster.cellDistance.horizontal").toInt()); - Assertions.assertThrows(NumberFormatException.class, () -> mPrinterConfig.getProperty("mName").toDouble()); + Assertions.assertThrows(NumberFormatException.class, () -> mPrinterConfig.getProperty("name").toDouble()); } } diff --git a/src/test/resources/config/base_format.properties b/src/test/resources/config/base_format.properties new file mode 100644 index 00000000..ee3e7c4d --- /dev/null +++ b/src/test/resources/config/base_format.properties @@ -0,0 +1,27 @@ +# JProperties Printer & Format Configuration +# +# Embosser: Dummy Printer +# Test Revision (19-07-19) (DON'T USE FOR PRINTING) +# +# Description: +# This is a test configuration file for the AbstractCanvas and +# RasterCanvas printing area calculation tests. +# ============================================================================= + +### General Printer Properties +### ========================== + +# No constraint +printer.constraint.top=0 +printer.constraint.left=0 +printer.raster.constraint.top=0 +printer.raster.constraint.left=0 + +### Format Definitions +### ================== + +# No margins +format.test.margin.top=0 +format.test.margin.left=0 +format.test.margin.bottom=0 +format.test.margin.right=0 \ No newline at end of file diff --git a/src/test/resources/config/concrete.properties b/src/test/resources/config/concrete.properties new file mode 100644 index 00000000..ae38765f --- /dev/null +++ b/src/test/resources/config/concrete.properties @@ -0,0 +1,50 @@ +# JProperties Printer & Format Configuration +# +# Embosser: Dummy Printer +# Test Revision (19-07-23) (DON'T USE FOR PRINTING) +# +# Description: +# This is the main configuration file for use with the braille plot application +# when embossing with the 'Index Everest-D V4'. +# The configuration specifies the general printer abilities and defines +# pre-selectable formats for this embosser. +# +# https://gitlab.hrz.tu-chemnitz.de/s9444737--tu-dresden.de/brailleplot/wikis/Software%20Design#configuration-files +# ============================================================================= + +### General Printer Properties +### ========================== + +printer.name=Dummy Printer +printer.mode=normal +printer.brailletable=src/test/resources/mapping/mapping.properties +printer.floatingDot.support=true +printer.floatingDot.resolution=0.05 + +# The following values represent the fixed indentation and maximum technical printing area of the embosser. +# If the outputs don't fit on the page you might want to tweak this values. (Check the format too.) +printer.constraint.top=5.0 +printer.constraint.left=0 + +# The following properties define the exact grid spacing. +printer.raster.cellDistance.horizontal=3.6 +printer.raster.cellDistance.vertical=4.8 +printer.raster.dotDistance.horizontal=2.5 +printer.raster.dotDistance.vertical=2.5 +printer.raster.dotDiameter=1.5 + +### Format Definitions +### ================== + +# A4 Format +format.A4.page.width=210 +format.A4.page.height=297 +format.A4.margin.left=0 + +# A5 Format +format.A5.page.width=148 +format.A5.page.height=210 +format.A5.margin.top=0 +format.A5.margin.left=0 +format.A5.margin.bottom=0 +format.A5.margin.right=0 \ No newline at end of file diff --git a/src/test/resources/config/constraint_only.properties b/src/test/resources/config/constraint_only.properties new file mode 100644 index 00000000..35b2e55f --- /dev/null +++ b/src/test/resources/config/constraint_only.properties @@ -0,0 +1,31 @@ +# JProperties Printer & Format Configuration +# +# Embosser: Dummy Printer +# Test Revision (19-07-19) (DON'T USE FOR PRINTING) +# +# Description: +# This is a test configuration file for the AbstractCanvas and +# RasterCanvas printing area calculation tests. +# ============================================================================= + +### General Printer Properties +### ========================== + +# Test constraint +printer.constraint.top=5.0 +printer.constraint.left=7.5 +printer.constraint.width=190.0 +printer.constraint.height=250.0 +printer.raster.constraint.top=1 +printer.raster.constraint.left=2 +printer.raster.constraint.width=30 +printer.raster.constraint.height=28 + +### Format Definitions +### ================== + +# No margins +format.test.margin.top=0 +format.test.margin.left=0 +format.test.margin.bottom=0 +format.test.margin.right=0 \ No newline at end of file diff --git a/src/test/resources/config/default.properties b/src/test/resources/config/default.properties new file mode 100644 index 00000000..0ddc21c5 --- /dev/null +++ b/src/test/resources/config/default.properties @@ -0,0 +1,55 @@ +# JProperties Printer & Format Configuration +# +# Embosser: Dummy Default +# Test Revision (19-07-23) (DON'T USE FOR PRINTING) +# +# Description: +# This is the default configuration file for the braille plot application. +# The configuration specifies the default values of required properties. +# +# https://gitlab.hrz.tu-chemnitz.de/s9444737--tu-dresden.de/brailleplot/wikis/Software%20Design#configuration-files +# ============================================================================= + +# ATTENTION: Changes to this configuration will affect settings for ALL printer and format definitions which +# are not overriding the defaults. + +printer.mode=normal +printer.brailletable=src/test/resources/mapping/mapping.properties +printer.floatingDot.support=false + +# The following values represent the fixed indentation and maximum technical printing area of the embosser. +# If the outputs don't fit on the page you might want to tweak this values. (Check the format too.) +printer.constraint.top=0 +printer.constraint.left=0 +# The second constraint in the printer.raster namespace helps to limit the available printing area in steps of +# whole cells, for example if the printer enforces a maximum char per line limit or borders are activated. +printer.raster.constraint.top=0 +printer.raster.constraint.left=0 +printer.raster.constraint.width=200 +printer.raster.constraint.height=300 + +# Overall grid layout / type +printer.raster.type=6-dot + +# The following properties define the exact grid spacing. Standard values based on the +# 'Marburg Medium' publication standard as described in the FFI braille technical guideline: +# https://www.ffi.de/assets/Uploads/Technische-Richtlinie-Blindenschrift.pdf +# See also: # https://codes.iccsafe.org/content/ICCA117_12003/chapter-7-communication-elements-and-features#ICCA117.1_2003_Ch07_Sec703 +printer.raster.cellDistance.horizontal=3.5 +printer.raster.cellDistance.vertical=5.0 +printer.raster.dotDistance.horizontal=2.5 +printer.raster.dotDistance.vertical=2.5 +printer.raster.dotDiameter=1.5 + + +### Format Definitions +### ================== + +# Default Format Definition +format.default.page.height=297 +format.default.margin.top=10 +format.default.margin.left=10 +format.default.margin.bottom=10 +format.default.margin.right=10 + +# This is a template. Do not define concrete formats in this file. Use the specific user config file for this purpose. \ No newline at end of file diff --git a/src/test/resources/config/illegalPropertyNameExample.properties b/src/test/resources/config/illegalPropertyNameExample.properties new file mode 100644 index 00000000..c4418b85 --- /dev/null +++ b/src/test/resources/config/illegalPropertyNameExample.properties @@ -0,0 +1,59 @@ +# JProperties Printer & Format Configuration +# +# Embosser: Dummy Default with illegal property name +# Test Revision (19-07-23) (DON'T USE FOR PRINTING) +# +# Description: +# This is the default configuration file for the braille plot application. +# The configuration specifies the default values of required properties. +# +# https://gitlab.hrz.tu-chemnitz.de/s9444737--tu-dresden.de/brailleplot/wikis/Software%20Design#configuration-files +# ============================================================================= + +# ATTENTION: Changes to this configuration will affect settings for ALL printer and format definitions which +# are not overriding the defaults. + +printer.mode=normal +printer.brailletable=src/test/resources/mapping/mapping.properties +printer.floatingDot.support=false + +# Illegal property name example +printer.garbageProperty=illegal + +# The following values represent the fixed indentation and maximum technical printing area of the embosser. +# If the outputs don't fit on the page you might want to tweak this values. (Check the format too.) +printer.constraint.top=0 +printer.constraint.left=0 +# The second constraint in the printer.raster namespace helps to limit the available printing area in steps of +# whole cells, for example if the printer enforces a maximum char per line limit or borders are activated. +printer.raster.constraint.top=0 +printer.raster.constraint.left=0 +printer.raster.constraint.width=200 +printer.raster.constraint.height=300 + +# Overall grid layout / type +printer.raster.type=6-dot + +# The following properties define the exact grid spacing. Standard values based on the +# 'Marburg Medium' publication standard as described in the FFI braille technical guideline: +# https://www.ffi.de/assets/Uploads/Technische-Richtlinie-Blindenschrift.pdf +# See also: # https://codes.iccsafe.org/content/ICCA117_12003/chapter-7-communication-elements-and-features#ICCA117.1_2003_Ch07_Sec703 +printer.raster.cellDistance.horizontal=3.5 +printer.raster.cellDistance.vertical=5.0 +printer.raster.dotDistance.horizontal=2.5 +printer.raster.dotDistance.vertical=2.5 +printer.raster.dotDiameter=1.5 + + +### Format Definitions +### ================== + +# Default Format Definition (assume A4 portrait) +format.default.page.width=210 +format.default.page.height=297 +format.default.margin.top=10 +format.default.margin.left=10 +format.default.margin.bottom=10 +format.default.margin.right=10 + +# This is a template. Do not define concrete formats in this file. Use the specific user config file for this purpose. \ No newline at end of file diff --git a/src/test/resources/config/illegalPropertyValueExample.properties b/src/test/resources/config/illegalPropertyValueExample.properties new file mode 100644 index 00000000..fb25331a --- /dev/null +++ b/src/test/resources/config/illegalPropertyValueExample.properties @@ -0,0 +1,59 @@ +# JProperties Printer & Format Configuration +# +# Embosser: Dummy Default with illegal property value +# Test Revision (19-07-23) (DON'T USE FOR PRINTING) +# +# Description: +# This is the default configuration file for the braille plot application. +# The configuration specifies the default values of required properties. +# +# https://gitlab.hrz.tu-chemnitz.de/s9444737--tu-dresden.de/brailleplot/wikis/Software%20Design#configuration-files +# ============================================================================= + +# ATTENTION: Changes to this configuration will affect settings for ALL printer and format definitions which +# are not overriding the defaults. + +printer.mode=normal +printer.brailletable=src/test/resources/mapping/mapping.properties +printer.floatingDot.support=false + +# The following values represent the fixed indentation and maximum technical printing area of the embosser. +# If the outputs don't fit on the page you might want to tweak this values. (Check the format too.) +printer.constraint.top=0 +printer.constraint.left=0 +# The second constraint in the printer.raster namespace helps to limit the available printing area in steps of +# whole cells, for example if the printer enforces a maximum char per line limit or borders are activated. +printer.raster.constraint.top=0 +printer.raster.constraint.left=0 +printer.raster.constraint.width=200 +printer.raster.constraint.height=300 + +# Overall grid layout / type +printer.raster.type=6-dot + +# The following properties define the exact grid spacing. Standard values based on the +# 'Marburg Medium' publication standard as described in the FFI braille technical guideline: +# https://www.ffi.de/assets/Uploads/Technische-Richtlinie-Blindenschrift.pdf +# See also: # https://codes.iccsafe.org/content/ICCA117_12003/chapter-7-communication-elements-and-features#ICCA117.1_2003_Ch07_Sec703 +printer.raster.cellDistance.horizontal=3.5 +printer.raster.cellDistance.vertical=5.0 +printer.raster.dotDistance.horizontal=2.5 +printer.raster.dotDistance.vertical=2.5 +printer.raster.dotDiameter=1.5 + + +### Format Definitions +### ================== + +# Default Format Definition (assume A4 portrait) +format.default.page.width=210 + +# Illegal property value example +format.default.page.height=two hundred ninety seven + +format.default.margin.top=10 +format.default.margin.left=10 +format.default.margin.bottom=10 +format.default.margin.right=10 + +# This is a template. Do not define concrete formats in this file. Use the specific user config file for this purpose. \ No newline at end of file diff --git a/src/test/resources/config/margins_and_constraint.properties b/src/test/resources/config/margins_and_constraint.properties new file mode 100644 index 00000000..a73b7dab --- /dev/null +++ b/src/test/resources/config/margins_and_constraint.properties @@ -0,0 +1,31 @@ +# JProperties Printer & Format Configuration +# +# Embosser: Dummy Printer +# Test Revision (19-07-19) (DON'T USE FOR PRINTING) +# +# Description: +# This is a test configuration file for the AbstractCanvas and +# RasterCanvas printing area calculation tests. +# ============================================================================= + +### General Printer Properties +### ========================== + +# Test constraint +printer.constraint.top=5.0 +printer.constraint.left=7.5 +printer.constraint.width=190.0 +printer.constraint.height=250.0 +printer.raster.constraint.top=0 +printer.raster.constraint.left=2 +printer.raster.constraint.width=30 +printer.raster.constraint.height=28 + +### Format Definitions +### ================== + +# Test margins +format.test.margin.top=12 +format.test.margin.left=6 +format.test.margin.bottom=42 +format.test.margin.right=0 \ No newline at end of file diff --git a/src/test/resources/config/margins_only.properties b/src/test/resources/config/margins_only.properties new file mode 100644 index 00000000..bd4cbc70 --- /dev/null +++ b/src/test/resources/config/margins_only.properties @@ -0,0 +1,27 @@ +# JProperties Printer & Format Configuration +# +# Embosser: Dummy Printer +# Test Revision (19-07-19) (DON'T USE FOR PRINTING) +# +# Description: +# This is a test configuration file for the AbstractCanvas and +# RasterCanvas printing area calculation tests. +# ============================================================================= + +### General Printer Properties +### ========================== + +# No constraint +printer.constraint.top=0 +printer.constraint.left=0 +printer.raster.constraint.top=0 +printer.raster.constraint.left=0 + +### Format Definitions +### ================== + +# Test margins +format.test.margin.top=12 +format.test.margin.left=6 +format.test.margin.bottom=30 +format.test.margin.right=0 \ No newline at end of file diff --git a/src/test/resources/config/missingRequiredPropertyExample.properties b/src/test/resources/config/missingRequiredPropertyExample.properties new file mode 100644 index 00000000..8692f1bb --- /dev/null +++ b/src/test/resources/config/missingRequiredPropertyExample.properties @@ -0,0 +1,52 @@ +# JProperties Printer & Format Configuration +# +# Embosser: Dummy Printer +# Test Revision (19-07-23) (DON'T USE FOR PRINTING) +# +# Description: +# This is the main configuration file for use with the braille plot application +# when embossing with the 'Index Everest-D V4'. +# The configuration specifies the general printer abilities and defines +# pre-selectable formats for this embosser. +# +# https://gitlab.hrz.tu-chemnitz.de/s9444737--tu-dresden.de/brailleplot/wikis/Software%20Design#configuration-files +# ============================================================================= + +### General Printer Properties +### ========================== + +# Missing required property (not specified by default): +# printer.name=Dummy Printer +printer.mode=normal +printer.brailletable=src/test/resources/mapping/mapping.properties +printer.floatingDot.support=true +printer.floatingDot.resolution=0.05 + +# The following values represent the fixed indentation and maximum technical printing area of the embosser. +# If the outputs don't fit on the page you might want to tweak this values. (Check the format too.) +printer.constraint.top=5.0 +printer.constraint.left=0 + +# The following properties define the exact grid spacing. +printer.raster.cellDistance.horizontal=3.6 +printer.raster.cellDistance.vertical=4.8 +printer.raster.dotDistance.horizontal=2.5 +printer.raster.dotDistance.vertical=2.5 +printer.raster.dotDiameter=1.5 + +### Format Definitions +### ================== + +# A4 Format +format.A4.page.width=210 +format.A4.page.height=297 +format.A4.margin.left=0 + +# A5 Format +# Missing required property (not specified by default): +# format.A5.page.width=148 +format.A5.page.height=210 +format.A5.margin.top=0 +format.A5.margin.left=0 +format.A5.margin.bottom=0 +format.A5.margin.right=0 \ No newline at end of file diff --git a/src/test/resources/config/rasterizer_test_default.properties b/src/test/resources/config/rasterizer_test_default.properties new file mode 100644 index 00000000..27e44cea --- /dev/null +++ b/src/test/resources/config/rasterizer_test_default.properties @@ -0,0 +1,43 @@ +# JProperties Printer & Format Configuration +# +# Embosser: Dummy Default +# Test Revision (19-07-23) (DON'T USE FOR PRINTING) +# +# Description: +# This is a test configuration file for the AbstractCanvas and +# RasterCanvas printing area calculation tests. +# ============================================================================= + +# Define these here to have neat small concrete test configs. +printer.name=Dummy Default +printer.mode=normal +printer.brailletable=src/test/resources/mapping/eurobraille.properties +printer.floatingDot.support=false +printer.raster.type=6-dot + +# Default grid spacing. +printer.raster.cellDistance.horizontal=3.5 +printer.raster.cellDistance.vertical=5.0 +printer.raster.dotDistance.horizontal=2.5 +printer.raster.dotDistance.vertical=2.5 +printer.raster.dotDiameter=1.5 + +# No default constraint +printer.constraint.top=0 +printer.constraint.left=0 +printer.raster.constraint.top=0 +printer.raster.constraint.left=0 + + +### Format Definitions +### ================== + +# A4 size for testing +format.default.page.width=210 +format.default.page.height=297 + +# No default margin +format.default.margin.top=0 +format.default.margin.left=0 +format.default.margin.bottom=0 +format.default.margin.right=0 \ No newline at end of file diff --git a/src/test/resources/examples/img/dummy.bmp b/src/test/resources/examples/img/dummy.bmp new file mode 100644 index 0000000000000000000000000000000000000000..b26c0eb8cd047a78af4484cfe480ae7167c933dd GIT binary patch literal 58 fcmZ?rwPJt(Ga#h_#Eft(0hV9^lc>c1|Nj{PN|ppf literal 0 HcmV?d00001 diff --git a/src/test/resources/mapping/eurobraille.properties b/src/test/resources/mapping/eurobraille.properties new file mode 100644 index 00000000..5a20a38b --- /dev/null +++ b/src/test/resources/mapping/eurobraille.properties @@ -0,0 +1,146 @@ +# JProperties Mapping BrailleTable +# +# Table: eurobraille +# Version 1 Rev. 3 (19-07-18) +# +# Description: +# This table contains a mapping from 6-bit-strings to decimal ascii byte values. +# It is used by the printer backend to encode data sent to the embosser. +# The pairs are ordered by ascending ascii byte value. +# +# ============================================================================= + +# 0-31:NUL-US (non visible characters) +# Space +000000=32 +# ! +000010=33 +# " +000100=34 +# # +001111=35 +# $ +000101=36 +# % +111111=37 +# & +111101=38 +# ' +000001=39 +# ( +011001=40 +# ) +001011=41 +# * +001010=42 +# + +011010=43 +# , +010000=44 +# - +001001=45 +# . +001000=46 +# / +010011=47 +# 0 +001101=48 +# 1 +100001=49 +# 2 +110001=50 +# 3 +100101=51 +# 4 +100111=52 +# 5 +100011=53 +# 6 +110101=54 +# 7 +110111=55 +# 8 +110011=56 +# 9 +010101=57 +# : +010010=58 +# ; +011000=59 +# < +000011=60 +# = +011011=61 +# > +000110=62 +# ? +010001=63 +# 64-90:@-Z +# [ +111011=91 +# 92:\ +# 93:] +# 94:^ +# _ +000111=95 +# ` +001110=96 +# a +100000=97 +# b +110000=98 +# c +100100=99 +# d +100110=100 +# e +100010=101 +# f +110100=102 +# g +110110=103 +# h +110010=104 +# i +010100=105 +# j +010110=106 +# k +101000=107 +# l +111000=108 +# m +101100=109 +# n +101110=110 +# o +101010=111 +# p +111100=112 +# q +111110=113 +# r +111010=114 +# s +011100=115 +# t +011110=116 +# u +101001=117 +# v +111001=118 +# w +010111=119 +# x +101101=120 +# y +101111=121 +# z +101011=122 +# { +011111=123 +# | +001100=124 +# ~ +011101=126 +# 127:DEL \ No newline at end of file diff --git a/src/test/resources/mapping/mapping.properties b/src/test/resources/mapping/mapping.properties new file mode 100644 index 00000000..787be18b --- /dev/null +++ b/src/test/resources/mapping/mapping.properties @@ -0,0 +1,146 @@ +# JProperties Mapping BrailleTable +# +# Table: de-chardefs6 +# Version 1 Rev. 2 (19-07-11) +# +# Description: +# This table contains a mapping from 6-bit-strings to decimal ascii byte values. +# It is used by the printer backend to encode data sent to the embosser. +# The pairs are ordered by ascending ascii byte value. +# +# ============================================================================= + +# 0-31:NUL-US (non visible characters) +# Space +000000=32 +# ! +000010=33 +# " +000100=34 +# # +001111=35 +# $ +000101=36 +# % +111111=37 +# & +111101=38 +# ' +000001=39 +# ( +011001=40 +# ) +001011=41 +# * +001010=42 +# + +011010=43 +# , +010000=44 +# - +001001=45 +# . +001000=46 +# / +010011=47 +# 0 +001101=48 +# 1 +100001=49 +# 2 +110001=50 +# 3 +100101=51 +# 4 +100111=52 +# 5 +100011=53 +# 6 +110101=54 +# 7 +110111=55 +# 8 +110011=56 +# 9 +010101=57 +# : +010010=58 +# ; +011000=59 +# < +000011=60 +# = +011011=61 +# > +000110=62 +# ? +010001=63 +# 64-90:@-Z +# [ +111011=91 +# 92:\ +# 93:] +# 94:^ +# _ +000111=95 +# ` +001110=96 +# a +100000=97 +# b +110000=98 +# c +100100=99 +# d +100110=100 +# e +100010=101 +# f +110100=102 +# g +110110=103 +# h +110010=104 +# i +010100=105 +# j +010110=106 +# k +101000=107 +# l +111000=108 +# m +101100=109 +# n +101110=110 +# o +101010=111 +# p +111100=112 +# q +111110=113 +# r +111010=114 +# s +011100=115 +# t +011110=116 +# u +101001=117 +# v +111001=118 +# w +010111=119 +# x +101101=120 +# y +101111=121 +# z +101011=122 +# { +011111=123 +# | +001100=124 +# ~ +011101=126 +# 127:DEL \ No newline at end of file -- GitLab