Skip to content

Commit

Permalink
UI fixes and sanity checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ringosham committed Jan 23, 2019
1 parent ef1557e commit 430cfc9
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 46 deletions.
2 changes: 1 addition & 1 deletion src/com/ringosham/Global.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.util.Locale;
import java.util.Properties;

public class Global {
public final class Global {
public static final Global INSTANCE = new Global();
private File configFile;
public final List<Beatmap> beatmapList = new ArrayList<>();
Expand Down
49 changes: 30 additions & 19 deletions src/com/ringosham/fxml/Login.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,40 @@
~ Licensed under the Apache license. Version 2.0
~ http://www.apache.org/licenses/LICENSE-2.0
-->

<!--suppress ALL -->

<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane xmlns:fx="http://javafx.com/fxml/1" minHeight="-Infinity" prefHeight="223.0" prefWidth="311.0"
xmlns="http://javafx.com/javafx/8.0.121">
<AnchorPane xmlns:fx="http://javafx.com/fxml/1" minHeight="-Infinity" prefHeight="241.0" prefWidth="311.0"
xmlns="http://javafx.com/javafx/8.0.172-ea">
<children>
<Button fx:id="loginButton" layoutX="222.0" layoutY="184.0" mnemonicParsing="false" onAction="#onLogin"
text="%login.title" AnchorPane.bottomAnchor="14.0" AnchorPane.leftAnchor="222.0"
AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="191.0"/>
<Label layoutX="14.0" layoutY="14.0" text="%login.explanation" AnchorPane.bottomAnchor="192.0"
AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="14.0"/>
<Label layoutX="14.0" layoutY="31.0" text="%login.saveInfo" wrapText="true" AnchorPane.bottomAnchor="160.0"
AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="31.0"/>
<Label layoutX="14.0" layoutY="75.0" text="%login.email" AnchorPane.bottomAnchor="131.0"
AnchorPane.leftAnchor="14.0"
AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="75.0"/>
<TextField fx:id="email" layoutX="14.0" layoutY="102.0" AnchorPane.bottomAnchor="101.0"
AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="102.0"/>
<Label layoutX="14.0" layoutY="128.0" text="%login.password" AnchorPane.bottomAnchor="78.0"
AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="128.0"/>
<PasswordField fx:id="password" layoutX="14.0" layoutY="153.0" AnchorPane.bottomAnchor="50.0"
AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="153.0"/>
<GridPane AnchorPane.bottomAnchor="10.0" AnchorPane.leftAnchor="20.0" AnchorPane.rightAnchor="20.0"
AnchorPane.topAnchor="10.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints maxHeight="42.0" minHeight="10.0" prefHeight="42.0" vgrow="SOMETIMES"/>
<RowConstraints maxHeight="33.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints maxHeight="37.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints maxHeight="26.0" minHeight="10.0" prefHeight="25.0" vgrow="SOMETIMES"/>
<RowConstraints maxHeight="48.0" minHeight="10.0" prefHeight="33.0" vgrow="SOMETIMES"/>
<RowConstraints maxHeight="41.0" minHeight="10.0" prefHeight="29.0" vgrow="SOMETIMES"/>
</rowConstraints>
<children>
<Label text="%login.explanation"/>
<Label text="%login.saveInfo" wrapText="true" GridPane.rowIndex="1"/>
<Label text="%login.email" GridPane.rowIndex="2"/>
<TextField fx:id="email" GridPane.rowIndex="3"/>
<Label text="%login.password" GridPane.rowIndex="4"/>
<PasswordField fx:id="password" GridPane.rowIndex="5"/>
<Pane nodeOrientation="RIGHT_TO_LEFT" prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="6">
<children>
<Button fx:id="loginButton" mnemonicParsing="false" onAction="#onLogin" text="%login.title"/>
</children>
</Pane>
</children>
</GridPane>
</children>
</AnchorPane>
57 changes: 33 additions & 24 deletions src/com/ringosham/fxml/about.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,37 @@
<?import javafx.scene.text.Font?>
<AnchorPane xmlns:fx="http://javafx.com/fxml/1" prefHeight="292.0" prefWidth="321.0"
xmlns="http://javafx.com/javafx/8.0.172-ea">
<Label layoutX="80.0" layoutY="132.0" text="Lazer Exporter" AnchorPane.topAnchor="132.0">
<font>
<Font name="Verdana" size="22.0"/>
</font>
</Label>
<Label alignment="CENTER" layoutX="75.0" layoutY="177.0" text="Copyright © 2018 - Ringosham"
AnchorPane.leftAnchor="50.0" AnchorPane.rightAnchor="50.0" AnchorPane.topAnchor="177.0"/>
<Label layoutX="153.0" layoutY="160.0" text="1.3" AnchorPane.topAnchor="160.0"/>
<Hyperlink fx:id="license" alignment="CENTER" contentDisplay="TOP" graphicTextGap="0.0" minWidth="-Infinity"
text="Licensed under Apache 2.0" AnchorPane.bottomAnchor="20.0" AnchorPane.leftAnchor="85.0"
AnchorPane.rightAnchor="85.0"/>
<Hyperlink fx:id="github" contentDisplay="GRAPHIC_ONLY" layoutX="141.0" layoutY="207.0" minHeight="-Infinity"
minWidth="-Infinity" prefHeight="32.0" prefWidth="32.0" AnchorPane.bottomAnchor="53.0"
AnchorPane.leftAnchor="140.0" AnchorPane.rightAnchor="140.0">
<graphic>
<ImageView fitHeight="32.0" fitWidth="32.0" pickOnBounds="true" preserveRatio="true">
<Image url="@../assets/GitHub-Mark-32px.png"/>
</ImageView>
</graphic>
</Hyperlink>
<ImageView fitHeight="64.0" fitWidth="64.0" layoutX="129.0" layoutY="42.0" pickOnBounds="true" preserveRatio="true"
AnchorPane.leftAnchor="129.0" AnchorPane.rightAnchor="128.0" AnchorPane.topAnchor="42.0">
<Image url="@../assets/logo64x64.png"/>
</ImageView>
<GridPane alignment="CENTER" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
AnchorPane.topAnchor="0.0">
<columnConstraints>
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="139.0" minHeight="10.0" prefHeight="123.0" vgrow="SOMETIMES"/>
<RowConstraints maxHeight="123.0" minHeight="10.0" prefHeight="42.0" vgrow="SOMETIMES"/>
<RowConstraints maxHeight="86.0" minHeight="8.0" prefHeight="8.0" vgrow="SOMETIMES"/>
<RowConstraints maxHeight="44.0" minHeight="10.0" prefHeight="12.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
</rowConstraints>
<ImageView fitHeight="64.0" fitWidth="64.0" pickOnBounds="true" preserveRatio="true">
<Image url="@../assets/logo64x64.png"/>
</ImageView>
<Label text="Lazer Exporter" GridPane.rowIndex="1">
<font>
<Font name="Verdana" size="22.0"/>
</font>
</Label>
<Label text="1.3" GridPane.rowIndex="2"/>
<Label alignment="CENTER" text="Copyright © 2019 - Ringosham" GridPane.rowIndex="3"/>
<Hyperlink fx:id="github" contentDisplay="GRAPHIC_ONLY" GridPane.rowIndex="4">
<graphic>
<ImageView fitHeight="32.0" fitWidth="32.0" pickOnBounds="true" preserveRatio="true">
<Image url="@../assets/GitHub-Mark-32px.png"/>
</ImageView>
</graphic>
</Hyperlink>
<Hyperlink fx:id="license" alignment="CENTER" contentDisplay="TOP" graphicTextGap="0.0"
text="Licensed under Apache 2.0" GridPane.rowIndex="5"/>
</GridPane>
</AnchorPane>
5 changes: 3 additions & 2 deletions src/com/ringosham/threads/imports/ListImport.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,16 @@ protected Void call() {
}
updateMessage(Localizer.getLocalizedText("status.list.processingXML"));
List<BeatmapXML> list = xml.getBeatmaps();
//Sanity checks. Marshaller converts all non-digits and decimals to 0.
list.removeIf(beatmapXML -> beatmapXML.getBeatmapID() <= 0);
//Preparing view.
list.sort((o1, o2) -> {
if (isBeatmapInstalled(o1.getBeatmapID()) && !isBeatmapInstalled(o2.getBeatmapID()))
return 1;
else if (!isBeatmapInstalled(o1.getBeatmapID()) && isBeatmapInstalled(o2.getBeatmapID()))
return -1;
else {
else
return Integer.compare(o1.getBeatmapID(), o2.getBeatmapID());
}
});
//Convert data to viewable objects for TableView
List<BeatmapView> view = new ArrayList<>();
Expand Down

0 comments on commit 430cfc9

Please sign in to comment.