Examples of LineTo


Examples of com.kitfox.svg.pathcmd.LineTo

                case 'm':
                    cmd = new MoveTo(true, nextFloat(tokens), nextFloat(tokens));
                    curCmd = 'l';
                    break;
                case 'L':
                    cmd = new LineTo(false, nextFloat(tokens), nextFloat(tokens));
                    break;
                case 'l':
                    cmd = new LineTo(true, nextFloat(tokens), nextFloat(tokens));
                    break;
                case 'H':
                    cmd = new Horizontal(false, nextFloat(tokens));
                    break;
                case 'h':
View Full Code Here

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

      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

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

          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()));
        }
        command = commands.get(0);
        if (command instanceof MoveTo) {
          commands.add(new LineTo(bbox.getX(), ((MoveTo) command).getY()));
        } else if (command instanceof LineTo) {
          commands.add(new LineTo(bbox.getX(), ((LineTo) command).getY()));
        }
      }
      prevAreaIndex = i;
    }
  }
View Full Code Here

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

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

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

      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

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

    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());
    } else {
      commands.add(new EllipticalArc(endRho, endRho, 0, flag, 1, x4, y4));
      commands.add(new LineTo(x3, y3));
      commands.add(new EllipticalArc(startRho, startRho, 0, flag, 0, x1, y1));
      commands.add(new ClosePath());
    }

    return commands;
View Full Code Here

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

        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

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

        if (commands.get(0) instanceof MoveTo) {
          sprite.setCommand(0, commands.get(0));
        }
        if (commands.get(2) instanceof EllipticalArc) {
          EllipticalArc arc = (EllipticalArc) commands.get(2);
          sprite.setCommand(1, new LineTo(arc.getX(), arc.getY()));
        }
        sprite.redraw();
      }
    };
  }
View Full Code Here

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

          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))),
              bbox.getWidth() + 20, bbox.getHeight() + 20);
View Full Code Here

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

        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
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.