30 lines
548 B
Java
30 lines
548 B
Java
package org.hwo.ui.diagram;
|
|
|
|
import java.awt.Color;
|
|
import java.awt.Graphics2D;
|
|
|
|
public class CirclePlotPainter implements PlotPainter {
|
|
|
|
int radius;
|
|
|
|
public CirclePlotPainter() {
|
|
this.radius = 3;
|
|
}
|
|
|
|
public CirclePlotPainter(int radius){
|
|
this.radius = radius;
|
|
}
|
|
|
|
@Override
|
|
public void reset() {
|
|
}
|
|
|
|
@Override
|
|
public void paintPoint(Graphics2D g, Color color, int x, int y) {
|
|
g.setColor(color);
|
|
g.drawArc(x - radius, y - radius, 2*radius, 2*radius, 0, 360);
|
|
g.fillArc(x - radius, y - radius, 2*radius, 2*radius, 0, 360);
|
|
}
|
|
|
|
}
|