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

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


          PathSprite shadow = new PathSprite();
          Sprite shadowAttr = shadowAttributes.get(i);
          shadow.setStrokeWidth(shadowAttr.getStrokeWidth());
          shadow.setStrokeOpacity(shadowAttr.getStrokeOpacity());
          shadow.setStroke(shadowAttr.getStroke());
          shadow.setTranslation(new Translation(shadowAttr.getTranslation()));
          shadow.setFill(Color.NONE);
          shadow.setCommands(radar.getCommands());
          chart.addSprite(shadow);
          radarShadows.add(shadow);
        }
View Full Code Here


   *
   * @param x the translation on the x-axis
   * @param y the translation on the y-axis
   */
  public void setTranslation(double x, double y) {
    setTranslation(new Translation(x, y));
  }
View Full Code Here

    setOpacity(sprite.opacity);
    setSurface(sprite.surface);
    setStroke(sprite.stroke);
    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) {
View Full Code Here

        }
        shadowSprite.setStrokeWidth(shadowBarAttr.getStrokeWidth());
        shadowSprite.setStrokeOpacity(shadowBarAttr.getStrokeOpacity());
        shadowSprite.setStroke(shadowBarAttr.getStroke());
        shadowSprite.setFill(Color.NONE);
        shadowSprite.setTranslation(new Translation(shadowBarAttr.getTranslation()));
        shadows.add(shadowSprite);
        chart.addSprite(shadowSprite);
      }
      if (chart.isAnimated() && chart.isResizing()) {
        if (column) {
View Full Code Here

    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();
    }
    if (translation != null) {
      matrix.translate(translation.getX(), translation.getY());
    }
    if (viewBoxShift != null) {
      matrix.scale(viewBoxShift.getX(), viewBoxShift.getY(), -1, -1);
      matrix.add(1, 0, 0, 1, viewBoxShift.getCenterX(), viewBoxShift.getCenterY());
    }
View Full Code Here

      for (int i = 0; i < markerIndex; i++) {
        marker = sprites.get(i);
        sprites.remove(i);
        sprites.add(marker);
        Sprite markerTemp = sprites.get(sprites.size() - 2);
        marker.setTranslation(new Translation(markerTemp.getTranslation()));
        marker.redraw();
      }
    }

    calculateBounds();

    double x = 0;
    double y = 0;
    boolean gap = false;
    for (int i = 0; i < store.size(); i++) {
      PrecisePoint point = coordinates.get(i);
      if (point != null) {
        x = point.getX();
        y = point.getY();
      } else {
        x = y = Double.NaN;
      }
      if (!Double.isNaN(x) && !Double.isNaN(y)) {
        if (onbreak) {
          onbreak = false;
        }
        if (lineCommands.size() > 0 && !gap) {
          lineCommands.add(new LineTo(x, y));
        } else {
          lineCommands.add(new MoveTo(x, y));
          gap = false;
        }
        gapPosition.put(String.valueOf(lineCommands.size() - 1), i);
      } else if (!gapless) {
        gap = true;
      }

      if (Double.isNaN(firstY) && !Double.isNaN(y)) {
        firstY = y;
      }
    }

    List<PathCommand> renderCommands;

    if (smooth && lineCommands.size() > 0) {
      PathSprite smooth = new PathSprite();
      smooth.setCommands(lineCommands);
      renderCommands = smooth.copy().toSmooth(segments).getCommands();
    } else {
      renderCommands = PathSprite.copyCommands(lineCommands);
    }

    // Correct path if we're animating timeAxis intervals
    if (markerIndex > 0 && previousCommands != null && previousCommands.size() > 1) {
      previousCommands.remove(1);
      line.setCommands(previousCommands);
      if (chart.hasShadows()) {
        for (int i = 0; i < lineShadows.size(); i++) {
          PathSprite shadow = lineShadows.get(i);
          shadow.setCommands(previousCommands);
        }
      }
    }

    List<PathCommand> dummyCommands = new ArrayList<PathCommand>();
    dummyCommands.add(new MoveTo(bbox.getX(), bbox.getY() + bbox.getHeight() / 2.0));
    for (int k = 1; k < lineCommands.size(); k++) {
      dummyCommands.add(new LineTo(bbox.getX() + bbox.getWidth() / k, bbox.getY() + bbox.getHeight() / 2.0));
    }

    // Only create a line if one doesn't exist.
    if (line == null) {
      line = new PathSprite();
      line.setStroke(stroke);
      chart.addSprite(line);
      line.setCommands(dummyCommands);

      if (chart.hasShadows()) {
        // create shadows
        for (int i = 0; i < shadowGroups.size(); i++) {
          PathSprite shadow = new PathSprite();
          Sprite shadowAttr = shadowAttributes.get(i);
          shadow.setStrokeWidth(shadowAttr.getStrokeWidth());
          shadow.setStrokeOpacity(shadowAttr.getStrokeOpacity());
          shadow.setStroke(shadowAttr.getStroke());
          shadow.setTranslation(new Translation(shadowAttr.getTranslation()));
          shadow.setFill(Color.NONE);
          shadow.setCommands(line.getCommands());
          chart.addSprite(shadow);
          lineShadows.add(shadow);
        }
View Full Code Here

  }

  @Override
  protected int getIndex(PrecisePoint point) {
    for (int i = 0; i < sprites.size(); i++) {
      Translation trans = sprites.get(i).getTranslation();
      if (point.equalsNoPrecision(new PrecisePoint(trans.getX(), trans.getY()), selectionTolerance)) {
        return i;
      }
    }
    return -1;
  }
View Full Code Here

TOP

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

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.