Skip to content

Commit

Permalink
UI Improvements big and small
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharqosity committed Mar 13, 2017
1 parent b680005 commit b553f96
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 30 deletions.
47 changes: 34 additions & 13 deletions src/main/java/WHS_planner/Calendar/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import com.jfoenix.controls.JFXButton;
import com.jfoenix.controls.JFXTextField;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.Label;
import javafx.scene.input.KeyCode;
import javafx.scene.input.MouseButton;
import javafx.scene.layout.HBox;
Expand All @@ -19,6 +17,11 @@
* Created by geoffrey_wang on 9/20/16.
*/
public class Task {
private final static String ICON_DELETE = "\uf057";
private final static String ICON_BACK = "\uf137";
private final static String ICON_UNDO = "\uf0e2";


String Class, Title, Description;
private Boolean doesExist = true;
private Boolean isEditing = false;
Expand Down Expand Up @@ -72,14 +75,21 @@ public Pane getPane(CalendarBox box){
isEditing = false;

JFXButton deleteButton = new JFXButton();
// deleteButton.setPadding(new Insets(0,3,2,0));
setButtonToDelete(deleteButton);
deleteButton.setMinHeight(20);

JFXButton cancelButton = new JFXButton("Cancel");
cancelButton.setPrefWidth(50);
cancelButton.setMinWidth(50);
// JFXButton cancelButton = new JFXButton("Cancel");
JFXButton cancelButton = new JFXButton(ICON_BACK);

// cancelButton.setPrefWidth(50);
cancelButton.setPrefWidth(20);
// cancelButton.setMinWidth(50);
cancelButton.setMinWidth(20);

cancelButton.setMinHeight(20);
cancelButton.setStyle("-fx-background-color: #F26650");
// cancelButton.setStyle("-fx-background-color: #F26650");
cancelButton.setStyle("-fx-background-color: transparent; -fx-font-family: 'FontAwesome Regular'; -fx-font-size: 20px;");

deleteButton.setOnMouseClicked((event -> {
if (event.getButton() == MouseButton.PRIMARY) {
Expand All @@ -102,7 +112,7 @@ public Pane getPane(CalendarBox box){
if (!isEditing) {
isEditing = true;
JFXTextField textbox = new JFXTextField();
pane.setHgrow(textbox, Priority.ALWAYS);
HBox.setHgrow(textbox, Priority.ALWAYS);
textbox.setText(label.getText());
pane.getChildren().setAll(spaces, cancelButton, spaces2, textbox);

Expand Down Expand Up @@ -164,16 +174,27 @@ Boolean doesExist() {
}

public void setButtonToDelete(JFXButton button){
button.setText("\uf00d");
// button.setText("\uf00d");
button.setText(ICON_DELETE);
// button.setAlignment(Pos.BASELINE_CENTER);

button.setPrefWidth(20);
button.setMinWidth(20);
button.setStyle("-fx-background-color: rgb(56, 118, 237); -fx-font-family: 'FontAwesome Regular';");
// button.setStyle("-fx-background-color: rgb(56, 118, 237); -fx-font-family: 'FontAwesome Regular'; -fx-font-size: 18px;");
button.setStyle("-fx-background-color: transparent; -fx-font-family: 'FontAwesome Regular'; -fx-font-size: 20px;");


}

public void setButtonToUndo(JFXButton button){
button.setText("Undo");
button.setPrefWidth(50);
button.setMinWidth(50);
button.setStyle("-fx-background-color: #F26650;-fx-font-family: 'Roboto';");
// button.setText("Undo");
button.setText(ICON_UNDO);
// button.setPrefWidth(50);
// button.setMinWidth(50);
button.setPrefWidth(20);
button.setMinWidth(20);
button.setStyle("-fx-background-color: transparent; -fx-font-family: 'FontAwesome Regular'; -fx-font-size: 18px;");

// button.setStyle("-fx-background-color: #F26650;-fx-font-family: 'Roboto'; -fx-font-size: 14px;");
}
}
5 changes: 4 additions & 1 deletion src/main/java/WHS_planner/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

public class Main extends Application {

public static final String SAVE_FOLDER = System.getenv("HOME" ) + File.separator + "Library" + File.separator + "Application Support" + File.separator + "WHS Planner";
public static final String SAVE_FOLDER = System.getenv("HOME") + File.separator + "Library" + File.separator + "Application Support" + File.separator + "WHS Planner";

public static final String VERSION_NUMBER = "1.3.1";

Expand Down Expand Up @@ -176,6 +176,9 @@ public void start(Stage stage) throws Exception {
stage.setMinHeight(CalendarBox.CALENDAR_BOX_MIN_HEIGHT * 5 + 198 + 110); //Set the minimum height of the window
stage.setMinWidth(CalendarBox.CALENDAR_BOX_MIN_WIDTH*7+90+280); //Set the minimum width of the window

System.out.println("width: "+ stage.getMinWidth());
System.out.println("height: "+ stage.getMinHeight());


stage.setTitle("WHS Planner"); //Set the title of the window
stage.setScene(scene); //Set the window (stage) to display things in the scene
Expand Down
17 changes: 12 additions & 5 deletions src/main/java/WHS_planner/UI/MainPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.scene.paint.Paint;
import javafx.scene.text.TextAlignment;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -220,6 +219,8 @@ private void initiateDropDown(Button bigButton) {
// Font.loadFont(font,10);
bigButton.setText("\uf142");
bigButton.setCursor(Cursor.HAND);
// bigButton.getStylesheets().setAll("UI" + File.separator + "dropDown.css");
// bigButton.getStyleClass().setAll("big-button");
bigButton.setStyle("-fx-font-family: 'FontAwesome Regular'; -fx-font-size: 28px; -fx-text-fill: #FFFFFF;");
Pane parent = (Pane)(bigButton.getParent());
bigButton.prefHeightProperty().bind(parent.heightProperty());
Expand All @@ -241,6 +242,7 @@ private void initiateDropDown(Button bigButton) {
});
JFXButton button1 = new JFXButton();
button1.setText(" " + ICON_SCHEDULE + " Refresh Schedule");

button1.setOnMouseClicked(event12 -> {
try {
schedule.getScheduleControl().logout();
Expand All @@ -266,7 +268,7 @@ private void initiateDropDown(Button bigButton) {
}
});
JFXButton button4 = new JFXButton();
button4.setText(" " + ICON_ABOUT + " About");
button4.setText(" " + ICON_ABOUT + " About");
button4.setOnMouseClicked(event14 -> {
info.getChildren().clear();
Label versionLabel = new Label("Version:");
Expand Down Expand Up @@ -297,10 +299,10 @@ private void initiateDropDown(Button bigButton) {
JFXButton licenses = new JFXButton("Licenses");
// buttonContainer.getChildren().add(licenses);
// buttonContainer.setAlignment(Pos.CENTER);
licenses.setButtonType(JFXButton.ButtonType.RAISED);
licenses.setTextAlignment(TextAlignment.CENTER);
licenses.setButtonType(JFXButton.ButtonType.FLAT);
licenses.setAlignment(Pos.CENTER);
licenses.getStyleClass().setAll("gray-button");
licenses.setPrefSize(175,40);
licenses.setPrefSize(75,30);
licenses.setOnMouseClicked(showLicences -> {
info.getChildren().clear();
Label licenseText = new Label("We used the JSOUP library (https://jsoup.org/) which is licensed under the MIT license:\nThe MIT License \nCopyright © 2009 - 2016 Jonathan Hedley (jonathan@hedley.net) \nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: \nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. \nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \n\nWe also used federkasten's appbundler library (https://github.com/federkasten/appbundle-maven-plugin), as well as the JFoenix UI library (http://www.jfoenix.com/). \nBoth are avaiable under the Apache License 2.0(https://www.apache.org/licenses/LICENSE-2.0). \nCredit goes to Stack Overflow users: Chui Tey and jewelsea for their work on the Layout Animator class. \nhttps://gist.github.com/jewelsea/5683558 \n\nFont Awesome by Dave Gandy - http://fontawesome.io");
Expand Down Expand Up @@ -337,6 +339,11 @@ private void initiateDropDown(Button bigButton) {
info.setSpacing(0);
info.setMinSize(200, info.getChildren().toArray().length*50);
JFXDialog dialog = new JFXDialog(backmanISGay, info, JFXDialog.DialogTransition.CENTER, true);

// dialog.setTranslateX(470);
// dialog.setTranslateY(-135);
// JFXDialog dialog2 = new JFXDialog()

dialog.show();
/*
\
Expand Down
12 changes: 6 additions & 6 deletions src/main/resources/Schedule/material_login.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,35 @@
<children>
<Pane fx:id="loginPane" maxHeight="360.0" maxWidth="360.0" minHeight="360.0" minWidth="360.0" prefHeight="360.0" prefWidth="360.0" style="-fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.25), 15, 0, 1, 2, 0); -fx-background-color: #FFFFFF;">
<children>
<Label layoutX="85.0" layoutY="18.0" text="Login to iPass">
<Label layoutX="85.0" layoutY="22.0" text="Login to iPass">
<font>
<Font name="Roboto" size="30.0" />
</font>
</Label>
<ImageView fitHeight="96.0" fitWidth="96.0" layoutX="132.0" layoutY="72.0" pickOnBounds="true" preserveRatio="true" smooth="false">
<ImageView fitHeight="96.0" fitWidth="96.0" layoutX="132.0" layoutY="70.0" pickOnBounds="true" preserveRatio="true" smooth="false">
<image>
<Image url="@account_box_grey_96x96.png" />
</image>
</ImageView>
<JFXTextField fx:id="user" focusColor="#0079f5" layoutX="45.0" layoutY="186.0" maxWidth="270.0" minWidth="220.0" prefHeight="31.0" prefWidth="270.0" promptText="Username:">
<JFXTextField fx:id="user" focusColor="#0079f5" layoutX="45.0" layoutY="176.0" maxWidth="270.0" minWidth="220.0" prefHeight="31.0" prefWidth="270.0" promptText="Username:">
<font>
<Font name="Roboto" size="13.0" />
</font>
</JFXTextField>
<JFXPasswordField fx:id="password" focusColor="#0079f5" layoutX="45.0" layoutY="238.0" maxWidth="270.0" prefWidth="270.0" promptText="Password:">
<JFXPasswordField fx:id="password" focusColor="#0079f5" layoutX="45.0" layoutY="228.0" maxWidth="270.0" prefWidth="270.0" promptText="Password:">
<font>
<Font name="Roboto" size="13.0" />
</font>
</JFXPasswordField>
<JFXButton fx:id="button" alignment="CENTER" buttonType="RAISED" contentDisplay="CENTER" layoutX="45.0" layoutY="296.0" onAction="#submit" prefWidth="270.0" style="-fx-padding: 0.7em 0.57em; -fx-background-color: #0079F5;" text="Sign in" textFill="WHITE">
<JFXButton fx:id="button" alignment="CENTER" buttonType="RAISED" contentDisplay="CENTER" layoutX="45.0" layoutY="290.0" onAction="#submit" prefWidth="270.0" style="-fx-padding: 0.7em 0.57em; -fx-background-color: #0079F5;" text="Sign in" textFill="WHITE">
<cursor>
<Cursor fx:constant="HAND" />
</cursor>
<font>
<Font name="Roboto" size="14.0" />
</font>
</JFXButton>
<VBox alignment="CENTER" layoutY="252.0" prefHeight="50.0" prefWidth="360.0">
<VBox alignment="CENTER" layoutY="244.0" prefHeight="50.0" prefWidth="360.0">
<children>
<Label fx:id="error" alignment="CENTER" contentDisplay="CENTER" textAlignment="CENTER" textFill="RED">
<font>
Expand Down
14 changes: 9 additions & 5 deletions src/main/resources/UI/dropDown.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
-fx-cursor: hand;

-fx-font-family: 'FontAwesome Regular';
}


}

.label-button {
-fx-font-size: 14px;
Expand All @@ -34,12 +34,10 @@

.gray-button {
-fx-background-color: #BDBDBD;
-fx-font-size: 18px;
-fx-font-size: 14px;
-fx-font-family: "Roboto";
-fx-padding: 5;
-fx-background-radius: 5;


-fx-background-radius: 3;
}

.times {
Expand All @@ -59,3 +57,9 @@

}

.big-button{
-fx-font-family: 'FontAwesome Regular';
-fx-font-size: 28px;
-fx-text-fill: #FFFFFF;
}

0 comments on commit b553f96

Please sign in to comment.