|
@@ -69,24 +69,18 @@ public class Application extends javafx.application.Application {
|
|
|
|
|
|
private void plot(Solution solution) {
|
|
|
System.out.println(solution);
|
|
|
-
|
|
|
- // 绘制里面的矩形
|
|
|
-// List<PlaceSquare> placeSquareList = solution.getPlaceSquareList();
|
|
|
-// System.out.println(placeSquareList.size());
|
|
|
-// for (PlaceSquare placeSquare : placeSquareList) {
|
|
|
-// canvas = draw(canvas,placeSquare.getX(),placeSquare.getY(),placeSquare.getL(),placeSquare.getW());
|
|
|
-// }
|
|
|
}
|
|
|
|
|
|
- private void draw(Canvas canvas, double x, double y, double l, double w) {
|
|
|
+ private void draw(Canvas canvas, double x, double y, double length, double width) {
|
|
|
GraphicsContext gc = canvas.getGraphicsContext2D();
|
|
|
// 边框
|
|
|
gc.setStroke(Color.BLACK);
|
|
|
gc.setLineWidth(2);
|
|
|
- gc.strokeRect(x, y, l, w);
|
|
|
+ gc.strokeRect(x, y, length, width);
|
|
|
// 填充
|
|
|
gc.setFill(new Color(new Random().nextDouble(), new Random().nextDouble(), new Random().nextDouble(), new Random().nextDouble()));
|
|
|
- gc.fillRect(x, y, l, w);
|
|
|
+ gc.fillRect(x, y, length, width);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|