Examples of MTComponent


Examples of org.mt4j.components.MTComponent

    //Add a scene to the mt application
    this.scene = new DummyScene(app, "Dummy Scene");
    app.addScene(scene);
   
    //Set up components
    parent = new MTComponent(app);
    getCanvas().addChild(parent);
  }
View Full Code Here

Examples of org.mt4j.components.MTComponent

        assertEquals(0, parent.getChildCount());
        int numChildren = Math.round(ToolsMath.getRandom(1, 10));
        assertTrue("children created and added: " + numChildren  + " -> >= 1 && <= 10", numChildren >= 1 && numChildren <= 10);

        for (int i = 0; i < numChildren; i++) {
          MTComponent newChild = new MTComponent(app);
          parent.addChild(newChild);
        }
        assertTrue("children list not emtpy", parent.getChildren().length > 0);

        assertEquals("parent Childcount == created children number", numChildren, parent.getChildCount());

        MTComponent first = parent.getChildByIndex(0);
        //parent.sendChildToFront(first);
        first.sendToFront();
        MTComponent last = parent.getChildByIndex(parent.getChildCount()-1);
        assertEquals("Sent first to front (last) - is it there now?" , first, last);

       
        int id = first.getID();
        MTComponent childByID = parent.getChildbyID(id);
        assertEquals(first, childByID);
       
        assertTrue(parent.containsChild(first));
        assertTrue(parent.containsDirectChild(first));
       
View Full Code Here

Examples of org.mt4j.components.MTComponent

   * Disable and delete children display lists.
   */
  public void disableAndDeleteChildrenDisplayLists() {
    MTComponent[] childs = this.getChildren();
    for (int i = 0; i < childs.length; i++) {
      MTComponent child = childs[i];
      if (child instanceof MTPolygon) {
        MTPolygon poly = (MTPolygon) child;
        poly.disableAndDeleteDisplayLists();
      }
    }
View Full Code Here

Examples of org.mt4j.components.MTComponent

   * @param pa the pa
   *
   * @return the mT base component
   */
  public MTComponent loadSVGFile(String fileName, PApplet pa){
    MTComponent returnComponent = null;
   
    //Get the object back out of the cache
    returnComponent = (MTComponent) cache.retrieve(fileName);
   
    if (returnComponent == null){
      System.out.println("Found no cached obj for filepath: " + fileName);
      if (new File(fileName).exists()){
//        BatikSvgParser batikSvgParser = new BatikSvgParser(pa);
//        SVGDocument svgDoc = batikSvgParser.parseSvg(fileName);
//        MTBaseComponent[] comps = batikSvgParser.getCreatedSvgComponents(svgDoc);
//        MTBaseComponent group = new MTBaseComponent(pa);
//        //Wrap the svg in a group
//        group.setName("svg: " + fileName);
//        group.addChildren(comps);
       
        SVGLoader batikSvgParser = new SVGLoader(pa);
        MTComponent svg = batikSvgParser.loadSvg(fileName);
       
        returnComponent = svg;
       
        //TODO store copy? because sonst wird matrix etc ver�ndert wenn damit gearbeitet wurde
        cache.store(fileName, svg);
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.