Skip to content

Commit

Permalink
Added About Information and UNSL webpage
Browse files Browse the repository at this point in the history
  • Loading branch information
emlautarom1 committed May 2, 2019
1 parent 150d322 commit 614605a
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 82 deletions.
25 changes: 25 additions & 0 deletions src/main/java/app/controller/MainController.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
import javafx.stage.FileChooser;
import javafx.stage.Stage;

import java.awt.*;
import java.io.File;
import java.net.URI;
import java.net.URL;
import java.util.LinkedHashMap;
import java.util.ResourceBundle;
Expand Down Expand Up @@ -88,6 +90,29 @@ private void setOutputPath() {
}
}

@FXML
private void openSite() {
if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
try {
Desktop.getDesktop().browse(new URI("http://www.unsl.edu.ar/"));
} catch (Exception ignored) {
}
}
}

@FXML
private void displayAbout() {
Alert alert = new Alert(Alert.AlertType.INFORMATION);
alert.setTitle("About");
alert.setHeaderText("Information Theory App");
alert.setContentText(
"Cross-platform Desktop App for data Protection and Compression using Hamming's and Huffman's algorithms\n\n" +
"Built using Java 8 and JavaFX\n\n" +
"2019 - UNSL - Argentina"
);
alert.showAndWait();
}

private void setOperations() {
operationsChoiceBox.setItems(
FXCollections.observableArrayList(
Expand Down
154 changes: 72 additions & 82 deletions src/main/resources/app/fxml/main.fxml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.scene.Cursor?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.CheckBox?>
<?import javafx.scene.control.ChoiceBox?>
Expand All @@ -13,86 +14,75 @@
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>

<VBox minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="600.0" spacing="20.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="app.controller.MainController">
<children>
<AnchorPane VBox.vgrow="NEVER">
<children>
<Button contentDisplay="RIGHT" layoutX="475.0" layoutY="22.0" mnemonicParsing="false" prefWidth="115.0" text="About" AnchorPane.rightAnchor="0.0" />
<ImageView fitHeight="150.0" fitWidth="200.0" pickOnBounds="true" preserveRatio="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0">
<image>
<Image url="@../img/unsl_logo.png" />
</image>
</ImageView>
</children>
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</padding>
<VBox.margin>
<Insets />
</VBox.margin>
</AnchorPane>
<Separator prefWidth="200.0" />
<HBox spacing="20.0" VBox.vgrow="NEVER">
<children>
<Label minWidth="-Infinity" prefWidth="80.0" text="Source File:" />
<TextField fx:id="sourcePathTextField" maxWidth="1.7976931348623157E308" HBox.hgrow="ALWAYS" />
<Button mnemonicParsing="false" onAction="#setSourcePath">
<graphic>
<ImageView fitHeight="30.0" fitWidth="16.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../icon/folder.png" />
</image>
</ImageView>
</graphic></Button>
</children>
</HBox>
<HBox layoutX="20.0" layoutY="132.0" spacing="20.0">
<children>
<Label minWidth="-Infinity" prefWidth="80.0" text="Output File:" />
<TextField fx:id="outputPathTextField" maxWidth="1.7976931348623157E308" HBox.hgrow="ALWAYS" />
<Button mnemonicParsing="false" onAction="#setOutputPath">
<graphic>
<ImageView fitHeight="30.0" fitWidth="16.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../icon/folder.png" />
</image>
</ImageView>
</graphic></Button>
</children>
</HBox>
<Separator prefWidth="200.0" />
<HBox alignment="CENTER_LEFT" spacing="50.0" VBox.vgrow="NEVER">
<children>
<Label text="Operation(s):" />
<ChoiceBox fx:id="operationsChoiceBox" prefWidth="150.0" />
</children>
</HBox>
<Separator layoutX="20.0" layoutY="222.0" prefWidth="200.0" />
<VBox fx:id="protectionAdvancedSettingsContainer" spacing="20.0">
<children>
<Label text="Protection Advanced Settings:" />
<HBox alignment="CENTER_LEFT" spacing="50.0">
<children>
<ChoiceBox fx:id="protectionLevelsChoiceBox" prefWidth="150.0" />
<CheckBox fx:id="protectionCustomSetting" mnemonicParsing="false" text="CustomSetting" />
</children>
</HBox>
</children>
</VBox>
<AnchorPane prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS">
<children>
<Button contentDisplay="RIGHT" defaultButton="true" graphicTextGap="10.0" mnemonicParsing="false" onAction="#runApplication" prefWidth="115.0" text="Run" AnchorPane.bottomAnchor="0.0" AnchorPane.rightAnchor="0.0">
<graphic>
<ImageView fitHeight="150.0" fitWidth="16.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../icon/startup.png" />
</image>
</ImageView>
</graphic></Button>
</children>
</AnchorPane>
</children>
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</padding>
<VBox minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="600.0" spacing="20.0"
xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="app.controller.MainController">
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</padding>
<AnchorPane VBox.vgrow="NEVER">
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</padding>
<VBox.margin>
<Insets/>
</VBox.margin>
<Button contentDisplay="RIGHT" layoutX="475.0" layoutY="22.0" mnemonicParsing="false"
onAction="#displayAbout" prefWidth="115.0" text="About" AnchorPane.rightAnchor="0.0"/>
<ImageView fitHeight="150.0" fitWidth="200.0" onMouseClicked="#openSite" pickOnBounds="true"
preserveRatio="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.topAnchor="0.0">
<cursor>
<Cursor fx:constant="HAND"/>
</cursor>
<Image url="@../img/unsl_logo.png"/>
</ImageView>
</AnchorPane>
<Separator prefWidth="200.0"/>
<HBox spacing="20.0" VBox.vgrow="NEVER">
<Label minWidth="-Infinity" prefWidth="80.0" text="Source File:"/>
<TextField fx:id="sourcePathTextField" maxWidth="1.7976931348623157E308" HBox.hgrow="ALWAYS"/>
<Button mnemonicParsing="false" onAction="#setSourcePath">
<graphic>
<ImageView fitHeight="30.0" fitWidth="16.0" pickOnBounds="true" preserveRatio="true">
<Image url="@../icon/folder.png"/>
</ImageView>
</graphic>
</Button>
</HBox>
<HBox layoutX="20.0" layoutY="132.0" spacing="20.0">
<Label minWidth="-Infinity" prefWidth="80.0" text="Output File:"/>
<TextField fx:id="outputPathTextField" maxWidth="1.7976931348623157E308" HBox.hgrow="ALWAYS"/>
<Button mnemonicParsing="false" onAction="#setOutputPath">
<graphic>
<ImageView fitHeight="30.0" fitWidth="16.0" pickOnBounds="true" preserveRatio="true">
<Image url="@../icon/folder.png"/>
</ImageView>
</graphic>
</Button>
</HBox>
<Separator prefWidth="200.0"/>
<HBox alignment="CENTER_LEFT" spacing="50.0" VBox.vgrow="NEVER">
<Label text="Operation(s):"/>
<ChoiceBox fx:id="operationsChoiceBox" prefWidth="150.0"/>
</HBox>
<Separator layoutX="20.0" layoutY="222.0" prefWidth="200.0"/>
<VBox fx:id="protectionAdvancedSettingsContainer" spacing="20.0">
<Label text="Protection Advanced Settings:"/>
<HBox alignment="CENTER_LEFT" spacing="50.0">
<ChoiceBox fx:id="protectionLevelsChoiceBox" prefWidth="150.0"/>
<CheckBox fx:id="protectionCustomSetting" mnemonicParsing="false" text="CustomSetting"/>
</HBox>
</VBox>
<AnchorPane prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS">
<Button contentDisplay="RIGHT" defaultButton="true" graphicTextGap="10.0" mnemonicParsing="false"
onAction="#runApplication" prefWidth="115.0" text="Run" AnchorPane.bottomAnchor="0.0"
AnchorPane.rightAnchor="0.0">
<graphic>
<ImageView fitHeight="150.0" fitWidth="16.0" pickOnBounds="true" preserveRatio="true">
<Image url="@../icon/startup.png"/>
</ImageView>
</graphic>
</Button>
</AnchorPane>
</VBox>

0 comments on commit 614605a

Please sign in to comment.