Skip to content
This repository has been archived by the owner on Nov 9, 2018. It is now read-only.

Commit

Permalink
Adds padding to BlockProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Håkansson committed Jul 3, 2015
1 parent 5ff0da3 commit 8791f7b
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dotify.api/bnd.bnd
Expand Up @@ -9,7 +9,7 @@ Export-Package: \
org.daisy.dotify.api.formatter,\
org.daisy.dotify.api.engine,\
org.daisy.dotify.api.writer
Bundle-Version: 1.1.1-SNAPSHOT
Bundle-Version: 1.2.0-SNAPSHOT
Private-Package: \
org.daisy.dotify.consumer.hyphenator,\
org.daisy.dotify.consumer.text,\
Expand Down
2 changes: 1 addition & 1 deletion dotify.api/gradle.properties
Expand Up @@ -2,4 +2,4 @@ sonatypeUsername=user
sonatypePassword=password
repositoryRevision=N/A
repositoryURL=https://github.com/joeha480/dotify
version=1.1.1-SNAPSHOT
version=1.2.0-SNAPSHOT
84 changes: 84 additions & 0 deletions dotify.api/src/org/daisy/dotify/api/formatter/BlockProperties.java
Expand Up @@ -17,6 +17,10 @@ public class BlockProperties implements Cloneable {
private final int rightMargin;
private final int topMargin;
private final int bottomMargin;
private final int leftPadding;
private final int rightPadding;
private final int topPadding;
private final int bottomPadding;
private final int textIndent;
private final int firstLineIndent;
private final ListStyle listType;
Expand All @@ -43,6 +47,10 @@ public static class Builder {
int rightMargin = 0;
int topMargin = 0;
int bottomMargin = 0;
int leftPadding = 0;
int rightPadding = 0;
int topPadding = 0;
int bottomPadding = 0;
int textIndent = 0;
int firstLineIndent = 0;
ListStyle listType = ListStyle.NONE;
Expand Down Expand Up @@ -104,6 +112,46 @@ public Builder bottomMargin(int bottomMargin) {
return this;
}

/**
* Set the left padding for the block, in characters.
* @param leftPadding left padding, in characters
* @return returns "this" object
*/
public Builder leftPadding(int leftPadding) {
this.leftPadding = leftPadding;
return this;
}

/**
* Set the right padding for the block, in characters.
* @param rightPadding right padding, in characters
* @return returns "this" object
*/
public Builder rightPadding(int rightPadding) {
this.rightPadding = rightPadding;
return this;
}

/**
* Set the top padding for the block, in characters.
* @param topPadding top padding, in characters
* @return returns "this" object
*/
public Builder topPadding(int topPadding) {
this.topPadding = topPadding;
return this;
}

/**
* Set the bottom padding for the block, in characters.
* @param bottomPadding bottom padding, in characters
* @return returns "this" object
*/
public Builder bottomPadding(int bottomPadding) {
this.bottomPadding = bottomPadding;
return this;
}

/**
* Set the text indent for the block, in characters.
* The text indent controls the indent of all text rows except
Expand Down Expand Up @@ -245,6 +293,10 @@ protected BlockProperties(Builder builder) {
rightMargin = builder.rightMargin;
topMargin = builder.topMargin;
bottomMargin = builder.bottomMargin;
leftPadding = builder.leftPadding;
rightPadding = builder.rightPadding;
topPadding = builder.topPadding;
bottomPadding = builder.bottomPadding;
textIndent = builder.textIndent;
firstLineIndent = builder.firstLineIndent;
listType = builder.listType;
Expand Down Expand Up @@ -300,6 +352,38 @@ public int getBottomMargin() {
return bottomMargin;
}

/**
* Get left padding, in characters
* @return returns the left padding
*/
public int getLeftPadding() {
return leftPadding;
}

/**
* Get right padding, in characters
* @return returns the right padding
*/
public int getRightPadding() {
return rightPadding;
}

/**
* Get top padding, in characters
* @return returns the top padding
*/
public int getTopPadding() {
return topPadding;
}

/**
* Get bottom padding, in characters
* @return returns the bottom padding
*/
public int getBottomPadding() {
return bottomPadding;
}

/**
* Get text indent, in characters
* @return returns the text indent
Expand Down

0 comments on commit 8791f7b

Please sign in to comment.