Package net.codecrete.qrbill.generator
Class BillFormat
- java.lang.Object
-
- net.codecrete.qrbill.generator.BillFormat
-
- All Implemented Interfaces:
java.io.Serializable
public class BillFormat extends java.lang.Object implements java.io.SerializableFormatting properties for QR bill- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BillFormat()Creates a new instance with default valuesBillFormat(BillFormat format)Copy constructor: creates a copy of the specified format
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.lang.StringgetFontFamily()Gets the font family to be used for textGraphicsFormatgetGraphicsFormat()Gets the graphics format for the generated QR billLanguagegetLanguage()Gets the bill language.OutputSizegetOutputSize()Gets the output size for the generated QR billintgetResolution()Gets the resolution for pixel graphics formats.SeparatorTypegetSeparatorType()Gets the type of separator drawn above and between the payment part and the receiptinthashCode()voidsetFontFamily(java.lang.String fontFamily)Sets the font family to be used for textvoidsetGraphicsFormat(GraphicsFormat graphicsFormat)Sets the graphics format for the generated QR billvoidsetLanguage(Language language)Sets the bill languagevoidsetOutputSize(OutputSize outputSize)Sets the output size for the generated QR billvoidsetResolution(int resolution)Sets the resolution for pixel graphics formats.voidsetSeparatorType(SeparatorType separatorType)Sets the type of separator drawn above and between the payment part and the receiptjava.lang.StringtoString()
-
-
-
Constructor Detail
-
BillFormat
public BillFormat()
Creates a new instance with default values
-
BillFormat
public BillFormat(BillFormat format)
Copy constructor: creates a copy of the specified format- Parameters:
format- format to copy
-
-
Method Detail
-
getOutputSize
public OutputSize getOutputSize()
Gets the output size for the generated QR billDefaults to
OutputSize.QR_BILL_ONLY, i.e. the QR bill only (about 105 by 210 mm)- Returns:
- output size
-
setOutputSize
public void setOutputSize(OutputSize outputSize)
Sets the output size for the generated QR bill- Parameters:
outputSize- output size
-
getLanguage
public Language getLanguage()
Gets the bill language.Defaults to EN (English).
- Returns:
- the language
-
setLanguage
public void setLanguage(Language language)
Sets the bill language- Parameters:
language- the language
-
getSeparatorType
public SeparatorType getSeparatorType()
Gets the type of separator drawn above and between the payment part and the receiptDefaults to
SeparatorType.DASHED_LINE_WITH_SCISSORS- Returns:
- separator type
-
setSeparatorType
public void setSeparatorType(SeparatorType separatorType)
Sets the type of separator drawn above and between the payment part and the receipt- Parameters:
separatorType- separator type
-
getFontFamily
public java.lang.String getFontFamily()
Gets the font family to be used for textAccording to the implementation guidelines Arial, Frutiger, Helvetica and Liberation Sans are the only permitted fonts.
Two styles of the font are used: normal/regular and bold.
Defaults to "Helvetica".
- Returns:
- font family name
-
setFontFamily
public void setFontFamily(java.lang.String fontFamily)
Sets the font family to be used for textAccording to the implementation guidelines Arial, Frutiger, Helvetica and Liberation Sans are the only permitted fonts. However, any string is accepted as the font name might be more elaborate such as "Frutiger 55 Regular".
Two styles of the font are used: normal/regular and bold.
Defaults to "Helvetica".
- Parameters:
fontFamily- font family name
-
getGraphicsFormat
public GraphicsFormat getGraphicsFormat()
Gets the graphics format for the generated QR billDefaults to SVG.
- Returns:
- graphics format
-
setGraphicsFormat
public void setGraphicsFormat(GraphicsFormat graphicsFormat)
Sets the graphics format for the generated QR bill- Parameters:
graphicsFormat- graphics format
-
getResolution
public int getResolution()
Gets the resolution for pixel graphics formats.Defaults to 144 dpi.
- Returns:
- graphics resolution, in dpi
-
setResolution
public void setResolution(int resolution)
Sets the resolution for pixel graphics formats.- Parameters:
resolution- graphics resolution, in dpi
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-