Skip to content

Commit

Permalink
Release 0.1.6
Browse files Browse the repository at this point in the history
Diese Version behebt Fehler beim Laden von Ressourcen und lädt beim Programmstart die zuletzt verwendete Oberfläche.
  • Loading branch information
Tim Muehle committed Aug 27, 2020
1 parent 65706d0 commit fab99d3
Show file tree
Hide file tree
Showing 12 changed files with 130 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
* @author Tim Mühle
*
* @since Bitchanger 0.1.0
* @version 0.1.4
* @version 0.1.6
*
*/
/* <!-- $LANGUAGE=EN -->
Expand All @@ -72,7 +72,7 @@
* @author Tim Mühle
*
* @since Bitchanger 0.1.0
* @version 0.1.4
* @version 0.1.6
*
*/
public class AlphaNumKeysController extends ControllerBase<AlphaNumKeys> {
Expand Down Expand Up @@ -408,7 +408,7 @@ private void setAllToKeyboard(char startLetter) {
* @see Preferences#getPrefs()
*/
private void setCommaBinding() {
Preferences.getPrefs().commaProperty.addListener(new ChangeListener<Comma>() {
Preferences.getPrefs().commaProperty().addListener(new ChangeListener<Comma>() {
@Override
public void changed(ObservableValue<? extends Comma> observable, Comma oldComma, Comma newComma) {
commaBtn.setText(String.valueOf(newComma.get()));
Expand Down Expand Up @@ -606,7 +606,7 @@ private void setSimulateKeyEvents() {
@Override
public void handle(ActionEvent event) {
KeyCode commaKeyCode = KeyCode.COMMA;
if(Preferences.getPrefs().commaProperty.get().equals(Comma.COMMA_EN)) {
if(Preferences.getPrefs().commaProperty().get().equals(Comma.COMMA_EN)) {
commaKeyCode = KeyCode.PERIOD;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @author Tim Mühle
*
* @since Bitchanger 0.1.0
* @version 0.1.4
* @version 0.1.6
*
*/
/* <!-- $LANGUAGE=EN -->
Expand All @@ -46,7 +46,7 @@
* @author Tim Muehle
*
* @since Bitchanger 0.1.0
* @version 0.1.4
* @version 0.1.6
*
*/
public class ConverterController extends ControllerBase<ConverterView> {
Expand Down Expand Up @@ -540,7 +540,7 @@ public void handle(MouseEvent event) {

// TODO JavaDoc
private void updateIndicateFractionalPrecision() {
Preferences.getPrefs().indicateFractionalPrecisionProperty.addListener(new ChangeListener<Boolean>() {
Preferences.getPrefs().indicateFractionalPrecisionProperty().addListener(new ChangeListener<Boolean>() {
@Override
public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
import javafx.scene.control.CheckMenuItem;

//TODO JavaDoc
/** <!-- $LANGUAGE=DE -->
*
* @author Tim Mühle
*
* @since Bitchanger 0.1.4
* @version 0.1.6
*
*/
public class ConverterMenuController extends BasicMenuController {

// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
Expand Down Expand Up @@ -72,7 +80,7 @@ public void setActions() {
super.setActions();

// Menu Options
Preferences.getPrefs().indicateFractionalPrecisionProperty.bindBidirectional(indicateFractionalInaccuracy.selectedProperty());
Preferences.getPrefs().indicateFractionalPrecisionProperty().bindBidirectional(indicateFractionalInaccuracy.selectedProperty());
}


Expand Down
6 changes: 3 additions & 3 deletions src/main/java/bitchanger/gui/controls/BasicMenuBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* @author Tim Mühle
*
* @since Bitchanger 0.1.4
* @version 0.1.4
* @version 0.1.6
*
* @see BasicMenuController
*/
Expand All @@ -53,7 +53,7 @@
* @author Tim Mühle
*
* @since Bitchanger 0.1.4
* @version 0.1.4
* @version 0.1.6
*
* @see BasicMenuController
*/
Expand Down Expand Up @@ -263,7 +263,7 @@ private void setChooseCommaAction(MenuItem chooseComma, Comma comma) {
chooseComma.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
Preferences.getPrefs().commaProperty.setValue(comma);
Preferences.getPrefs().commaProperty().setValue(comma);
}
});
}
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/bitchanger/gui/controls/InformationDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
import javafx.scene.control.Alert;

//TODO JavaDoc erstellen
/** <!-- $LANGUAGE=DE -->
*
* @author Tim Mühle
*
* @since Bitchanger 0.1.4
* @version 0.1.6
*
*/
public class InformationDialog extends Alert {

// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
Expand All @@ -33,7 +41,7 @@ public InformationDialog() {
public InformationDialog(InformationType informationType) {
super(AlertType.INFORMATION);

this.getDialogPane().getStylesheets().add(Preferences.getPrefs().readOnlyStylesheetProperty.get());
this.getDialogPane().getStylesheets().add(Preferences.getPrefs().stylesheetProperty().get());

switch(informationType) {
case ABOUT:
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/bitchanger/gui/controls/ValueField.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* @author Tim Mühle
*
* @since Bitchanger 0.1.0
* @version 0.1.4
* @version 0.1.6
*
*/
/* <!-- $LANGUAGE=EN -->
Expand All @@ -51,7 +51,7 @@
* @author Tim Mühle
*
* @since Bitchanger 0.1.0
* @version 0.1.4
* @version 0.1.6
*
*/
public class ValueField extends TextField {
Expand Down Expand Up @@ -342,7 +342,7 @@ public void run() {
* Monitors the CommaProperty from {@link Preferences} and adjusts the comma if the number is changing
*/
private void observeCommaProperty() {
Preferences.getPrefs().commaProperty.addListener(new ChangeListener<Comma>() {
Preferences.getPrefs().commaProperty().addListener(new ChangeListener<Comma>() {
@Override
public void changed(ObservableValue<? extends Comma> observable, Comma oldValue, Comma newValue) {
if(oldValue.equals(newValue))
Expand Down
36 changes: 26 additions & 10 deletions src/main/java/bitchanger/main/PrimaryFXApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import bitchanger.gui.views.IEEEView;
import bitchanger.gui.views.Viewable;
import bitchanger.preferences.Preferences;
import bitchanger.util.ArrayUtils;
import bitchanger.util.Resources;
import javafx.application.Application;
import javafx.beans.property.ObjectProperty;
Expand Down Expand Up @@ -122,14 +123,11 @@ public static void launchFXApplication(String[] args) {
// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##


// public ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
// private ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##

/** <!-- $LANGUAGE=DE --> Property für die aktuell im Fenster dargestellte View */
/* <!-- $LANGUAGE=EN --> Property of the currently displayed View */
public final ObjectProperty<Viewable> currentViewProperty;


// private ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
private final ObjectProperty<Viewable> currentViewProperty;

/** <!-- $LANGUAGE=DE --> View für die Umwandlung von Zahlensystemen */
/* <!-- $LANGUAGE=EN --> View for converting of numeral systems */
Expand Down Expand Up @@ -162,7 +160,7 @@ public PrimaryFXApp() {
super();
this.currentViewProperty = new SimpleObjectProperty<Viewable>();
}



// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
Expand Down Expand Up @@ -267,10 +265,18 @@ public void start(Stage primaryStage) throws Exception {
this.calculatorView = new CalculatorView();

adjustViews(converterView, ieeeView, calculatorView);

changeView(converterView);

for(Viewable view : ArrayUtils.arrayOf(converterView, ieeeView, calculatorView)) {
if(Preferences.getPrefs().viewClassProperty().get().equals(view.getClass())) {
changeView(view);
}
}

updateViewClassProperty();

currentViewProperty.set(converterView);

changeView(converterView);
primaryStage.setTitle("Bitchanger " + VERSION);

// Fenstergroesse an Scene anpassen und Maximale / Minimale Groesse einstellen (berechnet aus groesse der Scene und dem zusaetzlichen Fensterrahmen)
Expand All @@ -280,6 +286,16 @@ public void start(Stage primaryStage) throws Exception {
primaryStage.show();
}


// TODO JavaDoc
private void updateViewClassProperty() {
this.currentViewProperty.addListener(new ChangeListener<Viewable>() {
@Override
public void changed(ObservableValue<? extends Viewable> observable, Viewable oldValue, Viewable newView) {
Preferences.getPrefs().viewClassProperty().set(newView.getClass());
}
});
}


// Layout ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
Expand Down Expand Up @@ -377,7 +393,7 @@ private void adjustViews(Viewable... views) {
BasicMenuBar menubar = view.generateMenuBar(this);
view.setMenuBar(menubar);

Preferences.getPrefs().readOnlyStylesheetProperty.addListener(new ChangeListener<String>() {
Preferences.getPrefs().stylesheetProperty().addListener(new ChangeListener<String>() {
@Override
public void changed(ObservableValue<? extends String> observable, String oldStylesheet, String newStylesheet) {
try {
Expand All @@ -391,7 +407,7 @@ public void changed(ObservableValue<? extends String> observable, String oldStyl
});

view.getScene().getStylesheets().add(Resources.LAYOUT_CSS);
view.getScene().getStylesheets().add(Preferences.getPrefs().readOnlyStylesheetProperty.get());
view.getScene().getStylesheets().add(Preferences.getPrefs().stylesheetProperty().get());
}
}

Expand Down

0 comments on commit fab99d3

Please sign in to comment.