Search in sources :

Example 1 with WakeupOnBehaviorPost

use of javax.media.j3d.WakeupOnBehaviorPost 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 WakeupOnBehaviorPost

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

the class Renderer method initialize.

/**
 * {@inheritDoc}
 *
 * Initialize this behavior to respond to postID messages
 */
@Override
public void initialize() {
    postid = new WakeupOnBehaviorPost(this, 1);
    wakeupOn(postid);
}
Also used : WakeupOnBehaviorPost(javax.media.j3d.WakeupOnBehaviorPost)

Example 3 with WakeupOnBehaviorPost

use of javax.media.j3d.WakeupOnBehaviorPost 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

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