-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSquare.java
More file actions
38 lines (30 loc) · 934 Bytes
/
Square.java
File metadata and controls
38 lines (30 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.Parent;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.Pane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.GridPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import java.awt.GradientPaint;
import java.util.*;
class Square extends Pane {
static final int SIZE = 9;
static final int ROW = 3;
public Square(List<Tile> tiles) {
for (int i = 0; i < SIZE; i++) {
Tile tile = tiles.get(i);
tile.setTranslateX(30 * (i % ROW));
tile.setTranslateY(30 * (i / ROW));
getChildren().add(tile);
}
}
public static void main(String[] args) {
}
}