Skip to content

Commit

Permalink
Added listener to DataOptionsController.java and create ResetViewEven…
Browse files Browse the repository at this point in the history
…t.java
  • Loading branch information
GarreBrenn committed Sep 7, 2020
1 parent 619e8aa commit 20789b3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.event.EventTarget;
import javafx.fxml.FXML;
import javafx.scene.control.*;
import javafx.scene.input.MouseEvent;
Expand Down Expand Up @@ -135,6 +137,10 @@ public DataOptionsController() {
fireEventOnChanged(showUnincludedCheckBox.selectedProperty(), showUnincludedCheckBox, PlotOption.SHOW_UNINCLUDED);
fireEventOnChanged(resetViewOnChangeUnc.selectedProperty(), resetViewOnChangeUnc, PlotOption.RESET_VIEW_ON_CHANGE_UNC);

resetViewOnChangeUnc.selectedProperty().addListener(((observable, oldValue, newValue) -> {
Event.fireEvent(resetViewOnChangeUnc, new ResetViewEvent<>());
}));

fireEventOnChanged(pointsFillValue, pointsFillColorPicker, PlotOption.POINTS_FILL);
fireEventOnChanged(pointsOpacityValue, pointsFillColorPicker, PlotOption.POINTS_OPACITY);
fireEventOnChanged(ellipsesFillValue, ellipsesFillColorPicker, PlotOption.ELLIPSES_FILL);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.cirdles.topsoil.app.control.plot.panel;

import javafx.event.Event;
import javafx.event.EventType;

class ResetViewEvent<T> extends Event {

public final static EventType<OptionChangeEvent> RESET_VIEW = new EventType<>("RESET_VIEW");


ResetViewEvent() {
super(RESET_VIEW);
}

}

0 comments on commit 20789b3

Please sign in to comment.