Skip to content

Commit

Permalink
Make a working notebook prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
IzN432 committed Oct 20, 2024
1 parent bafdab5 commit 530ac38
Show file tree
Hide file tree
Showing 2 changed files with 160 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/main/java/keycontacts/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

import java.util.logging.Logger;

import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.MenuItem;
import javafx.scene.control.TextInputControl;
import javafx.scene.input.KeyCombination;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import keycontacts.commons.core.GuiSettings;
import keycontacts.commons.core.LogsCenter;
Expand All @@ -23,7 +27,7 @@
*/
public class MainWindow extends UiPart<Stage> {

private static final String FXML = "MainWindow.fxml";
private static final String FXML = "Notebook.fxml";

private final Logger logger = LogsCenter.getLogger(getClass());

Expand All @@ -35,6 +39,15 @@ public class MainWindow extends UiPart<Stage> {
private ResultDisplay resultDisplay;
private HelpWindow helpWindow;

@FXML
private AnchorPane leftPage;

@FXML
private AnchorPane rightPage;

@FXML
private StackPane binder;

@FXML
private StackPane commandBoxPlaceholder;

Expand Down Expand Up @@ -66,6 +79,12 @@ public MainWindow(Stage primaryStage, Logic logic) {
setAccelerators();

helpWindow = new HelpWindow();

rightPage.getParent().getScene().widthProperty().addListener((observable, oldValue, newValue) -> {
double newWidth = newValue.doubleValue();
leftPage.setPrefWidth((newWidth - binder.getWidth()) / 2);
rightPage.setPrefWidth((newWidth - binder.getWidth()) / 2);
});
}

public Stage getPrimaryStage() {
Expand Down
140 changes: 140 additions & 0 deletions src/main/resources/view/Notebook.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import java.net.URL?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.Scene?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.effect.DropShadow?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.shape.Arc?>
<?import javafx.stage.Stage?>

<fx:root minHeight="600" minWidth="450" onCloseRequest="#handleExit" title="KeyContacts" type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<scene>
<Scene>
<VBox prefHeight="200.0" prefWidth="100.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<MenuBar fx:id="menuBar" stylesheets="@DarkTheme.css" VBox.vgrow="NEVER">
<Menu mnemonicParsing="false" text="File">
<MenuItem mnemonicParsing="false" onAction="#handleExit" text="Exit" />
</Menu>
<Menu mnemonicParsing="false" text="Help">
<MenuItem fx:id="helpMenuItem" mnemonicParsing="false" onAction="#handleHelp" text="Help" />
</Menu>
</MenuBar>
<AnchorPane style="-fx-background-color: brown;" VBox.vgrow="ALWAYS">
<children>
<HBox layoutX="10.0" layoutY="10.0" style="-fx-background-color: whitesmoke;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<AnchorPane fx:id="leftPage" HBox.hgrow="ALWAYS">
<children>
<VBox style="-fx-border-color: brown; -fx-border-width: 2;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<StackPane fx:id="commandBoxPlaceholder" styleClass="pane-with-border" VBox.vgrow="NEVER">
<padding>
<Insets bottom="5" left="10" right="10" top="5" />
</padding>
</StackPane>

<StackPane fx:id="resultDisplayPlaceholder" maxHeight="100" minHeight="100" prefHeight="100" styleClass="pane-with-border" VBox.vgrow="NEVER">
<padding>
<Insets bottom="5" left="10" right="10" top="5" />
</padding>
</StackPane>

<VBox fx:id="studentList" styleClass="pane-with-border" VBox.vgrow="ALWAYS">
<padding>
<Insets bottom="10" left="10" right="10" top="10" />
</padding>
<StackPane fx:id="studentListPanelPlaceholder" VBox.vgrow="ALWAYS" />
</VBox>

<StackPane fx:id="statusbarPlaceholder" VBox.vgrow="NEVER" />
</VBox>
</children>
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding></AnchorPane>
<StackPane fx:id="binder" prefWidth="20.0">
<children>
<Pane prefHeight="200.0" prefWidth="10.0" style="-fx-border-color: black; -fx-border-width: 0 1 0 1; -fx-background-color: whitesmoke;">
<StackPane.margin>
<Insets left="5.0" right="5.0" />
</StackPane.margin>
<effect>
<DropShadow radius="6.335" spread="0.16" width="6.34" />
</effect>
</Pane>
<VBox alignment="TOP_CENTER" prefHeight="200.0" prefWidth="100.0" spacing="5.0">
<children>
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="586.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" VBox.vgrow="ALWAYS" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="16.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" VBox.vgrow="ALWAYS" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="31.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" VBox.vgrow="ALWAYS" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="46.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="61.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="76.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="91.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="106.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="121.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="136.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="151.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="166.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="181.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="196.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="211.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="226.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="241.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="256.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="271.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="286.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="301.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="316.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="331.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="346.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="361.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="376.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="391.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="406.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="421.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="436.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="451.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="466.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="481.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="496.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="511.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="526.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="541.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="556.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
<Arc fill="TRANSPARENT" layoutX="20.0" layoutY="571.0" length="260.0" radiusX="8.0" radiusY="6.0" startAngle="-40.0" stroke="BLACK" strokeType="INSIDE" />
</children>
</VBox>
</children>
</StackPane>
<AnchorPane fx:id="rightPage" HBox.hgrow="ALWAYS">
<children>
<VBox style="-fx-border-color: brown; -fx-border-width: 2;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
</children>
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding></AnchorPane>
</children>
</HBox>
</children>
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</padding>
</AnchorPane>
</children>
</VBox>
<stylesheets>
<URL value="@DarkTheme.css" />
<URL value="@Extensions.css" />
</stylesheets>
</Scene>
</scene>
</fx:root>

0 comments on commit 530ac38

Please sign in to comment.