Package com.sencha.gxt.chart.client.draw

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


   * @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

    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

                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

    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

  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

Related Classes of com.sencha.gxt.chart.client.draw.Rotation

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.