Package org.daisy.braille.pef
Class PEFGenerator
java.lang.Object
org.daisy.braille.pef.PEFGenerator
Provides a way to generate PEF-files for testing purposes.
The files can be configured to contain a specified number of
volumes, pages, rows and columns. The duplex property can also
be set. The file is filed with random content in the specified
braille range (6- or 8-dot).
- Author:
- Joel HÃ¥kansson
-
Field Summary
Modifier and TypeFieldDescriptionstatic String
Key used in the settings map passed to the constructor.static String
Key used in the settings map passed to the constructor.static String
Key used in the settings map passed to the constructor.static String
Key used in the settings map passed to the constructor.static String
Key used in the settings map passed to the constructor.static String
Key used in the settings map passed to the constructor. -
Constructor Summary
ConstructorDescriptionCreates a new PEFGenerator with the default settings.PEFGenerator
(Map<String, String> p) Creates a new PEF generator with the supplied optional settings. -
Method Summary
Modifier and TypeMethodDescriptionvoid
generateTestBook
(File output) Generates a new PEF-file and writes it to the supplied pathvoid
generateTestPages
(File output) Generates a PEF-file with a few test pages to check the embosser setup (the arguments KEY_VOLUMES and KEY_PPV are ignored)static String
getDefaultValue
(String key) Gets the default value for a specified key.Gets a list of all keys which has default values
-
Field Details
-
KEY_VOLUMES
Key used in the settings map passed to the constructor. Its value defines the number of volumes in the generated file -
KEY_PPV
Key used in the settings map passed to the constructor. Its value defines the number of pages per volume in the generated file -
KEY_EIGHT_DOT
Key used in the settings map passed to the constructor. Its value defines if eight dot should be used (true/false) -
KEY_ROWS
Key used in the settings map passed to the constructor. Its value defines the maximum number of rows on a page in the generated file -
KEY_COLS
Key used in the settings map passed to the constructor. Its value defines the maximum number of columns on a page in the generated file -
KEY_DUPLEX
Key used in the settings map passed to the constructor. Its value defines the value of the duplex property (true/false). Note that the value of this property does not affect the number of pages generated in each volume.
-
-
Constructor Details
-
PEFGenerator
public PEFGenerator()Creates a new PEFGenerator with the default settings. -
PEFGenerator
Creates a new PEF generator with the supplied optional settings. See the enums of this class for a list of possible keys and their values.- Parameters:
p
- a map containing optional settings
-
-
Method Details
-
getOptionalArgumentKeys
Gets a list of all keys which has default values- Returns:
- returns a list of keys
-
getDefaultValue
Gets the default value for a specified key.- Parameters:
key
- The key to get the default value for- Returns:
- returns the value for the key, or null if the key is not found
-
generateTestBook
Generates a new PEF-file and writes it to the supplied path- Parameters:
output
- the output file- Throws:
FileNotFoundException
- If the given file object does not denote an existing, writable regular file and a new regular file of that name cannot be created, or if some other error occurs while opening or creating the file
-
generateTestPages
Generates a PEF-file with a few test pages to check the embosser setup (the arguments KEY_VOLUMES and KEY_PPV are ignored)- Parameters:
output
- the output file- Throws:
FileNotFoundException
- If the given file object does not denote an existing, writable regular file and a new regular file of that name cannot be created, or if some other error occurs while opening or creating the fileException
-