Package es.iiia.shapegrammar.shape

Examples of es.iiia.shapegrammar.shape.ShapeModel.moveToCenter()


        double resize = (iconSize - 8)
            / (bounds.getWidth() > bounds.getHeight() ? bounds
                .getWidth() : bounds.getHeight());
        // resize graphics
        ShapeModel newShape = shape.clone();
        newShape.moveToCenter();
        newShape.scale(resize, resize);
        // now move it to centre of the icon
        newShape.translate(iconSize / 2, iconSize  / 2);
               
       
View Full Code Here


        double resize = (iconSize - 8)
            / (bounds.getWidth() > bounds.getHeight() ? bounds
                .getWidth() : bounds.getHeight());
        // resize graphics
        ShapeModel newShape = shape.clone();
        newShape.moveToCenter();
        newShape.scale(resize, resize);
        // now move it to centre of the icon
        newShape.translate(iconSize / 2, iconSize  / 2);
               
       
View Full Code Here

    // clear basket
    this.shapeBasket.clear();

    // init start state
    ShapeModel startShape = this.getGrammar().getStartShape().clone();
    startShape.moveToCenter();
    this.startState = new StateExecution(startShape, new AffineTransform());

    // add first shape to the basket
    this.shapeBasket.add(getStartState().getShape());
View Full Code Here

    }
   
    System.out.println("#$#$##: " + getStartState());
   
    ShapeModel shape = super.getShapeBasket().get(0).clone();
    shape.moveToCenter();
    shape.maximize();
   
    // get requested ammount of subshapes
    ArrayList<StateExecution> states = this.getNexts(monitor, shape, possibleStates);
   
View Full Code Here

  // rule
  public boolean executeNext(IProgressMonitor monitor) {
    // in the basket always first is our main shape
   
    ShapeModel shape = super.getShapeBasket().get(0).clone();
    shape.moveToCenter();
    shape.maximize();

    // get next state
    StateExecution state = this.getNext(monitor, shape);
View Full Code Here

          Debugger.getInstance().addMessage("No rules for: " + grammarShape.getName());
          continue;
        }
 
        ShapeModel clone = grammarShape.clone();
        clone.moveToCenter();
 
        // TODO: Allow to stop even in subshape detection
        try {
          ExecutionReport.startShape(grammarShape.getName());
          subShapes = ShapeTools.findSubShape(
View Full Code Here

  public ShapeModel getCenteredShape() {
    ShapeModel clonedShape = this.shape.clone();

    // center the shape, send it to [0,0]
    clonedShape.moveToCenter();

    return clonedShape;
  }

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.