com.aspose.barcode.generation

Class Caption

  • java.lang.Object
    • com.aspose.barcode.generation.Caption


  • public class Caption
    extends java.lang.Object

    The text caption shown in the barcode image. There are two captions: CaptionBelow and CaptionAbove

    • Constructor Summary

      Constructors 
      Constructor and Description
      Caption(java.lang.String text)
      Initializes a new instance of the Caption class with specified text.
      Caption(java.lang.String text, boolean visible, int alignment, Unit space, java.awt.Color color, java.awt.Font font)
      Initializes a new instance of the Caption class.
      Caption(java.lang.String text, boolean visible, int alignment, Unit space, java.awt.Color color, FontUnit font)
      Initializes a new instance of the Caption class.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      int getAlignment()
      Gets or sets the text System.Drawing.StringAlignmentalignment of the caption.
      java.awt.Color getColor()
      Gets or sets the System.Drawing.Colorforecolor of the Captioncaption.
      FontUnit getFont()
      Gets or sets the System.Drawing.Fontfont of the Captioncaption.
      Unit getSpace()
      Gets or sets the space between the caption and the barcode, and the space between border and the caption in Unit value.
      java.lang.String getText()
      Gets or sets the content of the caption.
      boolean getVisible()
      Gets or sets a value indicates whether the Captioncaption is visible.
      void setAlignment(int value)
      Gets or sets the text System.Drawing.StringAlignmentalignment of the caption.
      void setColor(java.awt.Color value)
      Gets or sets the System.Drawing.Colorforecolor of the Captioncaption.
      void setText(java.lang.String value)
      Gets or sets the content of the caption.
      void setVisible(boolean value)
      Gets or sets a value indicates whether the Captioncaption is visible.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Caption

        public Caption(java.lang.String text)

        Initializes a new instance of the Caption class with specified text.

        Parameters:
        text - The text content of the caption object
      • Caption

        public Caption(java.lang.String text,
               boolean visible,
               int alignment,
               Unit space,
               java.awt.Color color,
               java.awt.Font font)

        Initializes a new instance of the Caption class.

        Parameters:
        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.
      • Caption

        public Caption(java.lang.String text,
               boolean visible,
               int alignment,
               Unit space,
               java.awt.Color color,
               FontUnit font)

        Initializes a new instance of the Caption class.

        Parameters:
        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 unit of the text in the caption.
    • Method Detail

      • getVisible

        public boolean getVisible()

        Gets or sets a value indicates whether the Captioncaption is visible.

      • setVisible

        public void setVisible(boolean value)

        Gets or sets a value indicates whether the Captioncaption is visible.

      • getColor

        public java.awt.Color getColor()

        Gets or sets the System.Drawing.Colorforecolor of the Captioncaption.

      • setColor

        public void setColor(java.awt.Color value)

        Gets or sets the System.Drawing.Colorforecolor of the Captioncaption.

      • getFont

        public FontUnit getFont()

        Gets or sets the System.Drawing.Fontfont of the Captioncaption.

      • getSpace

        public Unit getSpace()

        Gets or sets the space between the caption and the barcode, and the space between border and the caption in Unit value.

        <p>The <b>Space</b> parameter value is less than 0.</p>
      • getAlignment

        public int getAlignment()

        Gets or sets the text System.Drawing.StringAlignmentalignment 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

      • setAlignment

        public void setAlignment(int value)

        Gets or sets the text System.Drawing.StringAlignmentalignment 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

      • getText

        public java.lang.String getText()

        Gets or sets the content of the caption.

      • setText

        public void setText(java.lang.String value)

        Gets or sets the content of the caption.