19 package org.sleuthkit.autopsy.timeline.zooming;
21 import java.time.temporal.ChronoUnit;
22 import javafx.application.Platform;
23 import javafx.beans.InvalidationListener;
24 import javafx.beans.property.ReadOnlyObjectProperty;
25 import javafx.fxml.FXML;
26 import javafx.scene.control.Button;
27 import javafx.scene.control.Label;
28 import javafx.scene.control.Slider;
29 import javafx.scene.control.TitledPane;
30 import javafx.scene.control.Tooltip;
31 import javafx.util.StringConverter;
32 import org.openide.util.NbBundle;
89 timeUnitSlider.setMax(
TimeUnits.values().length - 2);
92 typeZoomSlider.setMin(1);
93 typeZoomSlider.setMax(2);
97 descrLODLabel.setText(
98 NbBundle.getMessage(
this.getClass(),
"ZoomSettingsPane.descrLODLabel.text"));
99 typeZoomLabel.setText(NbBundle.getMessage(
this.getClass(),
"ZoomSettingsPane.typeZoomLabel.text"));
100 timeUnitLabel.setText(NbBundle.getMessage(
this.getClass(),
"ZoomSettingsPane.timeUnitLabel.text"));
101 zoomLabel.setText(NbBundle.getMessage(
this.getClass(),
"ZoomSettingsPane.zoomLabel.text"));
102 historyLabel.setText(NbBundle.getMessage(
this.getClass(),
"ZoomSettingsPane.historyLabel.text"));
104 initializeSlider(timeUnitSlider,
106 TimeUnits requestedUnit =
TimeUnits.values()[
new Double(timeUnitSlider.getValue()).intValue()];
120 initializeSlider(descrLODSlider,
126 initializeSlider(typeZoomSlider,
129 () -> typeZoomSlider.setValue(
this.filteredEvents.eventTypeZoomProperty().get().ordinal()));
133 backButton.disableProperty().bind(back.disabledProperty());
134 backButton.setOnAction(back);
135 backButton.setTooltip(
new Tooltip(
136 NbBundle.getMessage(
this.getClass(),
"ZoomSettingsPane.backButton.toolTip.text",
137 back.getAccelerator().getName())));
139 forwardButton.disableProperty().bind(forward.disabledProperty());
140 forwardButton.setOnAction(forward);
141 forwardButton.setTooltip(
new Tooltip(
142 NbBundle.getMessage(
this.getClass(),
"ZoomSettingsPane.forwardButton.toolTip.text",
143 forward.getAccelerator().getName())));
170 private <T>
void initializeSlider(Slider slider, Runnable sliderChangeHandler, ReadOnlyObjectProperty<T> driver, Runnable driverChangHandler) {
171 final InvalidationListener sliderListener = observable -> {
172 if (slider.isValueChanging() ==
false) {
173 sliderChangeHandler.run();
176 slider.valueProperty().addListener(sliderListener);
177 slider.valueChangingProperty().addListener(sliderListener);
179 Platform.runLater(driverChangHandler);
181 driver.addListener(observable -> {
182 slider.valueProperty().removeListener(sliderListener);
183 slider.valueChangingProperty().removeListener(sliderListener);
185 Platform.runLater(() -> {
186 driverChangHandler.run();
187 slider.valueProperty().addListener(sliderListener);
188 slider.valueChangingProperty().addListener(sliderListener);
203 return new Integer(
TimeUnits.valueOf(
string).ordinal()).doubleValue();
229 return new Integer(
DescriptionLoD.valueOf(
string).ordinal()).doubleValue();
Double fromString(String string)
ChronoUnit getChronoUnit()
FilteredEventsModel filteredEvents
FilteredEventsModel getEventsModel()
synchronized ReadOnlyObjectProperty< VisualizationMode > viewModeProperty()
Double fromString(String string)
synchronized ReadOnlyObjectProperty< EventTypeZoomLevel > eventTypeZoomProperty()
TimeLineController controller
synchronized boolean pushTimeRange(Interval timeRange)
static RangeDivisionInfo getRangeDivisionInfo(Interval timeRange)
String toString(Double object)
Double fromString(String string)
String toString(Double object)
static Interval getIntervalAround(DateTime aroundInstant, ReadablePeriod period)
ZoomSettingsPane(TimeLineController controller)
static TimeUnits fromChronoUnit(ChronoUnit chronoUnit)
synchronized void pushDescrLOD(DescriptionLoD newLOD)
String toString(Double object)
synchronized ReadOnlyObjectProperty< DescriptionLoD > descriptionLODProperty()
TimeUnits getPeriodSize()
static void construct(Node node, String fxmlFileName)
synchronized ReadOnlyObjectProperty< Interval > timeRangeProperty()
static DateTime middleOf(Interval interval)
synchronized void pushEventTypeZoom(EventTypeZoomLevel typeZoomeLevel)