Examples of PathSprite


Examples of com.sencha.gxt.chart.client.draw.path.PathSprite

    return height;
  }

  @Override
  public PathSprite getPathSprite() {
    return new PathSprite(this);
  }
View Full Code Here

Examples of com.sencha.gxt.chart.client.draw.path.PathSprite

  /**
   * Create an axis.
   */
  public Axis() {
    axisConfig = new PathSprite();
    axisConfig.setStroke(RGB.BLACK);
    axisConfig.setStrokeWidth(1);
    axisConfig.setZIndex(1);
    labelConfig.setZIndex(3);
  }
View Full Code Here

Examples of com.sencha.gxt.chart.client.draw.path.PathSprite

  /**
   * Removes all the sprites of the axis from the surface.
   */
  public void clear() {
    while (lines.size() > 0) {
      PathSprite sprite = lines.remove(lines.size() - 1);
      if (sprite != null) {
        sprite.remove();
      }
    }
    while (labels.size() > 0) {
      TextSprite sprite = labels.remove(labels.size() - 1);
      if (sprite != null) {
        sprite.remove();
      }
    }
    if (titleSprite != null) {
      titleSprite.remove();
      titleSprite = null;
View Full Code Here

Examples of com.sencha.gxt.chart.client.draw.path.PathSprite

    return centerY;
  }

  @Override
  public PathSprite getPathSprite() {
    return new PathSprite(this);
  }
View Full Code Here

Examples of com.sencha.gxt.chart.client.draw.path.PathSprite

    for (int i = 0; i < yFields.size(); i++) {
      if (exclude.contains(i)) {
        continue;
      }
      final PathSprite path;
      if (i < areas.size()) {
        path = areas.get(i);
        path.setHidden(false);
      } else {
        path = new PathSprite();
        path.setFill(colors.get(i));
        chart.addSprite(path);
        areas.add(path);
      }
      if (chart.isAnimated() && path.getCommands().size() > 0) {
        DrawFx.createCommandsAnimator(path, areasCommands.get(i)).run(chart.getAnimationDuration(),
            chart.getAnimationEasing());
      } else {
        path.setCommands(areasCommands.get(i));
        path.redraw();
      }
      if (stroke != null) {
        path.setStroke(stroke);
      }
      if (!Double.isNaN(strokeWidth)) {
        path.setStrokeWidth(strokeWidth);
      }
      if (renderer != null) {
        renderer.spriteRenderer(path, i, store);
      }
    }
View Full Code Here

Examples of com.sencha.gxt.chart.client.draw.path.PathSprite

    return fontWeight;
  }

  @Override
  public PathSprite getPathSprite() {
    return new PathSprite(this);
  }
View Full Code Here

Examples of com.sencha.gxt.chart.client.draw.path.PathSprite

    center.setX(chartBBox.getX() + (chartBBox.getWidth() / 2.0));
    center.setY(chartBBox.getY() + chartBBox.getHeight());
    double rho = Math.min(chartBBox.getWidth(), 2.0 * chartBBox.getHeight()) / 2.0 + margin;

    if (this.margin >= 0 && displayGrid) {
      final PathSprite line;
      if (lines.size() == 0) {
        line = axisConfig.copy();
        chart.addSprite(line);
        lines.add(line);
      } else {
        line = lines.get(0);
        line.clearCommands();
      }
      for (double i = 0; i <= gaugeSteps; i++) {
        double position = i / gaugeSteps * Math.PI - Math.PI;
        line.addCommand(new MoveTo(center.getX() + (rho - margin) * Math.cos(position), center.getY() + (rho - margin)
            * Math.sin(position)));
        line.addCommand(new LineTo(center.getX() + rho * Math.cos(position), center.getY() + rho * Math.sin(position)));
        line.addCommand(new ClosePath());
      }
      line.redraw();
    }
    drawLabels();
    if (title != null) {
      drawTitle();
    }
View Full Code Here

Examples of com.sencha.gxt.chart.client.draw.path.PathSprite

   * Creates a radar series.
   */
  public RadarSeries() {
    // setup shadow attributes
    shadowAttributes = new ArrayList<Sprite>();
    Sprite config = new PathSprite();
    config.setStrokeWidth(6);
    config.setStrokeOpacity(0.05);
    config.setStroke(RGB.BLACK);
    config.setTranslation(1, 1);
    shadowAttributes.add(config);
    config = new PathSprite();
    config.setStrokeWidth(4);
    config.setStrokeOpacity(0.1);
    config.setStroke(RGB.BLACK);
    config.setTranslation(1, 1);
    shadowAttributes.add(config);
    config = new PathSprite();
    config.setStrokeWidth(2);
    config.setStrokeOpacity(0.15);
    config.setStroke(RGB.BLACK);
    config.setTranslation(1, 1);
    shadowAttributes.add(config);

    // initialize shadow groups
    if (shadowGroups.size() == 0) {
      for (int i = 0; i < shadowAttributes.size(); i++) {
View Full Code Here

Examples of com.sencha.gxt.chart.client.draw.path.PathSprite

    }
    commands.add(new ClosePath());

    // create path sprite
    if (radar == null) {
      radar = new PathSprite();
      radar.addCommand(new MoveTo(centerX, centerY));
      for (int i = 1; i < commands.size(); i++) {
        radar.addCommand(new LineTo(centerX, centerY));
      }
      chart.addSprite(radar);
      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(radar.getCommands());
          chart.addSprite(shadow);
          radarShadows.add(shadow);
        }
      }
    } else if (chart.isResizing() && chart.isAnimated()) {
      radar.clearCommands();
      radar.addCommand(new MoveTo(centerX, centerY));
      for (int i = 1; i < commands.size(); i++) {
        radar.addCommand(new LineTo(centerX, centerY));
      }
      for (int i = 0; i < radarShadows.size(); i++) {
        radarShadows.get(i).setCommands(radar.getCommands());
      }
    }
    if (!Double.isNaN(strokeWidth)) {
      radar.setStrokeWidth(strokeWidth);
    }
    if (fill != null) {
      radar.setFill(fill);
    }
    if (stroke != null) {
      radar.setStroke(stroke);
    }
    if (chart.isAnimated() && radar.size() > 0) {
      DrawFx.createCommandsAnimator(radar, commands).run(500);
    } else {
      radar.setCommands(commands);
      radar.redraw();
    }
    if (lineRenderer != null) {
      lineRenderer.spriteRenderer(radar, 0, chart.getStore());
    }
    if (chart.hasShadows()) {
      for (int i = 0; i < radarShadows.size(); i++) {
        PathSprite shadow = radarShadows.get(i);
        if (!hidden) {
          shadow.setHidden(false);
        }
        if (chart.isAnimated()) {
          DrawFx.createCommandsAnimator(shadow, commands).run(500);
        } else {
          shadow.setCommands(commands);
          shadow.redraw();
        }
      }
      shadowed = true;
    } else {
      hideShadows();
View Full Code Here

Examples of com.sencha.gxt.chart.client.draw.path.PathSprite

    }

    // do pie slices after.
    for (int i = 0; i < slices.size(); i++) {
      Slice slice = slices.get(i);
      final PathSprite sprite;

      if (i < sprites.size()) {
        sprite = (PathSprite) sprites.get(i);
      } else {
        sprite = new PathSprite();
        chart.addSprite(sprite);
        sprites.add(sprite);
      }

      // set pie slice properties
      sprite.setHidden(false);
      if (i == 0) {
        sprite.setFill(colors.get(0));
      } else {
        sprite.setFill(colors.get(1));
      }
      slice.setMargin(margin);
      slice.setStartRho(slice.getRho() * donut / 100.0);
      slice.setEndRho(slice.getRho());
      if (stroke != null) {
        sprite.setStroke(stroke);
      }
      if (!Double.isNaN(strokeWidth)) {
        sprite.setStrokeWidth(strokeWidth);
      }
      if (chart.isAnimated() && oldSlices.size() == slices.size()) {
        createSegmentAnimator(sprite, oldSlices.get(i), slice).run(chart.getAnimationDuration(),
            chart.getAnimationEasing());
      } else {
        List<PathCommand> commands = calculateSegment(slice);
        sprite.setCommands(commands);
        sprite.redraw();
      }
      if (renderer != null) {
        renderer.spriteRenderer(sprite, i, chart.getCurrentStore());
      }
    }

    if (needle) {
      splitAngle = splitAngle * Math.PI / 180;

      if (needleSprite == null) {
        needleSprite = new PathSprite();
        needleSprite.setStrokeWidth(4);
        needleSprite.setStroke(new Color("#222"));
        chart.addSprite(needleSprite);
      }

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.