Examples of IMTComponent3D


Examples of org.mt4j.components.interfaces.IMTComponent3D

  /* (non-Javadoc)
   * @see org.mt4j.input.inputProcessors.componentProcessors.AbstractCursorProcessor#cursorStarted(org.mt4j.input.inputData.InputCursor, org.mt4j.input.inputData.MTFingerInputEvt)
   */
  @Override
  public void cursorStarted(InputCursor m, MTFingerInputEvt positionEvent) {
    IMTComponent3D comp = positionEvent.getTargetComponent();
    if (lockedCursors.size() >= 1){ //We assume that the gesture is already in progress and add this new cursor to the unUsedList
      unUsedCursors.add(m);
    }else{
      if (unUsedCursors.size() == 0){ //Only start gesture if no other finger on the component yet
        if (this.canLock(m)){//See if we can obtain a lock on this cursor (depends on the priority)
View Full Code Here

Examples of org.mt4j.components.interfaces.IMTComponent3D

  /* (non-Javadoc)
   * @see org.mt4j.input.inputProcessors.componentProcessors.AbstractCursorProcessor#cursorEnded(org.mt4j.input.inputData.InputCursor, org.mt4j.input.inputData.MTFingerInputEvt)
   */
  @Override
  public void cursorEnded(InputCursor m, MTFingerInputEvt positionEvent) {
    IMTComponent3D comp = positionEvent.getTargetComponent();
    logger.debug(this.getName() + " INPUT_ENDED RECIEVED - CURSOR: " + m.getId());

    if (lockedCursors.contains(m)){ //cursor was a actual gesture cursor
      lockedCursors.remove(m);
      if (unUsedCursors.size() > 0){ //check if there are other cursors on the component, we could use
View Full Code Here

Examples of org.mt4j.components.interfaces.IMTComponent3D

//        logger.debug(this.getName() + " we didnt have a unused cursor previously to start gesture now");
//        unUsedCursors.add(m);
//      }
//    }
   
    IMTComponent3D comp = fEvt.getTargetComponent();
    logger.debug(this.getName() + " INPUT_STARTED, Cursor: " + newCursor.getId());
   
    List<InputCursor> alreadyLockedCursors = getLockedCursors();
    if (alreadyLockedCursors.size() >= 2){ //this gesture with 2 fingers already in progress
      //TODO get the 2 cursors which are most far away from each other
View Full Code Here

Examples of org.mt4j.components.interfaces.IMTComponent3D



  @Override
  public void cursorUpdated(InputCursor m, MTFingerInputEvt fEvt) {
    IMTComponent3D comp = fEvt.getTargetComponent();
//    if (lockedCursors.size() == 2 && lockedCursors.contains(m)){
//      float newFactor = sc.getUpdatedScaleFactor(m);
//      //Use the other cursor as the scaling point
//      if (m.equals(sc.getFirstFingerCursor())){
//        this.fireGestureEvent(new ScaleEvent(this, MTGestureEvent.GESTURE_UPDATED, comp, sc.getFirstFingerCursor(), sc.getSecondFingerCursor(), newFactor, newFactor, 1, sc.getSecondFingerNewPos()));
View Full Code Here

Examples of org.mt4j.components.interfaces.IMTComponent3D

 
 
  @Override
  public void cursorEnded(InputCursor c, MTFingerInputEvt fEvt) {
    IMTComponent3D comp = fEvt.getTargetComponent();
   
    logger.debug(this.getName() + " INPUT_ENDED -> Active cursors: " + getCurrentComponentCursors().size() + " Available cursors: " + getFreeComponentCursors().size() " Locked cursors: " + getLockedCursors().size());
    if (getLockedCursors().contains(c)){
      InputCursor firstCursor = sc.getFirstFingerCursor();
      InputCursor secondCursor = sc.getSecondFingerCursor();
View Full Code Here

Examples of org.mt4j.components.interfaces.IMTComponent3D

    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());
View Full Code Here

Examples of org.mt4j.components.interfaces.IMTComponent3D

    }
   
    public boolean processGestureEvent(MTGestureEvent g) {
      if (g instanceof TapEvent){
        TapEvent clickEvent = (TapEvent)g;
        IMTComponent3D clicked = clickEvent.getTargetComponent();
       
        if (clicked != null && clicked instanceof MTKey){
          MTKey clickedKey = (MTKey)clicked;
         
          switch (clickEvent.getTapID()) {
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.