Labels
Date: 2019-10-22

org.jmol.shape

## Class Labels

- java.lang.Object
- - org.jmol.shape.Shape
  - - org.jmol.shape.AtomShape
    - - org.jmol.shape.Labels

-     public class Labels
      extends AtomShape

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private java.util.Map<java.lang.Integer,Text>` | `atomLabels`
    `short[]` | `bgcolixes`
    `javajs.util.BS` | `bsBgColixSet`
    `javajs.util.BS` | `bsFontSet`
    `int` | `defaultAlignment`
    `short` | `defaultBgcolix`
    `short` | `defaultColix`
    `byte` | `defaultFontId`
    `int` | `defaultOffset`
    `byte` | `defaultPaletteID`
    `int` | `defaultPointer`
    `private boolean` | `defaultsOnlyForNone`
    `int` | `defaultZPos`
    `byte[]` | `fids`
    `java.lang.String[]` | `formats`
    `private boolean` | `isScaled`
    `private java.util.Map<java.lang.Integer,float[]>` | `labelBoxes`
    `private int` | `lastPicked`
    `private static LabelToken[][]` | `nullToken`
    `int[]` | `offsets`
    `private int` | `pickedAtom`
    `private int` | `pickedOffset`
    `private int` | `pickedX`
    `private int` | `pickedY`
    `private javajs.util.P3` | `ptTemp`
    `private float` | `scalePixelsPerMicron`
    `private boolean` | `setDefaults`
    `java.lang.String[]` | `strings`
    `byte` | `zeroFontId`

    - ### Fields inherited from class org.jmol.shape.AtomShape

      `ac, atoms, bsSizeDefault, colixes, isActive, mad, mads, monomerCount, paletteIDs`

    - ### Fields inherited from class org.jmol.shape.Shape

      `bsColixSet, bsSizeSet, isBioShape, ms, myType, RADIUS_MAX, shapeID, translucentAllowed, translucentLevel, vf, vwr`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Labels()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private boolean` | `addString(Atom atom, int i, java.lang.String label, java.lang.String strLabel)`
    `private int` | `checkBgColixLength(short colix, int n)`
    `java.util.Map<java.lang.String,java.lang.Object>` | `checkObjectClicked(int x, int y, int modifiers, javajs.util.BS bsVisible, boolean drawPicking)`
    `boolean` | `checkObjectDragged(int prevX, int prevY, int x, int y, int dragAction, javajs.util.BS bsVisible)`
    `private int` | `checkStringLength(int n)`
    `private int` | `findNearestLabel(int x, int y)`
    `float[]` | `getBox(int i)`
    `short` | `getColix2(int i, Atom atom, boolean isBg)`
    `Text` | `getLabel(int i)`
    `java.lang.Object` | `getProperty(java.lang.String property, int index)`
    `void` | `initShape()`
    `private boolean` | `isPickingMode()`
    `private void` | `move2D(int pickedAtom, int x, int y)`
    `void` | `putBox(int i, float[] boxXY)`
    `void` | `putLabel(int i, Text text)`
    `void` | `setAtomClickability()`
    `private void` | `setBgcolix(int i, short bgcolix)`
    `private void` | `setFont(int i, byte fid)`
    `private void` | `setHorizAlignment(int i, int hAlign)`
    `private void` | `setLabel(LabelToken[][] temp, java.lang.String strLabel, int i, boolean doAll)`
    `private void` | `setLabelColix(int i, short colix, byte pid)`
    `private void` | `setOffsets(int i, int offset)`
    `private void` | `setPointer(int i, int pointer)`
    `void` | `setProperty(java.lang.String propertyName, java.lang.Object value, javajs.util.BS bsSelected)`
    `private void` | `setPymolLabel(int i, Text t, java.lang.String format)`
    `private void` | `setPymolLabels(java.util.Map<java.lang.Integer,Text> labels, javajs.util.BS bsSelected)`
    `private void` | `setPymolOffset(int i, float[] value)` Sets offset using PyMOL standard array; only operates in cases where label is already defined
    `private void` | `setScaling()`
    `private void` | `setZPos(int i, int flag, boolean TF)`

    - ### Methods inherited from class org.jmol.shape.AtomShape

      `checkColixLength, getInfoAsString, getShapeState, getSize, initModelSet, setColixAndPalette, setPropAS, setSize, setSize2, setSizeRD, setSizeRD2`

    - ### Methods inherited from class org.jmol.shape.Shape

      `appendCmd, checkBoundsMinMax, checkObjectHovered, coordinateInRange, encodeColor, findNearestAtomIndex, getColix, getColixA, getColixB, getColixI, getColorCommand, getColorCommandUnk, getFontCommand, getIndexFromName, getPropertyData, getPropShape, getShapeDetail, getSizeG, getTranslucentLabel, initializeShape, replaceGroup, setModelSet, setModelVisibilityFlags, setPropS, setShapeSizeRD, wasClicked`

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

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

- - ### Field Detail

    - #### strings

          public java.lang.String[] strings

    - #### formats

          public java.lang.String[] formats

    - #### bgcolixes

          public short[] bgcolixes

    - #### fids

          public byte[] fids

    - #### offsets

          public int[] offsets

    - #### atomLabels

          private java.util.Map<java.lang.Integer,Text> atomLabels

    - #### labelBoxes

          private java.util.Map<java.lang.Integer,float[]> labelBoxes

    - #### bsFontSet

          public javajs.util.BS bsFontSet

    - #### bsBgColixSet

          public javajs.util.BS bsBgColixSet

    - #### defaultOffset

          public int defaultOffset

    - #### defaultAlignment

          public int defaultAlignment

    - #### defaultZPos

          public int defaultZPos

    - #### defaultFontId

          public byte defaultFontId

    - #### defaultColix

          public short defaultColix

    - #### defaultBgcolix

          public short defaultBgcolix

    - #### defaultPaletteID

          public byte defaultPaletteID

    - #### defaultPointer

          public int defaultPointer

    - #### zeroFontId

          public byte zeroFontId

    - #### defaultsOnlyForNone

          private boolean defaultsOnlyForNone

    - #### setDefaults

          private boolean setDefaults

    - #### nullToken

          private static final LabelToken[][] nullToken

    - #### isScaled

          private boolean isScaled

    - #### scalePixelsPerMicron

          private float scalePixelsPerMicron

    - #### ptTemp

          private javajs.util.P3 ptTemp

    - #### pickedAtom

          private int pickedAtom

    - #### lastPicked

          private int lastPicked

    - #### pickedOffset

          private int pickedOffset

    - #### pickedX

          private int pickedX

    - #### pickedY

          private int pickedY

  - ### Constructor Detail

    - #### Labels

          public Labels()

  - ### Method Detail

    - #### initShape

          public void initShape()

      Overrides:
        `initShape` in class `AtomShape`

    - #### setProperty

          public void setProperty(java.lang.String propertyName,
                                  java.lang.Object value,
                                  javajs.util.BS bsSelected)

      Specified by:
        `setProperty` in class `Shape`

    - #### isPickingMode

          private boolean isPickingMode()

    - #### checkStringLength

          private int checkStringLength(int n)

    - #### checkBgColixLength

          private int checkBgColixLength(short colix,
                                         int n)

    - #### setPymolLabels

          private void setPymolLabels(java.util.Map<java.lang.Integer,Text> labels,
                                      javajs.util.BS bsSelected)

    - #### setPymolOffset

          private void setPymolOffset(int i,
                                      float[] value)

      Sets offset using PyMOL standard array; only operates in cases where label is already defined
      Parameters:
        `i` -
        `value` -

    - #### setScaling

          private void setScaling()

    - #### setPymolLabel

          private void setPymolLabel(int i,
                                     Text t,
                                     java.lang.String format)

    - #### setLabel

          private void setLabel(LabelToken[][] temp,
                                java.lang.String strLabel,
                                int i,
                                boolean doAll)

    - #### addString

          private boolean addString(Atom atom,
                                    int i,
                                    java.lang.String label,
                                    java.lang.String strLabel)

    - #### getProperty

          public java.lang.Object getProperty(java.lang.String property,
                                              int index)

      Overrides:
        `getProperty` in class `Shape`
      Returns:
        true if serviced

    - #### putLabel

          public void putLabel(int i,
                               Text text)

    - #### getLabel

          public Text getLabel(int i)

    - #### putBox

          public void putBox(int i,
                             float[] boxXY)

    - #### getBox

          public float[] getBox(int i)

    - #### setLabelColix

          private void setLabelColix(int i,
                                     short colix,
                                     byte pid)

    - #### setBgcolix

          private void setBgcolix(int i,
                                  short bgcolix)

    - #### setOffsets

          private void setOffsets(int i,
                                  int offset)

    - #### setHorizAlignment

          private void setHorizAlignment(int i,
                                         int hAlign)

    - #### setPointer

          private void setPointer(int i,
                                  int pointer)

    - #### setZPos

          private void setZPos(int i,
                               int flag,
                               boolean TF)

    - #### setFont

          private void setFont(int i,
                               byte fid)

    - #### setAtomClickability

          public void setAtomClickability()

      Overrides:
        `setAtomClickability` in class `AtomShape`

    - #### checkObjectClicked

          public java.util.Map<java.lang.String,java.lang.Object> checkObjectClicked(int x,
                                                                                     int y,
                                                                                     int modifiers,
                                                                                     javajs.util.BS bsVisible,
                                                                                     boolean drawPicking)

      Overrides:
        `checkObjectClicked` in class `Shape`
        `drawPicking` - TODO
      Returns:
        Hashtable containing information about pt clicked

    - #### checkObjectDragged

          public boolean checkObjectDragged(int prevX,
                                            int prevY,
                                            int x,
                                            int y,
                                            int dragAction,
                                            javajs.util.BS bsVisible)

      Overrides:
        `checkObjectDragged` in class `Shape`
      Returns:
        T/F

    - #### findNearestLabel

          private int findNearestLabel(int x,
                                       int y)

    - #### move2D

          private void move2D(int pickedAtom,
                              int x,
                              int y)

    - #### getColix2

          public short getColix2(int i,
                                 Atom atom,
                                 boolean isBg)