Projekt LSR

This commit is contained in:
unknown 2020-06-14 13:43:10 +02:00
commit e7eb4a6663
35 changed files with 2176 additions and 0 deletions

19
Projekt-LSR/.classpath Normal file
View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-13">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.fx.ide.jdt.core.JAVAFX_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/aaaa"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/cokolwiek"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/JavaFX"/>
<classpathentry kind="lib" path="D:/Java/jFuzzyLogic.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

23
Projekt-LSR/.project Normal file
View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Projekt-LSR</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,14 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=13
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=13
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=13

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ChoiceBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.text.Font?>
<AnchorPane maxHeight="400.0" maxWidth="600.0" minHeight="400.0" minWidth="600.0" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.OpinionController">
<children>
<GridPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="20.0" prefWidth="20.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="560.0" minWidth="560.0" prefWidth="560.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="20.0" minWidth="20.0" prefWidth="20.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="10.0" minHeight="10.0" prefHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="10.0" minHeight="10.0" prefHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="330.0" minHeight="330.0" prefHeight="330.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label alignment="CENTER" text="Dodanie opinii" textAlignment="CENTER" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="1" GridPane.valignment="CENTER">
<font>
<Font name="System Bold" size="14.0" />
</font>
</Label>
<GridPane GridPane.columnIndex="1" GridPane.rowIndex="3">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="10.0" minWidth="10.0" prefWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="10.0" minHeight="10.0" prefHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="10.0" minHeight="10.0" prefHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="10.0" minHeight="10.0" prefHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="10.0" minHeight="10.0" prefHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="10.0" minHeight="10.0" prefHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Ocena:" GridPane.rowIndex="10">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<TextField fx:id="addOpinionTitleTextField" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="30.0" prefWidth="478.0" GridPane.columnIndex="2" />
<TextField fx:id="addOpinionNickTextField" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="30.0" prefWidth="518.0" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<TextField fx:id="addOpinionEMailTextField" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="30.0" prefWidth="507.0" GridPane.columnIndex="2" GridPane.rowIndex="4" />
<TextField fx:id="addOpinionDateTextField" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="30.0" prefWidth="507.0" GridPane.columnIndex="2" GridPane.rowIndex="6" />
<Label text="Tytuł filmu:">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<Label text="Nick:" GridPane.rowIndex="2">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<Label text="E-mail:" GridPane.rowIndex="4">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<Label text="Aktualna data:" GridPane.rowIndex="6">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<Label text="Opinia:" GridPane.rowIndex="8" GridPane.valignment="TOP">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<TextArea fx:id="addOpinionTextArea" prefHeight="200.0" prefWidth="200.0" wrapText="true" GridPane.columnIndex="2" GridPane.rowIndex="8" />
<Button fx:id="closeButton" maxHeight="1.7976931348623157E308" mnemonicParsing="false" onAction="#confirmOpinionButtonAction" text="Dodaj" GridPane.columnIndex="2" GridPane.halignment="RIGHT" GridPane.hgrow="ALWAYS" GridPane.rowIndex="10" GridPane.vgrow="ALWAYS" />
<ChoiceBox fx:id="ratingChoiceBox" maxHeight="1.7976931348623157E308" prefWidth="150.0" GridPane.columnIndex="2" GridPane.rowIndex="10" />
</children>
</GridPane>
</children>
</GridPane>
</children>
</AnchorPane>

View File

@ -0,0 +1,273 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ChoiceBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.text.Font?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="700.0" prefWidth="1000.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.ApplicationController">
<children>
<Label layoutX="162.0" layoutY="26.0" text="Wyszukiwarka filmów w oparciu o nieprecyzyjne zapytania z bazy IMDb">
<font>
<Font name="System Bold" size="20.0" />
</font>
</Label>
<Button layoutX="909.0" layoutY="26.0" mnemonicParsing="false" onAction="#creditsButtonAction" text="Autorzy">
<font>
<Font size="14.0" />
</font>
</Button>
<TabPane fx:id="tabPane" layoutX="-2.0" layoutY="69.0" prefHeight="631.0" prefWidth="1000.0" tabClosingPolicy="UNAVAILABLE">
<tabs>
<Tab closable="false" text="Wybór filmu">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<GridPane layoutX="2.0" prefHeight="600.0" prefWidth="1000.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="20.0" minWidth="20.0" prefWidth="20.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="20.0" minWidth="20.0" prefWidth="20.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="100.0" minHeight="100.0" prefHeight="100.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<GridPane GridPane.columnIndex="1" GridPane.rowIndex="1">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="10.0" minWidth="10.0" prefWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="10.0" minWidth="10.0" prefWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="10.0" minWidth="10.0" prefWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="10.0" minWidth="10.0" prefWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="10.0" minHeight="10.0" prefHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Gatunek" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<Label text="Czas powstania" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<Label text="Czas trwania" GridPane.columnIndex="4" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<Label text="Ocena użytkowników" GridPane.columnIndex="6" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<Label text="Ilość głosów" GridPane.columnIndex="8" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<ChoiceBox fx:id="typeChoiceBox" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.rowIndex="1" />
<ChoiceBox fx:id="productionChoiceBox" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<ChoiceBox fx:id="durationChoiceBox" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.columnIndex="4" GridPane.rowIndex="1" />
<ChoiceBox fx:id="userRatingChoiceBox" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.columnIndex="6" GridPane.rowIndex="1" />
<ChoiceBox fx:id="numberOfVotesChoiceBox" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.columnIndex="8" GridPane.rowIndex="1" />
<Button maxHeight="30.0" mnemonicParsing="false" onAction="#findMoviesButtonAction" text="Szukaj" GridPane.columnIndex="8" GridPane.halignment="RIGHT" GridPane.rowIndex="3" GridPane.valignment="CENTER" />
</children>
</GridPane>
<GridPane GridPane.columnIndex="1" GridPane.rowIndex="3">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="10.0" minHeight="10.0" prefHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Rezultat zapytania" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<TableView fx:id="queryResultTableView" prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="2">
<columns>
<TableColumn fx:id="titleColumn" maxWidth="300.0" minWidth="300.0" prefWidth="300.0" text="Tytuł" />
<TableColumn fx:id="typesColumn" maxWidth="160.0" minWidth="160.0" prefWidth="160.0" text="Gatunek" />
<TableColumn fx:id="productionYearColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" text="Rok produkcji" />
<TableColumn fx:id="durationColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" text="Czas trwania" />
<TableColumn fx:id="ratingColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" text="Średnia ocena" />
<TableColumn fx:id="numberOfVotesColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" text="Ilość głosów" />
<TableColumn fx:id="bestMatchingColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" text="Dopasowanie" />
</columns>
</TableView>
</children>
</GridPane>
</children>
</GridPane>
</children></AnchorPane>
</content>
</Tab>
<Tab closable="false" text="Szukaj filmu">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<GridPane prefHeight="600.0" prefWidth="1000.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="20.0" minWidth="20.0" prefWidth="20.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="20.0" minWidth="20.0" prefWidth="20.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="100.0" minHeight="100.0" prefHeight="100.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<GridPane GridPane.columnIndex="1" GridPane.rowIndex="1">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="80.0" minWidth="80.0" prefWidth="80.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<TextField fx:id="queryFindingTabTextField" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.rowIndex="1" />
<Label text="Szukaj filmu po tytule lub fragmencie">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<Button mnemonicParsing="false" onAction="#queryFindingTabButtonAction" text="Szukaj filmu" GridPane.halignment="RIGHT" GridPane.rowIndex="2" GridPane.valignment="CENTER" />
</children>
</GridPane>
<TableView fx:id="queryResultFindingTabTableView" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="3">
<columns>
<TableColumn fx:id="titleFindingTabColumn" maxWidth="400.0" minWidth="400.0" prefWidth="400.0" text="Tytuł" />
<TableColumn fx:id="typesFindingTabColumn" maxWidth="160.0" minWidth="160.0" prefWidth="160.0" text="Gatunek" />
<TableColumn fx:id="productionYearFindingTabColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" text="Rok produkcji" />
<TableColumn fx:id="durationFindingTabColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" text="Czas trwania" />
<TableColumn fx:id="ratingFindingTabColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" text="Średnia ocena" />
<TableColumn fx:id="numberOfVotesFindingTabColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" text="Ilość głosów" />
</columns>
</TableView>
</children>
</GridPane>
</children></AnchorPane>
</content>
</Tab>
<Tab closable="false" text="Opinie">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<GridPane prefHeight="600.0" prefWidth="1000.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="20.0" minWidth="20.0" prefWidth="20.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="20.0" minWidth="20.0" prefWidth="20.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="100.0" minHeight="100.0" prefHeight="100.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="10.0" minHeight="10.0" prefHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Dane z bazy IMDb" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="1" GridPane.valignment="TOP">
<font>
<Font name="System Bold" size="18.0" />
</font>
</Label>
<GridPane GridPane.columnIndex="1" GridPane.rowIndex="1">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="400.0" minWidth="400.0" prefWidth="400.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="10.0" minWidth="10.0" prefWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="10.0" minWidth="10.0" prefWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="10.0" minWidth="10.0" prefWidth="10.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Tytuł filmu" GridPane.rowIndex="1">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<TextField fx:id="opinionTabTitleTextField" editable="false" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.rowIndex="2" />
<Label text="Średnia ocena" GridPane.columnIndex="2" GridPane.rowIndex="1">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<TextField fx:id="opinionTabRatingTextField" editable="false" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<Label text="Ilość głosów" GridPane.columnIndex="4" GridPane.rowIndex="1">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<TextField fx:id="opinionTabVotesTextField" editable="false" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.columnIndex="4" GridPane.rowIndex="2" />
</children>
</GridPane>
<TableView fx:id="opinionsTableView" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="3">
<columns>
<TableColumn fx:id="nickOpinionsTabColumn" maxWidth="134.0" minWidth="134.0" prefWidth="134.0" text="Nick" />
<TableColumn fx:id="emailOpinionsTabColumn" maxWidth="200.0" minWidth="200.0" prefWidth="200.0" text="E-mail" />
<TableColumn fx:id="dateOpinionsTabColumn" maxWidth="150.0" minWidth="150.0" prefWidth="150.0" text="Data dodania opinii" />
<TableColumn fx:id="ratingOpinionsTabColumn" maxWidth="50.0" minWidth="50.0" prefWidth="50.0" text="Ocena" />
<TableColumn fx:id="opinionOpinionsTabColumn" maxWidth="1.7976931348623157E308" minWidth="425.0" prefWidth="425.0" text="Opinia" />
</columns>
</TableView>
<HBox maxHeight="200.0" maxWidth="188.0" prefHeight="100.0" prefWidth="200.0" spacing="10.0" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="5" GridPane.valignment="CENTER">
<children>
<Button maxHeight="1.7976931348623157E308" mnemonicParsing="false" onAction="#refreshButtonAction" text="Odswież" />
<Button maxHeight="1.7976931348623157E308" mnemonicParsing="false" onAction="#addOpinionButtonAction" text="Dodaj nową opinię" />
</children>
</HBox>
</children>
</GridPane>
</children>
</AnchorPane>
</content>
</Tab>
</tabs>
</TabPane>
</children>
</AnchorPane>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.text.Font?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="160.0" prefWidth="400.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.CreditsController">
<children>
<TextArea editable="false" prefHeight="160.0" prefWidth="400.0" text="Projekt realizowany w ramach przedmiotu Laboratorium Systemów Rozmytych.&#10;&#10;Autorzy:&#10;- Jagoda Jarowicz&#10;- Klaudia Kandulska&#10;- Marcin Stasiak" wrapText="true">
<font>
<Font size="14.0" />
</font>
</TextArea>
</children>
</AnchorPane>

View File

@ -0,0 +1,37 @@
FUNCTION_BLOCK ocena_dlugosc
VAR_INPUT
dlugosc: REAL;
END_VAR
VAR_OUTPUT
ocena : REAL;
END_VAR
FUZZIFY dlugosc
TERM krotki := (40, 1) (80,0);
TERM sredni := (60, 0) (90, 1) (120,1) (150,0);
TERM dlugi := (130, 0) (170,1);
END_FUZZIFY
DEFUZZIFY ocena
TERM slaby := (5,1) (11,0);
TERM srednia := (9,0) (15,1) (21,0);
TERM dobry := (19,0) (25,1);
METHOD : COG;
DEFAULT := 0;
END_DEFUZZIFY
RULEBLOCK No1
AND : MIN;
ACT : MIN;
ACCU : MAX;
RULE 1 : IF dlugosc is dlugi THEN ocena IS dobry;
RULE 2 : IF dlugosc is sredni THEN ocena IS srednia;
RULE 3 : IF dlugosc IS krotki THEN ocena IS slaby;
END_RULEBLOCK
END_FUNCTION_BLOCK

View File

@ -0,0 +1,35 @@
FUNCTION_BLOCK ocena
VAR_INPUT
glosy : REAL;
END_VAR
VAR_OUTPUT
ocena : REAL;
END_VAR
FUZZIFY glosy
TERM malo := (1000,1) (2500,0);
TERM srednio := (2000, 0) (3500, 1) (4500,1) (6000,0) ;
TERM duzo := (5500, 0) (6500,1);
END_FUZZIFY
DEFUZZIFY ocena
TERM slaby := (5,1) (11,0);
TERM srednia := (9,0) (15,1) (21,0);
TERM dobry := (19,0) (25,1);
METHOD : COG;
DEFAULT := 0;
END_DEFUZZIFY
RULEBLOCK No1
AND : MIN;
ACT : MIN;
ACCU : MAX;
RULE 7 : IF glosy IS duzo THEN ocena IS dobry;
RULE 8 : IF glosy IS srednio THEN ocena IS srednia;
RULE 9 : IF glosy IS malo THEN ocena IS slaby;
END_RULEBLOCK
END_FUNCTION_BLOCK

View File

@ -0,0 +1,37 @@
FUNCTION_BLOCK ocena_dlugosc
VAR_INPUT
dlugosc: REAL;
END_VAR
VAR_OUTPUT
ocena : REAL;
END_VAR
FUZZIFY dlugosc
TERM krotki := (40, 1) (80,0);
TERM sredni := (60, 0) (90, 1) (120,1) (150,0);
TERM dlugi := (130, 0) (170,1);
END_FUZZIFY
DEFUZZIFY ocena
TERM slaby := (5,1) (11,0);
TERM srednia := (9,0) (15,1) (21,0);
TERM dobry := (19,0) (25,1);
METHOD : COG;
DEFAULT := 0;
END_DEFUZZIFY
RULEBLOCK No1
AND : MIN;
ACT : MIN;
ACCU : MAX;
RULE 1 : IF dlugosc is krotki THEN ocena IS dobry;
RULE 2 : IF dlugosc is sredni THEN ocena IS srednia;
RULE 3 : IF dlugosc IS dlugi THEN ocena IS slaby;
END_RULEBLOCK
END_FUNCTION_BLOCK

View File

@ -0,0 +1,35 @@
FUNCTION_BLOCK ocena
VAR_INPUT
glosy : REAL;
END_VAR
VAR_OUTPUT
ocena : REAL;
END_VAR
FUZZIFY glosy
TERM malo := (1000,1) (2500,0);
TERM srednio := (2000, 0) (3500, 1) (4500,1) (6000,0) ;
TERM duzo := (5500, 0) (6500,1);
END_FUZZIFY
DEFUZZIFY ocena
TERM slaby := (5,1) (11,0);
TERM srednia := (9,0) (15,1) (21,0);
TERM dobry := (19,0) (25,1);
METHOD : COG;
DEFAULT := 0;
END_DEFUZZIFY
RULEBLOCK No1
AND : MIN;
ACT : MIN;
ACCU : MAX;
RULE 7 : IF glosy IS malo THEN ocena IS dobry;
RULE 8 : IF glosy IS srednio THEN ocena IS srednia;
RULE 9 : IF glosy IS duzo THEN ocena IS slaby;
END_RULEBLOCK
END_FUNCTION_BLOCK

View File

@ -0,0 +1,37 @@
FUNCTION_BLOCK ocena_sr
VAR_INPUT
sr_ocena : REAL;
END_VAR
VAR_OUTPUT
ocena : REAL;
END_VAR
FUZZIFY sr_ocena
TERM niska := (3,1) (5,0);
TERM srednia := (4, 0) (5, 1) (6,1) (7,0) ;
TERM wysoka := (6, 0) (8,1);
END_FUZZIFY
DEFUZZIFY ocena
TERM slaby := (5,1) (11,0);
TERM srednia := (9,0) (15,1) (21,0);
TERM dobry := (19,0) (25,1);
METHOD : COG;
DEFAULT := 0;
END_DEFUZZIFY
RULEBLOCK No1
AND : MIN;
ACT : MIN;
ACCU : MAX;
RULE 7 : IF sr_ocena IS wysoka THEN ocena IS slaby;
RULE 8 : IF sr_ocena IS srednia THEN ocena IS srednia;
RULE 9 : IF sr_ocena IS niska THEN ocena IS dobry;
END_RULEBLOCK
END_FUNCTION_BLOCK

View File

@ -0,0 +1,35 @@
FUNCTION_BLOCK ocena
VAR_INPUT
rok : REAL;
END_VAR
VAR_OUTPUT
ocena : REAL;
END_VAR
FUZZIFY rok
TERM stary := (1990, 1) (1997,0);
TERM sredni := (1995, 0) (2000, 1) (2005,1) (2010,0) ;
TERM nowy := (2007,0) (2015,1);
END_FUZZIFY
DEFUZZIFY ocena
TERM slaby := (5,1) (11,0);
TERM srednia := (9,0) (15,1) (21,0);
TERM dobry := (19,0) (25,1);
METHOD : COG;
DEFAULT := 0;
END_DEFUZZIFY
RULEBLOCK No1
AND : MIN;
ACT : MIN;
ACCU : MAX;
RULE 4 : IF rok IS nowy THEN ocena IS dobry;
RULE 5 : IF rok IS sredni THEN ocena IS srednia;
RULE 6 : IF rok IS stary THEN ocena IS slaby;
END_RULEBLOCK
END_FUNCTION_BLOCK

View File

@ -0,0 +1,37 @@
FUNCTION_BLOCK ocena_dlugosc
VAR_INPUT
dlugosc: REAL;
END_VAR
VAR_OUTPUT
ocena : REAL;
END_VAR
FUZZIFY dlugosc
TERM krotki := (40, 1) (80,0);
TERM sredni := (60, 0) (90, 1) (120,1) (150,0);
TERM dlugi := (130, 0) (170,1);
END_FUZZIFY
DEFUZZIFY ocena
TERM slaby := (5,1) (11,0);
TERM srednia := (9,0) (15,1) (21,0);
TERM dobry := (19,0) (25,1);
METHOD : COG;
DEFAULT := 0;
END_DEFUZZIFY
RULEBLOCK No1
AND : MIN;
ACT : MIN;
ACCU : MAX;
RULE 1 : IF dlugosc is krotki THEN ocena IS slaby;
RULE 2 : IF dlugosc is sredni THEN ocena IS dobry;
RULE 3 : IF dlugosc IS dlugi THEN ocena IS slaby;
END_RULEBLOCK
END_FUNCTION_BLOCK

View File

@ -0,0 +1,37 @@
FUNCTION_BLOCK ocena_sr
VAR_INPUT
sr_ocena : REAL;
END_VAR
VAR_OUTPUT
ocena : REAL;
END_VAR
FUZZIFY sr_ocena
TERM niska := (3,1) (5,0);
TERM srednia := (4, 0) (5, 1) (6,1) (7,0) ;
TERM wysoka := (6, 0) (8,1);
END_FUZZIFY
DEFUZZIFY ocena
TERM slaby := (5,1) (11,0);
TERM srednia := (9,0) (15,1) (21,0);
TERM dobry := (19,0) (25,1);
METHOD : COG;
DEFAULT := 0;
END_DEFUZZIFY
RULEBLOCK No1
AND : MIN;
ACT : MIN;
ACCU : MAX;
RULE 7 : IF sr_ocena IS wysoka THEN ocena IS slaby;
RULE 8 : IF sr_ocena IS srednia THEN ocena IS dobry;
RULE 9 : IF sr_ocena IS niska THEN ocena IS slaby;
END_RULEBLOCK
END_FUNCTION_BLOCK

View File

@ -0,0 +1,35 @@
FUNCTION_BLOCK ocena
VAR_INPUT
glosy : REAL;
END_VAR
VAR_OUTPUT
ocena : REAL;
END_VAR
FUZZIFY glosy
TERM malo := (1000,1) (2500,0);
TERM srednio := (2000, 0) (3500, 1) (4500,1) (6000,0) ;
TERM duzo := (5500, 0) (6500,1);
END_FUZZIFY
DEFUZZIFY ocena
TERM slaby := (5,1) (11,0);
TERM srednia := (9,0) (15,1) (21,0);
TERM dobry := (19,0) (25,1);
METHOD : COG;
DEFAULT := 0;
END_DEFUZZIFY
RULEBLOCK No1
AND : MIN;
ACT : MIN;
ACCU : MAX;
RULE 7 : IF glosy IS malo THEN ocena IS slaby;
RULE 8 : IF glosy IS srednio THEN ocena IS dobry;
RULE 9 : IF glosy IS duzo THEN ocena IS slaby;
END_RULEBLOCK
END_FUNCTION_BLOCK

View File

@ -0,0 +1,35 @@
FUNCTION_BLOCK ocena
VAR_INPUT
rok : REAL;
END_VAR
VAR_OUTPUT
ocena : REAL;
END_VAR
FUZZIFY rok
TERM stary := (1990, 1) (1997,0);
TERM sredni := (1995, 0) (2000, 1) (2005,1) (2010,0) ;
TERM nowy := (2007,0) (2015,1);
END_FUZZIFY
DEFUZZIFY ocena
TERM slaby := (5,1) (11,0);
TERM srednia := (9,0) (15,1) (21,0);
TERM dobry := (19,0) (25,1);
METHOD : COG;
DEFAULT := 0;
END_DEFUZZIFY
RULEBLOCK No1
AND : MIN;
ACT : MIN;
ACCU : MAX;
RULE 4 : IF rok IS nowy THEN ocena IS slaby;
RULE 5 : IF rok IS sredni THEN ocena IS dobry;
RULE 6 : IF rok IS stary THEN ocena IS slaby;
END_RULEBLOCK
END_FUNCTION_BLOCK

View File

@ -0,0 +1,35 @@
FUNCTION_BLOCK ocena
VAR_INPUT
rok : REAL;
END_VAR
VAR_OUTPUT
ocena : REAL;
END_VAR
FUZZIFY rok
TERM stary := (1990, 1) (1997,0);
TERM sredni := (1995, 0) (2000, 1) (2005,1) (2010,0) ;
TERM nowy := (2007,0) (2015,1);
END_FUZZIFY
DEFUZZIFY ocena
TERM slaby := (5,1) (11,0);
TERM srednia := (9,0) (15,1) (21,0);
TERM dobry := (19,0) (25,1);
METHOD : COG;
DEFAULT := 0;
END_DEFUZZIFY
RULEBLOCK No1
AND : MIN;
ACT : MIN;
ACCU : MAX;
RULE 4 : IF rok IS nowy THEN ocena IS slaby;
RULE 5 : IF rok IS sredni THEN ocena IS srednia;
RULE 6 : IF rok IS stary THEN ocena IS dobry;
END_RULEBLOCK
END_FUNCTION_BLOCK

View File

@ -0,0 +1,37 @@
FUNCTION_BLOCK ocena_sr
VAR_INPUT
sr_ocena : REAL;
END_VAR
VAR_OUTPUT
ocena : REAL;
END_VAR
FUZZIFY sr_ocena
TERM niska := (3,1) (5,0);
TERM srednia := (4, 0) (5, 1) (6,1) (7,0) ;
TERM wysoka := (6, 0) (8,1);
END_FUZZIFY
DEFUZZIFY ocena
TERM slaby := (5,1) (11,0);
TERM srednia := (9,0) (15,1) (21,0);
TERM dobry := (19,0) (25,1);
METHOD : COG;
DEFAULT := 0;
END_DEFUZZIFY
RULEBLOCK No1
AND : MIN;
ACT : MIN;
ACCU : MAX;
RULE 7 : IF sr_ocena IS wysoka THEN ocena IS dobry;
RULE 8 : IF sr_ocena IS srednia THEN ocena IS srednia;
RULE 9 : IF sr_ocena IS niska THEN ocena IS slaby;
END_RULEBLOCK
END_FUNCTION_BLOCK

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="ASCII"?>
<anttasks:AntTask xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:anttasks="http://org.eclipse.fx.ide.jdt/1.0" buildDirectory="${project}/build">
<deploy>
<application name="Projekt-LSR"/>
<info/>
</deploy>
<signjar/>
</anttasks:AntTask>

View File

@ -0,0 +1,606 @@
package application;
import java.io.IOException;
import java.net.URL;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.ResourceBundle;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.TabPane;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.input.MouseButton;
import javafx.scene.input.MouseEvent;
import javafx.stage.Stage;
public class ApplicationController implements Initializable {
//variables
private ObservableList<String> observableList;
private List<String> values;
private String url = "jdbc:postgresql://localhost:5432/fcl";
private String user = "postgres";
private String password = "postgres";
Connection connection;
@FXML
private TabPane tabPane;
//FXML app tab
@FXML
private ChoiceBox<String> typeChoiceBox;
@FXML
private ChoiceBox<String> productionChoiceBox;
@FXML
private ChoiceBox<String> durationChoiceBox;
@FXML
private ChoiceBox<String> userRatingChoiceBox;
@FXML
private ChoiceBox<String> numberOfVotesChoiceBox;
@FXML
private TableView<Movie> queryResultTableView;
@FXML
private TableColumn<Movie, String> titleColumn;
@FXML
private TableColumn<Movie, ArrayList<String>> typesColumn;
@FXML
private TableColumn<Movie, Integer> productionYearColumn;
@FXML
private TableColumn<Movie, Integer> durationColumn;
@FXML
private TableColumn<Movie, Double> ratingColumn;
@FXML
private TableColumn<Movie, Integer> numberOfVotesColumn;
@FXML
private TableColumn<Movie, Double> bestMatchingColumn;
//FXML findingMovieTab
@FXML
private TextField queryFindingTabTextField;
@FXML
private TableView<Movie> queryResultFindingTabTableView;
@FXML
private TableColumn<Movie, String> titleFindingTabColumn;
@FXML
private TableColumn<Movie, ArrayList<String>> typesFindingTabColumn;
@FXML
private TableColumn<Movie, Integer> productionYearFindingTabColumn;
@FXML
private TableColumn<Movie, Integer> durationFindingTabColumn;
@FXML
private TableColumn<Movie, Double> ratingFindingTabColumn;
@FXML
private TableColumn<Movie, Integer> numberOfVotesFindingTabColumn;
//FXML opinionTab
@FXML
private TextField opinionTabTitleTextField;
@FXML
private TextField opinionTabRatingTextField;
@FXML
private TextField opinionTabVotesTextField;
@FXML
public TableView<Opinion> opinionsTableView;
@FXML
private TableColumn<Opinion, String> emailOpinionsTabColumn;
@FXML
private TableColumn<Opinion, String> dateOpinionsTabColumn;
@FXML
private TableColumn<Opinion, String> opinionOpinionsTabColumn;
@FXML
private TableColumn<Opinion, Integer> ratingOpinionsTabColumn;
@FXML
private TableColumn<Opinion, String> nickOpinionsTabColumn;
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
initializeChoiceBoxes();
initializeTables();
queryResultTableView.setOnMouseClicked((MouseEvent e) -> {
Movie selectedMovie = queryResultTableView.getSelectionModel().getSelectedItem();
if (e.getButton() == MouseButton.PRIMARY && e.getClickCount() == 2 && selectedMovie != null) {
tabPane.getSelectionModel().select(2);
insertSelectedMovie(selectedMovie.getTitle(), selectedMovie.getRating(), selectedMovie.getNumberOfVotes());
updateTableView(selectedMovie.getTitle());
}
});
queryResultFindingTabTableView.setOnMouseClicked((MouseEvent e) -> {
Movie selectedMovie = queryResultFindingTabTableView.getSelectionModel().getSelectedItem();
if (e.getButton() == MouseButton.PRIMARY && e.getClickCount() == 2 && selectedMovie != null) {
tabPane.getSelectionModel().select(2);
insertSelectedMovie(selectedMovie.getTitle(), selectedMovie.getRating(), selectedMovie.getNumberOfVotes());
updateTableView(selectedMovie.getTitle());
}
});
}
private void insertSelectedMovie(String title, Double rating, int numberOfVotes) {
opinionTabTitleTextField.setEditable(true);
opinionTabRatingTextField.setEditable(true);
opinionTabVotesTextField.setEditable(true);
opinionTabTitleTextField.setText(title);
opinionTabRatingTextField.setText(String.valueOf(rating));
opinionTabVotesTextField.setText(String.valueOf(numberOfVotes));
opinionTabTitleTextField.setEditable(false);
opinionTabRatingTextField.setEditable(false);
opinionTabVotesTextField.setEditable(false);
}
private void initializeChoiceBoxes() {
initializeTypeChoiceBox();
initializeProductionChoiceBox();
initializeDurationChoiceBox();
initializeUserRatingChoiceBox();
initializeNumberOfVotesChoiceBox();
}
private void initializeTypeChoiceBox() {
this.values = new ArrayList<>();
this.values.add(" ");
this.values.add("comedy");
this.values.add("drama");
this.values.add("crime");
this.values.add("fantasy");
this.values.add("horror");
this.values.add("romance");
this.values.add("adventure");
this.values.add("animation");
this.values.add("history");
this.values.add("sci-fi");
this.values.add("sport");
this.values.add("thriller");
this.values.add("biography");
this.values.add("documentary");
this.values.add("musical");
this.observableList = FXCollections.observableArrayList();
this.observableList.addAll(values);
typeChoiceBox.setItems(observableList);
typeChoiceBox.setValue(values.get(0));
}
private void initializeProductionChoiceBox() {
this.values = new ArrayList<>();
this.values.add(" ");
this.values.add("Stary film");
this.values.add("Sredni film");
this.values.add("Nowy film");
this.observableList = FXCollections.observableArrayList();
this.observableList.addAll(values);
productionChoiceBox.setItems(observableList);
productionChoiceBox.setValue(values.get(0));
}
private void initializeDurationChoiceBox() {
this.values = new ArrayList<>();
this.values.add(" ");
this.values.add("Krotkiej dlugosci film");
this.values.add("Sredniej dlugosci film");
this.values.add("Dlugiej dlugosci film");
this.observableList = FXCollections.observableArrayList();
this.observableList.addAll(values);
durationChoiceBox.setItems(observableList);
durationChoiceBox.setValue(values.get(0));
}
private void initializeUserRatingChoiceBox() {
this.values = new ArrayList<>();
this.values.add(" ");
this.values.add("Slaby film");
this.values.add("Przecietny film");
this.values.add("Dobry film");
this.observableList = FXCollections.observableArrayList();
this.observableList.addAll(values);
userRatingChoiceBox.setItems(observableList);
userRatingChoiceBox.setValue(values.get(0));
}
private void initializeNumberOfVotesChoiceBox() {
this.values = new ArrayList<>();
this.values.add(" ");
this.values.add("Mala ilosc glosow");
this.values.add("Srednia ilosc glosow");
this.values.add("Duza ilosc glosow");
this.observableList = FXCollections.observableArrayList();
this.observableList.addAll(values);
numberOfVotesChoiceBox.setItems(observableList);
numberOfVotesChoiceBox.setValue(values.get(0));
}
private void initializeTables() {
//app Tab Table
titleColumn.setCellValueFactory(new PropertyValueFactory<>("title"));
typesColumn.setCellValueFactory(new PropertyValueFactory<>("types"));
productionYearColumn.setCellValueFactory(new PropertyValueFactory<>("productionYear"));
durationColumn.setCellValueFactory(new PropertyValueFactory<>("duration"));
ratingColumn.setCellValueFactory(new PropertyValueFactory<>("rating"));
numberOfVotesColumn.setCellValueFactory(new PropertyValueFactory<>("numberOfVotes"));
bestMatchingColumn.setCellValueFactory(new PropertyValueFactory<>("bestMatching"));
//find Movie Tab Table
titleFindingTabColumn.setCellValueFactory(new PropertyValueFactory<>("title"));
typesFindingTabColumn.setCellValueFactory(new PropertyValueFactory<>("types"));
productionYearFindingTabColumn.setCellValueFactory(new PropertyValueFactory<>("productionYear"));
durationFindingTabColumn.setCellValueFactory(new PropertyValueFactory<>("duration"));
ratingFindingTabColumn.setCellValueFactory(new PropertyValueFactory<>("rating"));
numberOfVotesFindingTabColumn.setCellValueFactory(new PropertyValueFactory<>("numberOfVotes"));
//opinions Tab Table
emailOpinionsTabColumn.setCellValueFactory(new PropertyValueFactory<>("email"));
dateOpinionsTabColumn.setCellValueFactory(new PropertyValueFactory<>("date"));
opinionOpinionsTabColumn.setCellValueFactory(new PropertyValueFactory<>("opinion"));
ratingOpinionsTabColumn.setCellValueFactory(new PropertyValueFactory<>("rating"));
nickOpinionsTabColumn.setCellValueFactory(new PropertyValueFactory<>("nick"));
}
@FXML
private void creditsButtonAction() {
try {
FXMLLoader loader = new FXMLLoader(this.getClass().getResource("creditsView.fxml"));
Parent root = (Parent) loader.load();
Stage stage = new Stage();
stage.setTitle("Credits");
stage.setScene(new Scene(root));
stage.show();
} catch (IOException e) {
e.printStackTrace();
}
}
@FXML
private void findMoviesButtonAction() {
String genre = typeChoiceBox.getSelectionModel().getSelectedItem();
String production = productionChoiceBox.getSelectionModel().getSelectedItem();
String duration = durationChoiceBox.getSelectionModel().getSelectedItem();
String userRating = userRatingChoiceBox.getSelectionModel().getSelectedItem();
String numberOfVotes = numberOfVotesChoiceBox.getSelectionModel().getSelectedItem();
ObservableList<Movie> data = FXCollections.observableArrayList();
try {
connection = DriverManager.getConnection(url, user, password);
if (connection != null) {
Statement statement = connection.createStatement();
String query = "SELECT * FROM title_join";
//kategoria
if (!(genre == " ")) {
query += " WHERE \"genres\" LIKE '%" + genre + "%'";
}
//rok produkcji
if (production.equals("Nowy film")) {
query += " AND CAST(\"startyear\" AS INT) > '2000'";
} else if (production.equals("Sredni film")) {
query += " AND CAST(\"startyear\" AS INT) > '1980' AND CAST(\"startyear\" AS INT) < '2020'";
} else if (production.equals("Stary film")) {
query += " AND CAST(\"startyear\" AS INT) < '2000'";
}
//dlugosc filmu
if (duration.equals("Dlugiej dlugosci film")) {
query += " AND CAST(\"runtimeminutes\" AS INT) > '120'";
} else if (duration.equals("Sredniej dlugosci film")) {
query += " AND CAST(\"runtimeminutes\" AS INT) > '50' AND CAST(\"runtimeminutes\" AS INT) < '150'";
} else if (duration.equals("Krotkiej dlugosci film")) {
query += " AND CAST(\"runtimeminutes\" AS INT) < '100'";
}
//ocena uzytkownikow
if (userRating.equals("Dobry film")) {
query += " AND \"averagerating\" > '5'";
} else if (userRating.equals("Przecietny film")) {
query += " AND \"averagerating\" > '2' AND \"averagerating\" < '8'";
} else if (userRating.equals("Slaby film")) {
query += " AND \"averagerating\" < '5'";
}
//ilosc glosow uzytkownikow
if (numberOfVotes.equals("Duza ilosc glosow")) {
query += " AND \"numvotes\" > '150'";
} else if (numberOfVotes.equals("Srednia ilosc glosow")) {
query += " AND \"numvotes\" < '200' AND \"numvotes\" > '50'";
} else if (numberOfVotes.equals("Mala ilosc glosow")) {
query += " AND \"numvotes\" < '100'";
}
//gdyby brakowalo jakiegos pola dopasowuje zapytanie
query = query.replaceFirst("title_join AND", "title_join WHERE");
ResultSet queryResult = statement.executeQuery(query);
while (queryResult.next()) {
Movie m = new Movie();
m.setTitle(queryResult.getString(2));
m.setProductionYear(queryResult.getInt(3));
m.setDuration(queryResult.getInt(4));
String s = queryResult.getString(5);
ArrayList<String> genres = new ArrayList<String>(Arrays.asList(s.split(",")));
m.setTypes(genres);
m.setRating(queryResult.getDouble(6));
m.setNumberOfVotes(queryResult.getInt(7));
m.setBestMatching(1.0);
data.add(m);
}
} else {
Alert alert = new Alert(AlertType.INFORMATION);
alert.setTitle("Information Dialog");
alert.setHeaderText(null);
alert.setContentText("Blad polaczenia z baza danych");
alert.showAndWait();
}
} catch (SQLException e) {
e.printStackTrace();
}
if(!(production.equals(" ") && duration.equals(" ") && userRating.equals(" ") && numberOfVotes.equals(" "))){
for (Movie m : data) {
m.setBestMatching(calculateBestMatching(m.getProductionYear(), m.getDuration(), m.getRating(), m.getNumberOfVotes()));
}
}
if (data.size() == 0) {
Alert alert = new Alert(AlertType.INFORMATION);
alert.setTitle("Information Dialog");
alert.setHeaderText(null);
alert.setContentText("W bazie nie znajduja sie filmy pasujace do podanego zapytania.");
alert.showAndWait();
}
queryResultTableView.setItems(data);
}
private double calculateBestMatching(int productionYear, int movieDuration, double rating, int votes) {
String production = productionChoiceBox.getSelectionModel().getSelectedItem();
String duration = durationChoiceBox.getSelectionModel().getSelectedItem();
String userRating = userRatingChoiceBox.getSelectionModel().getSelectedItem();
String numberOfVotes = numberOfVotesChoiceBox.getSelectionModel().getSelectedItem();
double matching = 0.0;
//rok produkcji
if (!production.equals(" ")) {
if (production.equals("Nowy film")) {
matching = fp(2010, 2015, 2015, productionYear);
} else if (production.equals("Sredni film")) {
matching = fpCenter(1995, 2003, 2007, 2015, productionYear);
} else if (production.equals("Stary film")) {
matching = fp(1980, 1980, 2000, productionYear);
}
}
//dlugosc filmu
if (!duration.equals(" ")) {
if (matching != 0) {
if (duration.equals("Dlugiej dlugosci film")) {
matching = (fp(120, 180, 180, movieDuration) + matching) / 2;
} else if (duration.equals("Sredniej dlugosci film")) {
matching = (fpCenter(50, 90, 110, 150, movieDuration) + matching) / 2;
} else if (duration.equals("Krotkiej dlugosci film")) {
matching = (fp(30, 30, 90, movieDuration) + matching) / 2;
}
} else {
if (duration.equals("Dlugiej dlugosci film")) {
matching = fp(120, 180, 180, movieDuration);
} else if (duration.equals("Sredniej dlugosci film")) {
matching = fpCenter(50, 90, 110, 150, movieDuration);
} else if (duration.equals("Krotkiej dlugosci film")) {
matching = fp(30, 30, 90, movieDuration);
}
}
}
//ocena uzytkownikow
if (!userRating.equals(" ")) {
if (matching != 0) {
if (userRating.equals("Dobry film")) {
matching = (fp(5.0, 7.5, 7.5, rating) + matching) / 2;
} else if (userRating.equals("Przecietny film")) {
matching = (fpCenter(2.5, 4, 6, 7.5, rating) + matching) / 2;
} else if (userRating.equals("Slaby film")) {
matching = (fp(2.5, 2.5, 5.0, rating) + matching) / 2;
}
} else {
if (userRating.equals("Dobry film")) {
matching = fp(5.0, 7.5, 7.5, rating);
} else if (userRating.equals("Przecietny film")) {
matching = fpCenter(2.5, 4, 6, 7.5, rating);
} else if (userRating.equals("Slaby film")) {
matching = fp(2.5, 2.5, 5.0, rating);
}
}
}
//ilosc glosow uzytkownikow
if (!numberOfVotes.equals(" ")) {
if (matching != 0) {
if (numberOfVotes.equals("Duza ilosc glosow")) {
matching = (fp(150, 250, 250, votes) + matching) / 2;
} else if (numberOfVotes.equals("Srednia ilosc glosow")) {
matching = (fpCenter(75, 100, 150, 175, votes) + matching) / 2;
} else if (numberOfVotes.equals("Mala ilosc glosow")) {
matching = (fp(50, 50, 100, votes) + matching) / 2;
}
} else {
if (numberOfVotes.equals("Duza ilosc glosow")) {
matching = fp(150, 250, 250, votes);
} else if (numberOfVotes.equals("Srednia ilosc glosow")) {
matching = fpCenter(75, 100, 150, 175, votes);
} else if (numberOfVotes.equals("Mala ilosc glosow")) {
matching = fp(50, 50, 100, votes);
}
}
}
return matching;
}
double fp(double a, double b, double c, double x) {
double y = -1;
if (a == b) {
if (x <= a) {
return 1;
} else if (x > a && x < c) {
y = (0 - 1) / (c - a) * (x - a) + 1;
return y;
} else {
return 0;
}
} else if (b == c) {
if (x <= a) {
return 0;
} else if (x > a && x < c) {
y = (1 - 0) / (c - a) * (x - a);
return y;
} else {
return 1;
}
}
return y;
}
double fpCenter(double a, double b, double c, double d, double x) {
double y = -1;
if (x <= a || x >= d) {
return 0;
} else if (x >= b && x <=c) {
return 1;
} else if (x > a && x < b) {
y = (1 - 0) / (b - a) * (x - a);
return y;
} else {
y = (0 - 1) / (d - c) * (x - c) + 1;
return y;
}
}
@FXML
void queryFindingTabButtonAction() {
if (!queryFindingTabTextField.getText().isEmpty()) {
ObservableList<Movie> data = FXCollections.observableArrayList();
try {
connection = DriverManager.getConnection(url, user, password);
if (connection != null) {
Statement statement = connection.createStatement();
String query = "SELECT * FROM title_join WHERE \"originaltitle\" LIKE '%"
+ queryFindingTabTextField.getText() + "%'";
ResultSet queryResult = statement.executeQuery(query);
while (queryResult.next()) {
Movie m = new Movie();
m.setTitle(queryResult.getString(2));
m.setProductionYear(queryResult.getInt(3));
m.setDuration(queryResult.getInt(4));
String s = queryResult.getString(5);
ArrayList<String> genres = new ArrayList<String>(Arrays.asList(s.split(",")));
m.setTypes(genres);
m.setRating(queryResult.getDouble(6));
m.setNumberOfVotes(queryResult.getInt(7));
data.add(m);
}
} else {
Alert alert = new Alert(AlertType.INFORMATION);
alert.setTitle("Information Dialog");
alert.setHeaderText(null);
alert.setContentText("Blad polaczenia z baza danych");
alert.showAndWait();
}
} catch (SQLException e) {
e.printStackTrace();
}
queryResultFindingTabTableView.setItems(data);
} else {
Alert alert = new Alert(AlertType.INFORMATION);
alert.setTitle("Information Dialog");
alert.setHeaderText(null);
alert.setContentText("Wpisz tytul lub jego fragment");
alert.showAndWait();
}
}
@FXML
void addOpinionButtonAction() {
if(!opinionTabTitleTextField.getText().equals("")) {
try {
FXMLLoader loader = new FXMLLoader(this.getClass().getResource("addOpinionView.fxml"));
Parent root = (Parent) loader.load();
Stage stage = new Stage();
stage.setTitle("Add new opinion");
stage.setScene(new Scene(root));
stage.show();
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy");
Date date = new Date();
TextField textField = (TextField) root.lookup("#addOpinionTitleTextField");
textField.setText(opinionTabTitleTextField.getText());
textField.setEditable(false);
textField = (TextField) root.lookup("#addOpinionDateTextField");
textField.setText(formatter.format(date));
textField.setEditable(false);
} catch (IOException e) {
e.printStackTrace();
}
}else {
Alert alert = new Alert(AlertType.INFORMATION);
alert.setTitle("Information Dialog");
alert.setHeaderText(null);
alert.setContentText("Nie mozna dodac opinii bez wybranego filmu");
alert.showAndWait();
}
}
public void updateTableView(String title){
ObservableList<Opinion> data = FXCollections.observableArrayList();
try {
connection = DriverManager.getConnection(url, user, password);
if (connection != null) {
Statement statement = connection.createStatement();
String query = "SELECT * FROM movie_opinions WHERE \"originaltitle\" = '" + title + "'";
ResultSet queryResult = statement.executeQuery(query);
while (queryResult.next()) {
Opinion o = new Opinion();
o.setTitle(queryResult.getString(2));
o.setEmail(queryResult.getString(3));
o.setOpinionDate(queryResult.getString(4));
o.setOpinion(queryResult.getString(5));
o.setRating(queryResult.getInt(6));
o.setNick(queryResult.getString(7));
data.add(o);
}
} else {
Alert alert = new Alert(AlertType.INFORMATION);
alert.setTitle("Information Dialog");
alert.setHeaderText(null);
alert.setContentText("Blad polaczenia z baza danych");
alert.showAndWait();
}
} catch (SQLException e) {
e.printStackTrace();
}
opinionsTableView.setItems(data);
}
@FXML
void refreshButtonAction() {
if(!opinionTabTitleTextField.getText().equals("")) {
updateTableView(opinionTabTitleTextField.getText());
}
}
}

View File

@ -0,0 +1,3 @@
package application;
public class CreditsController {}

View File

@ -0,0 +1,29 @@
package application;
import java.io.IOException;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
public class Main extends Application {
public static void main(String[] args) {launch(args);}
@Override
public void start(Stage stage) throws IOException {
try {
FXMLLoader loader = new FXMLLoader(this.getClass().getResource("applicationView.fxml"));
AnchorPane root = loader.load();
Scene scene = new Scene(root);
stage.setResizable(false);
stage.setTitle("Projekt LSR");
stage.setScene(scene);
stage.show();
} catch (IOException e) {
System.out.println(e);
}
}
}

View File

@ -0,0 +1,81 @@
package application;
import java.util.ArrayList;
public class Movie {
private String title;
private ArrayList<String>types;
private int productionYear;
private int duration;
private double rating;
private int numberOfVotes;
private double bestMatching;
public Movie() {}
public Movie(String title, ArrayList<String>types, int productionYear, int duration, double rating, int numberOfVotes) {
this.title = title;
this.types = types;
this.productionYear = productionYear;
this.duration = duration;
this.rating = rating;
this.numberOfVotes = numberOfVotes;
this.bestMatching = -1.0;
}
public Movie(String title, ArrayList<String>types, int productionYear, int duration, double rating, int numberOfVotes, double bestMatching) {
this.title = title;
this.types = types;
this.productionYear = productionYear;
this.duration = duration;
this.rating = rating;
this.numberOfVotes = numberOfVotes;
this.bestMatching = bestMatching;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public ArrayList<String> getTypes() {
return types;
}
public void setTypes(ArrayList<String> types) {
this.types = types;
}
public int getProductionYear() {
return productionYear;
}
public void setProductionYear(int productionYear) {
this.productionYear = productionYear;
}
public int getDuration() {
return duration;
}
public void setDuration(int duration) {
this.duration = duration;
}
public double getRating() {
return rating;
}
public void setRating(double rating) {
this.rating = rating;
}
public int getNumberOfVotes() {
return numberOfVotes;
}
public void setNumberOfVotes(int numberOfVotes) {
this.numberOfVotes = numberOfVotes;
}
public double getBestMatching() {
return bestMatching;
}
public void setBestMatching(double d) {
this.bestMatching = d;
}
}

View File

@ -0,0 +1,63 @@
package application;
public class Opinion {
private String title;
private String email;
private String date;
private String opinion;
private int rating;
private String nick;
public Opinion() {}
public Opinion(String title, String email, String date, String opinion, int rating, String nick) {
this.title = title;
this.email = email;
this.date = date;
this.opinion = opinion;
this.rating = rating;
this.nick = nick;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getNick() {
return nick;
}
public void setNick(String nick) {
this.nick = nick;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getDate() {
return date;
}
public void setOpinionDate(String date) {
this.date = date;
}
public int getRating() {
return rating;
}
public void setRating(int rating) {
this.rating = rating;
}
public String getOpinion() {
return opinion;
}
public void setOpinion(String opinion) {
this.opinion = opinion;
}
}

View File

@ -0,0 +1,128 @@
package application;
import java.net.URL;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.ResourceBundle;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.control.Alert.AlertType;
import javafx.stage.Stage;
public class OpinionController implements Initializable {
private ObservableList<String> observableList;
private String url = "jdbc:postgresql://localhost:5432/fcl";
private String user = "postgres";
private String password = "postgres";
Connection connection;
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
List<String> values = new ArrayList<String>();
values.add("10");
values.add("9");
values.add("8");
values.add("7");
values.add("6");
values.add("5");
values.add("5");
values.add("4");
values.add("3");
values.add("2");
values.add("1");
this.observableList = FXCollections.observableArrayList();
this.observableList.addAll(values);
ratingChoiceBox.setItems(observableList);
ratingChoiceBox.setValue(values.get(0));
}
@FXML
private TextField addOpinionTitleTextField;
@FXML
private TextField addOpinionNickTextField;
@FXML
private TextField addOpinionEMailTextField;
@FXML
private TextField addOpinionDateTextField;
@FXML
private TextArea addOpinionTextArea;
@FXML
private ChoiceBox<String> ratingChoiceBox;
@FXML
private Button closeButton;
@FXML
void confirmOpinionButtonAction() {
Opinion opinion = new Opinion();
String patternString = "[^@]+@[^\\.]+\\..+";
Pattern pattern = Pattern.compile(patternString);
Matcher matcher = pattern.matcher(addOpinionEMailTextField.getText());
boolean matches = matcher.matches();
if(!(addOpinionTitleTextField.getText().equals("") || matches == false || addOpinionDateTextField.getText().equals("") ||
addOpinionTextArea.getText().equals("") || addOpinionNickTextField.getText().equals(""))) {
opinion.setTitle(addOpinionTitleTextField.getText());
opinion.setEmail(addOpinionEMailTextField.getText());
opinion.setOpinionDate(addOpinionDateTextField.getText());
opinion.setOpinion(addOpinionTextArea.getText());
opinion.setRating(Integer.valueOf(ratingChoiceBox.getSelectionModel().getSelectedItem()));
opinion.setNick(addOpinionNickTextField.getText());
insertOpinion(opinion);
Stage stage = (Stage) closeButton.getScene().getWindow();
stage.close();
}else {
Alert alert = new Alert(AlertType.INFORMATION);
alert.setTitle("Information Dialog");
alert.setHeaderText(null);
alert.setContentText("Nie mozna dodac opinii do podanego filmu bez wymaganych danych");
alert.showAndWait();
}
}
private void insertOpinion(Opinion opinion) {
String query = "INSERT INTO movie_opinions(tconst, originaltitle, email, date, opinion, rating, nick) "
+ "VALUES(?,?,?,?,?,?,?)";
try (
Connection conn = DriverManager.getConnection(url, user, password);
PreparedStatement statement = conn.prepareStatement(query);) {
statement.setString(1, "1");
statement.setString(2, opinion.getTitle());
statement.setString(3, opinion.getEmail());
statement.setString(4, opinion.getDate());
statement.setString(5, opinion.getOpinion());
statement.setInt(6, opinion.getRating());
statement.setString(7, opinion.getNick());
statement.addBatch();
statement.executeBatch();
} catch (SQLException ex) {
System.out.println(ex.getMessage());
}
}
}

View File

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ChoiceBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.text.Font?>
<AnchorPane maxHeight="400.0" maxWidth="600.0" minHeight="400.0" minWidth="600.0" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.OpinionController">
<children>
<GridPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="20.0" prefWidth="20.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="560.0" minWidth="560.0" prefWidth="560.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="20.0" minWidth="20.0" prefWidth="20.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="10.0" minHeight="10.0" prefHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="10.0" minHeight="10.0" prefHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="330.0" minHeight="330.0" prefHeight="330.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label alignment="CENTER" text="Dodanie opinii" textAlignment="CENTER" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="1" GridPane.valignment="CENTER">
<font>
<Font name="System Bold" size="14.0" />
</font>
</Label>
<GridPane GridPane.columnIndex="1" GridPane.rowIndex="3">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="10.0" minWidth="10.0" prefWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="10.0" minHeight="10.0" prefHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="10.0" minHeight="10.0" prefHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="10.0" minHeight="10.0" prefHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="10.0" minHeight="10.0" prefHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="10.0" minHeight="10.0" prefHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Ocena:" GridPane.rowIndex="10">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<TextField fx:id="addOpinionTitleTextField" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="30.0" prefWidth="478.0" GridPane.columnIndex="2" />
<TextField fx:id="addOpinionNickTextField" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="30.0" prefWidth="518.0" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<TextField fx:id="addOpinionEMailTextField" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="30.0" prefWidth="507.0" GridPane.columnIndex="2" GridPane.rowIndex="4" />
<TextField fx:id="addOpinionDateTextField" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="30.0" prefWidth="507.0" GridPane.columnIndex="2" GridPane.rowIndex="6" />
<Label text="Tytuł filmu:">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<Label text="Nick:" GridPane.rowIndex="2">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<Label text="E-mail:" GridPane.rowIndex="4">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<Label text="Aktualna data:" GridPane.rowIndex="6">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<Label text="Opinia:" GridPane.rowIndex="8" GridPane.valignment="TOP">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<TextArea fx:id="addOpinionTextArea" prefHeight="200.0" prefWidth="200.0" wrapText="true" GridPane.columnIndex="2" GridPane.rowIndex="8" />
<Button fx:id="closeButton" maxHeight="1.7976931348623157E308" mnemonicParsing="false" onAction="#confirmOpinionButtonAction" text="Dodaj" GridPane.columnIndex="2" GridPane.halignment="RIGHT" GridPane.hgrow="ALWAYS" GridPane.rowIndex="10" GridPane.vgrow="ALWAYS" />
<ChoiceBox fx:id="ratingChoiceBox" maxHeight="1.7976931348623157E308" prefWidth="150.0" GridPane.columnIndex="2" GridPane.rowIndex="10" />
</children>
</GridPane>
</children>
</GridPane>
</children>
</AnchorPane>

View File

@ -0,0 +1,273 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ChoiceBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.text.Font?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="700.0" prefWidth="1000.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.ApplicationController">
<children>
<Label layoutX="162.0" layoutY="26.0" text="Wyszukiwarka filmów w oparciu o nieprecyzyjne zapytania z bazy IMDb">
<font>
<Font name="System Bold" size="20.0" />
</font>
</Label>
<Button layoutX="909.0" layoutY="26.0" mnemonicParsing="false" onAction="#creditsButtonAction" text="Autorzy">
<font>
<Font size="14.0" />
</font>
</Button>
<TabPane fx:id="tabPane" layoutX="-2.0" layoutY="69.0" prefHeight="631.0" prefWidth="1000.0" tabClosingPolicy="UNAVAILABLE">
<tabs>
<Tab closable="false" text="Wybór filmu">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<GridPane layoutX="2.0" prefHeight="600.0" prefWidth="1000.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="20.0" minWidth="20.0" prefWidth="20.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="20.0" minWidth="20.0" prefWidth="20.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="100.0" minHeight="100.0" prefHeight="100.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<GridPane GridPane.columnIndex="1" GridPane.rowIndex="1">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="10.0" minWidth="10.0" prefWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="10.0" minWidth="10.0" prefWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="10.0" minWidth="10.0" prefWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="10.0" minWidth="10.0" prefWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="10.0" minHeight="10.0" prefHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Gatunek" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<Label text="Czas powstania" GridPane.columnIndex="2" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<Label text="Czas trwania" GridPane.columnIndex="4" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<Label text="Ocena użytkowników" GridPane.columnIndex="6" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<Label text="Ilość głosów" GridPane.columnIndex="8" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<ChoiceBox fx:id="typeChoiceBox" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.rowIndex="1" />
<ChoiceBox fx:id="productionChoiceBox" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<ChoiceBox fx:id="durationChoiceBox" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.columnIndex="4" GridPane.rowIndex="1" />
<ChoiceBox fx:id="userRatingChoiceBox" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.columnIndex="6" GridPane.rowIndex="1" />
<ChoiceBox fx:id="numberOfVotesChoiceBox" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.columnIndex="8" GridPane.rowIndex="1" />
<Button maxHeight="30.0" mnemonicParsing="false" onAction="#findMoviesButtonAction" text="Szukaj" GridPane.columnIndex="8" GridPane.halignment="RIGHT" GridPane.rowIndex="3" GridPane.valignment="CENTER" />
</children>
</GridPane>
<GridPane GridPane.columnIndex="1" GridPane.rowIndex="3">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="10.0" minHeight="10.0" prefHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Rezultat zapytania" GridPane.halignment="CENTER" GridPane.valignment="CENTER">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<TableView fx:id="queryResultTableView" prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="2">
<columns>
<TableColumn fx:id="titleColumn" maxWidth="300.0" minWidth="300.0" prefWidth="300.0" text="Tytuł" />
<TableColumn fx:id="typesColumn" maxWidth="160.0" minWidth="160.0" prefWidth="160.0" text="Gatunek" />
<TableColumn fx:id="productionYearColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" text="Rok produkcji" />
<TableColumn fx:id="durationColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" text="Czas trwania" />
<TableColumn fx:id="ratingColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" text="Średnia ocena" />
<TableColumn fx:id="numberOfVotesColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" text="Ilość głosów" />
<TableColumn fx:id="bestMatchingColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" text="Dopasowanie" />
</columns>
</TableView>
</children>
</GridPane>
</children>
</GridPane>
</children></AnchorPane>
</content>
</Tab>
<Tab closable="false" text="Szukaj filmu">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<GridPane prefHeight="600.0" prefWidth="1000.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="20.0" minWidth="20.0" prefWidth="20.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="20.0" minWidth="20.0" prefWidth="20.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="100.0" minHeight="100.0" prefHeight="100.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<GridPane GridPane.columnIndex="1" GridPane.rowIndex="1">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="80.0" minWidth="80.0" prefWidth="80.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<TextField fx:id="queryFindingTabTextField" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.rowIndex="1" />
<Label text="Szukaj filmu po tytule lub fragmencie">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<Button mnemonicParsing="false" onAction="#queryFindingTabButtonAction" text="Szukaj filmu" GridPane.halignment="RIGHT" GridPane.rowIndex="2" GridPane.valignment="CENTER" />
</children>
</GridPane>
<TableView fx:id="queryResultFindingTabTableView" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="3">
<columns>
<TableColumn fx:id="titleFindingTabColumn" maxWidth="400.0" minWidth="400.0" prefWidth="400.0" text="Tytuł" />
<TableColumn fx:id="typesFindingTabColumn" maxWidth="160.0" minWidth="160.0" prefWidth="160.0" text="Gatunek" />
<TableColumn fx:id="productionYearFindingTabColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" text="Rok produkcji" />
<TableColumn fx:id="durationFindingTabColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" text="Czas trwania" />
<TableColumn fx:id="ratingFindingTabColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" text="Średnia ocena" />
<TableColumn fx:id="numberOfVotesFindingTabColumn" maxWidth="100.0" minWidth="100.0" prefWidth="100.0" text="Ilość głosów" />
</columns>
</TableView>
</children>
</GridPane>
</children></AnchorPane>
</content>
</Tab>
<Tab closable="false" text="Opinie">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<GridPane prefHeight="600.0" prefWidth="1000.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="20.0" minWidth="20.0" prefWidth="20.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="20.0" minWidth="20.0" prefWidth="20.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="100.0" minHeight="100.0" prefHeight="100.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="10.0" minHeight="10.0" prefHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="30.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Dane z bazy IMDb" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="1" GridPane.valignment="TOP">
<font>
<Font name="System Bold" size="18.0" />
</font>
</Label>
<GridPane GridPane.columnIndex="1" GridPane.rowIndex="1">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="400.0" minWidth="400.0" prefWidth="400.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="10.0" minWidth="10.0" prefWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="10.0" minWidth="10.0" prefWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="10.0" minWidth="10.0" prefWidth="10.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Tytuł filmu" GridPane.rowIndex="1">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<TextField fx:id="opinionTabTitleTextField" editable="false" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.rowIndex="2" />
<Label text="Średnia ocena" GridPane.columnIndex="2" GridPane.rowIndex="1">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<TextField fx:id="opinionTabRatingTextField" editable="false" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<Label text="Ilość głosów" GridPane.columnIndex="4" GridPane.rowIndex="1">
<font>
<Font name="System Bold" size="13.0" />
</font>
</Label>
<TextField fx:id="opinionTabVotesTextField" editable="false" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" GridPane.columnIndex="4" GridPane.rowIndex="2" />
</children>
</GridPane>
<TableView fx:id="opinionsTableView" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="3">
<columns>
<TableColumn fx:id="nickOpinionsTabColumn" maxWidth="134.0" minWidth="134.0" prefWidth="134.0" text="Nick" />
<TableColumn fx:id="emailOpinionsTabColumn" maxWidth="200.0" minWidth="200.0" prefWidth="200.0" text="E-mail" />
<TableColumn fx:id="dateOpinionsTabColumn" maxWidth="150.0" minWidth="150.0" prefWidth="150.0" text="Data dodania opinii" />
<TableColumn fx:id="ratingOpinionsTabColumn" maxWidth="50.0" minWidth="50.0" prefWidth="50.0" text="Ocena" />
<TableColumn fx:id="opinionOpinionsTabColumn" maxWidth="1.7976931348623157E308" minWidth="425.0" prefWidth="425.0" text="Opinia" />
</columns>
</TableView>
<HBox maxHeight="200.0" maxWidth="188.0" prefHeight="100.0" prefWidth="200.0" spacing="10.0" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="5" GridPane.valignment="CENTER">
<children>
<Button maxHeight="1.7976931348623157E308" mnemonicParsing="false" onAction="#refreshButtonAction" text="Odswież" />
<Button maxHeight="1.7976931348623157E308" mnemonicParsing="false" onAction="#addOpinionButtonAction" text="Dodaj nową opinię" />
</children>
</HBox>
</children>
</GridPane>
</children>
</AnchorPane>
</content>
</Tab>
</tabs>
</TabPane>
</children>
</AnchorPane>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.text.Font?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="160.0" prefWidth="400.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.CreditsController">
<children>
<TextArea editable="false" prefHeight="160.0" prefWidth="400.0" text="Projekt realizowany w ramach przedmiotu Laboratorium Systemów Rozmytych.&#10;&#10;Autorzy:&#10;- Jagoda Jarowicz&#10;- Klaudia Kandulska&#10;- Marcin Stasiak" wrapText="true">
<font>
<Font size="14.0" />
</font>
</TextArea>
</children>
</AnchorPane>

BIN
Raport końcowy.docx Normal file

Binary file not shown.