smmdb api integration rework part 2/2
* fixed all remaining parameters * course is downloaded as .zip now * junrar is replaced by zip4j
This commit is contained in:
@ -86,6 +86,17 @@ public class Main extends Application {
|
||||
}
|
||||
|
||||
//startup checks
|
||||
//check if client_secret.jason is present
|
||||
if (Main.class.getResourceAsStream("/resources/client_secret.json") == null) {
|
||||
System.err.println("client_secret is missing!!!!!");
|
||||
|
||||
Alert alert = new Alert(AlertType.ERROR);
|
||||
alert.setTitle("cemu_UI");
|
||||
alert.setHeaderText("Error");
|
||||
alert.setContentText("client_secret is missing! Please contact the maintainer. \nIf you compiled cemu_UI by yourself see: \nhttps://github.com/Seil0/cemu_UI/wiki/Documantation");
|
||||
alert.showAndWait();
|
||||
}
|
||||
|
||||
System.out.println("Directory: " + directory.exists());
|
||||
System.out.println("configfile: " + configFile.exists());
|
||||
if(directory.exists() != true){
|
||||
|
@ -40,10 +40,6 @@ import javax.swing.ProgressMonitor;
|
||||
import javax.swing.ProgressMonitorInputStream;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import com.github.junrar.Archive;
|
||||
import com.github.junrar.exception.RarException;
|
||||
import com.github.junrar.impl.FileVolumeManager;
|
||||
import com.github.junrar.rarfile.FileHeader;
|
||||
import com.jfoenix.controls.JFXButton;
|
||||
import com.jfoenix.controls.JFXColorPicker;
|
||||
import com.jfoenix.controls.JFXDialog;
|
||||
@ -95,6 +91,8 @@ import javafx.scene.text.TextFlow;
|
||||
import javafx.stage.DirectoryChooser;
|
||||
import javafx.stage.FileChooser;
|
||||
import javafx.util.Duration;
|
||||
import net.lingala.zip4j.core.ZipFile;
|
||||
import net.lingala.zip4j.exception.ZipException;
|
||||
|
||||
public class MainWindowController {
|
||||
|
||||
@ -184,19 +182,19 @@ public class MainWindowController {
|
||||
private JFXTreeTableView<CourseTableDataType> courseTreeTable = new JFXTreeTableView<CourseTableDataType>();
|
||||
|
||||
@FXML
|
||||
TreeItem<CourseTableDataType> root = new TreeItem<>(new CourseTableDataType("",0,0,0));
|
||||
TreeItem<CourseTableDataType> root = new TreeItem<>(new CourseTableDataType("","",0,0));
|
||||
|
||||
@FXML
|
||||
private JFXTreeTableColumn<CourseTableDataType, String> titleColumn = new JFXTreeTableColumn<>("title");
|
||||
|
||||
@FXML
|
||||
private JFXTreeTableColumn<CourseTableDataType, String> idColumn = new JFXTreeTableColumn<>("id");
|
||||
|
||||
@FXML
|
||||
private JFXTreeTableColumn<CourseTableDataType, Integer> starsColumn = new JFXTreeTableColumn<>("stars");
|
||||
|
||||
@FXML
|
||||
private JFXTreeTableColumn<CourseTableDataType, Integer> downloadsColumn = new JFXTreeTableColumn<>("downloads");
|
||||
|
||||
@FXML
|
||||
private JFXTreeTableColumn<CourseTableDataType, Integer> idColumn = new JFXTreeTableColumn<>("id");
|
||||
private JFXTreeTableColumn<CourseTableDataType, Integer> timeColumn = new JFXTreeTableColumn<>("time");
|
||||
|
||||
Main main;
|
||||
dbController dbController;
|
||||
@ -217,14 +215,14 @@ public class MainWindowController {
|
||||
private String color;
|
||||
private String dialogBtnStyle;
|
||||
private String version = "0.1.6";
|
||||
private String buildNumber = "029";
|
||||
private String buildNumber = "031";
|
||||
private String versionName = "Throwback Galaxy";
|
||||
private int xPos = -200;
|
||||
private int yPos = 17;
|
||||
private int xPosHelper;
|
||||
private int selectedUIDataIndex;
|
||||
private int selected;
|
||||
private int id;
|
||||
private String id;
|
||||
private DirectoryChooser directoryChooser = new DirectoryChooser();
|
||||
private File dirWin = new File(System.getProperty("user.home") + "/Documents/cemu_UI");
|
||||
private File dirLinux = new File(System.getProperty("user.home") + "/cemu_UI");
|
||||
@ -276,7 +274,7 @@ public class MainWindowController {
|
||||
|
||||
//initialize courseTable
|
||||
titleColumn.setPrefWidth(160);
|
||||
downloadsColumn.setPrefWidth(127);
|
||||
timeColumn.setPrefWidth(127);
|
||||
starsColumn.setPrefWidth(100);
|
||||
|
||||
courseTreeTable.setRoot(root);
|
||||
@ -284,14 +282,17 @@ public class MainWindowController {
|
||||
courseTreeTable.setEditable(false);
|
||||
|
||||
titleColumn.setCellValueFactory(cellData -> cellData.getValue().getValue().title);
|
||||
idColumn.setCellValueFactory(cellData -> cellData.getValue().getValue().id);
|
||||
starsColumn.setCellValueFactory(cellData -> cellData.getValue().getValue().stars.asObject());
|
||||
downloadsColumn.setCellValueFactory(cellData -> cellData.getValue().getValue().downloads.asObject());
|
||||
idColumn.setCellValueFactory(cellData -> cellData.getValue().getValue().id.asObject());
|
||||
timeColumn.setCellValueFactory(cellData -> cellData.getValue().getValue().time.asObject());
|
||||
|
||||
courseTreeTable.getColumns().setAll(titleColumn, downloadsColumn, starsColumn, idColumn);
|
||||
courseTreeTable.getColumns().setAll(titleColumn, timeColumn, starsColumn, idColumn);
|
||||
courseTreeTable.getColumns().get(3).setVisible(false); //hide idColumn (important)
|
||||
}
|
||||
|
||||
/**
|
||||
* initialize all actions not initialized by a own method
|
||||
*/
|
||||
void initActions() {
|
||||
System.out.println("initializing Actions... ");
|
||||
|
||||
@ -531,22 +532,19 @@ public class MainWindowController {
|
||||
@Override
|
||||
public void changed(ObservableValue<?> observable, Object oldVal, Object newVal){
|
||||
selected = courseTreeTable.getSelectionModel().getSelectedIndex(); //get selected item
|
||||
id = idColumn.getCellData(selected); //get name of selected item
|
||||
|
||||
//FIXME if a item is selected and you change the sorting,you can't select a new item
|
||||
id = idColumn.getCellData(selected); //get name of selected item
|
||||
|
||||
for (int i = 0; i < courses.size(); i++) {
|
||||
if (courses.get(i).getId() == id) {
|
||||
if (courses.get(i).getHasimage() == 1) {
|
||||
try {
|
||||
// URL url = new URL("http://smmdb.ddns.net/img/courses/thumbnails/" + id + ".pic"); //alt
|
||||
System.out.println("http://smmdb.ddns.net/courseimg/" + id + "_full.jpg?v=3");
|
||||
URL url = new URL("http://smmdb.ddns.net/courseimg/" + id + "_full.jpg?v=3");
|
||||
|
||||
Image image = new Image(url.toURI().toString());
|
||||
smmdbImageView.setImage(image);
|
||||
} catch (MalformedURLException | URISyntaxException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
if (courses.get(i).getId() == id) {
|
||||
try {
|
||||
// System.out.println("http://smmdb.ddns.net/courseimg/" + id + "_full.jpg?v=3");
|
||||
URL url = new URL("http://smmdb.ddns.net/courseimg/" + id + "_full.jpg?v=3");
|
||||
Image image = new Image(url.toURI().toString());
|
||||
smmdbImageView.setImage(image);
|
||||
} catch (MalformedURLException | URISyntaxException e) {
|
||||
e.printStackTrace();
|
||||
smmdbImageView.setImage(close_black);
|
||||
}
|
||||
addCourseDescription(courses.get(i));
|
||||
@ -646,8 +644,8 @@ public class MainWindowController {
|
||||
|
||||
//add query response to courseTreeTable
|
||||
for(int i = 0; i < courses.size(); i++){
|
||||
CourseTableDataType helpCourse = new CourseTableDataType(courses.get(i).getTitle(), courses.get(i).getDownloads(),
|
||||
courses.get(i).getStars(), courses.get(i).getId());
|
||||
CourseTableDataType helpCourse = new CourseTableDataType(courses.get(i).getTitle(), courses.get(i).getId(),
|
||||
courses.get(i).getTime(), courses.get(i).getStars());
|
||||
|
||||
root.getChildren().add(new TreeItem<CourseTableDataType>(helpCourse)); //add data to root-node
|
||||
}
|
||||
@ -712,7 +710,7 @@ public class MainWindowController {
|
||||
@FXML
|
||||
void smmdbDownloadBtnAction(ActionEvent event){
|
||||
String downloadUrl = "http://smmdb.ddns.net/api/downloadcourse?id=" + id + "&type=zip";
|
||||
String downloadFileURL = getCemuPath() + "/" + id + ".rar"; //getCemuPath() + "/" + smmID + "/" + id + ".rar"
|
||||
String downloadFileURL = getCemuPath() + "/" + id + ".zip"; //getCemuPath() + "/" + smmID + "/" + id + ".rar"
|
||||
String outputFile = getCemuPath() + "/";
|
||||
|
||||
try {
|
||||
@ -728,44 +726,29 @@ public class MainWindowController {
|
||||
System.out.println("downloaded successfull");
|
||||
|
||||
File downloadFile = new File(downloadFileURL);
|
||||
Archive a = null;
|
||||
try {
|
||||
a = new Archive(new FileVolumeManager(downloadFile));
|
||||
} catch (RarException | IOException e) {
|
||||
// Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (a != null) {
|
||||
a.getMainHeader().print();
|
||||
FileHeader fh = a.nextFileHeader();
|
||||
|
||||
for (int i = 0; i < smmIDs.size(); i++) {
|
||||
if (new File(outputFile + "mlc01/emulatorSave/" + smmIDs.get(i)).exists()) {
|
||||
File courseDirectory = new File(outputFile + "mlc01/emulatorSave/" + smmIDs.get(0) + "/" + fh.getFileNameString().substring(0, fh.getFileNameString().indexOf('\\')));
|
||||
System.out.println("Path: " + courseDirectory.getAbsolutePath());
|
||||
if (!courseDirectory.exists()) {
|
||||
courseDirectory.mkdir();
|
||||
}
|
||||
while (fh != null) {
|
||||
try {
|
||||
File out = new File(outputFile + "mlc01/emulatorSave/" + smmIDs.get(0) + "/" + fh.getFileNameString().trim());
|
||||
if (!out.getAbsolutePath().equals(courseDirectory.getAbsolutePath())) {
|
||||
System.out.println(out.getAbsolutePath());
|
||||
FileOutputStream os = new FileOutputStream(out);
|
||||
a.extractFile(fh, os);
|
||||
os.close();
|
||||
}
|
||||
|
||||
} catch (RarException | IOException e) {
|
||||
// Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
fh = a.nextFileHeader();
|
||||
}
|
||||
|
||||
String source = downloadFileURL;
|
||||
String destination = null;
|
||||
|
||||
for (int i = 0; i < smmIDs.size(); i++) {
|
||||
if (new File(outputFile + "mlc01/emulatorSave/" + smmIDs.get(i)).exists()) {
|
||||
File courseDirectory = new File(outputFile + "mlc01/emulatorSave/" + smmIDs.get(i) + "/" + id);
|
||||
System.out.println("Path: " + courseDirectory.getAbsolutePath());
|
||||
if (!courseDirectory.exists()) {
|
||||
courseDirectory.mkdir();
|
||||
}
|
||||
}
|
||||
destination = courseDirectory.getPath();
|
||||
}
|
||||
}
|
||||
a.close();
|
||||
|
||||
try {
|
||||
ZipFile zipFile = new ZipFile(source);
|
||||
zipFile.extractAll(destination);
|
||||
} catch (ZipException e) {
|
||||
e.printStackTrace();
|
||||
System.err.println("an error occurred during unziping the file!");
|
||||
}
|
||||
|
||||
downloadFile.delete();
|
||||
} catch (IOException e) {
|
||||
System.err.println("something went wrong during downloading the course");
|
||||
@ -1056,46 +1039,53 @@ public class MainWindowController {
|
||||
}
|
||||
|
||||
private void addCourseDescription(SmmdbApiDataType course) {
|
||||
String coursetype;
|
||||
String leveltype;
|
||||
String courseTheme;
|
||||
String gameStyle;
|
||||
String difficulty;
|
||||
String autoscroll;
|
||||
smmdbTextFlow.getChildren().remove(0, smmdbTextFlow.getChildren().size());
|
||||
nameText.clear();
|
||||
courseText.clear();
|
||||
|
||||
switch (course.getCoursetype()) {
|
||||
switch (course.getCourseTheme()) {
|
||||
case 0:
|
||||
coursetype = "Creation";
|
||||
courseTheme = "Ground";
|
||||
break;
|
||||
case 1:
|
||||
coursetype = "Recreation";
|
||||
courseTheme = "Underground";
|
||||
break;
|
||||
case 2:
|
||||
coursetype = "Wii U Dump";
|
||||
courseTheme = "Castle";
|
||||
break;
|
||||
case 3:
|
||||
courseTheme = "Airship";
|
||||
break;
|
||||
case 4:
|
||||
courseTheme = "Underwater";
|
||||
break;
|
||||
case 5:
|
||||
courseTheme = "Ghost House";
|
||||
break;
|
||||
default:
|
||||
coursetype = "notset";
|
||||
courseTheme = "notset";
|
||||
break;
|
||||
}
|
||||
|
||||
switch (course.getGamestyle()) {
|
||||
switch (course.getGameStyle()) {
|
||||
case 0:
|
||||
leveltype = "NSMBU";
|
||||
gameStyle = "SMB";
|
||||
break;
|
||||
case 1:
|
||||
leveltype = "SMW";
|
||||
gameStyle = "SMB3";
|
||||
break;
|
||||
case 2:
|
||||
leveltype = "SMB3";
|
||||
gameStyle = "SMW";
|
||||
break;
|
||||
case 3:
|
||||
leveltype = "SMB";
|
||||
break;
|
||||
case 4:
|
||||
leveltype = "Mixed";
|
||||
gameStyle = "NSMBU";
|
||||
break;
|
||||
default:
|
||||
leveltype = "notset";
|
||||
gameStyle = "notset";
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1120,23 +1110,45 @@ public class MainWindowController {
|
||||
break;
|
||||
}
|
||||
|
||||
switch (course.getAutoScroll()) {
|
||||
case 0:
|
||||
autoscroll = "disabled";
|
||||
break;
|
||||
case 1:
|
||||
autoscroll = "slow";
|
||||
break;
|
||||
case 2:
|
||||
autoscroll = "medium";
|
||||
break;
|
||||
case 3:
|
||||
autoscroll = "fast";
|
||||
break;
|
||||
default:
|
||||
autoscroll = "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(2, new Text("Course-Theme" + ": "));
|
||||
nameText.add(3, new Text("Game-Style" + ": "));
|
||||
nameText.add(4, new Text("difficulty" + ": "));
|
||||
nameText.add(5, new Text("lastmodified" + ": "));
|
||||
nameText.add(6, new Text("uploaded" + ": "));
|
||||
nameText.add(7, new Text("nintendoid" + ": "));
|
||||
nameText.add(5, new Text("Auto-Scroll" + ": "));
|
||||
nameText.add(6, new Text("Time" + ": "));
|
||||
nameText.add(7, new Text("lastmodified" + ": "));
|
||||
nameText.add(8, new Text("uploaded" + ": "));
|
||||
nameText.add(9, 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(1, new Text(course.getOwner() + "\n"));
|
||||
courseText.add(2, new Text(courseTheme + "\n"));
|
||||
courseText.add(3, new Text(gameStyle + "\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"));
|
||||
courseText.add(5, new Text(autoscroll + "\n"));
|
||||
courseText.add(6, new Text(course.getTime() + "\n"));
|
||||
courseText.add(7, new Text(new java.util.Date((long)course.getLastmodified()*1000) + "\n"));
|
||||
courseText.add(8, new Text(new java.util.Date((long)course.getUploaded()*1000) + "\n"));
|
||||
courseText.add(9, new Text(course.getNintendoid() + "\n"));
|
||||
|
||||
for(int i=0; i<nameText.size(); i++){
|
||||
nameText.get(i).setFont(Font.font ("System", FontWeight.BOLD, 14));
|
||||
@ -1146,7 +1158,11 @@ public class MainWindowController {
|
||||
|
||||
}
|
||||
|
||||
//TODO xPosHelper based on window with breite -24(windows, Linx = 36)
|
||||
//TODO Changelistener for resizing
|
||||
/**
|
||||
* xPosHelper based on window width = -24(Windows)/-36(Linux)
|
||||
* calculates how many games can be displayed in one row
|
||||
*/
|
||||
private void generatePosition() {
|
||||
int xPosHelperMax;
|
||||
if(System.getProperty("os.name").equals("Linux")){
|
||||
@ -1361,6 +1377,9 @@ public class MainWindowController {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
/**
|
||||
* @return the main color in hexadecimal format
|
||||
*/
|
||||
private String hexToRgb() {
|
||||
System.out.println(getColor());
|
||||
int hex = Integer.parseInt(getColor().substring(0, 5), 16);
|
||||
@ -1372,6 +1391,14 @@ public class MainWindowController {
|
||||
return r + ", " + g + ", " + b;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param originalImage original image which size is changed
|
||||
* @param type type of the original image (PNG,JPEG,...)
|
||||
* @param imgWidth wanted width
|
||||
* @param imgHeigth wanted height
|
||||
* @return the rezised image
|
||||
*/
|
||||
private static BufferedImage resizeImage(BufferedImage originalImage, int type, int imgWidth, int imgHeigth) {
|
||||
BufferedImage resizedImage = new BufferedImage(imgWidth, imgHeigth, type);
|
||||
Graphics2D g = resizedImage.createGraphics();
|
||||
|
@ -16,14 +16,16 @@
|
||||
* 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-table-cell-border-color: -fx-tree-table-color;
|
||||
-fx-text-fill: BLACK;
|
||||
}
|
||||
|
||||
@ -31,10 +33,13 @@
|
||||
-fx-text-fill: BLACK;
|
||||
}
|
||||
|
||||
|
||||
.tree-table-view .jfx-rippler {
|
||||
-jfx-rippler-fill: -fx-tree-table-rippler-color;
|
||||
-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 {
|
||||
|
@ -11,7 +11,6 @@ import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import com.eclipsesource.json.Json;
|
||||
import com.eclipsesource.json.JsonArray;
|
||||
import com.eclipsesource.json.JsonObject;
|
||||
import com.eclipsesource.json.JsonValue;
|
||||
|
||||
import datatypes.SmmdbApiDataType;
|
||||
@ -24,9 +23,11 @@ public class SmmdbApiQuery {
|
||||
//Auto-generated constructor stub
|
||||
}
|
||||
|
||||
//start api query
|
||||
/**
|
||||
* start smmdb api query
|
||||
* @return a ArryList with all courses found at smmdb
|
||||
*/
|
||||
public ArrayList<SmmdbApiDataType> startQuery() {
|
||||
ArrayList<Integer> courseIDs = new ArrayList<>();
|
||||
ArrayList<SmmdbApiDataType> course = new ArrayList<>();
|
||||
String output = "";
|
||||
|
||||
@ -48,93 +49,77 @@ public class SmmdbApiQuery {
|
||||
|
||||
JsonArray items = Json.parse(apiOutput).asObject().get("courses").asArray();
|
||||
for (JsonValue item : items) {
|
||||
int id, owner, coursetype, gamestyle, difficulty, lastmodified, uploaded, downloads, stars, hasimage, ispackage, updatereq;
|
||||
String nintendoid, title;
|
||||
|
||||
//TODO add "courseTheme", "time", "autoScroll"
|
||||
int courseTheme, gameStyle, difficulty, lastmodified, uploaded, autoScroll, stars ,time;
|
||||
String owner, id, nintendoid, title;
|
||||
|
||||
//geht
|
||||
try {
|
||||
id = item.asObject().getInt("id", 0);
|
||||
courseTheme = item.asObject().getInt("courseTheme", 9);
|
||||
} catch (Exception e) {
|
||||
id = 9;
|
||||
courseTheme = 9;
|
||||
}
|
||||
|
||||
//geht
|
||||
try {
|
||||
owner = item.asObject().getInt("owner", 0);
|
||||
gameStyle = item.asObject().getInt("gameStyle", 9);
|
||||
} catch (Exception e) {
|
||||
owner = 9;
|
||||
}
|
||||
|
||||
//test
|
||||
try {
|
||||
coursetype = item.asObject().getInt("coursetype", 0);
|
||||
} catch (Exception e) {
|
||||
coursetype = 9;
|
||||
gameStyle = 9;
|
||||
}
|
||||
|
||||
//geht
|
||||
try {
|
||||
gamestyle = item.asObject().getInt("gamestyle", 0);
|
||||
} catch (Exception e) {
|
||||
gamestyle = 9;
|
||||
}
|
||||
|
||||
//geht
|
||||
try {
|
||||
difficulty = item.asObject().getInt("difficulty", 0);
|
||||
difficulty = item.asObject().getInt("difficulty", 9);
|
||||
} catch (Exception e) {
|
||||
difficulty = 9;
|
||||
}
|
||||
|
||||
//geht
|
||||
try {
|
||||
lastmodified = item.asObject().getInt("lastmodified", 0);
|
||||
lastmodified = item.asObject().getInt("lastmodified", 9);
|
||||
} catch (Exception e) {
|
||||
lastmodified = 9;
|
||||
}
|
||||
|
||||
//geht
|
||||
try {
|
||||
uploaded = item.asObject().getInt("uploaded", 0);
|
||||
uploaded = item.asObject().getInt("uploaded", 9);
|
||||
} catch (Exception e) {
|
||||
uploaded = 9;
|
||||
}
|
||||
|
||||
//gestrichen
|
||||
//geht
|
||||
try {
|
||||
downloads = item.asObject().getInt("downloads", 0);
|
||||
autoScroll = item.asObject().getInt("autoScroll", 9);
|
||||
} catch (Exception e) {
|
||||
downloads = 9;
|
||||
autoScroll = 9;
|
||||
}
|
||||
|
||||
//geht
|
||||
try {
|
||||
stars = item.asObject().getInt("stars", 0);
|
||||
stars = item.asObject().getInt("stars", 9);
|
||||
} catch (Exception e) {
|
||||
stars = 9;
|
||||
}
|
||||
|
||||
//gestrichen
|
||||
//geht
|
||||
try {
|
||||
hasimage = item.asObject().getInt("hasimage", 0);
|
||||
time = item.asObject().getInt("time", 9);
|
||||
} catch (Exception e) {
|
||||
hasimage = 9;
|
||||
time = 9;
|
||||
}
|
||||
|
||||
//gestrichen
|
||||
//geht
|
||||
try {
|
||||
ispackage = item.asObject().getInt("ispackage", 0);
|
||||
owner = item.asObject().getString("owner", "");
|
||||
} catch (Exception e) {
|
||||
ispackage = 9;
|
||||
owner = "notset";
|
||||
}
|
||||
|
||||
//gestrichen
|
||||
//geht
|
||||
try {
|
||||
updatereq = item.asObject().getInt("updatereq", 0);
|
||||
id = item.asObject().getString("id", "");
|
||||
} catch (Exception e) {
|
||||
updatereq = 9;
|
||||
id = "notset";
|
||||
}
|
||||
|
||||
//geht
|
||||
@ -149,8 +134,8 @@ public class SmmdbApiQuery {
|
||||
title = "notset";
|
||||
}
|
||||
|
||||
course.add(new SmmdbApiDataType(id, owner, coursetype, gamestyle, difficulty, lastmodified, uploaded, downloads,
|
||||
stars, hasimage, ispackage, updatereq, nintendoid, title));
|
||||
course.add(new SmmdbApiDataType(courseTheme, gameStyle, difficulty, lastmodified, uploaded, autoScroll,
|
||||
stars, time, owner, id, nintendoid, title));
|
||||
}
|
||||
|
||||
return course;
|
||||
|
@ -13,14 +13,14 @@ import javafx.beans.property.StringProperty;
|
||||
public class CourseTableDataType extends RecursiveTreeObject<CourseTableDataType> {
|
||||
|
||||
public final StringProperty title;
|
||||
public final IntegerProperty downloads;
|
||||
public final StringProperty id;
|
||||
public final IntegerProperty time;
|
||||
public final IntegerProperty stars;
|
||||
public final IntegerProperty id;
|
||||
|
||||
public CourseTableDataType(String title, int downloads, int stars, int id) {
|
||||
public CourseTableDataType(String title, String id, int time, int stars) {
|
||||
this.title = new SimpleStringProperty(title);
|
||||
this.downloads = new SimpleIntegerProperty(downloads);
|
||||
this.id = new SimpleStringProperty(id);
|
||||
this.time = new SimpleIntegerProperty(time);
|
||||
this.stars = new SimpleIntegerProperty(stars);
|
||||
this.id = new SimpleIntegerProperty(id);
|
||||
}
|
||||
}
|
||||
|
@ -10,58 +10,43 @@ import javafx.beans.property.StringProperty;
|
||||
|
||||
public class SmmdbApiDataType {
|
||||
|
||||
private final IntegerProperty id = new SimpleIntegerProperty();
|
||||
private final IntegerProperty owner = new SimpleIntegerProperty();
|
||||
private final IntegerProperty coursetype = new SimpleIntegerProperty();
|
||||
private final IntegerProperty gamestyle = new SimpleIntegerProperty();
|
||||
private final IntegerProperty courseTheme = new SimpleIntegerProperty();
|
||||
private final IntegerProperty gameStyle = new SimpleIntegerProperty();
|
||||
private final IntegerProperty difficulty = new SimpleIntegerProperty();
|
||||
private final IntegerProperty lastmodified = new SimpleIntegerProperty();
|
||||
private final IntegerProperty uploaded = new SimpleIntegerProperty();
|
||||
private final IntegerProperty downloads = new SimpleIntegerProperty();
|
||||
private final IntegerProperty autoScroll = new SimpleIntegerProperty();
|
||||
private final IntegerProperty stars = new SimpleIntegerProperty();
|
||||
private final IntegerProperty hasimage = new SimpleIntegerProperty();
|
||||
private final IntegerProperty ispackage = new SimpleIntegerProperty();
|
||||
private final IntegerProperty updatereq = new SimpleIntegerProperty();
|
||||
private final IntegerProperty time = new SimpleIntegerProperty();
|
||||
private final StringProperty owner = new SimpleStringProperty();
|
||||
private final StringProperty id = new SimpleStringProperty();
|
||||
private final StringProperty nintendoid = new SimpleStringProperty();
|
||||
private final StringProperty title = new SimpleStringProperty();
|
||||
|
||||
public SmmdbApiDataType(final int id, final int owner, final int coursetype, final int gamestyle, final int difficulty,
|
||||
final int lastmodified, final int uploaded, final int downloads, final int stars, final int hasimage,
|
||||
final int ispackage, final int updatereq, final String nintendoid, final String title) {
|
||||
public SmmdbApiDataType(final int courseTheme, final int gameStyle, final int difficulty, final int lastmodified,
|
||||
final int uploaded, final int autoScroll, final int stars, final int time,
|
||||
final String owner, final String id, final String nintendoid, final String title) {
|
||||
this.id.set(id);
|
||||
this.owner.set(owner);
|
||||
this.coursetype.set(coursetype);
|
||||
this.gamestyle.set(gamestyle);
|
||||
this.courseTheme.set(courseTheme);
|
||||
this.gameStyle.set(gameStyle);
|
||||
this.difficulty.set(difficulty);
|
||||
this.lastmodified.set(lastmodified);
|
||||
this.uploaded.set(uploaded);
|
||||
this.downloads.set(downloads);
|
||||
this.autoScroll.set(autoScroll);
|
||||
this.stars.set(stars);
|
||||
this.hasimage.set(hasimage);
|
||||
this.ispackage.set(ispackage);
|
||||
this.updatereq.set(updatereq);
|
||||
this.time.set(time);
|
||||
this.nintendoid.set(nintendoid);
|
||||
this.title.set(title);
|
||||
}
|
||||
|
||||
public IntegerProperty idProperty(){
|
||||
return id;
|
||||
public IntegerProperty courseThemeProperty(){
|
||||
return courseTheme;
|
||||
}
|
||||
|
||||
public IntegerProperty ownerProperty(){
|
||||
return owner;
|
||||
}
|
||||
|
||||
public IntegerProperty coursetypeProperty(){
|
||||
return coursetype;
|
||||
}
|
||||
|
||||
public StringProperty nintendoidProperty(){
|
||||
return nintendoid;
|
||||
}
|
||||
|
||||
public IntegerProperty gamestyleProperty(){
|
||||
return gamestyle;
|
||||
public IntegerProperty gameStyleProperty(){
|
||||
return gameStyle;
|
||||
}
|
||||
|
||||
public IntegerProperty difficultyProperty(){
|
||||
@ -76,44 +61,40 @@ public class SmmdbApiDataType {
|
||||
return uploaded;
|
||||
}
|
||||
|
||||
public IntegerProperty downloadsProperty(){
|
||||
return downloads;
|
||||
public IntegerProperty autoScrollProperty(){
|
||||
return autoScroll;
|
||||
}
|
||||
|
||||
public IntegerProperty starsProperty(){
|
||||
return stars;
|
||||
}
|
||||
|
||||
public IntegerProperty hasimageProperty(){
|
||||
return hasimage;
|
||||
public IntegerProperty timeProperty(){
|
||||
return time;
|
||||
}
|
||||
|
||||
public IntegerProperty ispackageProperty(){
|
||||
return ispackage;
|
||||
public StringProperty ownerProperty(){
|
||||
return owner;
|
||||
}
|
||||
|
||||
public IntegerProperty updatereqProperty(){
|
||||
return updatereq;
|
||||
public StringProperty idProperty(){
|
||||
return id;
|
||||
}
|
||||
|
||||
public StringProperty nintendoidProperty(){
|
||||
return nintendoid;
|
||||
}
|
||||
|
||||
public StringProperty titleProperty(){
|
||||
return title;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return idProperty().get();
|
||||
public int getCourseTheme() {
|
||||
return courseThemeProperty().get();
|
||||
}
|
||||
|
||||
public int getOwner() {
|
||||
return ownerProperty().get();
|
||||
}
|
||||
|
||||
public int getCoursetype() {
|
||||
return coursetypeProperty().get();
|
||||
}
|
||||
|
||||
public int getGamestyle() {
|
||||
return gamestyleProperty().get();
|
||||
public int getGameStyle() {
|
||||
return gameStyleProperty().get();
|
||||
}
|
||||
|
||||
public int getDifficulty() {
|
||||
@ -128,24 +109,24 @@ public class SmmdbApiDataType {
|
||||
return uploadedProperty().get();
|
||||
}
|
||||
|
||||
public int getDownloads() {
|
||||
return downloadsProperty().get();
|
||||
public int getAutoScroll() {
|
||||
return autoScrollProperty().get();
|
||||
}
|
||||
|
||||
public int getStars() {
|
||||
return starsProperty().get();
|
||||
}
|
||||
|
||||
public int getHasimage() {
|
||||
return hasimageProperty().get();
|
||||
public int getTime() {
|
||||
return timeProperty().get();
|
||||
}
|
||||
|
||||
public int getIspackage() {
|
||||
return ispackageProperty().get();
|
||||
public String getOwner() {
|
||||
return ownerProperty().get();
|
||||
}
|
||||
|
||||
public int getUpdatereq() {
|
||||
return updatereqProperty().get();
|
||||
public String getId() {
|
||||
return idProperty().get();
|
||||
}
|
||||
|
||||
public String getNintendoid() {
|
||||
@ -156,20 +137,12 @@ public class SmmdbApiDataType {
|
||||
return titleProperty().get();
|
||||
}
|
||||
|
||||
public final void setId(int id) {
|
||||
idProperty().set(id);
|
||||
public final void setCourseTheme(int courseTheme) {
|
||||
courseThemeProperty().set(courseTheme);
|
||||
}
|
||||
|
||||
public final void setOwner(int owner) {
|
||||
ownerProperty().set(owner);
|
||||
}
|
||||
|
||||
public final void setCoursetype(int coursetype) {
|
||||
coursetypeProperty().set(coursetype);
|
||||
}
|
||||
|
||||
public final void setGamestyle(int leveltype) {
|
||||
gamestyleProperty().set(leveltype);
|
||||
public final void setGameStyle(int gameStyle) {
|
||||
gameStyleProperty().set(gameStyle);
|
||||
}
|
||||
|
||||
public final void setDifficulty(int difficulty) {
|
||||
@ -184,26 +157,26 @@ public class SmmdbApiDataType {
|
||||
uploadedProperty().set(uploaded);
|
||||
}
|
||||
|
||||
public final void setDownloads(int downloads) {
|
||||
downloadsProperty().set(downloads);
|
||||
public final void setAutoScroll(int autoScroll) {
|
||||
autoScrollProperty().set(autoScroll);
|
||||
}
|
||||
|
||||
public final void setStars(int stars) {
|
||||
starsProperty().set(stars);
|
||||
}
|
||||
|
||||
public final void setHasimage(int hasimage) {
|
||||
hasimageProperty().set(hasimage);
|
||||
|
||||
public final void setTime(int time) {
|
||||
timeProperty().set(time);
|
||||
}
|
||||
|
||||
public final void setIspackage(int ispackage) {
|
||||
ispackageProperty().set(ispackage);
|
||||
public final void setOwner(String owner) {
|
||||
ownerProperty().set(owner);
|
||||
}
|
||||
|
||||
public final void setUpdatereq(int updatereq) {
|
||||
updatereqProperty().set(updatereq);
|
||||
public final void setId(String id) {
|
||||
idProperty().set(id);
|
||||
}
|
||||
|
||||
|
||||
public final void setNintendoid(String nintendoid) {
|
||||
nintendoidProperty().set(nintendoid);
|
||||
}
|
||||
|
Binary file not shown.
BIN
src/libraries/zip4j-1.3.2.jar
Normal file
BIN
src/libraries/zip4j-1.3.2.jar
Normal file
Binary file not shown.
Reference in New Issue
Block a user