28 lines
389 B
Java
28 lines
389 B
Java
package org.hwo.ui.diagram;
|
|
|
|
import java.awt.Color;
|
|
import java.awt.Graphics2D;
|
|
|
|
public class LinePlotPainter implements PlotPainter {
|
|
|
|
int lx,ly;
|
|
|
|
@Override
|
|
public void reset() {
|
|
lx = -1;
|
|
ly = -1;
|
|
}
|
|
|
|
@Override
|
|
public void paintPoint(Graphics2D g, Color color, int x, int y) {
|
|
if (lx != -1){
|
|
g.setColor(color);
|
|
g.drawLine(lx, ly, x, y);
|
|
}
|
|
|
|
lx = x;
|
|
ly = y;
|
|
}
|
|
|
|
}
|