Package org.mt4j.input.inputProcessors.componentProcessors.tapProcessor

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


   */
  private void addTapProcessor(MTListCell cell, final ICreateScene createScene){
    cell.registerInputProcessor(new TapProcessor(app, 15));
    cell.addGestureListener(TapProcessor.class, new IGestureEventListener() {
      public boolean processGestureEvent(MTGestureEvent ge) {
        TapEvent te = (TapEvent)ge;
        if (te.isTapped()){
          //System.out.println("Clicked cell: " + te.getTargetComponent());
          final Iscene scene = createScene.getNewScene();
             
          if (!switchDirectlyToScene){//We have FBO support -> show scene in a window first
           
View Full Code Here


    listLabel.setPositionRelativeToParent(cell.getCenterPointLocal());
    cell.unregisterAllInputProcessors();
    cell.registerInputProcessor(new TapProcessor(p, 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

                    tagCircle.registerInputProcessor(new TapProcessor(p));
                    tagCircle.addGestureListener(TapProcessor.class, new IGestureEventListener(){
                      //@Override
                      public boolean processGestureEvent(MTGestureEvent g) {
                        if (g instanceof TapEvent) {
                          TapEvent ce = (TapEvent) g;
                          switch (ce.getTapID()) {
                          case TapEvent.BUTTON_DOWN:
                            IMTComponent3D e = ce.getTargetComponent();
                            Photo foto = tagToPhoto.get(e);
                            if (foto != null){
                              SinglePhotoLoader fotoLoader = new SinglePhotoLoader(foto, 50);
                              fotoLoader.start();
                             
View Full Code Here

    MTRoundRectangle r = getRoundRectWithText(0, 0, 120, 35, "New Puzzle", font);
    r.registerInputProcessor(new TapProcessor(getMTApplication()));
    r.addGestureListener(TapProcessor.class, new DefaultButtonClickAction(r));
    r.addGestureListener(TapProcessor.class, new IGestureEventListener() {
      public boolean processGestureEvent(MTGestureEvent ge) {
        TapEvent te = (TapEvent)ge;
        if (te.isTapped()){
          if (list.isVisible()){
            list.setVisible(false);
          }else{
            list.setVisible(true);
          }
View Full Code Here

    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

    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

    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

   */
  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

      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

   
   
    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

TOP

Related Classes of org.mt4j.input.inputProcessors.componentProcessors.tapProcessor.TapEvent

Copyright © 2018 www.massapicom. 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.