|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.extex.interpreter.type.AbstractCode
org.extex.interpreter.type.AbstractAssignment
org.extex.unit.color.Colordef
public class Colordef
This class provides an implementation for the primitive
The primitive \colordef defines a color variable and assigns it to
a control sequence. The color is initialized with a given color –
either a color constant or a color variable.
The control sequence can later be used wherever a color is expected.
The primitive \colordef constitutes an assignment. Thus the count
register \globaldefs and the token register
\afterassignment interact with it as for each assignment.
The primitive can be prefixed with the \global flag. In this case
the definition is performed globally. Otherwise the control sequence holds
the color value in the current group only. It is reset to the previous value
when the group is ended.
The color variable can be manipulated by assigning new colors to it. The
assignment is accomplished by specifying the new value after an optional
equals sign. Note that the assignment can not be prefixed by a
\global modifier since the scope has already been specified in the
declaration with \colordef.
\colordef.
The Primitive \colordef
Syntax
The formal description of this primitive is the following:
〈colordef〉
→ 〈optional prefix〉 \colordef 〈control sequence〉 〈color〉
〈optional prefix〉
→
| \global
Examples
\colordef\col alpha .1234 rgb {.2 .3 .4}
\global\colordef\col\color
| Field Summary | |
|---|---|
protected static long |
serialVersionUID
The field serialVersionUID contains the version number for serialization. |
| Constructor Summary | |
|---|---|
Colordef(CodeToken token)
Creates a new object. |
|
| Method Summary | |
|---|---|
void |
assign(Flags prefix,
Context context,
TokenSource source,
Typesetter typesetter)
The method assign is the core of the functionality of execute(). |
| Methods inherited from class org.extex.interpreter.type.AbstractAssignment |
|---|
execute |
| Methods inherited from class org.extex.interpreter.type.AbstractCode |
|---|
getLocalizer, getName, getToken, isIf, isOuter, readResolve, toString, toText, toText |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final long serialVersionUID
| Constructor Detail |
|---|
public Colordef(CodeToken token)
token - the initial token for the primitive| Method Detail |
|---|
public void assign(Flags prefix,
Context context,
TokenSource source,
Typesetter typesetter)
throws HelpingException,
TypesetterException
execute().
This method is preferable to execute() since the
execute() method provided in this class takes care of
\afterassignment and \globaldefs as well.
assign in class AbstractAssignmentprefix - the prefix controlling the executioncontext - the interpreter contextsource - the token sourcetypesetter - the typesetter
org.extex.framework.configuration.exception.ConfigurationException - in
case of an configuration error
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetterAbstractAssignment.assign(
org.extex.interpreter.Flags, org.extex.interpreter.context.Context,
org.extex.interpreter.TokenSource, org.extex.typesetter.Typesetter)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||