Skip to content

Commit

Permalink
WIP: Provide methods for required operations
Browse files Browse the repository at this point in the history
This is an implementation of an unreleased change to the dotify.api
See brailleapps/dotify.api#21
  • Loading branch information
Joel Håkansson authored and joeha480 committed Jun 13, 2019
1 parent 160d30a commit d737c6f
Showing 1 changed file with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.daisy.braille.utils.impl.tools.embosser;

import java.util.HashMap;
import java.util.Objects;

import org.daisy.dotify.api.embosser.Embosser;
import org.daisy.dotify.api.embosser.EmbosserFactoryProperties;
Expand Down Expand Up @@ -81,10 +82,19 @@ public String getModel() {
* Gets the page format
* @return returns the page format
*/
protected PageFormat getPageFormat() {
@Override
public PageFormat getPageFormat() {
return pageFormat;
}

@Override
public void setPageFormat(PageFormat pageFormat) {
if (!supportsPageFormat(pageFormat)) {
throw new IllegalArgumentException("Page format is not supported by the embosser: " + pageFormat);
}
this.pageFormat = pageFormat;
}

/**
* Gets cell width (2 x the horizontal dot-to-dot distance), in millimeters.
* @return returns cell width, in millimeters
Expand Down Expand Up @@ -188,6 +198,17 @@ public boolean supportsTable(Table table) {
return getTableFilter().accept(table);
}

@Override
public Table getTable() {
return setTable;
}

@Override
public void setTable(Table table) {
//TODO: the implementation accepts tables that are not supported
this.setTable = Objects.requireNonNull(table);
}

/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
Expand Down

0 comments on commit d737c6f

Please sign in to comment.