Skip to content
Snippets Groups Projects
Commit 162f66fc authored by LeonardK's avatar LeonardK
Browse files

Refactor memeber names in FloatingDotArea DocumentBuilder

parent 8a714794
No related branches found
No related tags found
1 merge request!8Feat/rasterizer 10
......@@ -6,3 +6,6 @@ build
# IntelliJ
.idea
*.iml
# Application
dummyPrinterConfig.properties
\ No newline at end of file
......@@ -32,11 +32,13 @@ dependencies {
}
// Define the main class for the application
mainClassName = 'de.tudresden.inf.mci.brailleplot.DirectPrint'
/*mainClassName = 'de.tudresden.inf.mci.brailleplot.DirectPrint' */
mainClassName = 'de.tudresden.inf.mci.brailleplot.App'
jar {
manifest {
attributes "Main-Class": "de.tudresden.inf.mci.brailleplot.DirectPrint"
/*attributes "Main-Class": "de.tudresden.inf.mci.brailleplot.DirectPrint" */
attributes "Main-Class": "de.tudresden.inf.mci.brailleplot.App"
}
from {
......
......@@ -10,11 +10,18 @@ public final class App {
public String getGreeting() {
return "Hello world.";
}
/*
public static void main(final String[] args) {
System.out.println(new App().getGreeting());
public void dummyConfigurationReader() {
String workingDir = System.getProperty("user.dir");
ConfigurationReader printerConfig = new ConfigurationReader(
workingDir + "/dummyPrinterConfig.properties"
);
}
*/
public static void main(final String[] args) {
//System.out.println(new App().getGreeting());
new App().dummyConfigurationReader();
}
}
......@@ -20,10 +20,10 @@ public class FloatingDotArea extends AbstractDocumentBuilder {
private final byte[] mNewLine = new byte[] {0x0A};
private final byte mColon = 0x3A;
private final byte mComma = 0x2C;
private int origoX = -1;
private int origoY = -1;
private int widthX = -1;
private int heightY = -1;
private int mOrigoX = -1;
private int mOrigoY = -1;
private int mWidthX = -1;
private int mHeightY = -1;
/**
* Construct a floating dot area with default origin and size.
......@@ -44,8 +44,8 @@ public class FloatingDotArea extends AbstractDocumentBuilder {
* Origin y value in centimetres
*/
public FloatingDotArea(final byte[] data, final int origoX, final int origoY) {
this.origoX = origoX;
this.origoY = origoY;
this.mOrigoX = origoX;
this.mOrigoY = origoY;
mDocument = this.assemble(data);
}
......@@ -69,10 +69,10 @@ public class FloatingDotArea extends AbstractDocumentBuilder {
final int widthX,
final int heightY
) {
this.origoX = origoX;
this.origoY = origoY;
this.widthX = widthX;
this.heightY = heightY;
this.mOrigoX = origoX;
this.mOrigoY = origoY;
this.mWidthX = widthX;
this.mHeightY = heightY;
mDocument = this.assemble(data);
}
......@@ -83,20 +83,20 @@ public class FloatingDotArea extends AbstractDocumentBuilder {
try {
stream.write(mActivateDotArea);
if ((origoX >= 0) && (origoY >= 0)) {
if ((mOrigoX >= 0) && (mOrigoY >= 0)) {
stream.write(mParameterOrigo);
//stream.write("(5.00, 3.00)".getBytes());
stream.write("5.00:0.00".getBytes());
}
if (widthX >= 0) {
if (mWidthX >= 0) {
stream.write(mComma);
stream.write(mParameterWidth);
stream.write(Integer.toString(widthX).getBytes());
stream.write(Integer.toString(mWidthX).getBytes());
}
if (heightY >= 0) {
if (mHeightY >= 0) {
stream.write(mComma);
stream.write(mParameterHeight);
stream.write(Integer.toString(heightY).getBytes());
stream.write(Integer.toString(mHeightY).getBytes());
}
stream.write(mSemicolon);
stream.write(mNewLine);
......
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