Examples of InputCursor


Examples of org.mt4j.input.inputData.InputCursor

    //-> actually we always lock 2 cursors at once so should never be only 1 locked, but just for safety..
    this.unLockAllCursors();

    List<InputCursor> availableCursors = getFreeComponentCursors();
    if (availableCursors.size() >= 2){ //we can try to resume the gesture
      InputCursor firstCursor = availableCursors.get(0);
      InputCursor secondCursor = getFarthestFreeComponentCursorTo(firstCursor);

      //See if we can obtain a lock on both cursors
      IMTComponent3D comp = firstCursor.getFirstEvent().getTargetComponent();
      ScaleContext newContext = new ScaleContext(firstCursor, secondCursor, comp);
      if (!newContext.isGestureAborted()){ //Check if we could start gesture (ie. if fingers on component)
        sc = newContext;
        this.getLock(firstCursor, secondCursor);
        logger.debug(this.getName() + " we could lock cursors: " + firstCursor.getId() +", " + secondCursor.getId());
      }else{
        sc = null;
        logger.debug(this.getName() + " we could NOT resume gesture - cursors not on component: " + firstCursor.getId() +", " + secondCursor.getId());
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.