com.aspose.barcode

Class Caption

  • java.lang.Object
    • com.aspose.barcode.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()
      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, int alignment, float space, java.awt.Color color, java.awt.Font font)
      Deprecated. 
      Caption(java.lang.String text, boolean visible, com.aspose.barcode.StringAlignment alignment, float space, java.awt.Color color, java.awt.Font font)
      Initializes a new instance of the Caption class.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      Caption copy()
      Get a new copy of the caption instance.
      void dispose()
      Dispose the Caption instance
      java.awt.Font getFont()
      Gets the java.awt.Font of the Captioncaption.
      java.awt.Color getForeColor()
      Gets the java.awt.Color 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.
      com.aspose.barcode.StringAlignment getTextAlign()
      Gets the text of the caption.
      java.lang.String getTextAlignName()
      Deprecated. 
      boolean getVisible()
      Gets a value indicates whether the caption is visible.
      void setFont(java.awt.Font value)
      Sets the java.awt.Font of the Captioncaption.
      void setForeColor(java.awt.Color value)
      Sets the java.awt.Color 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(int value)
      Deprecated. 
      void setTextAlign(com.aspose.barcode.StringAlignment value)
      Sets the text of the caption.
      void setVisible(boolean value)
      Sets a value indicates whether the caption 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()

        Initializes a new instance of the Caption class with default vaule.

      • 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,
               com.aspose.barcode.StringAlignment alignment,
               float 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

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

        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.
    • Method Detail

      • copy

        public Caption copy()

        Get a new copy of the caption instance.

        Returns:
        The new copy of the instance.
      • getVisible

        public boolean getVisible()

        Gets a value indicates whether the caption is visible.

      • setVisible

        public void setVisible(boolean value)

        Sets a value indicates whether the caption is visible.

      • getForeColor

        public java.awt.Color getForeColor()

        Gets the java.awt.Color of the Captioncaption.

      • setForeColor

        public void setForeColor(java.awt.Color value)

        Sets the java.awt.Color of the Captioncaption.

      • getFont

        public java.awt.Font getFont()

        Gets the java.awt.Font of the Captioncaption.

      • setFont

        public void setFont(java.awt.Font value)

        Sets the java.awt.Font of the Captioncaption.

      • getSpace

        public float getSpace()

        Gets the space between the caption and the barcode, and the space between border and the caption

        Throws:
        java.lang.IllegalArgumentException -

        The Space parameter value is less than 0.


        The measure unit of the space for the caption is indicated by the System.Drawing.GraphicsUnitGraphicsUnit.

      • setSpace

        public void setSpace(float value)

        Sets the space between the caption and the barcode, and the space between border and the caption

        Throws:
        java.lang.IllegalArgumentException -

        The Space parameter value is less than 0.


        The measure unit of the space for the caption is indicated by the System.Drawing.GraphicsUnitGraphicsUnit.

      • getTextAlign

        public com.aspose.barcode.StringAlignment getTextAlign()

        Gets the text 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

      • getTextAlignName

        @Deprecated
        public java.lang.String getTextAlignName()
        Deprecated. 

        Gets StringAlignment name of TextAlign

        Returns:
        name of TextAlign property
      • setTextAlign

        @Deprecated
        public void setTextAlign(int value)
        Deprecated. 

        Sets the text 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

      • setTextAlign

        public void setTextAlign(com.aspose.barcode.StringAlignment value)

        Sets the text 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 the content of the caption.

      • setText

        public void setText(java.lang.String value)

        Sets the content of the caption.

      • dispose

        public void dispose()

        Dispose the Caption instance