Class PbMiscTextAttr

  • All Implemented Interfaces:

    public class PbMiscTextAttr
    extends PbBase
    implements java.lang.Cloneable
    Class to define a numeric display format. This class is used to define miscellaneous text attributes.
    • Constructor Detail

      • PbMiscTextAttr

        public PbMiscTextAttr​(PbMiscTextAttr miscTextAttr)
      • PbMiscTextAttr

        public PbMiscTextAttr()
    • Method Detail

      • clone

        public java.lang.Object clone()
      • isPredefinedProfileEnabled

        public boolean isPredefinedProfileEnabled()
        Enables/Disables the use of a predefined profile for 3D text if they are activated (cf enableProfile()). If this option is disabled, the current profile in the state is used (cf SoLinearProfile,...) This option is enabled by default.
      • setFontName

        public void setFontName​(java.lang.String name)
        Sets the font name for texts. The default font name is "defaultFont".
      • enablePredefinedProfile

        public void enablePredefinedProfile​(boolean flag)
      • getFontName

        public java.lang.String getFontName()
        Gets the font name for texts.
      • enableProfile

        public void enableProfile​(boolean flag)
      • isProfileEnabled

        public boolean isProfileEnabled()
        Enables/Disables the appearance of a profile for 3D Text. Only SoText3 text takes into account of this option (cf PoBase.setTextType()) to to select the type of text used). This option is disabled by default.
      • setLineLength

        public void setLineLength​(byte endLineChar,
                                  int lineLength)
        Sets line length attributes. lineLength is the max number of characters per line. If several endLineChar appear before the lineLength character, only the last endLineChar is taken into account. if lineLength = LINE_LENGTH_MAX, the lines length is not limited, and if lineLength = LINE_LENGTH_MIN, the lines are limited to one word. By default endLineChar is ' ' and lineLength is LINE_LENGTH_MAX.

        Example of use with the string "United States of America" (24 characters) :

        • with endLineChar = ' ' and lineLength = 15, the string is cut into two lines: "United States" and "of America".
        • with endLineChar = ' ' and lineLength = 18, the string is cut into two lines: "United States of" and "America".

        Be careful, words (consecutive characters delimited by endLineChar characters) are never truncated, so lines could exceed lineLength characters if the first word of the line contains more than lineLength characters.