Example usage for javax.media.j3d WakeupOr WakeupOr

List of usage examples for javax.media.j3d WakeupOr WakeupOr

Introduction

In this page you can find the example usage for javax.media.j3d WakeupOr WakeupOr.

Prototype

public WakeupOr(WakeupCriterion conditions[]) 

Source Link

Document

Constructs a new WakeupOr criterion.

Usage

From source file:MouseNavigateTest.java

/**
 * Registers which AWT events are of interest to the behaviour
 *///from w ww  . j  ava2s .  c om
//*****************************************************************************
public void initialize() {
    WakeupCriterion[] 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);

    m_MouseCriterion = new WakeupOr(mouseEvents);
    wakeupOn(m_MouseCriterion);
}

From source file:KeyNavigateTest.java

public RandomWalkBehavior(TransformGroup tg, CollisionDetector detector) {
    m_TransformGroup = tg;//from w  ww .j a v a  2s.  c om

    m_CollisionChecker = new CollisionChecker(tg, detector, false);

    m_Transform3D = new Transform3D();

    TargetVector3d = new Vector3d();
    CurrentVector3d = new Vector3d();

    // create the WakeupCriterion for the behavior
    WakeupCriterion criterionArray[] = new WakeupCriterion[1];
    criterionArray[0] = new WakeupOnElapsedTime(100);

    // save the WakeupCriterion for the behavior
    m_WakeupCondition = new WakeupOr(criterionArray);
}

From source file:KeyNavigateTest.java

public void initialize() {
    WakeupCriterion[] keyEvents = new WakeupCriterion[2];
    keyEvents[0] = new WakeupOnAWTEvent(KeyEvent.KEY_PRESSED);
    keyEvents[1] = new WakeupOnAWTEvent(KeyEvent.KEY_RELEASED);
    keyCriterion = new WakeupOr(keyEvents);

    wakeupOn(keyCriterion);//  w ww  .  ja  v  a  2 s  .c o  m
}

From source file:ExText.java

/**
 * Initializes the behavior.// w ww. ja va  2s. c om
 */
public void initialize() {
    super.initialize();
    savedMouseCriterion = mouseCriterion; // from parent class
    mouseAndAnimationEvents = new WakeupCriterion[4];
    mouseAndAnimationEvents[0] = new WakeupOnAWTEvent(MouseEvent.MOUSE_DRAGGED);
    mouseAndAnimationEvents[1] = new WakeupOnAWTEvent(MouseEvent.MOUSE_PRESSED);
    mouseAndAnimationEvents[2] = new WakeupOnAWTEvent(MouseEvent.MOUSE_RELEASED);
    mouseAndAnimationEvents[3] = new WakeupOnElapsedFrames(0);
    mouseAndAnimationCriterion = new WakeupOr(mouseAndAnimationEvents);
    // Don't use the above criterion until a button 1 down event
}

From source file:KeyNavigateTest.java

public CollisionBehavior(Node node, ComplexObject owner) {
    wakeupOne = new WakeupOnCollisionEntry(node, WakeupOnCollisionEntry.USE_GEOMETRY);
    wakeupTwo = new WakeupOnCollisionExit(node, WakeupOnCollisionExit.USE_GEOMETRY);

    wakeupArray[0] = wakeupOne;/*from   w  w  w. ja  v  a 2s. co m*/
    wakeupArray[1] = wakeupTwo;

    wakeupCondition = new WakeupOr(wakeupArray);

    m_Owner = owner;
}

From source file:ExText.java

/**
 * Initialize the behavior.//from   ww w . j  a v a2 s.  c  o  m
 */
public void initialize() {
    // Wakeup when the mouse is dragged or when a mouse button
    // is pressed or released.
    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);
    wakeupOn(mouseCriterion);
}

From source file:FourByFour.java

public void initialize() {
    x = 0;/* ww w  . ja v a2  s . c om*/
    y = 0;
    x_last = 0;
    y_last = 0;
    x_angle = 0;
    y_angle = 0;
    x_factor = .02;
    y_factor = .02;

    mouseEvents = new WakeupCriterion[2];
    mouseEvents[0] = new WakeupOnAWTEvent(MouseEvent.MOUSE_DRAGGED);
    mouseEvents[1] = new WakeupOnAWTEvent(MouseEvent.MOUSE_PRESSED);
    mouseCriterion = new WakeupOr(mouseEvents);
    wakeupOn(mouseCriterion);
}