Examples of AbstractShape


Examples of org.apache.poi.hssf.model.AbstractShape

      {
        convertGroup( (HSSFShapeGroup) shape, escherParent, shapeToObj );
      }
      else
      {
        AbstractShape shapeModel = AbstractShape.createShape(
            shape,
            drawingManager.allocateShapeId(drawingGroupId) );
        shapeToObj.put( findClientData( shapeModel.getSpContainer() ), shapeModel.getObjRecord() );
        if ( shapeModel instanceof TextboxShape )
        {
          EscherRecord escherTextbox = ( (TextboxShape) shapeModel ).getEscherTextbox();
          shapeToObj.put( escherTextbox, ( (TextboxShape) shapeModel ).getTextObjectRecord() );
          //          escherParent.addChildRecord(escherTextbox);

          if ( shapeModel instanceof CommentShape ){
            CommentShape comment = (CommentShape)shapeModel;
            tailRec.add(comment.getNoteRecord());
          }

        }
        escherParent.addChildRecord( shapeModel.getSpContainer() );
      }
    }
//    drawingManager.newCluster( (short)1 );
//    drawingManager.newCluster( (short)2 );
View Full Code Here

Examples of org.apache.poi.hssf.model.AbstractShape

            {
                convertGroup( (HSSFShapeGroup) shape, escherParent, shapeToObj );
            }
            else
            {
                AbstractShape shapeModel = AbstractShape.createShape(
                        shape,
                        drawingManager.allocateShapeId(drawingGroupId) );
                shapeToObj.put( findClientData( shapeModel.getSpContainer() ), shapeModel.getObjRecord() );
                if ( shapeModel instanceof TextboxShape )
                {
                    EscherRecord escherTextbox = ( (TextboxShape) shapeModel ).getEscherTextbox();
                    shapeToObj.put( escherTextbox, ( (TextboxShape) shapeModel ).getTextObjectRecord() );
                    //                    escherParent.addChildRecord(escherTextbox);
                   
                    if ( shapeModel instanceof CommentShape ){
                        CommentShape comment = (CommentShape)shapeModel;
                        tailRec.add(comment.getNoteRecord());
                    }

                }
                escherParent.addChildRecord( shapeModel.getSpContainer() );
            }
        }
//        drawingManager.newCluster( (short)1 );
//        drawingManager.newCluster( (short)2 );
View Full Code Here

Examples of org.apache.poi.hssf.model.AbstractShape

            {
                convertGroup( (HSSFShapeGroup) shape, escherParent, shapeToObj );
            }
            else
            {
                AbstractShape shapeModel = AbstractShape.createShape(
                        shape,
                        drawingManager.allocateShapeId(drawingGroupId) );
                shapeToObj.put( findClientData( shapeModel.getSpContainer() ), shapeModel.getObjRecord() );
                if ( shapeModel instanceof TextboxShape )
                {
                    EscherRecord escherTextbox = ( (TextboxShape) shapeModel ).getEscherTextbox();
                    shapeToObj.put( escherTextbox, ( (TextboxShape) shapeModel ).getTextObjectRecord() );
                    //                    escherParent.addChildRecord(escherTextbox);
                }
                escherParent.addChildRecord( shapeModel.getSpContainer() );
            }
        }
    }
View Full Code Here

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

  public AbstractShape getShape(){
    this.endPath();
   
    ArrayList<Vertex[]> contours = this.pathHandler.getContours();
    Vertex[] allPoints = this.pathHandler.getPathPointsArray();
    AbstractShape returnComponent = null;
    //Check for convexity
    int convexity = ConvexityUtil.classifyPolygon2(allPoints.length, allPoints);
    switch (convexity) {
      case ConvexityUtil.NotConvexDegenerate:
//        logger.debug("not Convex Degenerate");
      case ConvexityUtil.NotConvex:
//        logger.debug("not convex");
        returnComponent = createComplexPoly(contours, MTComplexPolygon.WINDING_RULE_ODD);
        break;
      case ConvexityUtil.ConvexDegenerate:
//        logger.debug("convex degenerate");
      case ConvexityUtil.ConvexCW:
//        logger.debug("convex clockwise");
      case ConvexityUtil.ConvexCCW:
//        logger.debug("convex counterclockwise");
        returnComponent = createPoly(allPoints);
        break;
      default:
        break;
    }
   
    //Create some default texture coords
    if (returnComponent != null && returnComponent.hasBounds() && returnComponent.getBounds() instanceof BoundsZPlaneRectangle){
      BoundsZPlaneRectangle bounds = (BoundsZPlaneRectangle) returnComponent.getBounds();
      float width = bounds.getWidthXY(TransformSpace.LOCAL);
      float height = bounds.getHeightXY(TransformSpace.LOCAL);
      float upperLeftX = bounds.getVectorsLocal()[0].x;
      float upperLeftY = bounds.getVectorsLocal()[0].y;
      Vertex[] verts = returnComponent.getVerticesLocal();
      for (int i = 0; i < verts.length; i++) {
        Vertex vertex = verts[i];
        vertex.setTexCoordU((vertex.x-upperLeftX)/width);
        vertex.setTexCoordV((vertex.y-upperLeftY)/height);
        //System.out.println("TexU:" + vertex.getTexCoordU() + " TexV:" + vertex.getTexCoordV());
      }
      returnComponent.getGeometryInfo().updateTextureBuffer(returnComponent.isUseVBOs());
    }
    return returnComponent;
  }
View Full Code Here

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

  private TileSide getBottomOfUpperTile(List<AbstractShape> list, int currentI, int currentJ){
    if (currentI-1 < 0){
      return TileSide.linear;
    }
    for (Iterator<AbstractShape> iterator = list.iterator(); iterator.hasNext();) {
      AbstractShape tile = (AbstractShape) iterator.next();
      int i = (Integer) tile.getUserData("i");
      int j = (Integer) tile.getUserData("j");
      if (i == currentI -1 && j == currentJ){
        return (TileSide) tile.getUserData("bottom");
      }
    }
    return TileSide.linear;
  }
View Full Code Here

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

  private TileSide getRightOfLeftTile(List<AbstractShape> list, int currentI, int currentJ){
    if (currentJ-1 < 0){
      return TileSide.linear;
    }
    for (Iterator<AbstractShape> iterator = list.iterator(); iterator.hasNext();) {
      AbstractShape tile = (AbstractShape) iterator.next();
      int i = (Integer) tile.getUserData("i");
      int j = (Integer) tile.getUserData("j");
      if (i == currentI && j == currentJ-1){
        return (TileSide) tile.getUserData("right");
      }
    }
    return TileSide.linear;
  }
View Full Code Here

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

    MTComponent[] tags = tagContainer.getChildren();
    float scX = 1f/scale;
    for (int i = 0; i < tags.length; i++) {
      MTComponent baseComponent = tags[i];
      if (baseComponent instanceof AbstractShape) {
        AbstractShape shape = (AbstractShape) baseComponent;
//        System.out.println("Scaling: " + scX + " " + scY);
//        shape.scale(scX, scY, 1, shape.getCenterPointGlobal(), TransformSpace.GLOBAL);
        shape.scale(scX, scX, 1, shape.getCenterPointRelativeToParent(), TransformSpace.RELATIVE_TO_PARENT);
      }
    }
  }
View Full Code Here

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

      c.destroy();
    }
    PImage p = getMTApplication().loadImage(imagesPath + imageName);
    AbstractShape[] tiles = pf.createTiles(p, this.horizontalTiles, this.verticalTiles);
    for (int i = 0; i < tiles.length; i++) {
      final AbstractShape sh = tiles[i];
      //Delay to smooth the animation because of loading hickups
      final float x = ToolsMath.getRandom(0, MT4jSettings.getInstance().getWindowWidth());
      final float y = ToolsMath.getRandom(0, MT4jSettings.getInstance().getWindowHeight());
      registerPreDrawAction(new IPreDrawAction() {
        public void processAction() {
          getMTApplication().invokeLater(new Runnable() {
            public void run() {
              registerPreDrawAction(new IPreDrawAction() {
                public void processAction() {
                  getMTApplication().invokeLater(new Runnable() {
                    public void run() {
                      puzzleGroup.addChild(sh);
                      sh.tweenTranslateTo(x, y, 0, 400, 0f, 1.0f);
                    }
                  });
                }
                public boolean isLoop() {return false;}
              });
            }
          });
        }
        public boolean isLoop() {return false;}
      });
      sh.rotateZ(sh.getCenterPointRelativeToParent(), ToolsMath.getRandom(0, 359));
    }
  }
View Full Code Here

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

    if (inEvt instanceof MTFiducialInputEvt) {
      MTFiducialInputEvt fEvt = (MTFiducialInputEvt)inEvt;
      int fID = fEvt.getFiducialId();
      Vector3D position = fEvt.getPosition();

      AbstractShape comp;
      switch (fEvt.getId()) {
      case MTFiducialInputEvt.INPUT_DETECTED:
        //Create a new component for the fiducial
        AbstractShape newComp = createComponent(fID, position);
        fiducialIDToComp.put(fID, newComp); //Map id to component
        //Move component to fiducial position
        newComp.setPositionGlobal(position);
        //Save the absolute rotation angle in the component for late
        newComp.setUserData("angle", fEvt.getAngle());
        //Rotate the component
        newComp.rotateZ(newComp.getCenterPointRelativeToParent(), MTApplication.degrees(fEvt.getAngle()));
        //Add the component to the canvas to draw it
        getCanvas().addChild(newComp)
        break;
      case MTFiducialInputEvt.INPUT_UPDATED:
        //Retrieve the corresponding component for the fiducial ID from the map
View Full Code Here

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

   * @param windingRule the winding rule
   *
   * @return the live polygon component
   */
  private AbstractShape getLivePolygonComponent(SVGOMPolygonElement polyElem, boolean noFill, int windingRule){
    AbstractShape returnComponent = null;
   
    //Create Vertex array from points
      SVGPointList pointList = polyElem.getPoints();
      Vertex[] vertices = new Vertex[pointList.getNumberOfItems()];
      for (int i = 0; i < pointList.getNumberOfItems(); i++) {
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.