}
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();