|
|
@@ -38,6 +38,9 @@ public class GrafikView extends JComponent implements Printable |
|
|
|
private Line2D.Float line; |
|
|
|
private GrafikModel model; |
|
|
|
|
|
|
|
private Point from = null; |
|
|
|
private Point to = null; |
|
|
|
|
|
|
|
public GrafikView() |
|
|
|
{ |
|
|
|
pixel = new Rectangle2D.Float(); |
|
|
@@ -85,15 +88,17 @@ public class GrafikView extends JComponent implements Printable |
|
|
|
} |
|
|
|
|
|
|
|
public void drawPath(List<Point> path, Graphics2D g2){ |
|
|
|
from = path.getFirst(); |
|
|
|
to = null; |
|
|
|
|
|
|
|
for(int i=0; i < path.size()-1; i++) |
|
|
|
{ |
|
|
|
Point from = path.get(i); |
|
|
|
Point to = path.get(i+1); |
|
|
|
|
|
|
|
line.setLine(from,to); |
|
|
|
g2.draw(line); |
|
|
|
} |
|
|
|
path.forEach(point-> |
|
|
|
{ |
|
|
|
to = point; |
|
|
|
line.setLine(from,to); |
|
|
|
g2.draw(line); |
|
|
|
from = to; |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|