Skip to content
Snippets Groups Projects
Commit 74b7b455 authored by Andrey Ruzhanskiy's avatar Andrey Ruzhanskiy
Browse files

Added Comments.

parent 5ef0394a
No related branches found
No related tags found
1 merge request!14Feat/braille print back end 4
...@@ -12,7 +12,7 @@ import java.util.Objects; ...@@ -12,7 +12,7 @@ import java.util.Objects;
* Class representing a normal Document (for example a .txt) to print without * Class representing a normal Document (for example a .txt) to print without
* any Escapesequences. * any Escapesequences.
* @author Andrey Ruzhanskiy * @author Andrey Ruzhanskiy
* @version * @version 12.07.2019
*/ */
@SuppressWarnings("checkstyle:MagicNumber") @SuppressWarnings("checkstyle:MagicNumber")
public class NormalBuilder extends AbstractDocumentBuilder { public class NormalBuilder extends AbstractDocumentBuilder {
...@@ -29,7 +29,7 @@ public class NormalBuilder extends AbstractDocumentBuilder { ...@@ -29,7 +29,7 @@ public class NormalBuilder extends AbstractDocumentBuilder {
@Override @Override
public byte[] assemble(final MatrixData data) { public byte[] assemble(final MatrixData data) {
//Stolen Idea from Leo. //Check if Null Object was given.
mData = Objects.requireNonNull(data); mData = Objects.requireNonNull(data);
// Setting the right parser, catch if not found and throw RuntimeException which can be handled. // Setting the right parser, catch if not found and throw RuntimeException which can be handled.
try { try {
...@@ -39,13 +39,13 @@ public class NormalBuilder extends AbstractDocumentBuilder { ...@@ -39,13 +39,13 @@ public class NormalBuilder extends AbstractDocumentBuilder {
} }
// Get Iterator for Cells. // Get Iterator for Cells.
Iterator<BrailleCell6<Boolean>> iter = data.getBrailleCell6Iterator(); Iterator<BrailleCell6<Boolean>> iter = mData.getBrailleCell6Iterator();
// Set stream for final output. // Set stream for final output.
ByteArrayOutputStream stream = new ByteArrayOutputStream(); ByteArrayOutputStream stream = new ByteArrayOutputStream();
// Getting Width in BrailleCells // Getting Width in BrailleCells
int width = data.getColumnCount() / 2; int width = mData.getColumnCount() / 2;
// Declaration of local variables for better readability. // Declaration of local variables for better readability.
BrailleCell6 current; BrailleCell6 current;
...@@ -74,9 +74,4 @@ public class NormalBuilder extends AbstractDocumentBuilder { ...@@ -74,9 +74,4 @@ public class NormalBuilder extends AbstractDocumentBuilder {
} }
return stream.toByteArray(); return stream.toByteArray();
} }
protected NormalBuilder(){
}
} }
...@@ -4,7 +4,9 @@ package de.tudresden.inf.mci.brailleplot.exporter; ...@@ -4,7 +4,9 @@ package de.tudresden.inf.mci.brailleplot.exporter;
* This enum provides means to differentiate between printers. * This enum provides means to differentiate between printers.
* This should be extended if new printers are supported. If its unknown, the standard should be NormalPrinter. This * This should be extended if new printers are supported. If its unknown, the standard should be NormalPrinter. This
* assumes that no special features are supported and hence, normal braille should be printed. * assumes that no special features are supported and hence, normal braille should be printed.
* Currently used in PrintDirector * Because not every printer supports the same functionality or uses the same Protocol for the same functionality, the
* Softwaredeveloper must
* Currently used in PrintDirector.
* @author Andrey Ruzhanskiy * @author Andrey Ruzhanskiy
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment