Search in sources :

Example 1 with WakeupOr

use of javax.media.j3d.WakeupOr in project ffx by mjschnie.

the class MouseBehavior method initialize.

/*
     * Initializes the behavior.
     */
/**
 * <p>
 * initialize</p>
 */
public void initialize() {
    mouseEvents = new WakeupCriterion[3];
    mouseEvents[0] = new WakeupOnAWTEvent(MouseEvent.MOUSE_DRAGGED);
    mouseEvents[1] = new WakeupOnAWTEvent(MouseEvent.MOUSE_PRESSED);
    mouseEvents[2] = new WakeupOnAWTEvent(MouseEvent.MOUSE_RELEASED);
    mouseCriterion = new WakeupOr(mouseEvents);
    if (poster == null) {
        wakeupOn(mouseCriterion);
    } else {
        postCriterion = new WakeupOnBehaviorPost(poster, id);
        wakeupOn(postCriterion);
    }
    x = 0;
    y = 0;
    x_last = 0;
    y_last = 0;
}
Also used : WakeupOnAWTEvent(javax.media.j3d.WakeupOnAWTEvent) WakeupOr(javax.media.j3d.WakeupOr) WakeupOnBehaviorPost(javax.media.j3d.WakeupOnBehaviorPost)

Example 2 with WakeupOr

use of javax.media.j3d.WakeupOr in project ffx by mjschnie.

the class PickMouseBehavior method initialize.

/**
 * <p>
 * initialize</p>
 */
public void initialize() {
    conditions = new WakeupCriterion[1];
    conditions[0] = new WakeupOnAWTEvent(Event.MOUSE_DOWN);
    wakeupCondition = new WakeupOr(conditions);
    wakeupOn(wakeupCondition);
}
Also used : WakeupOnAWTEvent(javax.media.j3d.WakeupOnAWTEvent) WakeupOr(javax.media.j3d.WakeupOr)

Example 3 with WakeupOr

use of javax.media.j3d.WakeupOr in project ffx by mjschnie.

the class GraphicsEvents method initialize.

/**
 * <p>
 * initialize</p>
 */
public void initialize() {
    WakeupCriterion[] behaviorPost = new WakeupCriterion[3];
    behaviorPost[0] = new WakeupOnBehaviorPost(systemRotate, BEHAVIORDONEPOST);
    behaviorPost[1] = new WakeupOnBehaviorPost(systemTranslate, BEHAVIORDONEPOST);
    behaviorPost[2] = new WakeupOnBehaviorPost(globalZoom, BEHAVIORDONEPOST);
    postCriterion = new WakeupOr(behaviorPost);
    WakeupCriterion[] awtCriterion = new WakeupCriterion[2];
    awtCriterion[0] = new WakeupOnAWTEvent(Event.MOUSE_DOWN);
    awtCriterion[1] = new WakeupOnAWTEvent(Event.MOUSE_UP);
    mouseCriterion = new WakeupOr(awtCriterion);
    wakeupOn(mouseCriterion);
}
Also used : WakeupOnAWTEvent(javax.media.j3d.WakeupOnAWTEvent) WakeupCriterion(javax.media.j3d.WakeupCriterion) WakeupOr(javax.media.j3d.WakeupOr) WakeupOnBehaviorPost(javax.media.j3d.WakeupOnBehaviorPost)

Aggregations

WakeupOnAWTEvent (javax.media.j3d.WakeupOnAWTEvent)3 WakeupOr (javax.media.j3d.WakeupOr)3 WakeupOnBehaviorPost (javax.media.j3d.WakeupOnBehaviorPost)2 WakeupCriterion (javax.media.j3d.WakeupCriterion)1