Skip to content
Snippets Groups Projects
Commit 070f60b1 authored by aichinos's avatar aichinos
Browse files

aloitus muutettu

parent 82572557
No related branches found
No related tags found
No related merge requests found
package fxMMKurssit;
import fi.jyu.mit.fxgui.ModalController;
import fi.jyu.mit.fxgui.CheckBoxChooser;
import fi.jyu.mit.fxgui.ListChooser;
//import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
......@@ -35,10 +40,20 @@ public class MMKurssitGUIController {
//Attribuutit===================================================================
@FXML private Button buttonAddMeeting;
@FXML private Button buttonClose;
@FXML private Button buttonOpenCourse;
@FXML private Button buttonOpenMeeting;
@FXML private ListChooser<?> allCourses;
@FXML private Button buttonAddMeeting;
@FXML private Button buttonOpenMeeting;
@FXML private CheckBox onlyUpcoming;
@FXML private Label sectionTitle;
@FXML private CheckBoxChooser<?> selectedCourse;
@FXML private ListChooser<?> tapaamiset;
@FXML private TextField textSearch;
//==============================================================================
......@@ -47,29 +62,6 @@ public class MMKurssitGUIController {
ModalController.showModal(KurssinlisaysGUIController.class.getResource("LisaaTapaaminenGUIView.fxml"),
"Missä ja Milloin Kurssi", null, "");
}
@FXML void closeProgram() {
//
}
@FXML void openCourseInfo() {
/*Alert alert = new Alert(AlertType.INFORMATION);
alert.setTitle("Not yet");
alert.setContentText("Not ready yet.");
alert.showAndWait();*/
try {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("KurssinTiedotGUIView.fxml"));
Parent root1 = (Parent) fxmlLoader.load();
Stage stage = new Stage();
stage.setScene(new Scene(root1));
stage.show();
} catch(Exception e) {
System.err.println(e.getMessage());
}
}
//TapaaminenTiedot jotain outo? Ei toimi sen takia, että renamed afterwards?
......
<?xml version="1.0" encoding="UTF-8"?>
<?import fi.jyu.mit.fxgui.ComboBoxChooser?>
<?import fi.jyu.mit.fxgui.CheckBoxChooser?>
<?import fi.jyu.mit.fxgui.ListChooser?>
<?import javafx.geometry.Insets?>
<?import javafx.geometry.Point3D?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.CheckBox?>
<?import javafx.scene.control.Label?>
......@@ -14,28 +13,32 @@
<?import javafx.scene.input.KeyCodeCombination?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<BorderPane prefHeight="500.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fxMMKurssit.MMKurssitGUIController">
<BorderPane prefHeight="500.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fxMMKurssit.MMKurssitGUIController">
<top>
<MenuBar BorderPane.alignment="CENTER">
<menus>
<Menu mnemonicParsing="false" text="File">
<Menu mnemonicParsing="false" text="Edit">
<items>
<MenuItem mnemonicParsing="false" text="Save">
<MenuItem mnemonicParsing="false" text="Add new course">
<accelerator>
<KeyCodeCombination alt="UP" code="S" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
<KeyCodeCombination alt="UP" code="C" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator>
</MenuItem>
<MenuItem mnemonicParsing="false" text="Add course" />
<MenuItem mnemonicParsing="false" text="Add meeting" />
<MenuItem mnemonicParsing="false" text="Add new meeting">
<accelerator>
<KeyCodeCombination alt="UP" code="M" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator></MenuItem>
<MenuItem mnemonicParsing="false" text="Open the list of the courses">
<accelerator>
<KeyCodeCombination alt="UP" code="O" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator></MenuItem>
<MenuItem mnemonicParsing="false" text="Reset your courses" />
<MenuItem mnemonicParsing="false" text="Close" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Edit">
<items>
<MenuItem mnemonicParsing="false" text="Delete" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Help">
<items>
<MenuItem mnemonicParsing="false" text="About" />
......@@ -44,90 +47,63 @@
</menus>
</MenuBar>
</top>
<left>
<BorderPane BorderPane.alignment="CENTER">
<top>
<Label text="Courses" BorderPane.alignment="CENTER" />
</top>
<center>
<ListChooser minHeight="100.0" rivit="Japani 3&#10;Survival Finnish&#10;Academic Writing&#10;" BorderPane.alignment="CENTER">
<BorderPane.margin>
<Insets left="10.0" />
</BorderPane.margin>
</ListChooser>
</center>
<bottom>
<BorderPane prefHeight="200.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<top>
<HBox spacing="10.0" BorderPane.alignment="CENTER">
<children>
<TextField minWidth="40.0">
<HBox.margin>
<Insets left="10.0" />
</HBox.margin>
</TextField>
<ComboBoxChooser rivit="Course's name&#10;Teacher's name">
<HBox.margin>
<Insets right="10.0" />
</HBox.margin>
</ComboBoxChooser>
</children>
<BorderPane.margin>
<Insets top="15.0" />
</BorderPane.margin>
</HBox>
</top>
<center>
<ListChooser minHeight="100.0" rivit="Japani 1&#10;Dutch&#10;Kirjoitetaan suomeksi&#10;Calculus 1&#10;Calculus 2&#10;Algoritmi 2" BorderPane.alignment="CENTER">
<BorderPane.margin>
<Insets left="10.0" />
</BorderPane.margin>
</ListChooser>
</center>
</BorderPane>
</bottom>
</BorderPane>
</left>
<center>
<BorderPane prefHeight="200.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<top>
<Label text="Meetings" BorderPane.alignment="CENTER" />
</top>
<center>
<ListChooser rivit="January 8, 16:30-18:00&#10;February 1, 12:15-13:45&#10;February 3, 10:15-11:45&#10;" BorderPane.alignment="CENTER">
<BorderPane.margin>
<Insets right="10.0" />
</BorderPane.margin>
</ListChooser>
</center>
<bottom>
<CheckBox mnemonicParsing="false" text="Show only upcoming meetings" BorderPane.alignment="CENTER_RIGHT">
<CheckBox fx:id="onlyUpcoming" alignment="BOTTOM_CENTER" contentDisplay="CENTER" mnemonicParsing="false" text="Show only upcoming meetings" BorderPane.alignment="TOP_CENTER">
<BorderPane.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
<Insets bottom="10.0" left="5.0" right="5.0" />
</BorderPane.margin></CheckBox>
</bottom>
<center>
<HBox prefHeight="100.0" prefWidth="200.0" spacing="5.0" BorderPane.alignment="CENTER">
<children>
<VBox prefWidth="200.0" spacing="5.0">
<children>
<Label fx:id="sectionTitle" text="Your courses">
<font>
<Font name="System Bold" size="15.0" />
</font>
<VBox.margin>
<Insets top="10.0" />
</VBox.margin>
</Label>
<CheckBoxChooser fx:id="selectedCourse" rivit="Japani 3&#10;Dutch&#10;Ohjelmointi 2">
<VBox.margin>
<Insets bottom="10.0" />
</VBox.margin>
</CheckBoxChooser>
<VBox prefHeight="200.0" prefWidth="100.0">
<children>
<TextField fx:id="textSearch" promptText="Type here to search" />
<ListChooser fx:id="allCourses" rivit="(Kaikki kurssit listalle)&#10;Japani 1&#10;Saksa 2&#10;Calculus 1&#10;Microbiology&#10;Algoritmi 1&#10;Algoritmi 2&#10;Cloud services&#10;">
<VBox.margin>
<Insets />
</VBox.margin>
</ListChooser>
</children>
</VBox>
</children>
</VBox>
<ListChooser fx:id="tapaamiset" rivit="January 8, 16:30-18:00&#10;January 15, 16:30-18:00&#10;February 21, 12:00-14:00&#10;March 7, 8:45-10:15&#10;Tapaaminen 5&#10;Tapaaminen 6&#10;Tapaaminen 7&#10;Tapaaminen 8&#10;Tapaaminen 9&#10;Tapaaminen 10&#10;" />
<VBox alignment="TOP_CENTER" prefWidth="150.0" spacing="30.0">
<children>
<Button fx:id="buttonOpenMeeting" alignment="CENTER" lineSpacing="20.0" onAction="#openMeetingInfo" text="_Open meeting info" textAlignment="CENTER" />
<Button fx:id="buttonAddMeeting" mnemonicParsing="false" onAction="#addMeeting" text="Add new meeting" />
</children>
<HBox.margin>
<Insets bottom="5.0" right="5.0" top="20.0" />
</HBox.margin>
</VBox>
</children>
<BorderPane.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</BorderPane.margin>
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</HBox>
</center>
</BorderPane>
</center>
<bottom>
<HBox alignment="BOTTOM_CENTER" spacing="15.0" BorderPane.alignment="BOTTOM_RIGHT">
<children>
<Button fx:id="buttonOpenCourse" mnemonicParsing="false" onAction="#openCourseInfo" text="Open course info" />
<Button fx:id="buttonAddMeeting" mnemonicParsing="false" onAction="#addMeeting" text="Add new meeting" />
<Button fx:id="buttonOpenMeeting" alignment="CENTER" lineSpacing="20.0" onAction="#openMeetingInfo" text="_Open meeting info" textAlignment="CENTER" />
<Button fx:id="buttonClose" alignment="CENTER" contentDisplay="CENTER" lineSpacing="20.0" mnemonicParsing="false" onAction="#closeProgram" text="Close">
<HBox.margin>
<Insets left="25.0" />
</HBox.margin></Button>
</children>
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
<BorderPane.margin>
<Insets bottom="10.0" right="10.0" />
</BorderPane.margin>
<rotationAxis>
<Point3D />
</rotationAxis>
</HBox>
</bottom>
</BorderPane>
package fxMMKurssit;
import javafx.application.Application;
import javafx.application.Platform;
//import javafx.application.Platform;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
......@@ -21,16 +21,15 @@ public class MMKurssitMain extends Application {
try {
FXMLLoader ldr = new FXMLLoader(getClass().getResource("MMKurssitGUIView.fxml"));
final Pane root = ldr.load();
final MMKurssitGUIController mmkurssitCtrl = (MMKurssitGUIController) ldr.getController();
//final MMKurssitGUIController mmkurssitCtrl = (MMKurssitGUIController) ldr.getController();
Scene scene = new Scene(root);
scene.getStylesheets().add(getClass().getResource("mmkurssit.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.setTitle("MMKurssit");
if (!mmkurssitCtrl.avaa()) Platform.exit();
//primaryStage.show();//pääikkuna näkyviin
primaryStage.show();
} catch(Exception e) {
e.printStackTrace();
e.printStackTrace();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment