Java Reference
In-Depth Information
/**
* The maximum audio volume in decibels
*/
public double maxDecibels = 160.0;
/**
* The selected audio volume in decibels
*/
public IntegerProperty selectedDBs = new SimpleIntegerProperty(0);
/**
* Indicates whether audio is muted
*/
public BooleanProperty muting = new SimpleBooleanProperty(false);
/**
* List of some musical genres
*/
public ObservableList genres = FXCollections.observableArrayList(
"Chamber",
"Country",
"Cowbell",
"Metal",
"Polka",
"Rock"
);
/**
* A reference to the selection model used by the Slider
*/
public SingleSelectionModel genreSelectionModel;
/**
* Adds a change listener to the selection model of the ChoiceBox, and contains
* code that executes when the selection in the ChoiceBox changes.
*/
public void addListenerToGenreSelectionModel() {
genreSelectionModel.selectedIndexProperty().addListener((Observable o) -> {
int selectedIndex = genreSelectionModel.selectedIndexProperty().getValue();
switch(selectedIndex) {
case 0: selectedDBs.setValue(80);
break;
case 1: selectedDBs.setValue(100);
break;
case 2: selectedDBs.setValue(150);
break;
case 3: selectedDBs.setValue(140);
break;
Search WWH ::




Custom Search