added circles
This commit is contained in:
BIN
Muehle.class
BIN
Muehle.class
Binary file not shown.
19
Muehle.java
19
Muehle.java
@@ -43,7 +43,8 @@ public class Muehle extends Application {
|
|||||||
public Pane draw_game_board() {
|
public Pane draw_game_board() {
|
||||||
|
|
||||||
Color bg_color = Color.rgb(255,255,0);
|
Color bg_color = Color.rgb(255,255,0);
|
||||||
Color stroke_color = Color.rgb(250, 250, 50);
|
Color stroke_color = Color.RED;
|
||||||
|
Double circle_offset = 100.0;
|
||||||
|
|
||||||
ArrayList<Shape> shapes = new ArrayList<Shape>();
|
ArrayList<Shape> shapes = new ArrayList<Shape>();
|
||||||
|
|
||||||
@@ -61,7 +62,23 @@ public class Muehle extends Application {
|
|||||||
shapes.add(bg);
|
shapes.add(bg);
|
||||||
|
|
||||||
|
|
||||||
|
Rectangle circle1 = new Rectangle(topLeftX,topLeftY,topRightX,topRightY);
|
||||||
|
circle1.setStroke(stroke_color);
|
||||||
|
circle1.setStrokeWidth(10);
|
||||||
|
circle1.setFill(new Color(0.0,0.0,0.0,0.0));
|
||||||
|
shapes.add(circle1);
|
||||||
|
|
||||||
|
Rectangle circle2 = new Rectangle(topLeftX + 100,topLeftY + 100,topRightX - 200,topRightY - 200);
|
||||||
|
circle2.setStroke(stroke_color);
|
||||||
|
circle2.setStrokeWidth(10);
|
||||||
|
circle2.setFill(new Color(0.0,0.0,0.0,0.0));
|
||||||
|
shapes.add(circle2);
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
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));
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
object FGUIForm_1: TFXGUIForm
|
object FGUIForm: TFXGUIForm
|
||||||
Tag = 180
|
Tag = 180
|
||||||
Left = 240
|
Left = 240
|
||||||
Top = 154
|
Top = 154
|
||||||
|
|||||||
93
Muehle.~ava
Normal file
93
Muehle.~ava
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
import javafx.application.Application;
|
||||||
|
import javafx.scene.Scene;
|
||||||
|
import javafx.scene.layout.Pane;
|
||||||
|
import javafx.stage.Stage;
|
||||||
|
import javafx.scene.shape.Rectangle;
|
||||||
|
import javafx.scene.paint.Color;
|
||||||
|
import javafx.stage.Window;
|
||||||
|
import javafx.scene.shape.Shape;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import javafx.scene.control.Label;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Beschreibung
|
||||||
|
*
|
||||||
|
* @version 1.0 vom 25.09.2025
|
||||||
|
* @author
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Muehle extends Application {
|
||||||
|
// start attributes
|
||||||
|
// end attributes
|
||||||
|
private Label lTop = new Label();
|
||||||
|
|
||||||
|
public void start(Stage primaryStage) {
|
||||||
|
Pane root = new Pane();
|
||||||
|
|
||||||
|
Pane game_board = draw_game_board();
|
||||||
|
root.getChildren().addAll(lTop,game_board);
|
||||||
|
Scene scene = new Scene(root, 1080, 820);
|
||||||
|
|
||||||
|
setTopLabel("Test Label");
|
||||||
|
|
||||||
|
primaryStage.setOnCloseRequest(e -> System.exit(0));
|
||||||
|
primaryStage.setTitle("Muehle");
|
||||||
|
primaryStage.setScene(scene);
|
||||||
|
primaryStage.show();
|
||||||
|
} // end of public Muehle
|
||||||
|
public void setTopLabel(String value) {
|
||||||
|
lTop.setText(value);
|
||||||
|
}
|
||||||
|
// start methods
|
||||||
|
public Pane draw_game_board() {
|
||||||
|
|
||||||
|
Color bg_color = Color.rgb(255,255,0);
|
||||||
|
Color stroke_color = Color.RED;
|
||||||
|
Double circle_offset = 100.0;
|
||||||
|
|
||||||
|
ArrayList<Shape> shapes = new ArrayList<Shape>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Pane board = new Pane();
|
||||||
|
double topLeftX = (1080/2)-400;
|
||||||
|
double topLeftY = 720-(720/2)-300;
|
||||||
|
double topRightX =(1080/2)+200;
|
||||||
|
double topRightY = (720/2)+300;
|
||||||
|
|
||||||
|
Rectangle bg = new Rectangle(topLeftX,topLeftY,topRightX,topRightY);
|
||||||
|
bg.setFill(bg_color);
|
||||||
|
shapes.add(bg);
|
||||||
|
|
||||||
|
|
||||||
|
Rectangle circle1 = new Rectangle(topLeftX,topLeftY,topRightX,topRightY);
|
||||||
|
circle1.setStroke(stroke_color);
|
||||||
|
circle1.setStrokeWidth(10);
|
||||||
|
circle1.setFill(new Color(0.0,0.0,0.0,0.0));
|
||||||
|
shapes.add(circle1);
|
||||||
|
|
||||||
|
Rectangle circle2 = new Rectangle(topLeftX + 100,topLeftY + 100,topRightX - 200,topRightY - 200);
|
||||||
|
circle2.setStroke(stroke_color);
|
||||||
|
circle2.setStrokeWidth(10);
|
||||||
|
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);
|
||||||
|
circle3.setStroke(stroke_color);
|
||||||
|
circle3.setStrokeWidth(10);
|
||||||
|
circle3.setFill(new Color(0.0,0.0,0.0,0.0));
|
||||||
|
shapes.add(circle3);
|
||||||
|
|
||||||
|
for (int i = 0; i < shapes.size() ;i++ ) {
|
||||||
|
board.getChildren().add(shapes.get(i));
|
||||||
|
} // end of for
|
||||||
|
|
||||||
|
|
||||||
|
return board;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// end methods
|
||||||
|
} // end of class Muehle
|
||||||
46
Muehle.~fm
Normal file
46
Muehle.~fm
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
object FGUIForm_1: TFXGUIForm
|
||||||
|
Tag = 180
|
||||||
|
Left = 240
|
||||||
|
Top = 154
|
||||||
|
BorderIcons = [biSystemMenu]
|
||||||
|
Caption = 'Muehle'
|
||||||
|
ClientHeight = 227
|
||||||
|
ClientWidth = 270
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = DEFAULT_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = 'Segoe UI'
|
||||||
|
Font.Style = []
|
||||||
|
FormStyle = fsStayOnTop
|
||||||
|
Position = poDesigned
|
||||||
|
Visible = True
|
||||||
|
OnActivate = FormActivate
|
||||||
|
OnAfterMonitorDpiChanged = FormAfterMonitorDpiChanged
|
||||||
|
OnBeforeMonitorDpiChanged = FormBeforeMonitorDpiChanged
|
||||||
|
OnCanResize = FormCanResize
|
||||||
|
OnClose = FormClose
|
||||||
|
OnCloseQuery = FormCloseQuery
|
||||||
|
OnCreate = FormCreate
|
||||||
|
OnDeactivate = FormDeactivate
|
||||||
|
OnMouseActivate = FormMouseActivate
|
||||||
|
OnResize = FormResize
|
||||||
|
Resizable = True
|
||||||
|
Undecorated = False
|
||||||
|
Background = clBtnFace
|
||||||
|
Title = 'Muehle'
|
||||||
|
FontSize = 11
|
||||||
|
X = 0
|
||||||
|
Y = 0
|
||||||
|
FullScreen = False
|
||||||
|
AlwaysOnTop = False
|
||||||
|
Iconified = False
|
||||||
|
MaxHeight = 0
|
||||||
|
MaxWidth = 0
|
||||||
|
MinHeight = 0
|
||||||
|
MinWidth = 0
|
||||||
|
showing = ''
|
||||||
|
TextHeight = 15
|
||||||
|
object GNUgettextMarker: TGnuGettextComponentMarker
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user