|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sap.ip.me.api.pios.configuration.ConfigurationManager
com.sap.ip.me.api.pios.printer.FontConfigurationManager
The FontConfigurationManager is used to manage fonts. A font configuration represents a logical font that maps to physical printer font. Since most mobile printers provide a set of pre-installed fonts, the default font configuration contains entries that match the printer’s manufacturer fonts. To map additional fonts, the font must be installed or loaded to the printer’s memory. All changes to the font configuration are handled through this class. The printer connection must be reopen for any changes to take effect.
Example: Add a new font configuration
Connector connector = Connector.getInstance();
DriverInfo[] printers = connector.listDrivers(ConnectionType.PRINTER);
PrinterParameters parameters = new PrinterParameters(printers[0]);
parameters.setPrinterMode(PrinterParameters.GRAPHIC_MODE);
GraphicPrinter printer = (GraphicPrinter)connector.open(parameters);
FontConfigurationManager manager = printer.getFontConfigurationManager();
Configuration fontConfiguration = manager.addFontConfiguration("NewFont");
String[] fontParameters = fontConfiguration.getParameters();
for (int i=0; i<fontParameters.length; i++) {
fontConfiguration.setParameterValue(fontParameters[i], "NEW VALUE");
}
manager.save();
printer.close();
com.sap.ip.me.api.pios.configuration
Constructor Summary | |
protected |
FontConfigurationManager(ConfigurationManager confManager)
Creates a new FontConfigurationManager using the specified configuration manager. |
Method Summary | |
Configuration |
addFontConfiguration(java.lang.String fontName)
Adds a new empty font configuration to this printer connection. |
void |
deleteFontConfiguration(java.lang.String fontName)
Deletes a font configuration for this printer connection. |
Configuration |
getFontConfiguration(java.lang.String fontName)
Returns the font Configuration object for the specified font configuration name. |
java.lang.String[] |
listFontNames()
Returns available font names for this printer connection. |
void |
save()
Stores all font configuration changes. |
Methods inherited from class com.sap.ip.me.api.pios.configuration.ConfigurationManager |
add, delete, get, getConfig, getHeaderName, getParamaterValue, getParameters, getPossibleValues, getTypes, list, list, setParameterValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected FontConfigurationManager(ConfigurationManager confManager) throws ConfigurationException
confManager
- the configuration manager
ConfigurationException
- thrown if there is an error while
loading the configuration or metadata filesMethod Detail |
public Configuration addFontConfiguration(java.lang.String fontName) throws ConfigurationException
fontName
- the font configuration name
ConfigurationException
- thrown if unable to create new font configuration.public void deleteFontConfiguration(java.lang.String fontName) throws ConfigurationException
fontName
- the font configuration name
ConfigurationException
- thrown if unable to delete the font configurationpublic java.lang.String[] listFontNames() throws ConfigurationException
ConfigurationException
- thrown if an error occurs while
obtaining the font listpublic Configuration getFontConfiguration(java.lang.String fontName) throws ConfigurationException
fontName
- the font configuration name
ConfigurationException
- thrown if unable to get the font configuration
for this connectionpublic void save() throws ConfigurationException
save
in class ConfigurationManager
ConfigurationException
- thrown if an error occurs while saving the
font configuration file
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |