LabelToken
Date: 2019-10-22

org.jmol.modelset

## Class LabelToken

- java.lang.Object
- - org.jmol.modelset.LabelToken

-     public class LabelToken
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private boolean` | `alignLeft`
    `private char` | `ch1`
    `private java.lang.Object` | `data`
    `private boolean` | `intAsFloat`
    `private java.lang.String` | `key`
    `private static int[]` | `labelTokenIds`
    `private static java.lang.String` | `labelTokenParams`
    `private int` | `precision`
    `private int` | `pt`
    `static java.lang.String` | `STANDARD_LABEL`
    `private java.lang.String` | `text`
    `private int` | `tok`
    `private static int[]` | `twoCharLabelTokenIds`
    `private static java.lang.String` | `twoCharLabelTokenParams`
    `private int` | `width`
    `private boolean` | `zeroPad`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LabelToken()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private static void` | `appendAtomTokenValue(Viewer vwr, Atom atom, LabelToken t, javajs.util.SB strLabel, int[] indices, javajs.util.P3 ptTemp)`
    `static LabelToken[]` | `compile(Viewer vwr, java.lang.String strFormat, char chAtom, java.util.Map<java.lang.String,java.lang.Object> htValues)` Compiles a set of tokens for each primitive element of a label.
    `private java.lang.String` | `format(float floatT, java.lang.String strT, javajs.util.T3 ptT)`
    `java.lang.String` | `formatLabel(Viewer vwr, Atom atom, java.lang.String strFormat, javajs.util.P3 ptTemp)`
    `static java.lang.String` | `formatLabelAtomArray(Viewer vwr, Atom atom, LabelToken[] tokens, char chAtom, int[] indices, javajs.util.P3 ptTemp)` returns a formatted string based on the precompiled label tokens
    `static java.lang.String` | `formatLabelBond(Viewer vwr, Bond bond, LabelToken[] tokens, java.util.Map<java.lang.String,java.lang.Object> values, int[] indices, javajs.util.P3 ptTemp)`
    `static java.lang.String` | `formatLabelMeasure(Viewer vwr, Measurement m, java.lang.String label, float value, java.lang.String units)`
    `static java.util.Map<java.lang.String,java.lang.Object>` | `getBondLabelValues()`
    `static java.lang.String` | `getLabel(LabelToken[] tokens)`
    `private static boolean` | `isLabelPropertyTok(int tok)`
    `private LabelToken` | `set(java.lang.String text, int pt)`
    `private static int` | `setToken(Viewer vwr, java.lang.String strFormat, LabelToken lt, int cch, int chAtom, java.util.Map<java.lang.String,java.lang.Object> htValues)` sets a label token based on a label string
    `static void` | `setValues(LabelToken[] tokens, java.util.Map<java.lang.String,java.lang.Object> values)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### text

          private java.lang.String text

    - #### key

          private java.lang.String key

    - #### data

          private java.lang.Object data

    - #### tok

          private int tok

    - #### pt

          private int pt

    - #### ch1

          private char ch1

    - #### width

          private int width

    - #### precision

          private int precision

    - #### alignLeft

          private boolean alignLeft

    - #### zeroPad

          private boolean zeroPad

    - #### intAsFloat

          private boolean intAsFloat

    - #### labelTokenParams

          private static final java.lang.String labelTokenParams

      See Also:
        Constant Field Values

    - #### labelTokenIds

          private static final int[] labelTokenIds

    - #### STANDARD_LABEL

          public static final java.lang.String STANDARD_LABEL

      See Also:
        Constant Field Values

    - #### twoCharLabelTokenParams

          private static final java.lang.String twoCharLabelTokenParams

      See Also:
        Constant Field Values

    - #### twoCharLabelTokenIds

          private static final int[] twoCharLabelTokenIds

  - ### Constructor Detail

    - #### LabelToken

          public LabelToken()

  - ### Method Detail

    - #### set

          private LabelToken set(java.lang.String text,
                                 int pt)

    - #### isLabelPropertyTok

          private static boolean isLabelPropertyTok(int tok)

    - #### compile

          public static LabelToken[] compile(Viewer vwr,
                                             java.lang.String strFormat,
                                             char chAtom,
                                             java.util.Map<java.lang.String,java.lang.Object> htValues)

      Compiles a set of tokens for each primitive element of a label. This is the efficient way to create a set of labels.
      Parameters:
        `vwr` -
        `strFormat` -
        `chAtom` -
        `htValues` -
      Returns:
        array of tokens

    - #### formatLabel

          public java.lang.String formatLabel(Viewer vwr,
                                              Atom atom,
                                              java.lang.String strFormat,
                                              javajs.util.P3 ptTemp)

    - #### formatLabelAtomArray

          public static java.lang.String formatLabelAtomArray(Viewer vwr,
                                                              Atom atom,
                                                              LabelToken[] tokens,
                                                              char chAtom,
                                                              int[] indices,
                                                              javajs.util.P3 ptTemp)

      returns a formatted string based on the precompiled label tokens
      Parameters:
        `vwr` -
        `atom` -
        `tokens` -
        `chAtom` -
        `indices` -
        `ptTemp` -
      Returns:
        formatted string

    - #### getBondLabelValues

          public static java.util.Map<java.lang.String,java.lang.Object> getBondLabelValues()

    - #### formatLabelBond

          public static java.lang.String formatLabelBond(Viewer vwr,
                                                         Bond bond,
                                                         LabelToken[] tokens,
                                                         java.util.Map<java.lang.String,java.lang.Object> values,
                                                         int[] indices,
                                                         javajs.util.P3 ptTemp)

    - #### formatLabelMeasure

          public static java.lang.String formatLabelMeasure(Viewer vwr,
                                                            Measurement m,
                                                            java.lang.String label,
                                                            float value,
                                                            java.lang.String units)

    - #### setValues

          public static void setValues(LabelToken[] tokens,
                                       java.util.Map<java.lang.String,java.lang.Object> values)

    - #### getLabel

          public static java.lang.String getLabel(LabelToken[] tokens)

    - #### setToken

          private static int setToken(Viewer vwr,
                                      java.lang.String strFormat,
                                      LabelToken lt,
                                      int cch,
                                      int chAtom,
                                      java.util.Map<java.lang.String,java.lang.Object> htValues)

      sets a label token based on a label string
      Parameters:
        `vwr` -
        `strFormat` -
        `lt` -
        `cch` -
        `chAtom` -
        `htValues` -
      Returns:
        new position

    - #### appendAtomTokenValue

          private static void appendAtomTokenValue(Viewer vwr,
                                                   Atom atom,
                                                   LabelToken t,
                                                   javajs.util.SB strLabel,
                                                   int[] indices,
                                                   javajs.util.P3 ptTemp)

    - #### format

          private java.lang.String format(float floatT,
                                          java.lang.String strT,
                                          javajs.util.T3 ptT)