protected class SvgSource.ParamTranslate extends Util.Pairwise<Event>
In the code generation scheme, the target value of an interpolation process is already encoded with the command starting the interpoloation. In non-interpolation, a "set value" command is generated at the time of the event. Symbolically:
#0 #1 #2 #3 first(): prepare registers pairwise(): \-------/ ipol==true v0=====>v1... ipol==false v0!... pairwise(): \--------/ ipol==true v1=======>v2... left value == reachedValue --> NOP (No need for a command iff value simply STAYS!) ipol==false v1!... pairwise(): \--------/ etc. last() AND ipol=false: v3!...ATTENTION:
Modifier and Type | Field and Description |
---|---|
protected double |
currentTime |
protected String |
currentValue |
protected Function<Event,String> |
getParamValue |
protected String |
indent |
protected boolean |
ipol
Whether between the earlier and later event in
pairwise(Event,Event)
an interpolation is requested by the tscore source data. |
protected @Opt Map<Event,String> |
ipoltable |
protected boolean |
isTransform |
protected String |
paramName |
protected String |
paramType |
protected double |
predecTime |
protected String |
predecValue |
protected @Opt String |
reachedValue
Value currently valid in the state of the Svg/Smil processor, either as
the endpoint of an interpolation, or set and held as a constant.
|
_last, it, lit
Constructor and Description |
---|
ParamTranslate(Iterable<Event> it,
@Opt Map<Event,String> ipoltable,
boolean isTransform,
String paramType,
String paramName,
String indent,
Function<Event,String> getParamValue) |
Modifier and Type | Method and Description |
---|---|
void |
first(Event e)
Can be overridden by the user to visit the very first element before the first pair
is visited by
Util.Pairwise.pairwise(Object,Object) . |
void |
last(Event e)
Can be overridden by the user to visit the very last element after the last pair
is visited by
Util.Pairwise.pairwise(Object,Object) . |
void |
pairwise(Event predec,
Event current)
Must be overridden by the user to visit the define what to do with each pair of
adjacent elements.
|
protected double |
time(Event e) |
protected void |
writeSet()
Generate the source text which sets the parameter value only of the earlier event.
|
process
protected final String paramType
protected final String paramName
protected final String indent
protected final boolean isTransform
@Opt protected @Opt String reachedValue
protected String predecValue
protected String currentValue
protected double predecTime
protected double currentTime
protected boolean ipol
pairwise(Event,Event)
an interpolation is requested by the tscore source data.protected double time(Event e)
public void first(Event e)
Util.Pairwise.pairwise(Object,Object)
.
Here: Prepare the registers for the first call to pairwise(Event,Event)
.first
in class Util.Pairwise<Event>
protected void writeSet()
ATTENTION, HACK: "set" does not work with "@transform", so we use a VERY FAST animation.
public void pairwise(Event predec, Event current)
Iterator.next()
, so that it "points"
(e.g. with its Iterator.hasNext()
to the successor of the later of both
visited elements.
Here: Generate either the source text which describes the interpolation between
both events, or one which sets the parameter value only of the earlier event.
Before processing, predecTime
and predecValue
correspond to
the earlier event.
After processing, predecTime
and predecValue
correspond to
the later event = are prepared for the next cyclic call of this method.pairwise
in class Util.Pairwise<Event>
public void last(Event e)
Util.Pairwise.pairwise(Object,Object)
.. Here: If the very last event's parameter is not reached by the
last interpolation, then generate a "setValue" smil event.last
in class Util.Pairwise<Event>