Creates a new behavior from the BooleanBvr and two other behaviors. The value of the new behavior, at any point in time, is one of those two behaviors. Which of the behaviors chosen depends on the value of the BooleanBvr. Here is an example:
//Create a new behavior, y, which is either 1.0 if x > 1.0, or another behavior, x NumberBvr y = (NumberBvr)cond(gte(x, toBvr(1.0)), toBvr(1.0), x);
public static Behavior cond(
BooleanBvr bool,
Behavior a,
Behavior b
);
Returns the Behavior object.
Creates a new behavior that is the sum of the two Behavior parameters. In other words, the two behaviors are concatenated, according to their order in the parameter list. Once the duration is over, the behavior becomes a snapshot of the second behavior. An exception is when the first behavior is of infinite duration. In this case, the returned behavior is always the infinite behavior, no matter what the second behavior is.
public static Behavior sequence(
Behavior a,
Behavior b
);
Returns the Behavior object.
Notice that, in contrast to compose, which first apply the right-hand argument and then the left, sequence first applies the left-hand argument and then the right.
Creates a behavior that changes when a given event occurs. Up to and including the time the event occurs, the behavior is the same as a. After the event e occurs, the behavior changes to be the same as b. Because until takes behaviors and returns a behavior, it can be nested. Here are some examples:
//The ColorBvr col is initially red //It turns blue when the left mouse button is pressed ColorBvr c = (ColorBvr)until(red, leftButtonDown, blue); //Example of nested behaviors //The behavior is initially red //It turns blue when the left mouse button is pressed //And turns green when it is pressed again ColorBvr c = (ColorBvr)until(red, leftButtonDown, until(blue, leftButtonDown, green));
public static Behavior until(
Behavior a,
DXMEvent e,
Behavior b
);
Returns the Behavior object.
Creates a Behavior that changes upon a given event. Initially, the behavior is the same as a. When event e occurs, the behavior changes to the behavior returned by the event. This means that only DXMEvents that return a Behavior can be used. These events can be constructed with attachData, notifyEvent, and snapshotEvent.
public static Behavior untilEx(
Behavior a,
DXMEvent e
);
Returns the Behavior object caused by the event e.
Creates a behavior that changes upon a given event. Initially, the behavior is the same as a. When event e occurs, the behavior changes to the behavior returned by the event notifier notifier.
public static Behavior untilNotify(
Behavior a,
DXMEvent e,
UntilNotifier notifier
);
Returns the Behavior object.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.