application.ui.prefs.OptionNiceNames Maven / Gradle / Ivy
package application.ui.prefs;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.daisy.braille.utils.api.embosser.EmbosserProperties;
import org.daisy.braille.utils.api.embosser.PrintPage.Shape;
import org.daisy.braille.utils.api.paper.Length;
import org.daisy.braille.utils.api.paper.SheetPaperFormat;
import application.common.NiceName;
import application.l10n.Messages;
class OptionNiceNames {
private final Set printModeNN;
private final Map shapeNN;
private final Set orientationNN;
private final Set lengthNN;
private final Set zfoldingNN;
private final Set alignNN;
OptionNiceNames() {
printModeNN = new HashSet<>();
printModeNN.add(new NiceName(EmbosserProperties.PrintMode.REGULAR.toString(),
Messages.OPTION_VALUE_REGULAR_PRINT_MODE.localize()));
printModeNN.add(new NiceName(EmbosserProperties.PrintMode.MAGAZINE.toString(),
Messages.OPTION_VALUE_MAGAZINE_PRINT_MODE.localize()));
shapeNN = new HashMap<>();
addToShape(new NiceName(Shape.LANDSCAPE.toString(), Messages.OPTION_VALUE_LANDSCAPE.localize()));
addToShape(new NiceName(Shape.PORTRAIT.toString(), Messages.OPTION_VALUE_PORTRAIT.localize()));
addToShape(new NiceName(Shape.SQUARE.toString(), Messages.OPTION_VALUE_SQUARE.localize()));
orientationNN = new HashSet<>();
orientationNN.add(new NiceName(SheetPaperFormat.Orientation.DEFAULT.toString(), Messages.OPTION_VALUE_DEFAULT_ORIENTATION.localize()));
orientationNN.add(new NiceName(SheetPaperFormat.Orientation.REVERSED.toString(), Messages.OPTION_VALUE_REVERSED_ORIENTATION.localize()));
zfoldingNN = new HashSet<>();
zfoldingNN.add(new NiceName("OFF", "Off"));
zfoldingNN.add(new NiceName("ON", "On"));
lengthNN = new HashSet<>();
lengthNN.add(new NiceName(Length.UnitsOfLength.INCH.toString(), "inch"));
lengthNN.add(new NiceName(Length.UnitsOfLength.CENTIMETER.toString(), "cm"));
lengthNN.add(new NiceName(Length.UnitsOfLength.MILLIMETER.toString(), "mm"));
alignNN = new HashSet<>();
alignNN.add(new NiceName("center_inner", Messages.OPTION_VALUE_PAGE_ALIGNMENT_CENTER.localize()));
alignNN.add(new NiceName("inner", Messages.OPTION_VALUE_PAGE_ALIGNMENT_INNER.localize()));
alignNN.add(new NiceName("outer", Messages.OPTION_VALUE_PAGE_ALIGNMENT_OUTER.localize()));
alignNN.add(new NiceName("left", Messages.OPTION_VALUE_PAGE_ALIGNMENT_LEFT.localize()));
alignNN.add(new NiceName("right", Messages.OPTION_VALUE_PAGE_ALIGNMENT_RIGHT.localize()));
}
private void addToShape(NiceName nn) {
shapeNN.put(nn.getKey(), nn);
}
public Set getPrintModeNN() {
return printModeNN;
}
public Map getShapeNN() {
return shapeNN;
}
public Set getOrientationNN() {
return orientationNN;
}
public Set getLengthNN() {
return lengthNN;
}
public Set getZfoldingNN() {
return zfoldingNN;
}
public Set getAlignNN() {
return alignNN;
}
}