Examples of addGestureListener()


Examples of org.mt4j.components.MTComponent.addGestureListener()

       
        group.registerInputProcessor(new RotateProcessor(pa));
        group.addGestureListener(RotateProcessor.class, defaultRotateAction);
       
        group.registerInputProcessor(new ScaleProcessor(pa));
        group.addGestureListener(ScaleProcessor.class,  defaultScaleAction);
       
        ArrayList<MTComponent> groupChildren = new ArrayList<MTComponent>();
        //Traverse the children and add them to a new arraylist
        traverseChildren(gElem, groupChildren);
       
View Full Code Here

Examples of org.mt4j.components.clusters.Cluster.addGestureListener()

          //Add gestures //TODO what about the isRotatable/dragable settings of the childs?
          //TODO What if we want to click a item of the cluster only? ->Maybe cluster should
          //delegate other gestures to the components..
//          cluster.assignGestureClassAndAction(DragGestureAnalyzer.class,    new DefaultDragAction());
          cluster.registerInputProcessor(new DragProcessor(pa));
          cluster.addGestureListener(DragProcessor.class, new DefaultDragAction());
         
          cluster.addGestureListener(DragProcessor.class, new InertiaDragAction());
         
          cluster.registerInputProcessor(new RotateProcessor(pa));
          cluster.addGestureListener(RotateProcessor.class, new DefaultRotateAction());
View Full Code Here

Examples of org.mt4j.components.clusters.Cluster.addGestureListener()

          //delegate other gestures to the components..
//          cluster.assignGestureClassAndAction(DragGestureAnalyzer.class,    new DefaultDragAction());
          cluster.registerInputProcessor(new DragProcessor(pa));
          cluster.addGestureListener(DragProcessor.class, new DefaultDragAction());
         
          cluster.addGestureListener(DragProcessor.class, new InertiaDragAction());
         
          cluster.registerInputProcessor(new RotateProcessor(pa));
          cluster.addGestureListener(RotateProcessor.class, new DefaultRotateAction());
         
          cluster.registerInputProcessor(new ScaleProcessor(pa));
View Full Code Here

Examples of org.mt4j.components.clusters.Cluster.addGestureListener()

          cluster.addGestureListener(DragProcessor.class, new DefaultDragAction());
         
          cluster.addGestureListener(DragProcessor.class, new InertiaDragAction());
         
          cluster.registerInputProcessor(new RotateProcessor(pa));
          cluster.addGestureListener(RotateProcessor.class, new DefaultRotateAction());
         
          cluster.registerInputProcessor(new ScaleProcessor(pa));
          cluster.addGestureListener(ScaleProcessor.class,  new DefaultScaleAction());
         
          dse.getSelectionPoly().setFillColor(new MTColor(100,150,250, 50));
View Full Code Here

Examples of org.mt4j.components.clusters.Cluster.addGestureListener()

         
          cluster.registerInputProcessor(new RotateProcessor(pa));
          cluster.addGestureListener(RotateProcessor.class, new DefaultRotateAction());
         
          cluster.registerInputProcessor(new ScaleProcessor(pa));
          cluster.addGestureListener(ScaleProcessor.class,  new DefaultScaleAction());
         
          dse.getSelectionPoly().setFillColor(new MTColor(100,150,250, 50));
         
          dse.getSelectionPoly().setGestureAllowance(DragProcessor.class, true);
          dse.getSelectionPoly().setGestureAllowance(RotateProcessor.class, true);
View Full Code Here

Examples of org.mt4j.components.visibleComponents.shapes.AbstractShape.addGestureListener()

      restoreButton.setFillColor(new MTColor(255, 255, 255, buttonOpacity));
      restoreButton.setNoStroke(true);
      restoreButton.setVisible(false);
      this.addChild(restoreButton);
     
      menuShape.addGestureListener(DragProcessor.class, new IGestureEventListener() {
        public boolean processGestureEvent(MTGestureEvent ge) {
          DragEvent de = (DragEvent)ge;
          switch (de.getId()) {
          case MTGestureEvent.GESTURE_DETECTED:
            restoreButton.setVisible(true);
View Full Code Here

Examples of org.mt4j.components.visibleComponents.shapes.AbstractShape.addGestureListener()

          return false;
        }
      });
    }else{
      if (scene != null){
        menuShape.addGestureListener(DragProcessor.class, new IGestureEventListener() {
          public boolean processGestureEvent(MTGestureEvent ge) {
            DragEvent de = (DragEvent)ge;
            switch (de.getId()) {
            case MTGestureEvent.GESTURE_DETECTED:
              closeButton.setVisible(true);
View Full Code Here

Examples of org.mt4j.components.visibleComponents.shapes.MTEllipse.addGestureListener()

                   
                    tagContainer.addChild(tagCircle);
                   
                    tagCircle.unregisterAllInputProcessors();
                    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()) {
View Full Code Here

Examples of org.mt4j.components.visibleComponents.shapes.MTEllipse.addGestureListener()

          //will be executed the next time the mt4j thread runs.
          instance.invokeLater(new Runnable() {
            public void run() {
              MTEllipse e = new MTEllipse(instance, new Vector3D(0,0), ToolsMath.getRandom(50, 150),ToolsMath.getRandom(50, 150));
              e.setFillColor(new MTColor(ToolsMath.getRandom(50,255),ToolsMath.getRandom(50,255),ToolsMath.getRandom(50,255)));
              e.addGestureListener(DragProcessor.class, new InertiaDragAction());
              instance.getCurrentScene().getCanvas().addChild(e);
              e.setPositionGlobal(new Vector3D(ToolsMath.getRandom(0, instance.width), ToolsMath.getRandom(0, instance.height)));
            }
          });
         
View Full Code Here

Examples of org.mt4j.components.visibleComponents.shapes.MTRectangle.addGestureListener()

          //will be executed the next time the mt4j thread runs.
          instance.invokeLater(new Runnable() {
            public void run() {
              MTRectangle r = new MTRectangle(0,0,ToolsMath.getRandom(50, 250),ToolsMath.getRandom(50, 250), instance);
              r.setFillColor(new MTColor(ToolsMath.getRandom(50,255),ToolsMath.getRandom(50,255),ToolsMath.getRandom(50,255)));
              r.addGestureListener(DragProcessor.class, new InertiaDragAction());
              instance.getCurrentScene().getCanvas().addChild(r);
              r.setPositionGlobal(new Vector3D(ToolsMath.getRandom(0, instance.width), ToolsMath.getRandom(0, instance.height)));
            }
          });
         
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.