All Downloads are FREE. Search and download functionalities are using the official Maven repository.

application.preview.EmbossTask Maven / Gradle / Ivy

package application.preview;

import java.io.InputStream;
import java.net.URL;
import java.util.logging.Logger;

import org.daisy.braille.utils.api.embosser.Embosser;
import org.daisy.braille.utils.api.embosser.EmbosserWriter;
import org.daisy.braille.utils.pef.PEFConverterFacade;
import org.daisy.braille.utils.pef.PEFHandler;
import org.daisy.braille.utils.pef.PEFHandler.Alignment;
import org.daisy.braille.utils.pef.PrinterDevice;
import org.daisy.braille.utils.pef.Range;

import application.FeatureSwitch;
import javafx.concurrent.Task;
import shared.Configuration;

class EmbossTask extends Task {
	private static final Logger logger = Logger.getLogger(EmbossTask.class.getCanonicalName());
	private final URL url;
	private final String deviceName;
	private final String align;
	private final Range range;
	private final int copies;
	private final Configuration conf;
	
	EmbossTask(URL url, String deviceName, String align, Range range, int copies, Configuration conf) {
		this.url = url;
		this.deviceName = deviceName;
		this.align = align;
		this.range = range;
		this.copies = copies;
		this.conf = conf;
	}

	@Override
	protected Void call() throws Exception {
		//TODO: include range (requires release of pef-tools v2.3.0)
		logger.info("About to emboss " + (copies>1?copies + " copies ":"") + "on " + deviceName + " with alignment " + align);
		if (FeatureSwitch.EMBOSSING.isOn()) {
			for (int i=0; i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy