public class Caption
extends java.lang.Object
The text caption shown in the barcode image. There are two captions: CaptionBelow and CaptionAbove
Constructor and Description |
---|
Caption()
Initializes a new instance of the
Caption class with default vaule. |
Caption(java.lang.String text)
Initializes a new instance of the
Caption class with specified text. |
Caption(java.lang.String text,
boolean visible,
StringAlignment alignment,
float space,
java.awt.Color color,
java.awt.Font font)
Initializes a new instance of the
Caption class. |
Modifier and Type | Method and Description |
---|---|
Caption |
copy()
Get a new copy of the caption instance.
|
java.awt.Font |
getFont()
Gets the
System.Drawing.Fontfont of the Captioncaption . |
java.awt.Color |
getForeColor()
Gets the
System.Drawing.Colorforecolor of the Captioncaption . |
float |
getSpace()
Gets the space between the caption and the barcode,
and the space between border and the caption
|
java.lang.String |
getText()
Gets the content of the caption.
|
StringAlignment |
getTextAlign()
Gets the text alignment of the caption.
|
boolean |
getVisible()
Gets a value indicates whether the
Captioncaption is visible. |
void |
setFont(java.awt.Font value)
Sets the
System.Drawing.Fontfont of the Captioncaption . |
void |
setForeColor(java.awt.Color value)
Sets the
System.Drawing.Colorforecolor of the Captioncaption . |
void |
setSpace(float value)
Sets the space between the caption and the barcode,
and the space between border and the caption
|
void |
setText(java.lang.String value)
Sets the content of the caption.
|
void |
setTextAlign(StringAlignment value)
Sets the text alignment of the caption.
|
void |
setVisible(boolean value)
Sets a value indicates whether the
Captioncaption is visible. |
public Caption()
Initializes a new instance of the Caption
class with default vaule.
public Caption(java.lang.String text)
Initializes a new instance of the Caption
class with specified text.
text
- The text content of the caption objectpublic Caption(java.lang.String text, boolean visible, StringAlignment alignment, float space, java.awt.Color color, java.awt.Font font)
Initializes a new instance of the Caption
class.
text
- The context of the caption.visible
- Indicates whether the caption is visible.alignment
- The alignment of the text in the caption.space
- The amount of space in the caption.color
- The forecolor of the text in the caption.font
- The font of the text in the caption.public Caption copy()
Get a new copy of the caption instance.
public boolean getVisible()
Gets a value indicates whether the Captioncaption
is visible.
public void setVisible(boolean value)
Sets a value indicates whether the Captioncaption
is visible.
public java.awt.Color getForeColor()
Gets the System.Drawing.Colorforecolor
of the Captioncaption
.
public void setForeColor(java.awt.Color value)
Sets the System.Drawing.Colorforecolor
of the Captioncaption
.
public java.awt.Font getFont()
Gets the System.Drawing.Fontfont
of the Captioncaption
.
public void setFont(java.awt.Font value)
Sets the System.Drawing.Fontfont
of the Captioncaption
.
public float getSpace()
Gets the space between the caption and the barcode, and the space between border and the caption
java.lang.IllegalArgumentException
- <p>The <b>Space</b> parameter value is less than 0.</p>
<b>space</b>
for the caption is indicated by the System.Drawing.GraphicsUnitGraphicsUnit
.
public void setSpace(float value)
Sets the space between the caption and the barcode, and the space between border and the caption
java.lang.IllegalArgumentException
- <p>The <b>Space</b> parameter value is less than 0.</p>
<b>space</b>
for the caption is indicated by the System.Drawing.GraphicsUnitGraphicsUnit
.
public StringAlignment getTextAlign()
Gets the text alignment of the caption. e.g. when the text is writing from left to right, StringAlignment.Near means the Caption will be aligned to the left
public void setTextAlign(StringAlignment value)
Sets the text alignment of the caption. e.g. when the text is writing from left to right, StringAlignment.Near means the Caption will be aligned to the left
public java.lang.String getText()
Gets the content of the caption.
public void setText(java.lang.String value)
Sets the content of the caption.