update 30.09
This commit is contained in:
BIN
Chip.class
Normal file
BIN
Chip.class
Normal file
Binary file not shown.
47
Chip.java
Normal file
47
Chip.java
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
import javafx.scene.paint.Color;
|
||||||
|
import javafx.scene.shape.Shape;
|
||||||
|
import javafx.scene.shape.Circle;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Beschreibung
|
||||||
|
*
|
||||||
|
* @version 1.0 vom 30.09.2025
|
||||||
|
* @author
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Chip {
|
||||||
|
|
||||||
|
public Color color;
|
||||||
|
|
||||||
|
public int relativeX;
|
||||||
|
public int relativeY;
|
||||||
|
|
||||||
|
public double absoluteX;
|
||||||
|
public double absoluteY;
|
||||||
|
|
||||||
|
public double radius;
|
||||||
|
|
||||||
|
|
||||||
|
public Circle circle;
|
||||||
|
|
||||||
|
public Chip(relX,relY,absX,absY, Color color) {
|
||||||
|
relativeX = relX;
|
||||||
|
relativeY = relY;
|
||||||
|
|
||||||
|
absoluteX = absX;
|
||||||
|
absoluteY = absY;
|
||||||
|
|
||||||
|
this.color = color;
|
||||||
|
|
||||||
|
radius = 20;
|
||||||
|
|
||||||
|
this.color = color;
|
||||||
|
circle = new Circle(absoluteX, absoluteY, radius);
|
||||||
|
circle.setFill(this.color);
|
||||||
|
|
||||||
|
}
|
||||||
|
public Shape getShape() {
|
||||||
|
return circle;
|
||||||
|
|
||||||
|
}
|
||||||
|
} // end of Chip
|
||||||
24
Chip.uml
Normal file
24
Chip.uml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
[Files]
|
||||||
|
File0=Chip.java
|
||||||
|
|
||||||
|
[Box: - Chip]
|
||||||
|
X=20
|
||||||
|
Y=40
|
||||||
|
MinVis=0
|
||||||
|
ShowParameter=4
|
||||||
|
SortOrder=0
|
||||||
|
ShowIcons=1
|
||||||
|
|
||||||
|
[Diagram]
|
||||||
|
Comments=0
|
||||||
|
OffsetX=0
|
||||||
|
OffsetY=0
|
||||||
|
Visibility=0
|
||||||
|
ShowParameter=4
|
||||||
|
SortOrder=0
|
||||||
|
ShowIcons=1
|
||||||
|
ShowConnections=0
|
||||||
|
Fontname=Segoe UI
|
||||||
|
Fontsize=12
|
||||||
|
ShowObjectDiagram=0
|
||||||
|
|
||||||
45
Chip.~ava
Normal file
45
Chip.~ava
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
import javafx.scene.paint.Color;
|
||||||
|
import javafx.scene.shape.Shape;
|
||||||
|
import javafx.scene.shape.Circle;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Beschreibung
|
||||||
|
*
|
||||||
|
* @version 1.0 vom 30.09.2025
|
||||||
|
* @author
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Chip {
|
||||||
|
|
||||||
|
public Color color;
|
||||||
|
|
||||||
|
public int relativeX;
|
||||||
|
public int relativeY;
|
||||||
|
|
||||||
|
public double absoluteX;
|
||||||
|
public double absoluteY;
|
||||||
|
|
||||||
|
public double radius;
|
||||||
|
|
||||||
|
|
||||||
|
public Circle circle;
|
||||||
|
|
||||||
|
public Chip(relX,relY,absX,absY, Color color) {
|
||||||
|
relativeX = relX;
|
||||||
|
relativeY = relY;
|
||||||
|
|
||||||
|
absoluteX = absX;
|
||||||
|
absoluteY = absY;
|
||||||
|
|
||||||
|
this.color = color;
|
||||||
|
|
||||||
|
radius = 20;
|
||||||
|
|
||||||
|
circle = new Circle(absoluteX,absoluteY,radius);
|
||||||
|
|
||||||
|
}
|
||||||
|
public Shape getShape() {
|
||||||
|
return circle;
|
||||||
|
|
||||||
|
}
|
||||||
|
} // end of Chip
|
||||||
BIN
Game.class
Normal file
BIN
Game.class
Normal file
Binary file not shown.
26
Game.java
Normal file
26
Game.java
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import javafx.scene.shape.Shape;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Beschreibung
|
||||||
|
*
|
||||||
|
* @version 1.0 vom 30.09.2025
|
||||||
|
* @author
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Game {
|
||||||
|
|
||||||
|
public String currentTurnPlayer = "White";
|
||||||
|
public int white_chips = 7;
|
||||||
|
public int black_chips = 7;
|
||||||
|
|
||||||
|
public void addShape(Shape shape);
|
||||||
|
|
||||||
|
public void start() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void chip_button_clicked(MuehleButton button) {
|
||||||
|
System.out.println(button.absoluteX);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
24
Game.uml
Normal file
24
Game.uml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
[Files]
|
||||||
|
File0=Game.java
|
||||||
|
|
||||||
|
[Box: - Game]
|
||||||
|
X=20
|
||||||
|
Y=40
|
||||||
|
MinVis=0
|
||||||
|
ShowParameter=4
|
||||||
|
SortOrder=0
|
||||||
|
ShowIcons=1
|
||||||
|
|
||||||
|
[Diagram]
|
||||||
|
Comments=0
|
||||||
|
OffsetX=0
|
||||||
|
OffsetY=0
|
||||||
|
Visibility=0
|
||||||
|
ShowParameter=4
|
||||||
|
SortOrder=0
|
||||||
|
ShowIcons=1
|
||||||
|
ShowConnections=0
|
||||||
|
Fontname=Segoe UI
|
||||||
|
Fontsize=12
|
||||||
|
ShowObjectDiagram=0
|
||||||
|
|
||||||
25
Game.~ava
Normal file
25
Game.~ava
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* Beschreibung
|
||||||
|
*
|
||||||
|
* @version 1.0 vom 30.09.2025
|
||||||
|
* @author
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Game {
|
||||||
|
|
||||||
|
public String currentTurnPlayer = "White";
|
||||||
|
public int white_chips = 7;
|
||||||
|
public int black_chips = 7;
|
||||||
|
|
||||||
|
public void addShape;
|
||||||
|
|
||||||
|
public void start() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void chip_button_clicked(MuehleButton button) {
|
||||||
|
System.out.println(button.absoluteX);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
BIN
Muehle$1.class
Normal file
BIN
Muehle$1.class
Normal file
Binary file not shown.
BIN
Muehle.class
BIN
Muehle.class
Binary file not shown.
47
Muehle.java
47
Muehle.java
@@ -8,7 +8,10 @@ import javafx.stage.Window;
|
|||||||
import javafx.scene.shape.Shape;
|
import javafx.scene.shape.Shape;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
|
import javafx.scene.shape.Line;
|
||||||
|
import javafx.event.Event;
|
||||||
|
import javafx.event.EventHandler;
|
||||||
|
import javafx.scene.input.MouseEvent;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Beschreibung
|
* Beschreibung
|
||||||
@@ -21,15 +24,24 @@ public class Muehle extends Application {
|
|||||||
// start attributes
|
// start attributes
|
||||||
// end attributes
|
// end attributes
|
||||||
private Label lTop = new Label();
|
private Label lTop = new Label();
|
||||||
|
private Pane game_board;
|
||||||
|
private Game game;
|
||||||
|
|
||||||
public void start(Stage primaryStage) {
|
public void start(Stage primaryStage) {
|
||||||
|
|
||||||
|
game = new Game();
|
||||||
|
game.addShape = addShape;
|
||||||
|
game.start();
|
||||||
Pane root = new Pane();
|
Pane root = new Pane();
|
||||||
|
|
||||||
Pane game_board = draw_game_board();
|
game_board = draw_game_board();
|
||||||
root.getChildren().addAll(lTop,game_board);
|
root.getChildren().addAll(lTop,game_board);
|
||||||
Scene scene = new Scene(root, 1080, 820);
|
Scene scene = new Scene(root, 1080, 820);
|
||||||
|
|
||||||
|
|
||||||
|
//lTop.setAlignment();
|
||||||
setTopLabel("Test Label");
|
setTopLabel("Test Label");
|
||||||
|
|
||||||
|
|
||||||
primaryStage.setOnCloseRequest(e -> System.exit(0));
|
primaryStage.setOnCloseRequest(e -> System.exit(0));
|
||||||
primaryStage.setTitle("Muehle");
|
primaryStage.setTitle("Muehle");
|
||||||
@@ -80,6 +92,30 @@ public class Muehle extends Application {
|
|||||||
circle3.setFill(new Color(0.0,0.0,0.0,0.0));
|
circle3.setFill(new Color(0.0,0.0,0.0,0.0));
|
||||||
shapes.add(circle3);
|
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++ ) {
|
for (int i = 0; i < shapes.size() ;i++ ) {
|
||||||
board.getChildren().add(shapes.get(i));
|
board.getChildren().add(shapes.get(i));
|
||||||
} // end of for
|
} // end of for
|
||||||
@@ -88,6 +124,13 @@ public class Muehle extends Application {
|
|||||||
return board;
|
return board;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void addShape(Shape newShape) {
|
||||||
|
game_board.getChildren().add(newShape);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// end methods
|
// end methods
|
||||||
} // end of class Muehle
|
} // end of class Muehle
|
||||||
|
|||||||
48
Muehle.~ava
48
Muehle.~ava
@@ -8,7 +8,10 @@ import javafx.stage.Window;
|
|||||||
import javafx.scene.shape.Shape;
|
import javafx.scene.shape.Shape;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
|
import javafx.scene.shape.Line;
|
||||||
|
import javafx.event.Event;
|
||||||
|
import javafx.event.EventHandler;
|
||||||
|
import javafx.scene.input.MouseEvent;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Beschreibung
|
* Beschreibung
|
||||||
@@ -21,15 +24,23 @@ public class Muehle extends Application {
|
|||||||
// start attributes
|
// start attributes
|
||||||
// end attributes
|
// end attributes
|
||||||
private Label lTop = new Label();
|
private Label lTop = new Label();
|
||||||
|
private Pane game_board;
|
||||||
|
private Game game;
|
||||||
|
|
||||||
public void start(Stage primaryStage) {
|
public void start(Stage primaryStage) {
|
||||||
|
|
||||||
|
game = new Game();
|
||||||
|
game.start();
|
||||||
Pane root = new Pane();
|
Pane root = new Pane();
|
||||||
|
|
||||||
Pane game_board = draw_game_board();
|
game_board = draw_game_board();
|
||||||
root.getChildren().addAll(lTop,game_board);
|
root.getChildren().addAll(lTop,game_board);
|
||||||
Scene scene = new Scene(root, 1080, 820);
|
Scene scene = new Scene(root, 1080, 820);
|
||||||
|
|
||||||
|
|
||||||
|
//lTop.setAlignment();
|
||||||
setTopLabel("Test Label");
|
setTopLabel("Test Label");
|
||||||
|
|
||||||
|
|
||||||
primaryStage.setOnCloseRequest(e -> System.exit(0));
|
primaryStage.setOnCloseRequest(e -> System.exit(0));
|
||||||
primaryStage.setTitle("Muehle");
|
primaryStage.setTitle("Muehle");
|
||||||
@@ -74,12 +85,36 @@ public class Muehle extends Application {
|
|||||||
circle2.setFill(new Color(0.0,0.0,0.0,0.0));
|
circle2.setFill(new Color(0.0,0.0,0.0,0.0));
|
||||||
shapes.add(circle2);
|
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.setStroke(stroke_color);
|
||||||
circle3.setStrokeWidth(10);
|
circle3.setStrokeWidth(10);
|
||||||
circle3.setFill(new Color(0.0,0.0,0.0,0.0));
|
circle3.setFill(new Color(0.0,0.0,0.0,0.0));
|
||||||
shapes.add(circle3);
|
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++ ) {
|
for (int i = 0; i < shapes.size() ;i++ ) {
|
||||||
board.getChildren().add(shapes.get(i));
|
board.getChildren().add(shapes.get(i));
|
||||||
} // end of for
|
} // end of for
|
||||||
@@ -88,6 +123,13 @@ public class Muehle extends Application {
|
|||||||
return board;
|
return board;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void addShape(Shape newShape) {
|
||||||
|
game_board.getChildren().add(newShape);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// end methods
|
// end methods
|
||||||
} // end of class Muehle
|
} // end of class Muehle
|
||||||
|
|||||||
BIN
MuehleButton$1.class
Normal file
BIN
MuehleButton$1.class
Normal file
Binary file not shown.
BIN
MuehleButton.class
Normal file
BIN
MuehleButton.class
Normal file
Binary file not shown.
57
MuehleButton.java
Normal file
57
MuehleButton.java
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
import javafx.scene.paint.Color;
|
||||||
|
import javafx.scene.shape.Circle;
|
||||||
|
import javafx.scene.shape.Shape;
|
||||||
|
import javafx.event.Event;
|
||||||
|
import javafx.event.EventHandler;
|
||||||
|
import javafx.scene.input.MouseEvent;
|
||||||
|
public class MuehleButton {
|
||||||
|
|
||||||
|
public Game game;
|
||||||
|
|
||||||
|
public int relativeX;
|
||||||
|
public int relativeY;
|
||||||
|
|
||||||
|
public double absoluteX;
|
||||||
|
public double absoluteY;
|
||||||
|
|
||||||
|
public Color color;
|
||||||
|
|
||||||
|
public double radius;
|
||||||
|
|
||||||
|
public Circle circle;
|
||||||
|
|
||||||
|
public MuehleButton(int relX, int relY, double absX, double absY, Color color, Game game) {
|
||||||
|
relativeX = relX;
|
||||||
|
relativeY = relY;
|
||||||
|
|
||||||
|
absoluteX = absX;
|
||||||
|
absoluteY = absY;
|
||||||
|
|
||||||
|
radius = 20;
|
||||||
|
this.color = color;
|
||||||
|
circle = new Circle(absoluteX, absoluteY, radius);
|
||||||
|
circle.setFill(this.color);
|
||||||
|
|
||||||
|
this.game = game;
|
||||||
|
|
||||||
|
circle.addEventHandler(MouseEvent.MOUSE_RELEASED, mouse_click_target);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Shape getShape() {
|
||||||
|
return circle;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
EventHandler<MouseEvent> mouse_click_target = new EventHandler<MouseEvent>() {
|
||||||
|
public void handle(MouseEvent event) {
|
||||||
|
System.out.println("Button Clicked!");
|
||||||
|
MouseClick();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
public void MouseClick() {
|
||||||
|
game.chip_button_clicked(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // end of MuehleButton
|
||||||
24
MuehleButton.uml
Normal file
24
MuehleButton.uml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
[Files]
|
||||||
|
File0=MuehleButton.java
|
||||||
|
|
||||||
|
[Box: - MuehleButton]
|
||||||
|
X=20
|
||||||
|
Y=40
|
||||||
|
MinVis=0
|
||||||
|
ShowParameter=4
|
||||||
|
SortOrder=0
|
||||||
|
ShowIcons=1
|
||||||
|
|
||||||
|
[Diagram]
|
||||||
|
Comments=0
|
||||||
|
OffsetX=0
|
||||||
|
OffsetY=0
|
||||||
|
Visibility=0
|
||||||
|
ShowParameter=4
|
||||||
|
SortOrder=0
|
||||||
|
ShowIcons=1
|
||||||
|
ShowConnections=0
|
||||||
|
Fontname=Segoe UI
|
||||||
|
Fontsize=12
|
||||||
|
ShowObjectDiagram=0
|
||||||
|
|
||||||
57
MuehleButton.~ava
Normal file
57
MuehleButton.~ava
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
import javafx.scene.paint.Color;
|
||||||
|
import javafx.scene.shape.Circle;
|
||||||
|
import javafx.scene.shape.Shape;
|
||||||
|
import javafx.event.Event;
|
||||||
|
import javafx.event.EventHandler;
|
||||||
|
import javafx.scene.input.MouseEvent;
|
||||||
|
public class MuehleButton {
|
||||||
|
|
||||||
|
public Game game;
|
||||||
|
|
||||||
|
public int relativeX;
|
||||||
|
public int relativeY;
|
||||||
|
|
||||||
|
public double absoluteX;
|
||||||
|
public double absoluteY;
|
||||||
|
|
||||||
|
public Color color;
|
||||||
|
|
||||||
|
public double radius;
|
||||||
|
|
||||||
|
public Circle circle;
|
||||||
|
|
||||||
|
public MuehleButton(int relX, int relY, double absX, double absY, Color color, Game game) {
|
||||||
|
relativeX = relX;
|
||||||
|
relativeY = relY;
|
||||||
|
|
||||||
|
absoluteX = absX;
|
||||||
|
absoluteY = absY;
|
||||||
|
|
||||||
|
radius = 20;
|
||||||
|
this.color = color;
|
||||||
|
circle = new Circle(absoluteX, absoluteY, radius);
|
||||||
|
circle.setFill(this.color);
|
||||||
|
|
||||||
|
this.game = game;
|
||||||
|
|
||||||
|
circle.addEventHandler(MouseEvent.MOUSE_RELEASED, mouse_click_target);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Shape getShape() {
|
||||||
|
return circle;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
EventHandler<MouseEvent> mouse_click_target = new EventHandler<MouseEvent>() {
|
||||||
|
public void handle(MouseEvent event) {
|
||||||
|
System.out.println("Button Clicked!");
|
||||||
|
MouseClick();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
public void MouseClick() {
|
||||||
|
game.chip_button_clicked(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // end of MuehleButton
|
||||||
Reference in New Issue
Block a user