diff --git a/bin/.gitignore b/bin/.gitignore index 9eb92dc..94b23b3 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1,2 +1,3 @@ /application/ /datatypes/ +/resources/ diff --git a/bin/application/MainWindow.fxml b/bin/application/MainWindow.fxml index da7a543..2ef5945 100644 --- a/bin/application/MainWindow.fxml +++ b/bin/application/MainWindow.fxml @@ -87,7 +87,7 @@ - + diff --git a/bin/application/MainWindowController$1.class b/bin/application/MainWindowController$1.class index ca1cabc..40a1aae 100644 Binary files a/bin/application/MainWindowController$1.class and b/bin/application/MainWindowController$1.class differ diff --git a/bin/application/MainWindowController$2.class b/bin/application/MainWindowController$2.class index dd9d196..44632e2 100644 Binary files a/bin/application/MainWindowController$2.class and b/bin/application/MainWindowController$2.class differ diff --git a/bin/application/MainWindowController$3.class b/bin/application/MainWindowController$3.class index 609541d..87cf91a 100644 Binary files a/bin/application/MainWindowController$3.class and b/bin/application/MainWindowController$3.class differ diff --git a/bin/application/MainWindowController$4.class b/bin/application/MainWindowController$4.class index 2b83900..d9dc150 100644 Binary files a/bin/application/MainWindowController$4.class and b/bin/application/MainWindowController$4.class differ diff --git a/bin/application/MainWindowController$5.class b/bin/application/MainWindowController$5.class index daa45da..9952fc6 100644 Binary files a/bin/application/MainWindowController$5.class and b/bin/application/MainWindowController$5.class differ diff --git a/bin/application/MainWindowController$6.class b/bin/application/MainWindowController$6.class index 893270c..fefd632 100644 Binary files a/bin/application/MainWindowController$6.class and b/bin/application/MainWindowController$6.class differ diff --git a/bin/application/MainWindowController$7.class b/bin/application/MainWindowController$7.class index d948686..352e75b 100644 Binary files a/bin/application/MainWindowController$7.class and b/bin/application/MainWindowController$7.class differ diff --git a/bin/application/MainWindowController.class b/bin/application/MainWindowController.class index 2fff339..c123012 100644 Binary files a/bin/application/MainWindowController.class and b/bin/application/MainWindowController.class differ diff --git a/bin/application/MainWindows.css b/bin/application/MainWindows.css index cb1165b..c564daf 100644 --- a/bin/application/MainWindows.css +++ b/bin/application/MainWindows.css @@ -1,4 +1,86 @@ -.jfx-hamburgerW StackPane { -fx-background-color: white; - -fx-background-radius: 5px; } -.jfx-hamburgerB StackPane { -fx-background-color: black; - -fx-background-radius: 5px; } \ No newline at end of file +/* + * HAMBURGER CSS + */ + +.jfx-hamburgerW StackPane { + -fx-background-color: white; + -fx-background-radius: 5px; +} + +.jfx-hamburgerB StackPane { + -fx-background-color: black; + -fx-background-radius: 5px; +} + +/* + * TREE TABLE CSS + */ + +.tree-table-view { + -fx-tree-table-color: rgba(0, 168, 204, 0.2); + -fx-tree-table-rippler-color: rgba(0, 168, 204, 0.4); +} + +.tree-table-view:focused .tree-table-row-cell:selected { + -fx-background-color: -fx-tree-table-color; + -fx-table-cell-border-color: -fx-tree-table-color; + -fx-text-fill: BLACK; +} + +.tree-table-view:focused .tree-table-row-cell:selected .tree-table-cell { + -fx-text-fill: BLACK; +} + +.tree-table-view .jfx-rippler { + -jfx-rippler-fill: -fx-tree-table-rippler-color; +} + +.tree-table-view .column-header, +.tree-table-view .column-header-background, +.tree-table-view .column-header-background .filler { + -fx-background-color: TRANSPARENT; +} + +.tree-table-view .column-header { + -fx-border-width: 0 1 0 1; + -fx-border-color: #F3F3F3; +} + +.tree-table-view .column-header .label { + -fx-text-fill: #949494; + -fx-padding: 16 0 16 0; +} + +.tree-table-view .column-header .arrow, .tree-table-view .column-header .sort-order-dot { + -fx-background-color: #949494; +} + +.tree-table-view .column-header:last-visible { + -fx-border-width: 0 2 0 1; +} + +.tree-table-view .column-header-background { + -fx-border-width: 0 0.0 1 0; + -fx-border-color: #F3F3F3; +} + +.tree-table-view .tree-table-cell { + -fx-border-width: 0 0 0 0; + -fx-padding: 16 0 16 0; +} + +.tree-table-view .column-overlay { + -fx-background-color: -fx-tree-table-color; +} + +.tree-table-view .column-resize-line, .tree-table-view .column-drag-header { + -fx-background-color: -fx-tree-table-rippler-color; +} + +.tree-table-view:focused { + -fx-background-color: -fx-tree-table-color, -fx-box-border, -fx-control-inner-background; + -fx-background-insets: -1.4, 0, 1; + -fx-background-radius: 1.4, 0, 0; + /*....*/ + -fx-padding: 1; /* 0.083333em; */ +} \ No newline at end of file diff --git a/src/application/MainWindow.fxml b/src/application/MainWindow.fxml index da7a543..2ef5945 100644 --- a/src/application/MainWindow.fxml +++ b/src/application/MainWindow.fxml @@ -87,7 +87,7 @@ - + diff --git a/src/application/MainWindowController.java b/src/application/MainWindowController.java index 6f3adb0..0400b37 100644 --- a/src/application/MainWindowController.java +++ b/src/application/MainWindowController.java @@ -28,6 +28,7 @@ import java.net.URL; import java.sql.SQLException; import java.time.LocalDate; import java.time.format.DateTimeFormatter; +import java.util.ArrayList; import java.util.Optional; import java.util.Properties; @@ -77,6 +78,7 @@ import javafx.scene.paint.Color; import javafx.scene.paint.Paint; import javafx.scene.text.Font; import javafx.scene.text.FontWeight; +import javafx.scene.text.Text; import javafx.scene.text.TextFlow; import javafx.stage.DirectoryChooser; import javafx.stage.FileChooser; @@ -216,6 +218,8 @@ public class MainWindowController { File pictureCacheLinux = new File(dirLinux+"/picture_cache"); private ObservableList games = FXCollections.observableArrayList(); ObservableList courses = FXCollections.observableArrayList(); + ArrayList courseText = new ArrayList(); + ArrayList nameText = new ArrayList(); Properties props = new Properties(); Properties gameProps = new Properties(); private MenuItem edit = new MenuItem("edit"); @@ -235,6 +239,7 @@ public class MainWindowController { private ImageView settings_white = new ImageView(new Image("resources/icons/ic_settings_white_24dp_1x.png")); private ImageView cached_white = new ImageView(new Image("resources/icons/ic_cached_white_24dp_1x.png")); private ImageView smmdb_white = new ImageView(new Image("resources/icons/ic_get_app_white_24dp_1x.png")); + private Image close_black = new Image("resources/icons/close_black_2048x2048.png"); public void setMain(Main main) { this.main = main; @@ -253,8 +258,8 @@ public class MainWindowController { applyColor(); //initialize courseTable - titleColumn.setPrefWidth(168); - downloadsColumn.setPrefWidth(130); + titleColumn.setPrefWidth(160); + downloadsColumn.setPrefWidth(127); starsColumn.setPrefWidth(100); courseTreeTable.setRoot(root); @@ -522,18 +527,11 @@ public class MainWindowController { e.printStackTrace(); } } else { - //TODO show an image if none was found -// Image image = new Image(url.toURI().toString()); -// smmdbImageView.setImage(image); + smmdbImageView.setImage(close_black); } - - //TODO show additional information and download option - System.out.println(i); + addCourseDescription(courses.get(i)); } - - } - - System.out.println(id + "; " + selected); + } } }); System.out.println("initializing Actions done!"); @@ -556,13 +554,17 @@ public class MainWindowController { @FXML void settingsBtnAction(ActionEvent event) { - if(settingsTrue == false){ + if (smmdbTrue) { + smmdbAnchorPane.setVisible(false); + smmdbTrue = false; + } + if (settingsTrue) { + settingsAnchorPane.setVisible(false); + settingsTrue = false; + saveSettings(); + } else { settingsAnchorPane.setVisible(true); settingsTrue = true; - }else{ - settingsAnchorPane.setVisible(false); - saveSettings(); - settingsTrue = false; } } @@ -924,9 +926,100 @@ public class MainWindowController { gamesAnchorPane.getChildren().add(games.get(i).getVBox()); } } + + private void addCourseDescription(SmmdbApiDataType course) { + String coursetype; + String leveltype; + String difficulty; + smmdbTextFlow.getChildren().remove(0, smmdbTextFlow.getChildren().size()); + nameText.clear(); + courseText.clear(); + + switch (course.getCoursetype()) { + case 0: + coursetype = "Creation"; + break; + case 1: + coursetype = "Recreation"; + break; + case 2: + coursetype = "Wii U Dump"; + break; + default: + coursetype = "notset"; + break; + } + + switch (course.getLeveltype()) { + case 0: + leveltype = "NSMBU"; + break; + case 1: + leveltype = "SMW"; + break; + case 2: + leveltype = "SMB3"; + break; + case 3: + leveltype = "SMB"; + break; + case 4: + leveltype = "Mixed"; + break; + default: + leveltype = "notset"; + break; + } + + switch (course.getDifficulty()) { + case 0: + difficulty = "Easy"; + break; + case 1: + difficulty = "Normal"; + break; + case 2: + difficulty = "Expert"; + break; + case 3: + difficulty = "Super Expert"; + break; + case 4: + difficulty = "Mixed"; + break; + default: + difficulty = "notset"; + break; + } + + nameText.add(0, new Text("title" + ": ")); + nameText.add(1, new Text("owner" + ": ")); + nameText.add(2, new Text("coursetype" + ": ")); + nameText.add(3, new Text("leveltype" + ": ")); + nameText.add(4, new Text("difficulty" + ": ")); + nameText.add(5, new Text("lastmodified" + ": ")); + nameText.add(6, new Text("uploaded" + ": ")); + nameText.add(7, new Text("nintendoid" + ": ")); + + courseText.add(0, new Text(course.getTitle() + "\n")); + courseText.add(1, new Text(Integer.toString(course.getOwner()) + "\n")); + courseText.add(2, new Text(coursetype + "\n")); + courseText.add(3, new Text(leveltype + "\n")); + courseText.add(4, new Text(difficulty + "\n")); + courseText.add(5, new Text(new java.util.Date((long)course.getLastmodified()*1000) + "\n")); + courseText.add(6, new Text(new java.util.Date((long)course.getUploaded()*1000) + "\n")); + courseText.add(7, new Text(course.getNintendoid() + "\n")); + + for(int i=0; i> 16; + int g = (hex & 0xFF00) >> 8; + int b = (hex & 0xFF); + + return r + ", " + g + ", " + b; + } + private static BufferedImage resizeImage(BufferedImage originalImage, int type, int imgWidth, int imgHeigth) { BufferedImage resizedImage = new BufferedImage(imgWidth, imgHeigth, type); Graphics2D g = resizedImage.createGraphics(); diff --git a/src/application/MainWindows.css b/src/application/MainWindows.css index cb1165b..c564daf 100644 --- a/src/application/MainWindows.css +++ b/src/application/MainWindows.css @@ -1,4 +1,86 @@ -.jfx-hamburgerW StackPane { -fx-background-color: white; - -fx-background-radius: 5px; } -.jfx-hamburgerB StackPane { -fx-background-color: black; - -fx-background-radius: 5px; } \ No newline at end of file +/* + * HAMBURGER CSS + */ + +.jfx-hamburgerW StackPane { + -fx-background-color: white; + -fx-background-radius: 5px; +} + +.jfx-hamburgerB StackPane { + -fx-background-color: black; + -fx-background-radius: 5px; +} + +/* + * TREE TABLE CSS + */ + +.tree-table-view { + -fx-tree-table-color: rgba(0, 168, 204, 0.2); + -fx-tree-table-rippler-color: rgba(0, 168, 204, 0.4); +} + +.tree-table-view:focused .tree-table-row-cell:selected { + -fx-background-color: -fx-tree-table-color; + -fx-table-cell-border-color: -fx-tree-table-color; + -fx-text-fill: BLACK; +} + +.tree-table-view:focused .tree-table-row-cell:selected .tree-table-cell { + -fx-text-fill: BLACK; +} + +.tree-table-view .jfx-rippler { + -jfx-rippler-fill: -fx-tree-table-rippler-color; +} + +.tree-table-view .column-header, +.tree-table-view .column-header-background, +.tree-table-view .column-header-background .filler { + -fx-background-color: TRANSPARENT; +} + +.tree-table-view .column-header { + -fx-border-width: 0 1 0 1; + -fx-border-color: #F3F3F3; +} + +.tree-table-view .column-header .label { + -fx-text-fill: #949494; + -fx-padding: 16 0 16 0; +} + +.tree-table-view .column-header .arrow, .tree-table-view .column-header .sort-order-dot { + -fx-background-color: #949494; +} + +.tree-table-view .column-header:last-visible { + -fx-border-width: 0 2 0 1; +} + +.tree-table-view .column-header-background { + -fx-border-width: 0 0.0 1 0; + -fx-border-color: #F3F3F3; +} + +.tree-table-view .tree-table-cell { + -fx-border-width: 0 0 0 0; + -fx-padding: 16 0 16 0; +} + +.tree-table-view .column-overlay { + -fx-background-color: -fx-tree-table-color; +} + +.tree-table-view .column-resize-line, .tree-table-view .column-drag-header { + -fx-background-color: -fx-tree-table-rippler-color; +} + +.tree-table-view:focused { + -fx-background-color: -fx-tree-table-color, -fx-box-border, -fx-control-inner-background; + -fx-background-insets: -1.4, 0, 1; + -fx-background-radius: 1.4, 0, 0; + /*....*/ + -fx-padding: 1; /* 0.083333em; */ +} \ No newline at end of file diff --git a/src/resources/icons/close_black_2048x2048.png b/src/resources/icons/close_black_2048x2048.png new file mode 100644 index 0000000..2d0397b Binary files /dev/null and b/src/resources/icons/close_black_2048x2048.png differ