Package org.mt4j.components.visibleComponents.shapes

Examples of org.mt4j.components.visibleComponents.shapes.MTLine


        float y1 = line.getY1().getBaseVal().getValue();
        float x2 = line.getX2().getBaseVal().getValue();
        float y2 = line.getY2().getBaseVal().getValue();
        //logger.debug("Line x1: " + x1 + ",y1:" + y1 + ",x2:" + x2 + ",y2:" + y2);
       
        MTLine comp = new MTLine(pa, x1,y1 ,x2,y2);
      
        try{
          comp.setLocalMatrix(currentLocalTransformMatrix);
        }catch(Exception e){
          logger.error(e.getMessage());
        }
        returnComp = comp;
      }else if (gfxElem instanceof SVGOMClipPathElement){
      }else if (gfxElem instanceof SVGOMDefsElement){
      }else if (gfxElem instanceof SVGOMMaskElement){
      }else if (gfxElem instanceof SVGOMSwitchElement){
      }else if (gfxElem instanceof SVGOMFlowRootElement){
      }else if (gfxElem instanceof SVGURIReferenceGraphicsElement){
      }else if (gfxElem instanceof BindableElement){
      }else if (gfxElem instanceof SVGOMForeignObjectElement){
      }else if (gfxElem instanceof SVGOMToBeImplementedElement){
      }
     
      //Do the finishing touch of the svg graphics element
      if (returnComp != null){
        returnComp.setName(gfxElem.getTagName());
       
        //Set style infos
        if (returnComp instanceof AbstractVisibleComponent){
          AbstractVisibleComponent comp = (AbstractVisibleComponent)returnComp;
          //Set Fill
          comp.setFillColor(new MTColor(fillR, fillG, fillB, fillOpacity));
          comp.setNoFill(noFill);
          //Set Stroke
          comp.setStrokeColor(new MTColor(strokeR, strokeG, strokeB, strokeOpacity));
          //Opengl cant handle big lines well
          //So cap at width 3
          if (strokeWidth > 2.0f)
            strokeWidth = 2.0f;
          comp.setStrokeWeight(strokeWidth);
          comp.setNoStroke(noStroke);
          //Other
          comp.setDrawSmooth(true);
          comp.setPickable(false);
         
          //Hack for smoothing non stroked components with a stroke same as fillcolor
          if (comp.isNoStroke()
           && linearGradient == null
          ){ 
            comp.setStrokeColor(new MTColor(fillR, fillG, fillB, fillOpacity)); //fillOpacity
            comp.setStrokeWeight(0.6f);
            //Ellipse doesent smooth right with 0.1f strokeweight
            if (comp instanceof MTEllipse){
              comp.setStrokeWeight(1.0f);
            }
            comp.setNoStroke(false);
          }

          //Some settings for Geometric shapes (actually should all be)
          if (comp instanceof AbstractShape ){
            AbstractShape shape = (AbstractShape)comp;
View Full Code Here


   
    //Create borders around the screen
    this.createScreenBorders(physicsContainer);
   
    //Create gamefield marks
    MTLine line = new MTLine(mtApplication, mtApplication.width/2f/scale, 0, mtApplication.width/2f/scale, mtApplication.height/scale);
    line.setPickable(false);
//    line.setStrokeColor(new MTColor(0,0,0));
    line.setStrokeColor(new MTColor(150,150,150));
    line.setStrokeWeight(0.5f);
    physicsContainer.addChild(line);
   
    MTEllipse centerCircle = new MTEllipse(mtApplication, new Vector3D(mtApplication.width/2f/scale, mtApplication.height/2f/scale), 80/scale, 80/scale);
    centerCircle.setPickable(false);
    centerCircle.setNoFill(true);
View Full Code Here

                    new Vertex(0,0,100)
                }
                ,getMTApplication());
            getCanvas().addChild(poly);
           
        MTLine line = new MTLine(getMTApplication(), new Vertex(30,30), new Vertex(150,110));
        getCanvas().addChild(line);
       
        MTRectangle r1 = new MTRectangle(10,10, 200,100, getMTApplication());
        getCanvas().addChild(r1);
        assertEquals(getCanvas().getChildren()[3], r1);
View Full Code Here

TOP

Related Classes of org.mt4j.components.visibleComponents.shapes.MTLine

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.