Skip to content

Commit

Permalink
Automatische Aktualisierung der Anzeige von abgebrochenen Nachkommast…
Browse files Browse the repository at this point in the history
…ellen
  • Loading branch information
Tim Mühle committed Aug 27, 2020
1 parent 4372ba5 commit 65706d0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/main/java/bitchanger/gui/controller/ConverterController.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import bitchanger.gui.controls.ValueButton;
import bitchanger.gui.controls.ValueField;
import bitchanger.gui.views.ConverterView;
import bitchanger.preferences.Preferences;
import bitchanger.util.ArrayUtils;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
Expand Down Expand Up @@ -189,6 +190,7 @@ public void setActions() {
setSpinnerActions();
setButtonActions();
setInitialState();
updateIndicateFractionalPrecision();
}


Expand Down Expand Up @@ -534,6 +536,26 @@ public void handle(MouseEvent event) {

}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

// TODO JavaDoc
private void updateIndicateFractionalPrecision() {
Preferences.getPrefs().indicateFractionalPrecisionProperty.addListener(new ChangeListener<Boolean>() {
@Override
public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
try {
value.setDec(value.toDecString());
} catch (Exception e) {
value.reset();
e.printStackTrace();
}

setTexts(tfHex != focusedTF, tfDec != focusedTF, tfOct != focusedTF, tfBin != focusedTF, tfAny != focusedTF);
}
});
}



// Spinner << << << << << << << << << << << << << << << << << << << << << << << << << << << << << << << <<
/** <!-- $LANGUAGE=DE -->
Expand Down

0 comments on commit 65706d0

Please sign in to comment.