public final class CodeTextStyle
extends java.lang.Object
Contains specific configuration properties for codetext of barcode.
This sample shows how to create and save a BarCode image.BarCodeGenerator generator = new BarCodeGenerator(EncodeTypes.CODE_128); generator.getCodeTextStyle().setLocation(CodeLocation.Above); generator.getCodeTextStyle().setColor(Color.GREEN); generator.getCodeTextStyle().setAlignment(StringAlignment.FAR); generator.getCodeTextStyle().getFont().setStyle(FontStyle.Italic); generator.getCodeTextStyle().getFont().getSize().setPoint(18); generator.getCodeTextStyle().getSpace().setMillimeters(5); generator.save("test.png");
Constructor and Description |
---|
CodeTextStyle(CodeLocation codeLocation,
StringAlignment alignment,
Unit space,
int color,
FontUnit font) |
CodeTextStyle(int codeLocation,
int alignment,
Unit space,
int color,
FontUnit font)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
StringAlignment |
getAlignment()
Gets or sets the alignment of the code text.
|
int |
getColor()
Specify the displaying CodeText's Color.
|
FontUnit |
getFont()
Specify the displaying CodeText's font.
|
CodeLocation |
getLocation()
Specify the displaying CodeText Location, set to CodeLocation.None to hide CodeText.
|
Unit |
getSpace()
Space between the CodeText and the BarCode in
Unit value. |
void |
setAlignment(StringAlignment value)
Gets or sets the alignment of the code text.
|
void |
setColor(int value)
Specify the displaying CodeText's Color.
|
void |
setLocation(CodeLocation value)
Specify the displaying CodeText Location, set to CodeLocation.None to hide CodeText.
|
void |
setLocation(int value)
Deprecated.
|
public CodeTextStyle(CodeLocation codeLocation, StringAlignment alignment, Unit space, int color, FontUnit font)
public CodeLocation getLocation()
Specify the displaying CodeText Location, set to CodeLocation.None to hide CodeText. CodeLocation will be ignored if SymbologyType is UPCE, UPCA, ISBN, EAN8 or EAN13.
public void setLocation(CodeLocation value)
Specify the displaying CodeText Location, set to CodeLocation.None to hide CodeText. CodeLocation will be ignored if SymbologyType is UPCE, UPCA, ISBN, EAN8 or EAN13.
@Deprecated public void setLocation(int value)
Specify the displaying CodeText Location, set to CodeLocation.None to hide CodeText. CodeLocation will be ignored if SymbologyType is UPCE, UPCA, ISBN, EAN8 or EAN13.
public StringAlignment getAlignment()
Gets or sets the alignment of the code text.
public void setAlignment(StringAlignment value)
Gets or sets the alignment of the code text.
public int getColor()
Specify the displaying CodeText's Color.
public void setColor(int value)
Specify the displaying CodeText's Color.
public Unit getSpace()
Space between the CodeText and the BarCode in Unit
value.
The Space parameter value is less than 0
public FontUnit getFont()
Specify the displaying CodeText's font.