Examples of Rotation


Examples of com.barrybecker4.puzzle.tantrix.model.Rotation

        Location newLocation = HexUtil.getNeighborLocation(pivotTile.getLocation(), numRotations);
        Location origLocation = pivotTile.getLocation();

        numRotations = numRotations + 3 - directionToPivot;
        Rotation tileRotation = firstTile.getRotation().rotateBy(numRotations);

        TilePlacement previousTilePlacement = new TilePlacement(firstTile.getTile(), newLocation, tileRotation);
        tiles.add(previousTilePlacement);

        // this part almost the same as reverser
        for (int i=1; i<subPathTiles.size(); i++) {
            TilePlacement currentTile = subPathTiles.get(i);

            newLocation = findOtherOutgoingLocation(previousTilePlacement, origLocation);

            Rotation tileRotation1 = currentTile.getRotation().rotateBy(numRotations);
            TilePlacement currentTilePlacement = new TilePlacement(currentTile.getTile(), newLocation, tileRotation1);
            assert fits(currentTilePlacement, previousTilePlacement) :
                    " current=" + currentTilePlacement +" (" + i  +") did not fit with " + previousTilePlacement
                            + " when swapping " + subPath + " at pivot = "+ pivotTile + " with primColor = " + primaryColor
                            + " The outgoing locations from curent are "  + currentTilePlacement.getOutgoingPathLocations(primaryColor);
View Full Code Here

Examples of com.barrybecker4.puzzle.tantrix.model.Rotation

         int startDir = 0;
         startDir = findOutgoingDirection(pivotTile, newLocation);
         int numRotations = startDir - 3 - outgoingDirection;

         Location origLocation = pivotTile.getLocation();
         Rotation tileRotation = lastTile.getRotation().rotateBy(numRotations);
         TilePlacement previousTilePlacement = new TilePlacement(lastTile.getTile(), newLocation, tileRotation);
         tiles.add(previousTilePlacement);

         // this part is almost the same as in swapper
         for (int i = subPathTiles.size()-2; i >= 0; i--) {
View Full Code Here

Examples of com.jcloisterzone.board.Rotation

    public void castleDeployed(Castle castle1, Castle castle2) {
        Position p1 = castle1.getTile().getPosition();
        Position p2 = castle2.getTile().getPosition();
        Position pos;
        Rotation rot;

        if (p1.x == p2.x) {
            pos = p1.y < p2.y ? p1 : p2;
            rot = Rotation.R0;
        } else {
View Full Code Here

Examples of com.khorn.terraincontrol.util.Rotation

    {
        for (int treeNumber = 0; treeNumber < trees.size(); treeNumber++)
        {
            if (random.nextInt(100) < treeChances.get(treeNumber))
            {
                Rotation rotation = trees.get(treeNumber).canRotateRandomly() ? Rotation.getRandomRotation(random) : Rotation.NORTH;
                if (trees.get(treeNumber).spawnForced(world, random, rotation, x, y, z))
                {
                    // Success!
                    return true;
                }
View Full Code Here

Examples of com.sencha.gxt.chart.client.draw.Rotation

   * Sets the {@link Rotation} of the sprite using the given angle.
   *
   * @param degrees the angle of rotation
   */
  public void setRotation(double degrees) {
    setRotation(new Rotation(degrees));
  }
View Full Code Here

Examples of com.sencha.gxt.chart.client.draw.Rotation

   * @param x the x-coordinate of rotation
   * @param y the y-coordinate of rotation
   * @param degrees the angle of rotation
   */
  public void setRotation(double x, double y, double degrees) {
    setRotation(new Rotation(x, y, degrees));
  }
View Full Code Here

Examples of com.sencha.gxt.chart.client.draw.Rotation

    setFill(sprite.fill);
    if (sprite.translation != null) {
      setTranslation(new Translation(sprite.translation));
    }
    if (sprite.rotation != null) {
      setRotation(new Rotation(sprite.rotation));
    }
    if (sprite.scaling != null) {
      setScaling(new Scaling(sprite.scaling));
    }
    setClipRectangle(sprite.clipRectangle);
View Full Code Here

Examples of com.sencha.gxt.chart.client.draw.Rotation

                chart.getAnimationEasing());
            DrawFx.createRotationAnimator(sprite, 0, 0, degrees).run(chart.getAnimationDuration(),
                chart.getAnimationEasing());
          } else {
            sprite.setTranslation(middle.getX(), middle.getY());
            sprite.setRotation(new Rotation(degrees));
          }
          previousDegrees = degrees;
        }
        sprite.redraw();
      }
View Full Code Here

Examples of com.sencha.gxt.chart.client.draw.Rotation

    double y = 0;
    double maxHeight = height;
    boolean vertical = false;
    double furthestLabel = 0;
    int horizontalLabelPadding = textLabelPadding;
    Rotation labelRotation = labelConfig.getRotation();

    if (labelRotation != null) {
      vertical = (Math.floor((labelRotation.getDegrees() - 90) % 180) == 0);
    }

    for (int i = 0; i < ticks.size() / labelStepRatio; i++) {
      point = ticks.get(i * labelStepRatio);
      textLabel = getOrCreateLabel(i);

      bbox = textLabel.getBBox();

      maxHeight = Math.max(maxHeight, bbox.getHeight() + dashSize + horizontalLabelPadding);

      if (!vertical) {
        x = Math.floor(point.getX() - (bbox.getHeight() / 2.0));
      } else {
        x = Math.floor(point.getX() - (bbox.getWidth() / 2.0));
      }

      if (position == Position.TOP) {
        y = Math.floor(point.getY() - dashSize - horizontalLabelPadding - bbox.getHeight());
      } else {
        y = Math.floor(point.getY() + dashSize + horizontalLabelPadding);
        if (labelRotation != null) {
          y += bbox.getHeight();
        }
      }

      textLabel.setHidden(false);
      textLabel.setX(x);
      textLabel.setY(y);
      if (labelRotation != null) {
        textLabel.setRotation(new Rotation(x, y, labelRotation.getDegrees()));
      }
      textLabel.redraw();
      bbox = textLabel.getBBox();

      // Skip label if there isn't available minimum space
View Full Code Here

Examples of com.sencha.gxt.chart.client.draw.Rotation

  private void transform(Sprite sprite) {
    double deltaDegrees = 0;
    double deltaScaleX = 1;
    double deltaScaleY = 1;
    Matrix matrix = new Matrix();
    Rotation rotation = sprite.getRotation();
    Scaling scaling = sprite.getScaling();
    Translation translation = sprite.getTranslation();
    XElement element = getElement(sprite);
    Style style = element.getStyle();
    Element skew = element.getPropertyJSO("skew").cast();

    if (rotation != null) {
      matrix.rotate(rotation.getDegrees(), rotation.getX(), rotation.getY());
      deltaDegrees += rotation.getDegrees();
    }
    if (scaling != null) {
      matrix.scale(scaling.getX(), scaling.getY(), scaling.getCenterX(), scaling.getCenterY());
      deltaScaleX *= scaling.getX();
      deltaScaleY *= scaling.getY();
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.