update 30.09
This commit is contained in:
48
Muehle.~ava
48
Muehle.~ava
@@ -8,7 +8,10 @@ import javafx.stage.Window;
|
||||
import javafx.scene.shape.Shape;
|
||||
import java.util.ArrayList;
|
||||
import javafx.scene.control.Label;
|
||||
|
||||
import javafx.scene.shape.Line;
|
||||
import javafx.event.Event;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
/**
|
||||
*
|
||||
* Beschreibung
|
||||
@@ -21,15 +24,23 @@ public class Muehle extends Application {
|
||||
// start attributes
|
||||
// end attributes
|
||||
private Label lTop = new Label();
|
||||
private Pane game_board;
|
||||
private Game game;
|
||||
|
||||
public void start(Stage primaryStage) {
|
||||
|
||||
game = new Game();
|
||||
game.start();
|
||||
Pane root = new Pane();
|
||||
|
||||
Pane game_board = draw_game_board();
|
||||
game_board = draw_game_board();
|
||||
root.getChildren().addAll(lTop,game_board);
|
||||
Scene scene = new Scene(root, 1080, 820);
|
||||
|
||||
|
||||
//lTop.setAlignment();
|
||||
setTopLabel("Test Label");
|
||||
|
||||
|
||||
primaryStage.setOnCloseRequest(e -> System.exit(0));
|
||||
primaryStage.setTitle("Muehle");
|
||||
@@ -74,12 +85,36 @@ public class Muehle extends Application {
|
||||
circle2.setFill(new Color(0.0,0.0,0.0,0.0));
|
||||
shapes.add(circle2);
|
||||
|
||||
Rectangle circle3 = new Rectangle(topLeftX + 200,topLeftY + 200,topRightX - 500,topRightY - 500);
|
||||
Rectangle circle3 = new Rectangle(topLeftX + 200,topLeftY + 200,topRightX - 400,topRightY - 400);
|
||||
circle3.setStroke(stroke_color);
|
||||
circle3.setStrokeWidth(10);
|
||||
circle3.setFill(new Color(0.0,0.0,0.0,0.0));
|
||||
shapes.add(circle3);
|
||||
|
||||
Line line1 = new Line((topLeftX+topRightX) /2 + topLeftX/2,topLeftY,(topLeftX+topRightX) /2 + topLeftX/2,250);
|
||||
line1.setStroke(stroke_color);
|
||||
line1.setStrokeWidth(10);
|
||||
shapes.add(line1);
|
||||
|
||||
Line line2 = new Line((topLeftX+topRightX) /2 + topLeftX/2,topRightY+50,(topLeftX+topRightX) /2 + topLeftX/2,520);
|
||||
line2.setStroke(stroke_color);
|
||||
line2.setStrokeWidth(10);
|
||||
shapes.add(line2);
|
||||
|
||||
Line line3 = new Line(topLeftX,topRightY/2+50,topLeftX+200,topRightY/2+50);
|
||||
line3.setStroke(stroke_color);
|
||||
line3.setStrokeWidth(10);
|
||||
shapes.add(line3);
|
||||
|
||||
Line line4 = new Line(topLeftX+550,topRightY/2+50,topLeftX+200+540,topRightY/2+50);
|
||||
line4.setStroke(stroke_color);
|
||||
line4.setStrokeWidth(10);
|
||||
shapes.add(line4);
|
||||
|
||||
|
||||
MuehleButton button1 = new MuehleButton(0,0,100,100,Color.BLUE,game);
|
||||
shapes.add(button1.getShape());
|
||||
|
||||
for (int i = 0; i < shapes.size() ;i++ ) {
|
||||
board.getChildren().add(shapes.get(i));
|
||||
} // end of for
|
||||
@@ -88,6 +123,13 @@ public class Muehle extends Application {
|
||||
return board;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void addShape(Shape newShape) {
|
||||
game_board.getChildren().add(newShape);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// end methods
|
||||
} // end of class Muehle
|
||||
|
||||
Reference in New Issue
Block a user