public class GrfEscape extends Object
GrfEscape
instance has a type code and an associated integer value.
The meaning of the sequence is determined by the type code, and
sometimes the value
integer. The known escape codes
are defined as static final integer members of this class - the
definitions below document the textual meaning of these and what,
if anything, the value means.
This class also contains static methods for locating escape sequences and global control of how AST handles them in text strings.
Grf.cap(int, int)
Modifier and Type | Field and Description |
---|---|
static int |
GRF__ESBAC
Code for a backwards space before drawing the next characters.
|
static int |
GRF__ESCOL
Code for a change in colour.
|
static int |
GRF__ESFON
Code for a change in font.
|
static int |
GRF__ESGAP
Code for a horizontal gap before drawing the next characters.
|
static int |
GRF__ESPER
Code for a literal percent sign.
|
static int |
GRF__ESPOP
Code for popping the current graphics attribute values from the stack.
|
static int |
GRF__ESPSH
Code for pushing the current graphics attribute values onto the stack.
|
static int |
GRF__ESSIZ
Code for a change in character size.
|
static int |
GRF__ESSTY
Code for a change in style.
|
static int |
GRF__ESSUB
Code for subscripted text.
|
static int |
GRF__ESSUP
Code for superscripted text.
|
static int |
GRF__ESWID
Code for a change in character width.
|
Constructor and Description |
---|
GrfEscape(int code,
int value)
Constructs a new escape object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static Object[] |
findEscapes(String text)
Parses a string into a set of blocks each representing text
or an escape code.
|
int |
getCode()
Returns the symbolic graphics code representing the type of this
escape object.
|
static boolean |
getEscapes()
Indicates whether escape sequences will be stripped out of
strings returned by AstObject methods.
|
String |
getText()
Returns the textual representation of this escape sequence.
|
int |
getValue()
Returns the integer value associated with this escape object.
|
int |
hashCode() |
static void |
setEscapes(boolean escapes)
Determines whether escape sequences should be stripped out of
strings returned by AstObject methods.
|
String |
toString() |
public static final int GRF__ESPER
value
is ignored.
Textual representation is "%%".
public static final int GRF__ESSUP
value
gives the distance from the base-line of "normal"
text to the base-line of the superscripted text, scaled so a
value of 100 corresponds to the height of normal text.
A value of -1 means draw subsequent characters with the normal baseline.
Textual representation is "%^value+", or "%^+" for value=-1.
public static final int GRF__ESSUB
value
gives the distance from the base-line of "normal"
text to the base-line of the subscripted text, scaled so that a
value of 100 corresponds to the height of normal text.
A value of -1 means draw subsequent characters with the normal baseline.
Textual representation is "%vvalue+", or "%v+" for value=-1.
public static final int GRF__ESGAP
value
gives the size of the movement, scaled
so that a value of 100 corresponds to the height(?) of normal text.
Textual representation is "%>value+".
public static final int GRF__ESBAC
value
gives the size of the movement, scaled
so that a value of 100 corresponds to the height(?) of normal text.
Textual representation is "%<value+".
public static final int GRF__ESSIZ
value
gives the new size as a fraction of "normal" size,
scaled so a value of 100 corresponds to 1.0.
A value of -1 means draw subsequent characters at the normal size.
Textual representation is "%svalue+", or "%s+" for value=-1.
public static final int GRF__ESWID
value
gives the new width as a fraction of "normal"
width,
scaled so a value of 100 corresponds to 1.0.
A value of -1 means draw subsequent characters at the normal width.
Textual representation is "%wvalue+", or "%w+" for value=-1.
public static final int GRF__ESFON
value
gives the new font value.
A value of -1 means reset the font attribute to its normal value.
Textual representation is "%fvalue+", or "%f+" for value=-1.
public static final int GRF__ESCOL
value
gives the new colour value.
A value of -1 means reset the font attribute to its normal value.
Textual representation is "%cvalue+", or "%c+" for value=-1.
public static final int GRF__ESSTY
value
gives the new style value.
A value of -1 means reset the styel attribute to its normal value.
Textual representation is "%tvalue+", or "%t+" for value=-1.
public static final int GRF__ESPOP
value
is ignored.
Textual representation is "%-".
public static final int GRF__ESPSH
value
is ignored.
Textual representation is "%+".
public GrfEscape(int code, int value)
code
- symbolic graphics code (one of the GRF__ES* constants)value
- associated numeric value (meaning is dependent on the
value of code
)public int getCode()
public int getValue()
public String getText()
public static void setEscapes(boolean escapes)
Plot
defines a set of escape sequences which can
be included within a text string to control the appearance of
substrings in the text.
It is usually inappropriate for object methods to return strings
containing such escape sequences when called by application code.
For instance, an application which displays the value of
the Title attribute of a Frame usually does not want the displayed
string to include escape sequences which a human would have
difficulty interpreting. Therefore the default behaviour is
to strip out such escape sequences when called by application code.escapes
- true iff you want get*
methods to
include escape sequencesPlot.setEscape(boolean)
public static boolean getEscapes()
Plot
defines a set of escape sequences which can
be included within a text string to constrol the appearance of
substrings in the text.
It is usually inappropriate for object methods to return strings
containing such escape sequences when called by application code.
For instance, an application which displays the value of
the Title attribute of a Frame usually does not want the displayed
string to include escape sequences which a human would have
difficulty interpreting. Therefore the default behaviour is
to strip out such escape sequences when called by application code.get*
methods will include
escape sequencesPlot.setEscape(boolean)
public static Object[] findEscapes(String text)
GrfEscape
or a String.text
- string to analyseGrfEscape
and String
objects representing the parsed value of text
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.