Package org.mt4j.util

Examples of org.mt4j.util.MTColor


    if (this.textInputListener == null){
      final MTTextArea t = new MTTextArea(pa, fontForTextField);
      this.textInputListener = t;
     
      t.setExpandDirection(ExpandDirection.UP);
      t.setStrokeColor(new MTColor(0,0 , 0, 255));
      t.setFillColor(new MTColor(205,200,177, 255));
     
      t.setGestureAllowance(DragProcessor.class, true);
      t.setGestureAllowance(RotateProcessor.class, false);
      t.setGestureAllowance(ScaleProcessor.class, false);
     
View Full Code Here


    runTest(new TestRunnable() {
      @Override
      public void runMTTestCode() {
        //Create 3 rectangles
        MTRectangle rect1 = new MTRectangle(100,100,getMTApplication());
        rect1.setFillColor(new MTColor(255,0,0));
        MTRectangle rect2 = new MTRectangle(100,100,getMTApplication());
        rect2.setFillColor(new MTColor(0,255,0));
        MTRectangle rect3 = new MTRectangle(100,100,getMTApplication());
        rect3.setFillColor(new MTColor(0,0,255));
       
        parent.addChild(rect1);
        parent.addChild(rect2);
        parent.addChild(rect3);
        assertEquals(3, parent.getChildCount());
View Full Code Here

 
  /**
   * Inits the.
   */
  private void init(){
      this.currentColor = new MTColor(255,255,255,255);
//      this.setNoFill(true);
     
      this.selectionRect = new MTRectangle(x,y, 3,3, app);
      this.selectionRect.setStrokeColor(new MTColor(150,150,150,255));
      this.selectionRect.setNoFill(true);
      this.selectionRect.setPickable(false);
      this.selectionRect.unregisterAllInputProcessors();
      this.addChild(selectionRect);
     
View Full Code Here

    this.app = pApplet;
    this.selected = false;
    stopSliderAdvance = false;
   
    this.setSizeLocal(105 + 2*sideBarWidth, 127 + topBarHeight + bottomBarHeight);
    this.setStrokeColor(new MTColor(0,0,0));
    this.setFillColor(new MTColor(50,50,50,200));
//    this.setNoFill(true);
   
    //Create movieclip child
    Vertex movieClipUpperLeft = new Vertex(upperLeft);
    movieClipUpperLeft.y += topBarHeight;
    movieClipUpperLeft.x += sideBarWidth;
    this.movieClip = new MovieClip(movieFile, movieClipUpperLeft, ifps, pApplet);
    this.movieClip.setStrokeColor(new MTColor(0,0,0));
    this.movieClip.setStrokeWeight(0.5f);
    this.movieClip.setNoFill(true);
    this.movieClip.setNoStroke(true);
    this.addChild(movieClip);
   
View Full Code Here

        new Vertex(centerPoint.x - radiusX/3f, centerPoint.y - radiusY/3f, centerPoint.z),
      };
      MTPolygon triangle = new MTPolygon(pApplet, vertices);
      triangle.setPickable(false);
      triangle.setNoFill(true);
      triangle.setStrokeColor(new MTColor(0,0,0,255));
      triangle.setStrokeWeight(1.5f);
      this.addChild(triangle);
     
      this.setComposite(true);
      this.setPickable(false); //We tap on the movie itself instead
      this.setFillColor(new MTColor(150,150,150,255));
      this.setStrokeColor(new MTColor(0,0,0,255));
      this.setStrokeWeight(1.5f);
    }
View Full Code Here

        //Create movie seek Slider
        float sliderXPadding = 10;
        float sliderYPadding = 3;
        float sliderHeight = bottomBarHeight - 2*sliderYPadding;
        slider = new MTSlider(lowerLeft.x + sliderXPadding, lowerLeft.y - sliderHeight - sliderYPadding, MTMovieClip.this.getWidthXY(TransformSpace.LOCAL) - sliderXPadding*2, sliderHeight, 0, 10, app);
        slider.getOuterShape().setFillColor(new MTColor(0, 0, 0, 80));
        slider.getOuterShape().setStrokeColor(new MTColor(0, 0, 0, 80));
        slider.getKnob().setFillColor(new MTColor(100, 100, 100, 80));
        slider.getOuterShape().setStrokeColor(new MTColor(100, 100, 100, 80));
        slider.getKnob().addGestureListener(DragProcessor.class, new IGestureEventListener() {
          public boolean processGestureEvent(MTGestureEvent ge) {
            DragEvent de = (DragEvent)ge;
            switch (de.getId()) {
            case MTGestureEvent.GESTURE_DETECTED:
              stopSliderAdvance = true;
              break;
            case MTGestureEvent.GESTURE_UPDATED:
              break;
            case MTGestureEvent.GESTURE_ENDED:
              if (movieClip != null && movieClip.getMovie() != null /*&& movieClip.getMovie().isPlaying()*/){
                float currValue = slider.getValue();
                movieClip.jump(currValue);
              }
              stopSliderAdvance = false;
              break;
            default:
              break;
            }
            return false;
          }
        });
        //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;
              break;
            case TapEvent.BUTTON_CLICKED:
              if (movieClip != null && movieClip.getMovie() != null /*&& movieClip.getMovie().isPlaying()*/){
                float currValue = slider.getValue();
                movieClip.jump(currValue);
              }
              stopSliderAdvance = false;
              break;
            default:
              break;
            }
            return false;
          }
        });
        if (app instanceof MTApplication) {
          MTApplication mtApp = (MTApplication) app;
          mtApp.invokeLater(new Runnable() {
            public void run() {
              MTMovieClip.this.addChild(slider);
            }
          });
        }else{
          this.addChild(slider);
        }
        slider.setVisible(true);
       
        //Create volume slider
        float volSliderWidth = this.getWidthXY(TransformSpace.LOCAL)/7f;
        float volSliderHeight = topBarHeight - 2*sliderYPadding;
        this.setAnchor(PositionAnchor.UPPER_LEFT);
        Vector3D movieUpperLeft = this.getPosition(TransformSpace.RELATIVE_TO_PARENT);
        volumeSlider = new MTSlider(movieUpperLeft.x + 1.5f, movieUpperLeft.y - volSliderHeight - 1.5f, volSliderWidth, volSliderHeight, 0, 1, app);
        volumeSlider.getOuterShape().setFillColor(new MTColor(0, 0, 0, 80));
        volumeSlider.getOuterShape().setStrokeColor(new MTColor(0, 0, 0, 80));
        volumeSlider.getKnob().setFillColor(new MTColor(100, 100, 100, 80));
        volumeSlider.getOuterShape().setStrokeColor(new MTColor(100, 100, 100, 80));
        if (app instanceof MTApplication) {
          MTApplication mtApp = (MTApplication) app;
          mtApp.invokeLater(new Runnable() {
            public void run() {
              MTMovieClip.this.addChild(volumeSlider);
View Full Code Here

TOP

Related Classes of org.mt4j.util.MTColor

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.