Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/netKnow/Class/IP.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public IP(String [] fullIPAdress){
convertStringToMask();
}


private void convertStringToIPAdress(String [] fullIPAdress){
for(int i = 0; i < 4; i++) {
ipArray[i] = Integer.parseInt(fullIPAdress[i]);
Expand Down
6 changes: 5 additions & 1 deletion src/netKnow/TODOfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@

-> Router(PC)
-> Switch
-> Siec
-> Siec


-> przy robieniu linkNode nie ma resetowania wartosci w textfieldach
-> wywalic do pliku hasla
26 changes: 16 additions & 10 deletions src/netKnow/controller/AggregationController.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package netKnow.controller;

import javafx.fxml.FXML;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
Expand All @@ -9,6 +10,7 @@
import javafx.scene.input.KeyCode;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import netKnow.Class.IP;
import netKnow.Code.NetworkAggregation;
import netKnow.scene.AggregationPopUp;
Expand All @@ -26,13 +28,13 @@ public class AggregationController {
@FXML
private Button okButton;
@FXML
private ScrollPane networkScrollPane;
@FXML
private VBox networkListVbox;
@FXML
private Button backButton;
@FXML
private Button aggregateButton;
@FXML
private Label errorLabel;

List<SingleIP> arrayListSingleIp;
int amount=0;
Expand All @@ -41,7 +43,7 @@ public class AggregationController {
public IP[] aggregatedNetwork;

@FXML
void initialize(){
void initialize(){
amountNetwork.setOnKeyPressed(event -> {
if(event.getCode() == KeyCode.ENTER ){
okButton.fire();
Expand All @@ -50,15 +52,19 @@ void initialize(){
okButton.setOnAction(event -> {

amount = Integer.parseInt(amountNetwork.getText());
networkListVbox.getChildren().clear();

arrayListSingleIp = new ArrayList<SingleIP>();
for (int i=0; i<amount ; i++){
arrayListSingleIp.add(new SingleIP(networkListVbox));
networkListVbox.getChildren().clear();
if(amount > 10){
errorLabel.setText("Liczba sieci do agregacji nie może być > 10");
}else if(amount < 1){
errorLabel.setText("Liczba nie może być <= 0");
}else{
arrayListSingleIp = new ArrayList<>();
for (int i=0; i<amount ; i++){
arrayListSingleIp.add(new SingleIP(networkListVbox));
}
clickedAggregation = true;
}

clickedAggregation = true;

});

aggregateButton.setOnAction(event -> {
Expand Down
2 changes: 2 additions & 0 deletions src/netKnow/controller/RegistrationController.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import netKnow.MailSender;
import netKnow.PasswordEncrypter;
import netKnow.scene.LoginScene;
import netKnow.scene.SuccessfulRegistrationScene;

import javax.mail.MessagingException;
import java.security.MessageDigest;
Expand Down Expand Up @@ -85,6 +86,7 @@ void initialize(){
} catch (MessagingException e1) {
e1.printStackTrace();
}
new SuccessfulRegistrationScene(scene);
}else{
registrationErrorLabel.setText("Hasła nie pasują do siebie");
}
Expand Down
2 changes: 1 addition & 1 deletion src/netKnow/controller/RoutingController.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private void initialize() {

String [] labels = {"Komputer", "Router", "Switch", "Chodar"};
//populate left pane with multiple colored icons for testing
for (int i = 0; i < 4; i++) {
for (int i = 0; i < 3; i++) {

DragIcon icn = new DragIcon();
Label descriptionLabel = new Label(labels[i]);
Expand Down
29 changes: 29 additions & 0 deletions src/netKnow/controller/SuccessfulRegistrationController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package netKnow.controller;

import javafx.fxml.FXML;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import netKnow.scene.LoginScene;

public class SuccessfulRegistrationController {

private Scene scene;
@FXML
private Label infoLabel;

@FXML
private Button loginButton;


@FXML
void initialize(){
loginButton.setOnAction(e ->{
new LoginScene(scene);
});
}

public void setScene(Scene scene){
this.scene = scene;
}
}
6 changes: 4 additions & 2 deletions src/netKnow/fxml/network_aggregation.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>

<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8.0.111" fx:controller="netKnow.controller.AggregationController">
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="netKnow.controller.AggregationController">
<columnConstraints>
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
Expand Down Expand Up @@ -43,6 +43,7 @@
<GridPane GridPane.rowIndex="2">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" percentWidth="60.0" prefWidth="100.0" />
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
Expand All @@ -54,11 +55,12 @@
<Insets left="20.0" top="5.0" />
</GridPane.margin>
</Button>
<Button fx:id="aggregateButton" mnemonicParsing="false" text="Agreguj" GridPane.columnIndex="1">
<Button fx:id="aggregateButton" mnemonicParsing="false" text="Agreguj" GridPane.columnIndex="2">
<GridPane.margin>
<Insets right="20.0" top="5.0" />
</GridPane.margin>
</Button>
<Label fx:id="errorLabel" GridPane.columnIndex="1" textFill="#fc0000"/>
</children>
<GridPane.margin>
<Insets bottom="10.0" />
Expand Down
26 changes: 26 additions & 0 deletions src/netKnow/fxml/successful_registration.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>

<VBox alignment="CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="netKnow.controller.SuccessfulRegistrationController">
<children>
<Label text="Rejestracja przebiegła pomyślnie">
<font>
<Font name="System Bold" size="24.0" />
</font>
<VBox.margin>
<Insets bottom="20.0" top="20.0" />
</VBox.margin>
</Label>
<Label fx:id="infoLabel" text="Na podany przez Ciebie adres email zostały przesłane dane rejestracji.&#10;Dziękujemy za rejestrację w naszej aplikacji!" textAlignment="CENTER">
<VBox.margin>
<Insets bottom="20.0" top="10.0" />
</VBox.margin>
</Label>
<Button fx:id="loginButton" mnemonicParsing="false" text="Wróć do logowania" />
</children>
</VBox>
5 changes: 0 additions & 5 deletions src/netKnow/resources/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
-fx-background-position: center;
-fx-background-size: 100% 100%;
}
.icon-label {
-fx-background-image: url("chodar.png");
-fx-background-position: center;
-fx-background-size: 100% 100%;
}

.draggable-icon {
-fx-border-width: 1;
Expand Down
Binary file removed src/netKnow/resources/chodar.png
Binary file not shown.
Binary file removed src/netKnow/resources/ruszil.png
Binary file not shown.
Binary file removed src/netKnow/resources/slowiak.png
Binary file not shown.
Binary file removed src/netKnow/resources/switch.png
Binary file not shown.
Binary file removed src/netKnow/resources/turek.png
Binary file not shown.
10 changes: 8 additions & 2 deletions src/netKnow/scene/DraggableNodePopUp.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyCode;
import javafx.scene.layout.ColumnConstraints;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
Expand Down Expand Up @@ -49,7 +49,6 @@ public static DraggableNodeData display(){
options.addRow(0, nameLabel, nameField);
options.addRow(1, hostLabel, hostField);


Button applyButton = new Button("Zatwierdź");
Button cancelButton = new Button("Anuluj");
applyButton.setPrefSize(100, 40);
Expand Down Expand Up @@ -85,9 +84,16 @@ public static DraggableNodeData display(){

cancelButton.setOnAction(e -> {
draggableNodeData = null;
resetTextFields();
window.close();
});

hostField.setOnKeyPressed(e -> {
if(e.getCode() == KeyCode.ENTER){
applyButton.fire();
}
});

Scene scene = new Scene(layout);
window.setScene(scene);
window.showAndWait();
Expand Down
8 changes: 8 additions & 0 deletions src/netKnow/scene/NodeLinkPopUp.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.input.KeyCode;
import javafx.scene.layout.*;
import javafx.scene.paint.Paint;
import javafx.scene.text.Font;
Expand Down Expand Up @@ -111,9 +112,16 @@ public static NodeLinkData display(){

cancelButton.setOnAction(e ->{
someIP = null;
resetTextFields();
window.close();
});

typeOfConnectionChoiceBox.setOnKeyPressed(e -> {
if(e.getCode() == KeyCode.ENTER){
applyButton.fire();
}
});

Scene scene = new Scene(layout);
window.setScene(scene);
window.showAndWait();
Expand Down
2 changes: 2 additions & 0 deletions src/netKnow/scene/SingleIP.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.sun.javafx.sg.prism.NGNode;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.HBox;
Expand All @@ -15,6 +16,7 @@ public class SingleIP extends HBox{
VBox vBox;
public SingleIP(VBox vBox){
hBox = new HBox();
hBox.setAlignment(Pos.CENTER);
this.vBox = vBox;

tv1 = new TextField();
Expand Down
40 changes: 40 additions & 0 deletions src/netKnow/scene/SuccessfulRegistrationScene.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package netKnow.scene;

import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import netKnow.controller.SuccessfulRegistrationController;

import java.io.IOException;

/**
* Created by MQ on 2017-05-25.
*/
public class SuccessfulRegistrationScene {
private Scene scene;
private FXMLLoader loader;
private SuccessfulRegistrationController successfulRegistrationController;

public SuccessfulRegistrationScene(Scene scene) {
this.scene = scene;
setScene();
setController();
}

private void setScene() {
loader = new FXMLLoader();
loader.setLocation(getClass().getResource("/netKnow/fxml/successful_registration.fxml"));

try {
VBox content = loader.load();
scene.setRoot(content);
} catch (IOException e) {
e.printStackTrace();
}
}

private void setController() {
successfulRegistrationController = loader.getController();
successfulRegistrationController.setScene(scene);
}
}