commit
81cb9ac1dd
@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
@ -0,0 +1,10 @@
|
||||
<component name="libraryTable">
|
||||
<library name="lib">
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/../javafx-sdk-19/lib" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
<jarDirectory url="file://$PROJECT_DIR$/../javafx-sdk-19/lib" recursive="false" />
|
||||
</library>
|
||||
</component>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_19" default="true" project-jdk-name="openjdk-19" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/Capteur.iml" filepath="$PROJECT_DIR$/Capteur.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Palette2">
|
||||
<group name="Swing">
|
||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||
</item>
|
||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||
<initial-values>
|
||||
<property name="text" value="Button" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="RadioButton" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="CheckBox" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="Label" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||
<preferred-size width="-1" height="20" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||
</item>
|
||||
</group>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/resource" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="lib" level="project" />
|
||||
</component>
|
||||
</module>
|
@ -0,0 +1,3 @@
|
||||
-instancier FXMLLoader
|
||||
-FXMLLoader.set'Controller'
|
||||
-FXMLLoader.load
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<fx:root type="GridPane"
|
||||
fx:id="imageWindow"
|
||||
xmlns:fx="http://javafx.com/fxml"
|
||||
maxHeight="-Infinity" maxWidth="-Infinity"
|
||||
minHeight="-Infinity" minWidth="-Infinity"
|
||||
prefHeight="223.0" prefWidth="443.0"
|
||||
xmlns="http://javafx.com/javafx/17.0.2-ea">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="391.0" minWidth="10.0" prefWidth="164.20001525878905" />
|
||||
<ColumnConstraints maxWidth="495.00001525878906" minWidth="146.60000000000002" prefWidth="277.99998474121094" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<ImageView fitHeight="202.0" fitWidth="228.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.valignment="CENTER" />
|
||||
<SplitPane prefHeight="200.0" prefWidth="200.0">
|
||||
<items>
|
||||
<GridPane prefWidth="119.0">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Label text="Température :" GridPane.halignment
|
||||
="RIGHT" GridPane.valignment="CENTER">
|
||||
<GridPane.margin>
|
||||
<Insets right="5.0" />
|
||||
</GridPane.margin></Label>
|
||||
<Label text="°C" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
|
||||
<GridPane.margin>
|
||||
<Insets left="5.0" />
|
||||
</GridPane.margin></Label>
|
||||
<Label fx:id="temperature" text="Label" GridPane.columnIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets left="5.0" />
|
||||
</GridPane.margin></Label>
|
||||
</children>
|
||||
</GridPane>
|
||||
</items></SplitPane>
|
||||
</children>
|
||||
</fx:root>
|
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="132.0" prefWidth="131.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="view.MainWindow">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="132.4" minHeight="10.0" prefHeight="89.4" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="128.4" minHeight="0.0" prefHeight="98.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="266.80000000000007" minHeight="10.0" prefHeight="93.19999999999999" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Button fx:id="btnImage" mnemonicParsing="false" onAction="#clickButtonImage" text="Image" GridPane.halignment="CENTER" GridPane.valignment="CENTER" />
|
||||
<Button fx:id="btnFermer" mnemonicParsing="false" onAction="#clickButtonFermer" text="Fermer" GridPane.halignment="CENTER" GridPane.rowIndex="2" GridPane.valignment="CENTER" />
|
||||
<Button fx:id="btnSpinner" mnemonicParsing="false" onAction="#clickButtonSpinner" text="Spinner" GridPane.halignment="CENTER" GridPane.rowIndex="1" GridPane.valignment="CENTER" />
|
||||
</children>
|
||||
</GridPane>
|
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<?import javafx.scene.control.SpinnerValueFactory.DoubleSpinnerValueFactory?>
|
||||
<fx:root fx:id="imageWindow" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="223.0" prefWidth="443.0" type="GridPane" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="50" minHeight="10.0" prefHeight="180" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30" minHeight="30" prefHeight="30" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Button mnemonicParsing="false" text="Button" GridPane.halignment="CENTER" GridPane.rowIndex="1" GridPane.valignment="TOP">
|
||||
<GridPane.margin>
|
||||
<Insets top="5.0" />
|
||||
</GridPane.margin></Button>
|
||||
<Spinner fx:id="spinner" GridPane.halignment="CENTER" GridPane.valignment="BOTTOM">
|
||||
<valueFactory>
|
||||
<SpinnerValueFactory.DoubleSpinnerValueFactory min="0.0" max="12.0"/>
|
||||
</valueFactory>
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0" />
|
||||
</GridPane.margin></Spinner>
|
||||
</children>
|
||||
</fx:root>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<fx:root type="GridPane"
|
||||
fx:id="imageWindow"
|
||||
xmlns:fx="http://javafx.com/fxml"
|
||||
maxHeight="-Infinity" maxWidth="-Infinity"
|
||||
minHeight="-Infinity" minWidth="-Infinity"
|
||||
prefHeight="223.0" prefWidth="443.0"
|
||||
xmlns="http://javafx.com/javafx/17.0.2-ea">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="391.0" minWidth="10.0" prefWidth="164.20001525878905" />
|
||||
<ColumnConstraints maxWidth="495.00001525878906" minWidth="146.60000000000002" prefWidth="277.99998474121094" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<ImageView fitHeight="202.0" fitWidth="228.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.valignment="CENTER" />
|
||||
<SplitPane prefHeight="200.0" prefWidth="200.0">
|
||||
<items>
|
||||
<GridPane prefWidth="119.0">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Label text="Température :" GridPane.halignment
|
||||
="RIGHT" GridPane.valignment="CENTER">
|
||||
<GridPane.margin>
|
||||
<Insets right="5.0" />
|
||||
</GridPane.margin></Label>
|
||||
<Label text="°C" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
|
||||
<GridPane.margin>
|
||||
<Insets left="5.0" />
|
||||
</GridPane.margin></Label>
|
||||
<Label fx:id="temperature" text="Label" GridPane.columnIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets left="5.0" />
|
||||
</GridPane.margin></Label>
|
||||
</children>
|
||||
</GridPane>
|
||||
</items></SplitPane>
|
||||
</children>
|
||||
</fx:root>
|
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="132.0" prefWidth="131.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="view.MainWindow">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="132.4" minHeight="10.0" prefHeight="89.4" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="128.4" minHeight="0.0" prefHeight="98.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="266.80000000000007" minHeight="10.0" prefHeight="93.19999999999999" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Button fx:id="btnImage" mnemonicParsing="false" onAction="#clickButtonImage" text="Image" GridPane.halignment="CENTER" GridPane.valignment="CENTER" />
|
||||
<Button fx:id="btnFermer" mnemonicParsing="false" onAction="#clickButtonFermer" text="Fermer" GridPane.halignment="CENTER" GridPane.rowIndex="2" GridPane.valignment="CENTER" />
|
||||
<Button fx:id="btnSpinner" mnemonicParsing="false" onAction="#clickButtonSpinner" text="Spinner" GridPane.halignment="CENTER" GridPane.rowIndex="1" GridPane.valignment="CENTER" />
|
||||
</children>
|
||||
</GridPane>
|
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<?import javafx.scene.control.SpinnerValueFactory.DoubleSpinnerValueFactory?>
|
||||
<fx:root fx:id="imageWindow" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="223.0" prefWidth="443.0" type="GridPane" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="50" minHeight="10.0" prefHeight="180" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="30" minHeight="30" prefHeight="30" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Button mnemonicParsing="false" text="Button" GridPane.halignment="CENTER" GridPane.rowIndex="1" GridPane.valignment="TOP">
|
||||
<GridPane.margin>
|
||||
<Insets top="5.0" />
|
||||
</GridPane.margin></Button>
|
||||
<Spinner fx:id="spinner" GridPane.halignment="CENTER" GridPane.valignment="BOTTOM">
|
||||
<valueFactory>
|
||||
<SpinnerValueFactory.DoubleSpinnerValueFactory min="0.0" max="12.0"/>
|
||||
</valueFactory>
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0" />
|
||||
</GridPane.margin></Spinner>
|
||||
</children>
|
||||
</fx:root>
|
@ -0,0 +1,5 @@
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello world!");
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package application;
|
||||
|
||||
public class ImageController {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package application;
|
||||
|
||||
public class MainController {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package application;
|
||||
|
||||
public class SpinnerController {
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package launcher;
|
||||
|
||||
import model.Capteur;
|
||||
import model.GenerateurAleatoire;
|
||||
import view.AfficheurTemperature;
|
||||
import view.SaisiseurTemperature;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class Console {
|
||||
public static void main(String[] args) {
|
||||
GenerateurAleatoire ga = new GenerateurAleatoire(-5,40);
|
||||
Capteur C001 = new Capteur("C001", ga);
|
||||
AfficheurTemperature a1 = new AfficheurTemperature("a1", C001);
|
||||
AfficheurTemperature a2 = new AfficheurTemperature("a2", C001);
|
||||
SaisiseurTemperature s1 = new SaisiseurTemperature("s1", C001);
|
||||
C001.addObservateur(a1);
|
||||
C001.addObservateur(a2);
|
||||
C001.addObservateur(s1);
|
||||
s1.sasir(C001.getStrategy().genereTemperature());
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,26 @@
|
||||
package launcher;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.layout.BorderPane;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class LaunchMeteo extends Application {
|
||||
private Stage primaryStage;
|
||||
private BorderPane layout;
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws Exception {
|
||||
Parent root = FXMLLoader.load(getClass().getResource("/fxml/MainWindow.fxml"));
|
||||
Scene scene = new Scene(root);
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.setTitle("Title");
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package model;
|
||||
|
||||
import javafx.beans.property.DoubleProperty;
|
||||
import javafx.beans.property.SimpleDoubleProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Capteur extends Observable implements Runnable{
|
||||
private static int idActuel;
|
||||
private int id;
|
||||
private String nom;
|
||||
private DoubleProperty temperature;
|
||||
// private Thread thread;
|
||||
private GenerateurStrategy strategy;
|
||||
|
||||
|
||||
public Capteur(String nom, GenerateurStrategy strategy) {
|
||||
this.id = idActuel;
|
||||
idActuel += 1;
|
||||
this.nom = nom;
|
||||
this.temperature = new SimpleDoubleProperty(strategy.genereTemperature());
|
||||
this.lesObservateurs = new ArrayList<>();
|
||||
this.strategy = strategy;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getNom() {
|
||||
return nom;
|
||||
}
|
||||
|
||||
public void setNom(String nom) {
|
||||
this.nom = nom;
|
||||
this.notifier();
|
||||
}
|
||||
|
||||
public DoubleProperty getTemperature() {
|
||||
return temperature;
|
||||
}
|
||||
|
||||
public void setTemperature(double temperature) {
|
||||
this.temperature = new SimpleDoubleProperty(temperature);
|
||||
this.notifier();
|
||||
}
|
||||
|
||||
public GenerateurStrategy getStrategy() {
|
||||
return strategy;
|
||||
}
|
||||
|
||||
public void setStrategy(GenerateurStrategy strategy) {
|
||||
this.strategy = strategy;
|
||||
}
|
||||
|
||||
public void setGenerateur(GenerateurStrategy strategy){
|
||||
this.strategy = strategy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(){}
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package model;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class GenerateurAleatoire implements GenerateurStrategy{
|
||||
private double bornInf;
|
||||
private double bornSup;
|
||||
|
||||
public GenerateurAleatoire(double bornInf, double bornSup) {
|
||||
this.bornInf = bornInf;
|
||||
this.bornSup = bornSup;
|
||||
}
|
||||
|
||||
public GenerateurAleatoire(){
|
||||
this.bornInf = Double.MIN_VALUE;
|
||||
this.bornSup = Double.MAX_VALUE;
|
||||
}
|
||||
|
||||
public double getBornInf() {
|
||||
return bornInf;
|
||||
}
|
||||
|
||||
public void setBornInf(double bornInf) {
|
||||
this.bornInf = bornInf;
|
||||
}
|
||||
|
||||
public double getBornSup() {
|
||||
return bornSup;
|
||||
}
|
||||
|
||||
public void setBornSup(double bornSup) {
|
||||
this.bornSup = bornSup;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double genereTemperature() {
|
||||
Random random = new Random();
|
||||
double temperature;
|
||||
temperature = bornInf+random.nextDouble(bornSup-bornInf);
|
||||
return temperature;
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
package model;
|
||||
|
||||
public interface GenerateurStrategy {
|
||||
public double genereTemperature();
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public abstract class Observable {
|
||||
public List<Observateur> lesObservateurs;
|
||||
public void addObservateur(Observateur observateur){
|
||||
this.lesObservateurs.add(observateur);
|
||||
}
|
||||
public void deleteObservateur(Observateur observateur){
|
||||
this.lesObservateurs.remove(observateur);
|
||||
}
|
||||
public void notifier(){
|
||||
for (Observateur observateur : lesObservateurs){
|
||||
observateur.update();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package model;
|
||||
public interface Observateur {
|
||||
void update();
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package model;
|
||||
|
||||
public class Thread {
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package view;
|
||||
|
||||
import model.Capteur;
|
||||
import model.Observateur;
|
||||
|
||||
public class AfficheurTemperature implements Observateur {
|
||||
private String nom;
|
||||
private Capteur capteur;
|
||||
|
||||
public AfficheurTemperature(String nom, Capteur capteur) {
|
||||
this.nom = nom;
|
||||
this.capteur = capteur;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
System.out.println("["+this.nom+"] "+this.capteur.getNom() + " : " + this.capteur.getTemperature() + " °C");
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package view;
|
||||
|
||||
import javafx.beans.property.Property;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.layout.BorderPane;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.util.converter.NumberStringConverter;
|
||||
import model.Capteur;
|
||||
import model.GenerateurAleatoire;
|
||||
import java.io.IOException;
|
||||
|
||||
public class ImageWindow extends Visualisateur{
|
||||
private Capteur capteur;
|
||||
private GridPane layout;
|
||||
@FXML
|
||||
private Label temperature;
|
||||
|
||||
public ImageWindow(Capteur capteur) throws IOException {
|
||||
this.capteur = capteur;
|
||||
Stage stage = new Stage();
|
||||
layout = new GridPane();
|
||||
FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/ImageWindow.fxml"));
|
||||
loader.setRoot(this.layout);
|
||||
loader.setController(this);
|
||||
Parent root = loader.load();
|
||||
Scene scene = new Scene(root);
|
||||
stage.setScene(scene);
|
||||
stage.setTitle("Image");
|
||||
stage.show();
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void initialize(){
|
||||
temperature.textProperty().bindBidirectional(this.capteur.getTemperature(), new NumberStringConverter());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
temperature.textProperty().bindBidirectional(this.capteur.getTemperature(), new NumberStringConverter());
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package view;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.stage.Stage;
|
||||
import model.Capteur;
|
||||
import model.GenerateurAleatoire;
|
||||
|
||||
public class MainWindow {
|
||||
@FXML
|
||||
private Button btnSpinner;
|
||||
@FXML
|
||||
private Button btnImage;
|
||||
@FXML
|
||||
private Button btnFermer;
|
||||
protected Capteur capteur;
|
||||
|
||||
public void initialize(){
|
||||
this.capteur = new Capteur("a", new GenerateurAleatoire(0,12));
|
||||
}
|
||||
@FXML
|
||||
private void clickButtonFermer(){
|
||||
Stage stage = (Stage) btnFermer.getScene().getWindow();
|
||||
stage.close();
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void clickButtonImage() throws Exception{
|
||||
ImageWindow Iw = new ImageWindow(this.capteur);
|
||||
}
|
||||
@FXML
|
||||
private void clickButtonSpinner() throws Exception{
|
||||
SpinnerWindow Sw = new SpinnerWindow(this.capteur);
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package view;
|
||||
|
||||
import model.Capteur;
|
||||
import model.Observateur;
|
||||
|
||||
public class SaisiseurTemperature implements Observateur {
|
||||
private String nom;
|
||||
private Capteur capteur;
|
||||
|
||||
public SaisiseurTemperature(String nom, Capteur capteur) {
|
||||
this.nom = nom;
|
||||
this.capteur = capteur;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
System.out.println("["+this.nom+"] "+this.capteur.getNom() + " : " + this.capteur.getTemperature() + " °C");
|
||||
}
|
||||
public void sasir(double temp){
|
||||
this.capteur.setTemperature(temp);
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package view;
|
||||
|
||||
import javafx.beans.property.IntegerProperty;
|
||||
import javafx.beans.property.ObjectProperty;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Spinner;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.util.converter.NumberStringConverter;
|
||||
import model.Capteur;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class SpinnerWindow extends Visualisateur{
|
||||
@FXML
|
||||
private Spinner spinner;
|
||||
protected Capteur capteur;
|
||||
private GridPane layout;
|
||||
|
||||
public SpinnerWindow(Capteur capteur) throws IOException {
|
||||
this.capteur = capteur;
|
||||
Stage stage = new Stage();
|
||||
layout = new GridPane();
|
||||
FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/SpinnerWindow.fxml"));
|
||||
loader.setRoot(this.layout);
|
||||
loader.setController(this);
|
||||
Parent root = loader.load();
|
||||
Scene scene = new Scene(root);
|
||||
stage.setScene(scene);
|
||||
stage.setTitle("Spinner");
|
||||
stage.show();
|
||||
}
|
||||
@FXML
|
||||
public void initialize(){
|
||||
spinner.getValueFactory().valueProperty().bindBidirectional(this.capteur.getTemperature());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
spinner.getValueFactory().valueProperty().bindBidirectional(this.capteur.getTemperature());
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package view;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.stage.Stage;
|
||||
import model.Capteur;
|
||||
import model.Observateur;
|
||||
|
||||
public abstract class Visualisateur implements Observateur {
|
||||
private void clickFermer(){
|
||||
// Stage stage = (Stage) .getScene().getWindow();
|
||||
// stage.close();
|
||||
}
|
||||
private void intialize (Capteur c){
|
||||
c.addObservateur(this);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue