Text
Date: 2019-10-22

org.jmol.modelset

## Class Text

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

-     public class Text
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `boolean` | `adjustForWindow`
    `int` | `align`
    `private int` | `ascent`
    `int` | `atomX`
    `int` | `atomY`
    `int` | `atomZ`
    `short` | `bgcolix`
    `float` | `boxHeight`
    `float` | `boxWidth`
    `float` | `boxX`
    `float[]` | `boxXY`
    `float` | `boxY`
    `int` | `boxYoff2`
    `short` | `colix`
    `int` | `descent`
    `boolean` | `doFormatText`
    `private byte` | `fid`
    `Font` | `font`
    `float` | `fontScale`
    `boolean` | `hidden`
    `java.lang.Object` | `image`
    `float` | `imageScale`
    `boolean` | `isEcho`
    `boolean` | `isMeasure`
    `private int` | `lineHeight`
    `java.lang.String[]` | `lines`
    `int` | `modelIndex`
    `int` | `movableX`
    `int` | `movableXPercent`
    `int` | `movableY`
    `int` | `movableYPercent`
    `int` | `movableZ`
    `int` | `movableZPercent`
    `protected int` | `offsetX`
    `protected int` | `offsetY`
    `int` | `pointer`
    `javajs.util.P3` | `pointerPt`
    `float[]` | `pymolOffset`
    `float` | `scalePixelsPerMicron`
    `java.lang.String` | `script`
    `java.lang.String` | `target`
    `java.lang.String` | `text`
    `private int` | `textHeight`
    `java.lang.String` | `textUnformatted`
    `private int` | `textWidth`
    `int` | `valign`
    `boolean` | `visible`
    `private Viewer` | `vwr`
    `private int[]` | `widths`
    `protected int` | `windowHeight`
    `protected int` | `windowWidth`
    `private float` | `xAdj`
    `javajs.util.P3` | `xyz`
    `private float` | `y0`
    `private float` | `yAdj`
    `int` | `z`
    `int` | `zSlab`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Text()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `appendFontCmd(javajs.util.SB s)`
    `boolean` | `checkObjectClicked(boolean isAntialiased, int x, int y, javajs.util.BS bsVisible)`
    `private void` | `getFontMetrics()`
    `void` | `getPymolScreenOffset(javajs.util.P3 atomPt, javajs.util.P3i screen, int zSlab, javajs.util.P3 pTemp, float sppm)` PyMOL will use 1 here for pymolOffset[0] for relative, 0 or absolute.
    `private float` | `getPymolXYOffset(float off, int width, float ppa)`
    `static Text` | `newEcho(Viewer vwr, Font font, java.lang.String target, short colix, int valign, int align, float scalePixelsPerMicron)`
    `static Text` | `newLabel(Viewer vwr, Font font, java.lang.String text, short colix, short bgcolix, int align, float scalePixelsPerMicron)`
    `static Text` | `newMeasure(Viewer vwr, Font font, short colix)`
    `private void` | `recalc()`
    `private void` | `set(Font font, short colix, int align, float scalePixelsPerMicron)`
    `boolean` | `setAlignment(int align)`
    `boolean` | `setAlignmentLCR(java.lang.String align)`
    `void` | `setBoxOffsetsInWindow(float margin, float vMargin, float vTop)`
    `static void` | `setBoxXY(float boxWidth, float boxHeight, float xOffset, float yOffset, float[] boxXY, boolean isAbsolute)`
    `void` | `setFont(Font f3d, boolean doAll)`
    `void` | `setFontFromFid(byte fid)`
    `void` | `setFontScale(float scale)`
    `void` | `setImage(java.lang.Object image)`
    `void` | `setMovableX(int x)`
    `void` | `setMovableXPercent(int x)`
    `void` | `setMovableY(int y)`
    `void` | `setMovableYPercent(int y)`
    `void` | `setMovableZPercent(int z)`
    `void` | `setOffset(int offset)`
    `private void` | `setPos(float scale)`
    `void` | `setPosition(float scalePixelsPerMicron, float imageFontScaling, boolean isAbsolute, float[] boxXY)`
    `void` | `setScale(float scale)`
    `void` | `setScalePixelsPerMicron(float scalePixelsPerMicron)`
    `void` | `setScript(java.lang.String script)`
    `void` | `setText(java.lang.String text)`
    `void` | `setTranslucent(float level, boolean isBackground)`
    `void` | `setWindow(int width, int height, float scalePixelsPerMicron)`
    `void` | `setXYA(float[] xy, int i)`
    `void` | `setXYZ(javajs.util.P3 xyz, boolean doAdjust)`
    `void` | `setXYZs(int x, int y, int z, int zSlab)`
    `void` | `setZs(int z, int zSlab)`
    `private int` | `stringWidth(java.lang.String str)`

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

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

- - ### Field Detail

    - #### vwr

          private Viewer vwr

    - #### doFormatText

          public boolean doFormatText

    - #### font

          public Font font

    - #### fid

          private byte fid

    - #### ascent

          private int ascent

    - #### descent

          public int descent

    - #### lineHeight

          private int lineHeight

    - #### offsetX

          protected int offsetX

    - #### offsetY

          protected int offsetY

    - #### boxYoff2

          public int boxYoff2

    - #### widths

          private int[] widths

    - #### textWidth

          private int textWidth

    - #### textHeight

          private int textHeight

    - #### text

          public java.lang.String text

    - #### textUnformatted

          public java.lang.String textUnformatted

    - #### lines

          public java.lang.String[] lines

    - #### image

          public java.lang.Object image

    - #### imageScale

          public float imageScale

    - #### xAdj

          private float xAdj

    - #### yAdj

          private float yAdj

    - #### y0

          private float y0

    - #### pointerPt

          public javajs.util.P3 pointerPt

    - #### isMeasure

          public boolean isMeasure

    - #### isEcho

          public boolean isEcho

    - #### xyz

          public javajs.util.P3 xyz

    - #### target

          public java.lang.String target

    - #### script

          public java.lang.String script

    - #### colix

          public short colix

    - #### bgcolix

          public short bgcolix

    - #### pointer

          public int pointer

    - #### fontScale

          public float fontScale

    - #### align

          public int align

    - #### valign

          public int valign

    - #### atomX

          public int atomX

    - #### atomY

          public int atomY

    - #### atomZ

          public int atomZ

    - #### movableX

          public int movableX

    - #### movableY

          public int movableY

    - #### movableZ

          public int movableZ

    - #### movableXPercent

          public int movableXPercent

    - #### movableYPercent

          public int movableYPercent

    - #### movableZPercent

          public int movableZPercent

    - #### z

          public int z

    - #### zSlab

          public int zSlab

    - #### pymolOffset

          public float[] pymolOffset

    - #### windowWidth

          protected int windowWidth

    - #### windowHeight

          protected int windowHeight

    - #### adjustForWindow

          public boolean adjustForWindow

    - #### boxWidth

          public float boxWidth

    - #### boxHeight

          public float boxHeight

    - #### boxX

          public float boxX

    - #### boxY

          public float boxY

    - #### modelIndex

          public int modelIndex

    - #### visible

          public boolean visible

    - #### hidden

          public boolean hidden

    - #### boxXY

          public float[] boxXY

    - #### scalePixelsPerMicron

          public float scalePixelsPerMicron

  - ### Constructor Detail

    - #### Text

          public Text()

  - ### Method Detail

    - #### newLabel

          public static Text newLabel(Viewer vwr,
                                      Font font,
                                      java.lang.String text,
                                      short colix,
                                      short bgcolix,
                                      int align,
                                      float scalePixelsPerMicron)

    - #### newMeasure

          public static Text newMeasure(Viewer vwr,
                                        Font font,
                                        short colix)

    - #### newEcho

          public static Text newEcho(Viewer vwr,
                                     Font font,
                                     java.lang.String target,
                                     short colix,
                                     int valign,
                                     int align,
                                     float scalePixelsPerMicron)

    - #### set

          private void set(Font font,
                           short colix,
                           int align,
                           float scalePixelsPerMicron)

    - #### setOffset

          public void setOffset(int offset)

    - #### getFontMetrics

          private void getFontMetrics()

    - #### setFontFromFid

          public void setFontFromFid(byte fid)

    - #### setText

          public void setText(java.lang.String text)

    - #### setImage

          public void setImage(java.lang.Object image)

    - #### setScale

          public void setScale(float scale)

    - #### setFont

          public void setFont(Font f3d,
                              boolean doAll)

    - #### setFontScale

          public void setFontScale(float scale)

    - #### recalc

          private void recalc()

    - #### setPosition

          public void setPosition(float scalePixelsPerMicron,
                                  float imageFontScaling,
                                  boolean isAbsolute,
                                  float[] boxXY)

    - #### getPymolXYOffset

          private float getPymolXYOffset(float off,
                                         int width,
                                         float ppa)

    - #### setPos

          private void setPos(float scale)

    - #### setBoxXY

          public static void setBoxXY(float boxWidth,
                                      float boxHeight,
                                      float xOffset,
                                      float yOffset,
                                      float[] boxXY,
                                      boolean isAbsolute)

    - #### stringWidth

          private int stringWidth(java.lang.String str)

    - #### setXYA

          public void setXYA(float[] xy,
                             int i)

    - #### appendFontCmd

          public void appendFontCmd(javajs.util.SB s)

    - #### setScalePixelsPerMicron

          public void setScalePixelsPerMicron(float scalePixelsPerMicron)

    - #### setXYZ

          public void setXYZ(javajs.util.P3 xyz,
                             boolean doAdjust)

    - #### setTranslucent

          public void setTranslucent(float level,
                                     boolean isBackground)

    - #### setMovableX

          public void setMovableX(int x)

    - #### setMovableY

          public void setMovableY(int y)

    - #### setMovableXPercent

          public void setMovableXPercent(int x)

    - #### setMovableYPercent

          public void setMovableYPercent(int y)

    - #### setMovableZPercent

          public void setMovableZPercent(int z)

    - #### setZs

          public void setZs(int z,
                            int zSlab)

    - #### setXYZs

          public void setXYZs(int x,
                              int y,
                              int z,
                              int zSlab)

    - #### setScript

          public void setScript(java.lang.String script)

    - #### setAlignmentLCR

          public boolean setAlignmentLCR(java.lang.String align)

    - #### setAlignment

          public boolean setAlignment(int align)

    - #### setBoxOffsetsInWindow

          public void setBoxOffsetsInWindow(float margin,
                                            float vMargin,
                                            float vTop)

    - #### setWindow

          public void setWindow(int width,
                                int height,
                                float scalePixelsPerMicron)

    - #### checkObjectClicked

          public boolean checkObjectClicked(boolean isAntialiased,
                                            int x,
                                            int y,
                                            javajs.util.BS bsVisible)

    - #### getPymolScreenOffset

          public void getPymolScreenOffset(javajs.util.P3 atomPt,
                                           javajs.util.P3i screen,
                                           int zSlab,
                                           javajs.util.P3 pTemp,
                                           float sppm)

      PyMOL will use 1 here for pymolOffset[0] for relative, 0 or absolute. Jmol set labelOffset or set echo offset or measure offset will set -1, when using {sx sy sz}.
      Parameters:
        `atomPt` -
        `screen` -
        `zSlab` -
        `pTemp` -
        `sppm` -