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

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


    if (highlightLine != null) {
      if (lineBottom == null) {
        lineBottom = new PrecisePoint(lineTop.getX(), bbox.getY() + bbox.getHeight());
      }
      highlightLine.clearCommands();
      highlightLine.addCommand(new MoveTo(lineTop.getX(), lineTop.getY()));
      highlightLine.addCommand(new LineTo(lineBottom.getX(), lineBottom.getY()));
      highlightLine.setHidden(false);
      highlightLine.redraw();
    } else {
      highlightAll(yFieldIndex);
View Full Code Here


        }
        acumY += yValue[j];
        y = bbox.getY() + bbox.getHeight() - (acumY - min.getY()) * yScale;
        if (areasCommands.get(j) == null) {
          commands = new ArrayList<PathCommand>();
          commands.add(new MoveTo(x, y));
          areasCommands.put(j, commands);
        } else {
          commands = areasCommands.get(j);
          commands.add(new LineTo(x, y));
        }
        componentCommands.add(new LineTo(x, y));
        pointsUp.get(j).add(new PrecisePoint(x, y));
      }
    }

    int prevAreaIndex = 0;
    // Close the paths
    for (int i = 0; i < yFields.size(); i++) {

      if (exclude.contains(i)) {
        continue;
      }

      pointsDown.put(i, new ArrayList<PrecisePoint>());
      commands = areasCommands.get(i);
      // Close bottom path to the axis
      if (first) {
        first = false;
        commands.add(new LineTo(x, bbox.getY() + bbox.getHeight()));
        commands.add(new LineTo(bbox.getX(), bbox.getY() + bbox.getHeight()));
      }
      // Close other paths to the one before them
      else {
        componentCommands = areasComponentCommands.get(prevAreaIndex);
        // reverse the componentCommands
        for (int j = 0; j < componentCommands.size() / 2; j++) {
          command = componentCommands.remove(j);
          componentCommands.add(componentCommands.size() - j, command);
          command = componentCommands.remove(componentCommands.size() - j - 2);
          componentCommands.add(j, command);
        }
        command = componentCommands.get(0);
        if (command instanceof MoveTo) {
          commands.add(new LineTo(x, ((MoveTo) command).getY()));
        } else if (command instanceof LineTo) {
          commands.add(new LineTo(x, ((LineTo) command).getY()));
        }

        for (int j = 0; j < ln; j++) {
          command = componentCommands.get(j);
          if (command instanceof MoveTo) {
            commands.add(new MoveTo((MoveTo) command));
          } else if (command instanceof LineTo) {
            commands.add(new LineTo((LineTo) command));
          }
          EndPointCommand point = (EndPointCommand) command;
          pointsDown.get(i).add(0, new PrecisePoint(point.getX(), point.getY()));
View Full Code Here

        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();
View Full Code Here

      M model = store.get(i);
      rho = radius * yField.getValue(model).doubleValue() / maxValue;
      x = rho * Math.cos(i / len * Math.PI * 2);
      y = rho * Math.sin(i / len * Math.PI * 2);
      if (i == 0) {
        commands.add(new MoveTo(x + centerX, y + centerY));
      } else {
        commands.add(new LineTo(x + centerX, y + centerY));
      }
      coordinates.put(i, new PrecisePoint(x + centerX, y + centerY));
    }
    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());
View Full Code Here

    double x4 = x + endRho * Math.cos(a2);
    double y4 = y + endRho * Math.sin(a2);

    List<PathCommand> commands = new ArrayList<PathCommand>();
    commands.add(new MoveTo(x1, y1));
    commands.add(new LineTo(x2, y2));
    // Solves mysterious clipping bug with IE
    if (Math.abs(x1 - x3) <= 0.01 && Math.abs(y1 - y3) <= 0.01) {
      commands.add(new EllipticalArc(endRho, endRho, 0, flag, 1, x4, y4));
      commands.add(new ClosePath());
View Full Code Here

        needleSlice = new Slice(value, -180, splitAngle * 180 / Math.PI, radius);
        needleSlice.setMargin(margin);
        needleSlice.setStartRho(needleSlice.getRho() * donut / 100.0);
        needleSlice.setEndRho(needleSlice.getRho());
        ArrayList<PathCommand> needleCommands = new ArrayList<PathCommand>();
        needleCommands.add(new MoveTo(center.getX() + (radius * donut / 100.0) * Math.cos(splitAngle), center.getY()
            + -Math.abs((radius * donut / 100.0)) * Math.sin(splitAngle)));
        needleCommands.add(new LineTo(center.getX() + radius * Math.cos(splitAngle), center.getY()
            + -Math.abs(radius * Math.sin(splitAngle))));
        needleSprite.setCommands(needleCommands);
        needleSprite.redraw();
View Full Code Here

          sprite.redraw();
          PreciseRectangle bbox = sprite.getBBox();

          List<PathCommand> commands = new ArrayList<PathCommand>();
          commands.add(new MoveTo(x + center.getX(), y + center.getY()));
          commands.add(new LineTo(calloutPoint.getX(), calloutPoint.getY()));
          commands.add(new LineTo(x > 0 ? 10 : -10, 0, true));

          PreciseRectangle rect = new PreciseRectangle(calloutPoint.getX() + (x > 0 ? 10 : -(bbox.getWidth() + 30)),
              calloutPoint.getY() + (y > 0 ? (-(bbox.getHeight() - 5)) : (-(bbox.getHeight() - 5))),
View Full Code Here

        line = axisConfig.copy();
        chart.addSprite(line);
        lines.add(line);
      }
      line.clearCommands();
      line.addCommand(new MoveTo(centerX, centerY));
      line.addCommand(new LineTo(centerX + rho * Math.cos(i / length * pi2), centerY + rho * Math.sin(i / length * pi2)));
      line.addCommand(new ClosePath());
      line.redraw();
    }
    drawLabels();
View Full Code Here

      if (series instanceof LineSeries) {
        LineSeries<M> lineSeries = (LineSeries<M>) series;
        line = new PathSprite();
        add(line);
        chart.addSprite(line);
        line.addCommand(new MoveTo(-5.5, 0.5));
        line.addCommand(new LineTo(17.5, 0.5));
        line.setStrokeWidth(lineSeries.getStrokeWidth());
        line.setStrokeLineJoin(LineJoin.ROUND);
        line.setStroke(lineSeries.getStroke());
        markers = lineSeries.isShowMarkers();
      } else if (series instanceof RadarSeries) {
        RadarSeries<M> radar = (RadarSeries<M>) series;
        line = new PathSprite();
        add(line);
        chart.addSprite(line);
        line.addCommand(new MoveTo(0.5, 0.5));
        line.addCommand(new LineTo(16.5, 0.5));
        line.setStrokeWidth(radar.getStrokeWidth());
        line.setStrokeLineJoin(LineJoin.ROUND);
        line.setStroke(radar.getStroke());
        markers = radar.isShowMarkers();
View Full Code Here

      @Override
      protected void onUpdate(double progress) {
        PathSprite start = new PathSprite(source);
        for (int i = 0; i < start.size(); i++) {
          if (start.getCommand(i) instanceof MoveTo) {
            MoveTo move1 = (MoveTo) start.getCommand(i);
            MoveTo move2 = (MoveTo) delta.getCommand(i);
            move1.setX(move1.getX() + (move2.getX() * progress));
            move1.setY(move1.getY() + (move2.getY() * progress));
          } else if (start.getCommand(i) instanceof CurveTo) {
            CurveTo curve1 = (CurveTo) start.getCommand(i);
            CurveTo curve2 = (CurveTo) delta.getCommand(i);
            curve1.setX(curve1.getX() + (curve2.getX() * progress));
            curve1.setY(curve1.getY() + (curve2.getY() * progress));
 
View Full Code Here

TOP

Related Classes of com.sencha.gxt.chart.client.draw.path.MoveTo

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.