Package org.jmol.modelset
Class LabelToken
java.lang.Object
org.jmol.modelset.LabelToken
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate charprivate Objectprivate booleanprivate Stringprivate static final int[]private static final Stringprivate intprivate intstatic final Stringprivate Stringprivate intprivate static final int[]private static final Stringprivate intprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidappendAtomTokenValue(Viewer vwr, Atom atom, LabelToken t, javajs.util.SB strLabel, int[] indices, javajs.util.P3 ptTemp) static LabelToken[]Compiles a set of tokens for each primitive element of a label.private StringformatLabel(Viewer vwr, Atom atom, String strFormat, javajs.util.P3 ptTemp) static StringformatLabelAtomArray(Viewer vwr, Atom atom, LabelToken[] tokens, char chAtom, int[] indices, javajs.util.P3 ptTemp) returns a formatted string based on the precompiled label tokensstatic StringformatLabelBond(Viewer vwr, Bond bond, LabelToken[] tokens, Map<String, Object> values, int[] indices, javajs.util.P3 ptTemp) static StringformatLabelMeasure(Viewer vwr, Measurement m, String label, float value, String units) static StringgetLabel(LabelToken[] tokens) private static booleanisLabelPropertyTok(int tok) private LabelTokenprivate static intsetToken(Viewer vwr, String strFormat, LabelToken lt, int cch, int chAtom, Map<String, Object> htValues) sets a label token based on a label stringstatic voidsetValues(LabelToken[] tokens, Map<String, Object> values)
-
Field Details
-
text
-
key
-
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
- See Also:
-
labelTokenIds
private static final int[] labelTokenIds -
STANDARD_LABEL
- See Also:
-
twoCharLabelTokenParams
- See Also:
-
twoCharLabelTokenIds
private static final int[] twoCharLabelTokenIds
-
-
Constructor Details
-
LabelToken
public LabelToken()
-
-
Method Details
-
set
-
isLabelPropertyTok
private static boolean isLabelPropertyTok(int tok) -
compile
public static LabelToken[] compile(Viewer vwr, String strFormat, char chAtom, Map<String, 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
-
formatLabelAtomArray
public static 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
-
formatLabelBond
-
formatLabelMeasure
public static String formatLabelMeasure(Viewer vwr, Measurement m, String label, float value, String units) -
setValues
-
getLabel
-
setToken
private static int setToken(Viewer vwr, String strFormat, LabelToken lt, int cch, int chAtom, Map<String, 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
-