diff --git a/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/utils/Colorpalette.java b/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/utils/Colorpalette.java index 2ef4b3c5017ab2fd4617c5eebde324830732d436..667a8428a2b572f39560ddd160a39bf7b532f5f7 100644 --- a/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/utils/Colorpalette.java +++ b/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/utils/Colorpalette.java @@ -5,5 +5,5 @@ import javafx.scene.paint.Color; public final class Colorpalette{ public static final Color White = Color.web("#FFFFFF"); public static final Color Black = Color.web("#000000"); - public static final Color Primary = Color.web("#7971EA"); + public static final Color Primary = Color.web("#5072A7"); } \ No newline at end of file diff --git a/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/views/Components/ExtraUserOptions.java b/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/views/Components/ExtraUserOptions.java index 442949fe11a6730f4361046837f3e7db2135daec..a4b3ad254c5a17809ec531709742dcc9134b1955 100644 --- a/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/views/Components/ExtraUserOptions.java +++ b/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/views/Components/ExtraUserOptions.java @@ -8,8 +8,10 @@ import javafx.scene.canvas.Canvas; import javafx.scene.canvas.GraphicsContext; import javafx.scene.control.Button; import javafx.scene.control.Label; +import javafx.scene.control.Separator; import javafx.scene.control.Slider; import javafx.scene.layout.HBox; +import javafx.scene.layout.Priority; import javafx.scene.layout.VBox; public class ExtraUserOptions extends VBox { @@ -21,7 +23,6 @@ public class ExtraUserOptions extends VBox { private final RotationButton rotationButton; private final InformationButton informationButton; - public ExtraUserOptions(Node node) { this.node = node; resetViewButton = new Button("Reset View"); @@ -29,22 +30,31 @@ public class ExtraUserOptions extends VBox { rotationButton = new RotationButton(node); informationButton = new InformationButton("Additional Information"); zoomSlider = new Slider(0.5, 4.0, 1.0); - + extraUserOptionsLabel(); Label rotationLabel = new Label("Rotate the view"); + rotationLabel.setStyle("-fx-font-size: 14px; "); + + Label zoomLabel = new Label("Zoom"); + zoomLabel.setStyle("-fx-font-size: 14px; "); - this.getChildren().addAll(resetViewButton, + this.getChildren().addAll( + zoomLabel, createZoomSliderWithLabels(), rotationLabel, rotationButton, + createSeparator(), + resetViewButton, clearCanvasButton, - informationButton); + informationButton + ); extraUserOptionsInitialize(); } + private HBox createZoomSliderWithLabels() { - Label zoomInLabel = new Label("Zoom In"); - Label zoomOutLabel = new Label("Zoom Out"); + Label zoomInLabel = new Label("In"); + Label zoomOutLabel = new Label("Out"); zoomSlider.setPrefWidth(100); HBox sliderWithLabels = new HBox(zoomOutLabel, zoomSlider, zoomInLabel); @@ -77,12 +87,12 @@ public class ExtraUserOptions extends VBox { setPrefHeight(0.3 * screenHeight); setMaxHeight(0.3 * screenHeight); setAlignment(Pos.CENTER); - setPadding(new Insets(10, 0, 10, 0)); + setPadding(new Insets(10, 20, 10, 20)); + setSpacing(10); } private void extraUserOptionsStyling() { - setPadding(new Insets(10, 10, 10, 10)); - setStyle("-fx-background-color: #f4f4f4;"); + setStyle("-fx-background-color: #eed9c4;"); } private void sliderToZoom() { @@ -106,4 +116,18 @@ public class ExtraUserOptions extends VBox { node.setTranslateY(0); }); } + + private void extraUserOptionsLabel() { + Label extraUserOptionsLabel = new Label("Extra Functions"); + extraUserOptionsLabel.setStyle("-fx-font-size: 16px; -fx-font-weight: bold;"); + getChildren().add(extraUserOptionsLabel); + } + + private Separator createSeparator() { + Separator separator = new Separator(); + separator.setMaxWidth(Double.MAX_VALUE); + VBox.setVgrow(separator, Priority.ALWAYS); + return separator; + } + } diff --git a/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/views/Components/InformationButton.java b/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/views/Components/InformationButton.java index 26815ce288c72696d3c891ec12448f8b6e7c7658..6fd628b6a842e7c6b2950014cf0cdb5426421cb6 100644 --- a/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/views/Components/InformationButton.java +++ b/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/views/Components/InformationButton.java @@ -19,12 +19,14 @@ public class InformationButton extends Button { String contentText = "Fractals use 3 primary colors to show hit density:\n" + "Red: Top 33% hit most\nBlue: Mid 33%\nGreen: Bottom 33%\n\n" + "Right side: Main menu - create, select, edit fractals\n" + - "Bottom menu: Extra user options for canvas interaction\n\n" + + "Bottom menu: Extra user options for canvas interaction" + + "The reset view button brings the canvas back to its original zoom and rotation\n" + + "The clear canvas button clears the whole canvas\n\n" + "Interact with canvas: Zoom with mouse, click-hold to move"; alert.setContentText(contentText); alert.getDialogPane().setPrefWidth(400); - alert.getDialogPane().setPrefHeight(250); + alert.getDialogPane().setPrefHeight(300); alert.getDialogPane().setMinWidth(Region.USE_PREF_SIZE); alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE); diff --git a/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/views/Components/Menu.java b/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/views/Components/Menu.java index c67d8681a65db85f7221cf92c5735c1c540682f3..47d7a8c1cdd5af9d17acfa6435a4366966bdef27 100644 --- a/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/views/Components/Menu.java +++ b/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/views/Components/Menu.java @@ -4,30 +4,37 @@ import edu.ntnu.idatt2003.mappevurderingprog2.controllers.GameController; import edu.ntnu.idatt2003.mappevurderingprog2.views.View; import javafx.geometry.Pos; import javafx.scene.control.Label; +import javafx.scene.control.Separator; import javafx.scene.layout.VBox; public class Menu extends VBox { private ExistingFractalsMenu existingFractalsMenu; private CreateFractalMenu createFractalMenu; - private EditFractalMenu editFractalMenu; // Add this line + private EditFractalMenu editFractalMenu; + private ExtraUserOptions extraUserOptions; public Menu(View view, GameController gameController) { existingFractalsMenu = new ExistingFractalsMenu(view, gameController); createFractalMenu = new CreateFractalMenu(); - editFractalMenu = new EditFractalMenu(view, gameController); // Initialize here + editFractalMenu = new EditFractalMenu(view, gameController); + extraUserOptions = new ExtraUserOptions(view.getMainCanvas()); initializeMenu(); } private void initializeMenu() { Label menuLabel = new Label("Menu"); - menuLabel.setStyle("-fx-font-size: 18px; -fx-font-weight: bold;"); + menuLabel.setStyle("-fx-font-size: 20px; -fx-font-weight: bold;-fx-font-family: 'Times New Roman'"); setPrefWidth(200); - getChildren().addAll(menuLabel, existingFractalsMenu, createFractalMenu, editFractalMenu); // Add to children + getChildren().addAll(menuLabel, new Separator(), + existingFractalsMenu, + createFractalMenu, + editFractalMenu, + new Separator(), + extraUserOptions); setAlignment(Pos.TOP_CENTER); setSpacing(20); - setStyle("-fx-background-color: #f4f4f4;"); - } -} - + setStyle(" -fx-background-color: #faf0e6;"); + } +} \ No newline at end of file diff --git a/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/views/Components/RotationButton.java b/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/views/Components/RotationButton.java index 824d5f9f7ef5cb3b49a61c505368928fab6fa4d7..83ba51c086677b5ef64719229acf6ab630aeebd2 100644 --- a/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/views/Components/RotationButton.java +++ b/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/views/Components/RotationButton.java @@ -16,8 +16,8 @@ public class RotationButton extends HBox { public RotationButton(Node node) { this.node = node; - rotateClockwise = new Button("Clockwise"); - rotateCounterClockwise = new Button("Counter Clockwise"); + rotateClockwise = new Button("Right"); + rotateCounterClockwise = new Button("Left"); initializeUI(); attachEventHandlers(); diff --git a/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/views/View.java b/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/views/View.java index 320c6739cf8ca4d63ab26258783bf02a92ff8ec6..c545a8abcb7a56376f66a01b42b7694de7d16789 100644 --- a/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/views/View.java +++ b/src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/views/View.java @@ -9,8 +9,6 @@ import edu.ntnu.idatt2003.mappevurderingprog2.models.chaos.ChaosGame; import edu.ntnu.idatt2003.mappevurderingprog2.models.chaos.ChaosGameObserver; import edu.ntnu.idatt2003.mappevurderingprog2.utils.Colorpalette; import edu.ntnu.idatt2003.mappevurderingprog2.utils.Size; - -import edu.ntnu.idatt2003.mappevurderingprog2.views.Components.Zoom; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Collections; @@ -18,13 +16,11 @@ import java.util.List; import javafx.application.Platform; import javafx.geometry.Insets; -import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.canvas.Canvas; import javafx.scene.canvas.GraphicsContext; import javafx.scene.layout.*; import javafx.scene.paint.Color; -import javafx.scene.control.Separator; public class View extends BorderPane implements ChaosGameObserver { @@ -98,15 +94,7 @@ public class View extends BorderPane implements ChaosGameObserver { this.setBackground(new Background(new BackgroundFill(Colorpalette.Primary, CornerRadii.EMPTY, Insets.EMPTY))); this.setCenter(mainCanvas); this.menu = new Menu(this, gameController); - - VBox rightContainer = new VBox(); - rightContainer.setAlignment(Pos.BOTTOM_RIGHT); - rightContainer.getChildren().add(extraUserOptions); - - this.setRight(rightContainer); this.setLeft(menu); - new Separator(); - return new Scene(this, Size.getScreenWidth(), Size.getScreenHeight()); } diff --git a/src/main/resources/styles/leftBoxUI.css b/src/main/resources/styles/leftBoxUI.css deleted file mode 100644 index 8b137891791fe96927ad78e64b0aad7bded08bdc..0000000000000000000000000000000000000000 --- a/src/main/resources/styles/leftBoxUI.css +++ /dev/null @@ -1 +0,0 @@ -