Examples of TapEvent


Examples of org.mt4j.input.inputProcessors.componentProcessors.tapProcessor.TapEvent

    listLabel.setPositionRelativeToParent(cell.getCenterPointLocal());
    cell.unregisterAllInputProcessors();
    cell.registerInputProcessor(new TapProcessor(getMTApplication(), 15));
    cell.addGestureListener(TapProcessor.class, new IGestureEventListener() {
      public boolean processGestureEvent(MTGestureEvent ge) {
        TapEvent te = (TapEvent)ge;
        switch (te.getTapID()) {
        case TapEvent.BUTTON_DOWN:
          cell.setFillColor(cellPressedFillColor);
          break;
        case TapEvent.BUTTON_UP:
          cell.setFillColor(cellFillColor);
View Full Code Here

Examples of org.mt4j.input.inputProcessors.componentProcessors.tapProcessor.TapEvent

    outerShape.unregisterAllInputProcessors();
    //When we click on the outershape move the knob in that direction a certain step
    outerShape.registerInputProcessor(new TapProcessor(applet, 35));
    outerShape.addGestureListener(TapProcessor.class, new IGestureEventListener() {
      public boolean processGestureEvent(MTGestureEvent ge) {
        TapEvent te = (TapEvent)ge;
        switch (te.getTapID()) {
        case TapEvent.BUTTON_CLICKED:
          Vector3D screenPos = te.getLocationOnScreen();
          Vector3D intersection = outerShape.getIntersectionGlobal(Tools3D.getCameraPickRay(app, outerShape, screenPos.x, screenPos.y));
          if (intersection != null){
            //Get the intersection point into knob local relative space
            Vector3D localClickPos = knob.globalToLocal(intersection);
            Vector3D knobCenterLocal = knob.getCenterPointLocal();
View Full Code Here

Examples of org.mt4j.input.inputProcessors.componentProcessors.tapProcessor.TapEvent

    tapOnly.setText("Tap me! ---");
    this.clearAllGestures(tapOnly);
    tapOnly.registerInputProcessor(new TapProcessor(app));
    tapOnly.addGestureListener(TapProcessor.class, new IGestureEventListener() {
      public boolean processGestureEvent(MTGestureEvent ge) {
        TapEvent te = (TapEvent)ge;
        switch (te.getId()) {
        case MTGestureEvent.GESTURE_DETECTED:
          tapOnly.setFillColor(new MTColor(220,220,220,255));
          break;
        case MTGestureEvent.GESTURE_UPDATED:
          break;
        case MTGestureEvent.GESTURE_ENDED:
          if (te.isTapped()){
            if (tapOnly.getText().endsWith("--"))
              tapOnly.setText("Tap me! -|-");
            else
              tapOnly.setText("Tap me! ---")
          }
          tapOnly.setFillColor(textAreaColor);
          break;
        }
        return false;
      }
    });
    this.getCanvas().addChild(tapOnly);
    tapOnly.setAnchor(PositionAnchor.UPPER_LEFT);
    tapOnly.setPositionGlobal(new Vector3D(1*horizontalPad,0,0));
   
    //Double Tap gesture
    final MTTextArea doubleTap = new MTTextArea(mtApplication, font);
    doubleTap.setFillColor(textAreaColor);
    doubleTap.setStrokeColor(textAreaColor);
    doubleTap.setText("Double Tap me! ---");
    this.clearAllGestures(doubleTap);
    doubleTap.registerInputProcessor(new TapProcessor(app, 25, true, 350));
    doubleTap.addGestureListener(TapProcessor.class, new IGestureEventListener() {
      public boolean processGestureEvent(MTGestureEvent ge) {
        TapEvent te = (TapEvent)ge;
        if (te.isDoubleTap()){
          if (doubleTap.getText().endsWith("--"))
            doubleTap.setText("Double Tap me! -|-");
          else
            doubleTap.setText("Double Tap me! ---")
        }
View Full Code Here

Examples of org.mt4j.input.inputProcessors.componentProcessors.tapProcessor.TapEvent

   */
  public boolean processGestureEvent(MTGestureEvent g) {
//    width = polyButton.getWidthLocal();//
   
    if (g instanceof TapEvent){
      TapEvent clickEvent = (TapEvent)g;
     
     
      if (g.getTargetComponent() instanceof MTComponent){
        MTComponent comp = (MTComponent)g.getTargetComponent();
       
        //Hack for keeping up with the buttons current width if it was changed
        //due to .scale or something sometime
        if (comp instanceof IclickableButton) {
          IclickableButton button = (IclickableButton) comp;
          if (!button.isSelected()){
//            this.width = ((AbstractShape)button).getWidthLocal();
            this.width = getCurrentUnscaledWidth();
           
//            this.getReferenceComp().getWidthVectObjSpace();
//            //TODO aktuelle width holen zu comptoscale relative
//            this.width = this.getReferenceComp().getWidthLocal();
          }
        }
       
        switch (clickEvent.getId()) {
        case MTGestureEvent.GESTURE_DETECTED:
//          if (comp.isGestureAllowed(TapAnalyzer.class)
//            && comp.isVisible()
//          ){
            comp.sendToFront();
View Full Code Here

Examples of org.mt4j.input.inputProcessors.componentProcessors.tapProcessor.TapEvent

      keyPressIndent = 3;
    }
   
    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()) {
          case TapEvent.BUTTON_DOWN:
            clickedKey.setPressed(true);
            float keyHeight = clickedKey.getHeightXY(TransformSpace.RELATIVE_TO_PARENT);
            float keyWidth   = clickedKey.getWidthXY(TransformSpace.RELATIVE_TO_PARENT);
           
View Full Code Here

Examples of org.mt4j.input.inputProcessors.componentProcessors.tapProcessor.TapEvent

   
   
    this.registerInputProcessor(new TapProcessor(app, 30));
    this.addGestureListener(TapProcessor.class, new IGestureEventListener() {
      public boolean processGestureEvent(MTGestureEvent ge) {
        TapEvent te = (TapEvent)ge;
        if (te.isTapped()){
          if (movieClip != null && movieClip.movie != null){
//            if (movieClip.getMovie().isPlaying()){
            if (!playSymbol.isVisible()){
//              System.out.println("Pause!");
              if (playSymbol != null){
View Full Code Here

Examples of org.mt4j.input.inputProcessors.componentProcessors.tapProcessor.TapEvent

        //Dont do every frame! Duration is only valid if playing..
        slider.setValueRange(0, m.duration());
       
        slider.getOuterShape().addGestureListener(TapProcessor.class, new IGestureEventListener() {
          public boolean processGestureEvent(MTGestureEvent ge) {
            TapEvent te = (TapEvent)ge;
            switch (te.getTapID()) {
            case TapEvent.BUTTON_DOWN:
              stopSliderAdvance = true;
              break;
            case TapEvent.BUTTON_UP:
              stopSliderAdvance = false;
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.