From 857dfaaacf20beac8b3433b6a19b46739d1e385a Mon Sep 17 00:00:00 2001 From: Sage The DM Date: Tue, 5 Nov 2024 09:14:32 +0100 Subject: [PATCH] boxes --- .../Wrapper-theorie/.vscode/settings.json | 7 ++ Code/Steiner/Wrapper-theorie/README.md | 18 +++ .../Wrapper-theorie/bin/NumberConverter.class | Bin 0 -> 2173 bytes .../Wrapper-theorie/src/NumberConverter.class | Bin 0 -> 1848 bytes .../Wrapper-theorie/src/NumberConverter.java | 41 +++++++ .../src/main/java/com/example/App.java | 110 ++++++++++++++++-- .../src/main/java/com/example/SystemInfo.java | 13 --- .../target/classes/com/example/App.class | Bin 1711 -> 4127 bytes 8 files changed, 164 insertions(+), 25 deletions(-) create mode 100644 Code/Steiner/Wrapper-theorie/.vscode/settings.json create mode 100644 Code/Steiner/Wrapper-theorie/README.md create mode 100644 Code/Steiner/Wrapper-theorie/bin/NumberConverter.class create mode 100644 Code/Steiner/Wrapper-theorie/src/NumberConverter.class create mode 100644 Code/Steiner/Wrapper-theorie/src/NumberConverter.java delete mode 100644 Code/ost/_05_layouts/src/main/java/com/example/SystemInfo.java diff --git a/Code/Steiner/Wrapper-theorie/.vscode/settings.json b/Code/Steiner/Wrapper-theorie/.vscode/settings.json new file mode 100644 index 0000000..e112a70 --- /dev/null +++ b/Code/Steiner/Wrapper-theorie/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin", + "java.project.referencedLibraries": [ + "lib/**/*.jar" + ] +} diff --git a/Code/Steiner/Wrapper-theorie/README.md b/Code/Steiner/Wrapper-theorie/README.md new file mode 100644 index 0000000..7c03a53 --- /dev/null +++ b/Code/Steiner/Wrapper-theorie/README.md @@ -0,0 +1,18 @@ +## Getting Started + +Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code. + +## Folder Structure + +The workspace contains two folders by default, where: + +- `src`: the folder to maintain sources +- `lib`: the folder to maintain dependencies + +Meanwhile, the compiled output files will be generated in the `bin` folder by default. + +> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there. + +## Dependency Management + +The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies). diff --git a/Code/Steiner/Wrapper-theorie/bin/NumberConverter.class b/Code/Steiner/Wrapper-theorie/bin/NumberConverter.class new file mode 100644 index 0000000000000000000000000000000000000000..c89fa6d40c7c081a72c2ef564f4daaba384e0f58 GIT binary patch literal 2173 zcmah~TUQ%Z6#fn*nGnVj0<=V-9V{(L3q)=OlX^+8NNl*+U}~+Go+Jk{Fqw%n6NEQ? zaV?*H(Fgqx_JOi+Eq{PN%H=*Y351fRFXx=umv8U$oxS(`{m{ZJ=6t*jD1p$WWK0o9sgPVJ)t@6I8xD26(x~aSGGxR2sC5FJNRTUBRqEAH-A;Kx> zrtq1`Dr+%@Aar>n6kX#Ph;M_@Zm;=3XXQQZPtv zo}%gMMygohrYY<`3}HmU@THuK$BrxNDz4)OLyrU<@ga39l{Xtrmrw<-XCjCqF7tnr zVKmXzBw3OX##D^sCf(g?5)~I<+mu`zEDVhyzHJEZ2u+worN&K-^kPrgX)S`cF{$7- z!;p6gN~ObF#U0#b2sR`jMQA1Cy}&sIGTnrVByK(${B_e$*Y7#FpXISGi}a1 zq`aSuiWJ^qP!74#6kEFtQ{BRKV7B~-uW8JySnv{XEkCgs71NT62UupfQRfGON~yx# zr@C9CljCyJr3b(JKOtI|lq|igA}z^KJTeSZMt!JK!BX*siJp>7+pEL8RDGx-iyXr> z*UIT8w~u`&Nn*YWF)=VKNxw%b)}&v*Ypsi;_Fa0g6h@vQkzGt`8~jMGH|v^5lxFQ} zEh5s|{M_R5;>yB<#pN&_GbFQ1WK9jy-FoKSd__jykPom)F}iSaDdjfrG3v9W7y>f! zD4wV&%8mheL{NwK|7m=nl7lzevr+2rRS*UO>Z`w`*s!) z`KskheD~GbG%`eXZL97-2jw6?h+`5Lt)^WOYr32d!>^5iS(yR#an7<_$F+H5L%21o z>O@e*t^)FyyvR{E53K`{@}JGGxHVpJE&EuO;vT~aNHPgir}%pXxI^m((7~K_RM|&vaU2VHng$ z+4-dA(?b(P^Lh4^G|R@a3!O@0omWLguXDq*XfRCV2)RAct6G^?4m9}&oj^AAWR9YA zGrJ5)51p5zcGcjHBOC=yhC5eYq8qmgzGJxg-=)Dc>x8syMVtLhuj{sw*Z;Ti@=Le6ZHEW#xF{ZB-ny+rI4Mhh?TR_xXZ zChnhLYGe8o_cuv0bAq`uECMH3p>yUGAEW~$j|a}M+9CZY9hB1G89w%;5^SA(*<7g*?nH&n_N}Mx{cL3dK`wdkV_p(~DcJVUV&7(XABv?}RZ*r*XQ^G|86` zLk=T&Oh2~I5yuORp@v&%K*RUAjh`@yUonN>knmV};@=!Q_>3_7@iR(zO1zBXNAiD0 zG>_v4e1Ye3ygF(sQpoZJVfBEcOuI%_HA2+A^}t)} T-fDU4w{XZRLKZF#afJB4EVw8l literal 0 HcmV?d00001 diff --git a/Code/Steiner/Wrapper-theorie/src/NumberConverter.class b/Code/Steiner/Wrapper-theorie/src/NumberConverter.class new file mode 100644 index 0000000000000000000000000000000000000000..dda8b37fbdc55e8e1ee178f31ad5f4898c716ab0 GIT binary patch literal 1848 zcmah~+g2M@82)xnGlUUnC?_pCSPDrCjf7AzsjW#Y5)B6p($;$DPO>2blbNi^gavor z`UZNT?_e(|3)k`id>}7f{(B~vK(jO#|K9WO@B7bt=g+?{{s6Fw!zkXyZ3VLfxP!SU z0+^S(xQav+cX3Z@7NUq@QHuL9BBkWPviwX-u@VE5x)@et1WqaVP(?;XR;nJx5JW15 zkVFLVSi#2%atx7&hGn>q7=rP{9z&>L*960G$*{y$yHOF&F0YuR2{pK3F^tDwln(hZ zPnz61NS0m4unw}47%kgvrz+MB3BKu53$}GE99KB^B}KzKxW#b8qqkkdOqQ$MvV@}` zuc3fXB;bjLb$rS&wPOn261uR6u5(K_XmcQ(jILlqLlK{8_#7n-o7mE@jS|C1-nQMA z>+t5LaO-xhH5|c?iZ3*LiL!=WN%;zU8lK{risu@>mg|elh`fY~z88jgE}hUf`H9hJ zH}qp}wuNr*>z(6_o?1$;rq`Aqq*oadxfOy^75hUM|HZD!XunbMt%~n7d@qYJe63KF zMYp=!l|xZ=uc*qWEmt%c0-NEw{xm_dmWm!%N|L37S+J^XV1vu#18{*`We=E1#i>r$hUK3TL z!A%bw?-TPChus3r{>tc=br%ckD*5@3}lh)em#sZ@6mOEuo+yFAMc)wmXG} zb!;Dr&Q zPKCnf7|TQ?h@6nkaSt~Y9vP7biab!fg9-0|qL}RFurAF~CWBBgN|8^}ZW=>aApHvc z(d02kFY`E_QE6UMLF$xild}B*xA7xp@iXS}3*waZ4A}|beF$2kRE;VQP$O27zIBB0 S0qK@J`M{HFp8Uv@kNyF2W7Dz# literal 0 HcmV?d00001 diff --git a/Code/Steiner/Wrapper-theorie/src/NumberConverter.java b/Code/Steiner/Wrapper-theorie/src/NumberConverter.java new file mode 100644 index 0000000..10b797b --- /dev/null +++ b/Code/Steiner/Wrapper-theorie/src/NumberConverter.java @@ -0,0 +1,41 @@ +import java.util.Scanner; + +public class NumberConverter { + public static void main(String[] args) { + // User input + Scanner scanner = new Scanner(System.in); + System.out.print("Please enter an integer: "); + String input = scanner.nextLine(); + + // Convert input to an Integer object + Integer number = Integer.valueOf(input); + + // A1) Display the entered number + System.out.println("A1) Entered number: " + number.toString()); + + // A2) Convert to binary and display + String binaryString = Integer.toBinaryString(number); + System.out.println("A2) Number in binary: " + binaryString); + + // A3) Convert to hexadecimal and display + String hexString = Integer.toHexString(number); + System.out.println("A3) Number in hexadecimal: " + hexString); + + // A4) Display the maximum value for Integer + System.out.println("A4) Maximum value of Integer: " + Integer.MAX_VALUE); + + // A5) Display the minimum value for Integer + System.out.println("A5) Minimum value of Integer: " + Integer.MIN_VALUE); + + // B1) Convert the binary string back to decimal and display + Integer fromBinary = Integer.valueOf(binaryString, 2); + System.out.println("B1) Converted back from binary: " + fromBinary.toString()); + + // B2) Convert the hexadecimal string back to decimal and display + Integer fromHex = Integer.valueOf(hexString, 16); + System.out.println("B2) Converted back from hexadecimal: " + fromHex.toString()); + + // Close the scanner + scanner.close(); + } +} diff --git a/Code/ost/_05_layouts/src/main/java/com/example/App.java b/Code/ost/_05_layouts/src/main/java/com/example/App.java index b9dbc2d..1248f16 100644 --- a/Code/ost/_05_layouts/src/main/java/com/example/App.java +++ b/Code/ost/_05_layouts/src/main/java/com/example/App.java @@ -1,23 +1,64 @@ +//#region imports package com.example; import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.AnchorPane; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Priority; +import javafx.scene.layout.StackPane; +import javafx.scene.layout.VBox; +import javafx.scene.paint.Color; +import javafx.scene.shape.Circle; +import javafx.scene.shape.Rectangle; +import javafx.scene.text.Text; import javafx.stage.Stage; -/** - * JavaFX App with AnchorPane layout - */ +//#region launcher public class App extends Application { + private Stage primaryStage; + + public static void main(String[] args) { + launch(args); + } + @Override public void start(Stage stage) { - // Create AnchorPane + this.primaryStage = stage; + showStackPane(); // Change this line to launch a different scene + } + + // #region HBox Scene + private void showHBoxScene() { + HBox hbox = new HBox(); + hbox.setPadding(new Insets(10, 20, 20, 20)); + hbox.setSpacing(15); + + // Create two buttons + Button leftButton = new Button("Left"); + Button rightButton = new Button("Right"); + + // Add buttons to the HBox + hbox.getChildren().addAll(leftButton, rightButton); + hbox.setAlignment(Pos.CENTER); + + Scene scene = new Scene(hbox, 250, 150); + primaryStage.setTitle("Hauptfenster - HBox Scene"); + primaryStage.setScene(scene); + primaryStage.show(); + } + // #endregion + + // #region AnchorPane Scene + private void showAnchorPaneScene() { AnchorPane anchorPane = new AnchorPane(); - // Create Controll button - Button mainButton = new Button("Button"); + // Create Control button + Button mainButton = new Button("Main Button"); AnchorPane.setTopAnchor(mainButton, 50.0); AnchorPane.setLeftAnchor(mainButton, 50.0); AnchorPane.setRightAnchor(mainButton, 10.0); @@ -31,14 +72,59 @@ public class App extends Application { // Add buttons to the pane anchorPane.getChildren().addAll(mainButton, button1); - // Set up the Scene with AnchorPane Scene scene = new Scene(anchorPane, 640, 480); - stage.setTitle("Hauptfenster with AnchorPane"); - stage.setScene(scene); - stage.show(); + primaryStage.setTitle("Hauptfenster - AnchorPane Scene"); + primaryStage.setScene(scene); + primaryStage.show(); } + // #endregion - public static void main(String[] args) { - launch(); + // #region VBox Scene + private void showVBoxScene() { + VBox vbox = new VBox(); + vbox.setSpacing(8); + + // Create the buttons + Button growButton = new Button("Lass mich wachsen!"); + Button relaxButton = new Button("Lass mich in ruhe!"); + + // Set grow priority for the growButton + VBox.setVgrow(growButton, Priority.ALWAYS); + growButton.setMaxHeight(500); + + // Add buttons to the VBox + vbox.getChildren().addAll(growButton, relaxButton); + + Scene scene = new Scene(vbox, 200, 400); + primaryStage.setTitle("VBox Scene"); + primaryStage.setScene(scene); + primaryStage.show(); } + // #endregion + + // #region StackPane Scene + private void showStackPane() { + StackPane stackPane = new StackPane(); + + // Create a circle + Circle circle = new Circle(100); + circle.setFill(Color.DARKSLATEBLUE); + circle.setStroke(Color.BLACK); + + // Create a rectangle + Rectangle rectangle = new Rectangle(50, 50); + + // Create a text + Text text = new Text("Hello World"); + text.setFill(Color.CRIMSON); + + // Add the shapes and text to the StackPane + stackPane.getChildren().addAll(circle, rectangle, text); + + Scene scene = new Scene(stackPane, 300, 300); + primaryStage.setTitle("StackPane Scene"); + primaryStage.setScene(scene); + primaryStage.show(); + } + // #endregion } diff --git a/Code/ost/_05_layouts/src/main/java/com/example/SystemInfo.java b/Code/ost/_05_layouts/src/main/java/com/example/SystemInfo.java deleted file mode 100644 index b566a3e..0000000 --- a/Code/ost/_05_layouts/src/main/java/com/example/SystemInfo.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.example; - -public class SystemInfo { - - public static String javaVersion() { - return System.getProperty("java.version"); - } - - public static String javafxVersion() { - return System.getProperty("javafx.version"); - } - -} \ No newline at end of file diff --git a/Code/ost/_05_layouts/target/classes/com/example/App.class b/Code/ost/_05_layouts/target/classes/com/example/App.class index 440c9981ff17d34c2b43e291d46ab49d9545e943..873f5c2bc5956fbcfcb96b0ce9d0f06b0d87d6e6 100644 GIT binary patch literal 4127 zcmaJ^X>=P`75>K2W_gk{wiDu{Y2>D%UXmz#!ERH@OPUaQsqNSiZJ}d%EKf4hD5J4s zLz|_v4Ljj*fB*pw`@V%%HZ?7QzyZoucFIzA=waV~0^fV1Jx**N&C`4L-FNTzefQ4u zlmC6}2>`d?KYr9GSedX=VSQFhWlTLB&1C%WD7fLMHlt0>hP6z_G!mL)SZT3V7%NaS zwvp28xnW03>IxcT`3+g|JuGKC75Hv7(uT87!LpXtQ3alEYeElV8R}H{5#ZS|BdzyO zr^a=AL>o8hs6J*TG;>t54e>oc>2aovtb$dss!(}?C#4x_1#4RFk`aVWEuG}?wvkSD zwvGm&pg~0=RxuV+n@%UDxJ9#*^wzM%4h3E&U^@z))3Q`Xt)sQ{xK4!^KH>X%6&pkz z%d=C~2_~I5HmIeUh43O^k@E+-tl8m&p4R8$Q#eUY0;8-IL}-R>ZWO=uHPwkz+v=(?sSf;5b zgc7sif$^+v&j^LYjI7h?M-SCe5m!HzR)_sK;Kv;bn)7Q{_o3n-UO_xnnp66 z($iGk+ABE{I|TA9pZbanrKEfjDa#|LphNCKuiNf)S!r^0T+?r*)1-#sF%Zh`Q9yBQ{S7r(}R9aT5kj8bk&{e_O zEB%#ssj`4br3fO*-eB3Hd}W+|OqaS~MK~qHARN>Mz`*PJ*o8vwalXhwNd$tp4=4S& zU%_>PI9L8X)-+YC;uKD^W@j{WS|6AcCDP*xz1)gQaqxhOm*GKIDI-?KJzYUd6}3X| zof4D^527D9cv!_*;bS?;5yj~`5i74y@k+6>f-ABVOG~d-@fxwTl1p6{t2^bc1@Jo3 z?B*KUA)G{fkq6zBeUX#yAb>Y1*jObmcfWwx6&X3zil{3HRdSkVzqC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