# Class Text

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

public class Text extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`boolean`
`adjustForWindow`
`int`
`align`
`int`
`atomX`
`int`
`atomY`
`int`
`atomZ`
`float`
`barDistance`
`int`
`barPixels`
`int`
`barPixelsXYZ`
`short`
`bgcolix`
`float`
`boxHeight`
`float`
`boxWidth`
`float`
`boxX`
`float[]`
`boxXY`
`float`
`boxY`
`int`
`boxYoff2`
`short`
`colix`
`int`
`descent`
`boolean`
`doFormatText`
`Font`
`font`
`float`
`fontScale`
`boolean`
`hidden`
`Object`
`image`
`float`
`imageScale`
`boolean`
`isEcho`
`boolean`
`isMeasure`
`int`
`lineHeight`
`String[]`
`lines`
`int`
`modelIndex`
`int`
`movableX`
`int`
`movableXPercent`
`int`
`movableY`
`int`
`movableYPercent`
`int`
`movableZ`
`int`
`movableZPercent`
`protected int`
`offsetX`
`protected int`
`offsetY`
`int`
`pointer`
`P3`
`pointerPt`
`static final int`
`PYMOL_LABEL_OFFSET_ABS`
`static final int`
`PYMOL_LABEL_OFFSET_ABS_ANG`
`static final int`
`PYMOL_LABEL_OFFSET_ABS_PIX`
`static final int`
`PYMOL_LABEL_OFFSET_ANG`
`static final int`
`PYMOL_LABEL_OFFSET_JMOL`
`static final int`
`PYMOL_LABEL_OFFSET_PIX`
`static final int`
`PYMOL_LABEL_OFFSET_REL`
`static final int`
`PYMOL_LABEL_OFFSET_REL_ANG`
`static final int`
`PYMOL_LABEL_OFFSET_REL_PIX`
`float[]`
`pymolOffset`
`float`
`scalePixelsPerMicron`
`String`
`script`
`String`
`target`
`String`
`text`
`String`
`textUnformatted`
`boolean`
`thisModelOnly`
`int`
`valign`
`boolean`
`visible`
`protected int`
`windowHeight`
`protected int`
`windowWidth`
`P3`
`xyz`
`int`
`z`
`int`
`zSlab`

## Constructor Summary

Constructors
Constructor
Description
`Text()`

## Method Summary

Modifier and Type
Method
Description
`void`
`appendFontCmd(SB s)`
`boolean`
`checkObjectClicked(boolean isAntialiased, int x, int y, BS bsVisible)`
`void`
`getPymolScreenOffset(P3 atomPt, P3i screen, int zSlab, P3 pTemp, float sppa)`
PyMOL will use 1 here for pymolOffset[0] for relative, 0 or absolute.
`String`
`getStateText()`
`static Text`
`newEcho(Viewer vwr, Font font, String target, short colix, int valign, int align, float scalePixelsPerMicron)`
`static Text`
`newLabel(Viewer vwr, Font font, String text, short colix, short bgcolix, int align, float scalePixelsPerMicron)`
`static Text`
`newMeasure(Viewer vwr, Font font, short colix)`
`boolean`
`setAlignment(int align)`
`boolean`
`setAlignmentLCR(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(int fid)`
`void`
`setFontScale(float scale)`
`void`
`setImage(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)`
`void`
`setPosition(float scalePixelsPerMicron, float imageFontScaling, boolean isAbsolute, float[] boxXY)`
`void`
`setScale(float scale)`
`void`
`setScalePixelsPerMicron(float scalePixelsPerMicron)`
`void`
`setScript(String script)`
`void`
`setText(String text)`
`void`
`setTranslucent(float level, boolean isBackground)`
`void`
`setWindow(int width, int height, float scalePixelsPerMicron)`
`void`
`setXYA(float[] xy, int i)`
`void`
`setXYZ(P3 xyz, boolean doAdjust)`
`void`
`setXYZs(int x, int y, int z, int zSlab)`
`void`
`setZs(int z, int zSlab)`
`String`
`toString()`

### Methods inherited from class Object

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

## Field Details

### PYMOL_LABEL_OFFSET_JMOL

public static final int PYMOL_LABEL_OFFSET_JMOL

See Also:
  - Constant Field Values

### PYMOL_LABEL_OFFSET_ABS

public static final int PYMOL_LABEL_OFFSET_ABS

See Also:
  - Constant Field Values

### PYMOL_LABEL_OFFSET_ANG

public static final int PYMOL_LABEL_OFFSET_ANG

See Also:
  - Constant Field Values

### PYMOL_LABEL_OFFSET_REL

public static final int PYMOL_LABEL_OFFSET_REL

See Also:
  - Constant Field Values

### PYMOL_LABEL_OFFSET_PIX

public static final int PYMOL_LABEL_OFFSET_PIX

See Also:
  - Constant Field Values

### PYMOL_LABEL_OFFSET_ABS_ANG

public static final int PYMOL_LABEL_OFFSET_ABS_ANG

See Also:
  - Constant Field Values

### PYMOL_LABEL_OFFSET_REL_ANG

public static final int PYMOL_LABEL_OFFSET_REL_ANG

See Also:
  - Constant Field Values

### PYMOL_LABEL_OFFSET_ABS_PIX

public static final int PYMOL_LABEL_OFFSET_ABS_PIX

See Also:
  - Constant Field Values

### PYMOL_LABEL_OFFSET_REL_PIX

public static final int PYMOL_LABEL_OFFSET_REL_PIX

See Also:
  - Constant Field Values

### doFormatText

public boolean doFormatText

### font

public Font font

### descent

public int descent

### lineHeight

public int lineHeight

### offsetX

protected int offsetX

### offsetY

protected int offsetY

### boxYoff2

public int boxYoff2

### text

public String text

### textUnformatted

public String textUnformatted

### lines

public String[] lines

### image

public Object image

### imageScale

public float imageScale

### barPixels

public int barPixels

### barDistance

public float barDistance

### isMeasure

public boolean isMeasure

### isEcho

public boolean isEcho

### xyz

public P3 xyz

### target

public String target

### script

public 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

### pointerPt

public P3 pointerPt

### 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

### thisModelOnly

public boolean thisModelOnly

### visible

public boolean visible

### hidden

public boolean hidden

### boxXY

public float[] boxXY

### scalePixelsPerMicron

public float scalePixelsPerMicron

### barPixelsXYZ

public int barPixelsXYZ

## Constructor Details

### Text

public Text()

## Method Details

### newLabel

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

Parameters:
  `vwr` -
  `font` -
  `text` -
  `colix` -
  `bgcolix` -
  `align` -
  `scalePixelsPerMicron` -
Returns:
  the new label

### newMeasure

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

### newEcho

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

### setOffset

public void setOffset(int offset)

### setFontFromFid

public void setFontFromFid(int fid)

### setText

public void setText(String text)

### setImage

public void setImage(Object image)

### setScale

public void setScale(float scale)

### setFont

public void setFont(Font f3d, boolean doAll)

### setFontScale

public void setFontScale(float scale)

### setPosition

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

### setBoxXY

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

### setXYA

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

### appendFontCmd

public void appendFontCmd(SB s)

### setScalePixelsPerMicron

public void setScalePixelsPerMicron(float scalePixelsPerMicron)

### setXYZ

public void setXYZ(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(String script)

### setAlignmentLCR

public boolean setAlignmentLCR(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, BS bsVisible)

### getPymolScreenOffset

public void getPymolScreenOffset(P3 atomPt, P3i screen, int zSlab, P3 pTemp, float sppa)
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` -
  `sppa` - screen pixels per angstrom regardless of font scaling

### getStateText

public String getStateText()

### toString

public String toString()

Overrides:
  `toString` in class `Object`