Merge pull request #910 from millmanorama/timeline-3.1.1_fixes

Timeline 3.1.1 fixes
This commit is contained in:
Richard Cordovano 2014-10-22 14:35:52 -04:00
commit 7e21ecc865
9 changed files with 172 additions and 103 deletions

View File

@ -670,7 +670,7 @@ public class TimeLineController {
} }
@Immutable @Immutable
class AutopsyCaseListener implements PropertyChangeListener { private class AutopsyCaseListener implements PropertyChangeListener {
@Override @Override
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {

View File

@ -18,6 +18,7 @@
*/ */
package org.sleuthkit.autopsy.timeline.ui; package org.sleuthkit.autopsy.timeline.ui;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import javafx.beans.InvalidationListener; import javafx.beans.InvalidationListener;
@ -102,7 +103,7 @@ public abstract class AbstractVisualization<X, Y, N extends Node, C extends XYCh
/** @return the list of nodes containing settings widgets to insert into /** @return the list of nodes containing settings widgets to insert into
* this visualization's header */ * this visualization's header */
protected List<Node> getSettingsNodes() { protected List<Node> getSettingsNodes() {
return settingsNodes; return Collections.unmodifiableList(settingsNodes);
} }
/** @param value a value along this visualization's x axis /** @param value a value along this visualization's x axis

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.text.*?>
<?import java.lang.*?> <?import java.lang.*?>
<?import javafx.geometry.*?> <?import javafx.geometry.*?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
@ -14,10 +15,13 @@
<items> <items>
<HBox alignment="CENTER" BorderPane.alignment="CENTER"> <HBox alignment="CENTER" BorderPane.alignment="CENTER">
<children> <children>
<Label text="Mode:"> <Label text="Visualization Mode:">
<HBox.margin> <HBox.margin>
<Insets right="5.0" /> <Insets right="5.0" />
</HBox.margin> </HBox.margin>
<font>
<Font name="System Bold" size="14.0" />
</font>
</Label> </Label>
<org.controlsfx.control.SegmentedButton maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity"> <org.controlsfx.control.SegmentedButton maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity">
@ -30,6 +34,9 @@
</image> </image>
</ImageView> </ImageView>
</graphic> </graphic>
<font>
<Font name="System Bold" size="16.0" />
</font>
</ToggleButton> </ToggleButton>
<ToggleButton fx:id="detailsToggle" alignment="CENTER_RIGHT" layoutX="74.0" mnemonicParsing="false" selected="false" text="Details"> <ToggleButton fx:id="detailsToggle" alignment="CENTER_RIGHT" layoutX="74.0" mnemonicParsing="false" selected="false" text="Details">
<graphic> <graphic>
@ -39,6 +46,9 @@
</image> </image>
</ImageView> </ImageView>
</graphic> </graphic>
<font>
<Font name="System Bold" size="16.0" />
</font>
</ToggleButton> </ToggleButton>
</buttons> </buttons>

View File

@ -16,4 +16,9 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#this is the label for the vetical axis
CountsChartPane.numberOfEvents=Number of Events CountsChartPane.numberOfEvents=Number of Events
#this is the message shown in the dialog when the user double clicks a bar at seconds resolution
CountsViewPane.detailSwitchMessage=There is no temporal resolution smaller than Seconds.\nWould you like to switch to the Details view instead?
#this is the title shown in the dialog when the user double clicks a bar at seconds resolution
CountsViewPane.detailSwitchTitle="Switch to Details View?

View File

@ -53,17 +53,20 @@ import javafx.scene.input.MouseEvent;
import javafx.scene.layout.HBox; import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane; import javafx.scene.layout.Pane;
import javafx.scene.layout.Region; import javafx.scene.layout.Region;
import javax.swing.JOptionPane;
import org.controlsfx.control.action.ActionGroup; import org.controlsfx.control.action.ActionGroup;
import org.controlsfx.control.action.ActionUtils; import org.controlsfx.control.action.ActionUtils;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.joda.time.Interval; import org.joda.time.Interval;
import org.joda.time.Seconds; import org.joda.time.Seconds;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.coreutils.ColorUtilities; import org.sleuthkit.autopsy.coreutils.ColorUtilities;
import org.sleuthkit.autopsy.coreutils.LoggedTask; import org.sleuthkit.autopsy.coreutils.LoggedTask;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.timeline.FXMLConstructor; import org.sleuthkit.autopsy.timeline.FXMLConstructor;
import org.sleuthkit.autopsy.timeline.TimeLineController; import org.sleuthkit.autopsy.timeline.TimeLineController;
import org.sleuthkit.autopsy.timeline.TimeLineView; import org.sleuthkit.autopsy.timeline.TimeLineView;
import org.sleuthkit.autopsy.timeline.VisualizationMode;
import org.sleuthkit.autopsy.timeline.actions.Back; import org.sleuthkit.autopsy.timeline.actions.Back;
import org.sleuthkit.autopsy.timeline.actions.Forward; import org.sleuthkit.autopsy.timeline.actions.Forward;
import org.sleuthkit.autopsy.timeline.events.FilteredEventsModel; import org.sleuthkit.autopsy.timeline.events.FilteredEventsModel;
@ -451,20 +454,45 @@ public class CountsViewPane extends AbstractVisualization<String, Number, Node,
} else if (e.getClickCount() >= 2) { //double-click => zoom in time } else if (e.getClickCount() >= 2) { //double-click => zoom in time
if (interval.toDuration().isLongerThan(Seconds.ONE.toStandardDuration())) { if (interval.toDuration().isLongerThan(Seconds.ONE.toStandardDuration())) {
controller.pushTimeRange(interval); controller.pushTimeRange(interval);
} else {
int showConfirmDialog = JOptionPane.showConfirmDialog(null,
NbBundle.getMessage(CountsViewPane.class, "CountsViewPane.detailSwitchMessage"),
NbBundle.getMessage(CountsViewPane.class, "CountsViewPane.detailSwitchTitle"), JOptionPane.YES_NO_OPTION);
if (showConfirmDialog == JOptionPane.YES_OPTION) {
controller.setViewMode(VisualizationMode.DETAIL);
}
/* //I would like to use the JAvafx dialog, but it doesn't
* block the ui (because it is embeded in a TopComponent)
* -jm
*
* final Dialogs.CommandLink yes = new
* Dialogs.CommandLink("Yes", "switch to Details view");
* final Dialogs.CommandLink no = new
* Dialogs.CommandLink("No", "return to Counts view with a
* resolution of Seconds");
* Action choice = Dialogs.create()
* .title("Switch to Details View?")
* .masthead("There is no temporal resolution smaller than
* Seconds.")
* .message("Would you like to switch to the Details view
* instead?")
* .showCommandLinks(Arrays.asList(yes, no));
*
* if (choice == yes) {
* controller.setViewMode(VisualizationMode.DETAIL);
* } */
} }
} }
} }
} }
class CountsViewSettingsPane extends HBox { private class CountsViewSettingsPane extends HBox {
@FXML @FXML
private RadioButton logRadio; private RadioButton logRadio;
@FXML
private RadioButton sqrtRadio;
@FXML @FXML
private RadioButton linearRadio; private RadioButton linearRadio;
@ -474,15 +502,13 @@ public class CountsViewPane extends AbstractVisualization<String, Number, Node,
@FXML @FXML
void initialize() { void initialize() {
assert logRadio != null : "fx:id=\"logRadio\" was not injected: check your FXML file 'CountsViewSettingsPane.fxml'."; assert logRadio != null : "fx:id=\"logRadio\" was not injected: check your FXML file 'CountsViewSettingsPane.fxml'.";
assert sqrtRadio != null : "fx:id=\"sqrtRadio\" was not injected: check your FXML file 'CountsViewSettingsPane.fxml'.";
assert linearRadio != null : "fx:id=\"linearRadio\" was not injected: check your FXML file 'CountsViewSettingsPane.fxml'."; assert linearRadio != null : "fx:id=\"linearRadio\" was not injected: check your FXML file 'CountsViewSettingsPane.fxml'.";
logRadio.setSelected(true); logRadio.setSelected(true);
scaleGroup.selectedToggleProperty().addListener(observable -> { scaleGroup.selectedToggleProperty().addListener(observable -> {
if (scaleGroup.getSelectedToggle() == linearRadio) { if (scaleGroup.getSelectedToggle() == linearRadio) {
scale.set(ScaleType.LINEAR); scale.set(ScaleType.LINEAR);
} else if (scaleGroup.getSelectedToggle() == sqrtRadio) { }
scale.set(ScaleType.SQUARE_ROOT); if (scaleGroup.getSelectedToggle() == logRadio) {
} else if (scaleGroup.getSelectedToggle() == logRadio) {
scale.set(ScaleType.LOGARITHMIC); scale.set(ScaleType.LOGARITHMIC);
} }
}); });
@ -496,7 +522,6 @@ public class CountsViewPane extends AbstractVisualization<String, Number, Node,
private static enum ScaleType { private static enum ScaleType {
LINEAR(t -> t.doubleValue()), LINEAR(t -> t.doubleValue()),
SQUARE_ROOT(t -> Math.sqrt(t)),
LOGARITHMIC(t -> Math.log10(t) + 1); LOGARITHMIC(t -> Math.log10(t) + 1);
private final Function<Long, Double> func; private final Function<Long, Double> func;

View File

@ -5,25 +5,24 @@
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<fx:root alignment="CENTER_LEFT" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" type="HBox" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"> <fx:root alignment="CENTER_LEFT" type="HBox" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<children><FlowPane alignment="CENTER_LEFT" hgap="5.0" prefWrapLength="250.0" vgap="5.0" HBox.hgrow="ALWAYS"> <children>
<children><Label minHeight="-Infinity" minWidth="-Infinity" text="Scale: "> <HBox alignment="CENTER_LEFT" spacing="5.0">
<HBox.margin> <children>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <Label minHeight="-Infinity" minWidth="-Infinity" text="Scale: ">
</HBox.margin></Label><FlowPane alignment="CENTER_LEFT" hgap="5.0" prefWrapLength="250.0" vgap="5.0">
<children><RadioButton fx:id="logRadio" mnemonicParsing="false" selected="true" text="Logarithmic">
<toggleGroup>
<ToggleGroup fx:id="scaleGroup" />
</toggleGroup></RadioButton><RadioButton fx:id="linearRadio" mnemonicParsing="false" text="Linear" toggleGroup="$scaleGroup" /><RadioButton fx:id="sqrtRadio" mnemonicParsing="false" text="Square Root" toggleGroup="$scaleGroup" />
</children>
<HBox.margin> <HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin> </HBox.margin>
<FlowPane.margin> </Label>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <RadioButton fx:id="logRadio" mnemonicParsing="false" selected="true" text="Logarithmic">
</FlowPane.margin></FlowPane> <toggleGroup>
</children> <ToggleGroup fx:id="scaleGroup" />
<HBox.margin> </toggleGroup>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> </RadioButton>
</HBox.margin></FlowPane> <RadioButton fx:id="linearRadio" mnemonicParsing="false" text="Linear" toggleGroup="$scaleGroup" />
</children>
<HBox.margin>
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
</HBox.margin>
</HBox>
</children></fx:root> </children></fx:root>

View File

@ -38,6 +38,7 @@ import javafx.scene.chart.Axis;
import javafx.scene.chart.BarChart; import javafx.scene.chart.BarChart;
import javafx.scene.chart.XYChart; import javafx.scene.chart.XYChart;
import javafx.scene.control.CheckBox; import javafx.scene.control.CheckBox;
import javafx.scene.control.Label;
import javafx.scene.control.MultipleSelectionModel; import javafx.scene.control.MultipleSelectionModel;
import javafx.scene.control.RadioButton; import javafx.scene.control.RadioButton;
import javafx.scene.control.ScrollBar; import javafx.scene.control.ScrollBar;
@ -60,9 +61,9 @@ import javafx.scene.layout.Priority;
import javafx.scene.layout.Region; import javafx.scene.layout.Region;
import javafx.scene.layout.VBox; import javafx.scene.layout.VBox;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.sleuthkit.autopsy.timeline.FXMLConstructor;
import org.sleuthkit.autopsy.coreutils.LoggedTask; import org.sleuthkit.autopsy.coreutils.LoggedTask;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.timeline.FXMLConstructor;
import org.sleuthkit.autopsy.timeline.TimeLineController; import org.sleuthkit.autopsy.timeline.TimeLineController;
import org.sleuthkit.autopsy.timeline.events.AggregateEvent; import org.sleuthkit.autopsy.timeline.events.AggregateEvent;
import org.sleuthkit.autopsy.timeline.events.FilteredEventsModel; import org.sleuthkit.autopsy.timeline.events.FilteredEventsModel;
@ -391,6 +392,9 @@ public class DetailViewPane extends AbstractVisualization<DateTime, AggregateEve
@FXML @FXML
private Slider truncateWidthSlider; private Slider truncateWidthSlider;
@FXML
private Label truncateSliderLabel;
public DetailViewSettingsPane() { public DetailViewSettingsPane() {
FXMLConstructor.construct(this, "DetailViewSettingsPane.fxml"); FXMLConstructor.construct(this, "DetailViewSettingsPane.fxml");
} }
@ -404,7 +408,7 @@ public class DetailViewPane extends AbstractVisualization<DateTime, AggregateEve
bandByTypeBox.selectedProperty().bindBidirectional(chart.getBandByType()); bandByTypeBox.selectedProperty().bindBidirectional(chart.getBandByType());
truncateAllBox.selectedProperty().bindBidirectional(chart.getTruncateAll()); truncateAllBox.selectedProperty().bindBidirectional(chart.getTruncateAll());
oneEventPerRowBox.selectedProperty().bindBidirectional(chart.getOneEventPerRow()); oneEventPerRowBox.selectedProperty().bindBidirectional(chart.getOneEventPerRow());
truncateWidthSlider.disableProperty().bind(truncateAllBox.selectedProperty().not()); truncateSliderLabel.disableProperty().bind(truncateAllBox.selectedProperty().not());
final InvalidationListener sliderListener = o -> { final InvalidationListener sliderListener = o -> {
if (truncateWidthSlider.isValueChanging() == false) { if (truncateWidthSlider.isValueChanging() == false) {
chart.getTruncateWidth().set(truncateWidthSlider.getValue()); chart.getTruncateWidth().set(truncateWidthSlider.getValue());

View File

@ -7,48 +7,73 @@
<fx:root alignment="CENTER_LEFT" spacing="5.0" type="javafx.scene.layout.HBox" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"> <fx:root alignment="CENTER_LEFT" spacing="5.0" type="javafx.scene.layout.HBox" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<children> <children>
<FlowPane alignment="CENTER_LEFT" hgap="5.0" prefHeight="-1.0" prefWidth="-1.0" prefWrapLength="220.0" vgap="5.0" HBox.hgrow="ALWAYS"> <MenuButton mnemonicParsing="false" text="Advanced Layout Options">
<children><Label text="Layout Options:" /> <items>
<HBox spacing="5.0"> <CustomMenuItem hideOnClick="false" mnemonicParsing="false" text="Band by Type">
<children> <content>
<CheckBox fx:id="bandByTypeBox" mnemonicParsing="false" text="Band by Type" /> <CheckBox fx:id="bandByTypeBox" mnemonicParsing="false" text="Band by Type">
<CheckBox fx:id="oneEventPerRowBox" mnemonicParsing="false" text="One Event Per Row" /> <padding>
</children> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
<FlowPane.margin> </padding></CheckBox>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> </content>
</FlowPane.margin> </CustomMenuItem>
</HBox> <CustomMenuItem hideOnClick="false" mnemonicParsing="false" text="One Event Per Row">
</children> <content>
<HBox.margin> <CheckBox fx:id="oneEventPerRowBox" mnemonicParsing="false" text="One Event Per Row">
<Insets bottom="5.0" left="5.0" right="5.0" /> <padding>
</HBox.margin> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</FlowPane> </padding></CheckBox>
<Separator orientation="VERTICAL" prefHeight="-1.0" /> </content>
<FlowPane columnHalignment="CENTER" hgap="5.0" prefHeight="-1.0" prefWidth="-1.0" prefWrapLength="350.0" vgap="5.0" HBox.hgrow="ALWAYS"> </CustomMenuItem>
<children> <SeparatorMenuItem mnemonicParsing="false" />
<CheckBox fx:id="truncateAllBox" mnemonicParsing="false" text="Truncate Descriptions to (px):" /> <CustomMenuItem hideOnClick="false" mnemonicParsing="false" text="Truncate Descriptions ">
<Slider id="truncateAllSlider" fx:id="truncateWidthSlider" blockIncrement="50.0" disable="false" majorTickUnit="150.0" max="500.0" min="50.0" minorTickCount="0" prefHeight="33.0" prefWidth="146.0" showTickLabels="true" showTickMarks="false" value="200.0"> <content>
<FlowPane.margin> <CheckBox fx:id="truncateAllBox" mnemonicParsing="false" text="Truncate Descriptions ">
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" /> <padding>
</FlowPane.margin></Slider> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</children> </padding></CheckBox>
</FlowPane> </content>
<Separator orientation="VERTICAL" prefHeight="-1.0" /><FlowPane alignment="CENTER_LEFT" hgap="5.0" minHeight="-Infinity" minWidth="-Infinity" prefWrapLength="200.0" vgap="5.0" HBox.hgrow="ALWAYS"> </CustomMenuItem>
<children><Label text="Description Visbility:" /> <CustomMenuItem hideOnClick="false" mnemonicParsing="false" text="max description width (px)">
<HBox spacing="5.0"> <content>
<children><RadioButton fx:id="showRadio" mnemonicParsing="false" selected="true" text="Show"> <Label fx:id="truncateSliderLabel" contentDisplay="BOTTOM" text="max description width (px):">
<graphic>
<Slider id="truncateAllSlider" fx:id="truncateWidthSlider" blockIncrement="50.0" disable="false" majorTickUnit="150.0" max="500.0" min="50.0" minorTickCount="0" prefHeight="33.0" prefWidth="150.0" showTickLabels="true" showTickMarks="false" value="200.0" />
</graphic>
</Label>
</content>
</CustomMenuItem>
<SeparatorMenuItem mnemonicParsing="false" text="Description Visibility" />
<CustomMenuItem hideOnClick="false" mnemonicParsing="false" text="Show Full Description">
<content>
<RadioButton fx:id="showRadio" mnemonicParsing="false" selected="true" text="Show Full Description">
<toggleGroup> <toggleGroup>
<ToggleGroup fx:id="descrVisibility" /> <ToggleGroup fx:id="descrVisibility" />
</toggleGroup></RadioButton><RadioButton fx:id="countsRadio" mnemonicParsing="false" text="Counts Only" toggleGroup="$descrVisibility" /><RadioButton fx:id="hiddenRadio" mnemonicParsing="false" text="Hide" toggleGroup="$descrVisibility" /> </toggleGroup>
</children> <padding>
<FlowPane.margin> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> </padding>
</FlowPane.margin> </RadioButton>
</HBox> </content>
</children> </CustomMenuItem>
<HBox.margin> <CustomMenuItem hideOnClick="false" mnemonicParsing="false" text="Show Counts Only">
<Insets /> <content>
</HBox.margin></FlowPane> <RadioButton fx:id="countsRadio" mnemonicParsing="false" text="Show Counts Only" toggleGroup="$descrVisibility">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding></RadioButton>
</content>
</CustomMenuItem>
<CustomMenuItem hideOnClick="false" mnemonicParsing="false" text="Hide Description">
<content>
<RadioButton fx:id="hiddenRadio" mnemonicParsing="false" text="Hide Description" toggleGroup="$descrVisibility">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding></RadioButton>
</content>
</CustomMenuItem>
</items>
</MenuButton>
</children> </children>
<padding> <padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />

View File

@ -111,40 +111,40 @@ public class ZoomSettingsPane extends TitledPane implements TimeLineView {
this.filteredEvents = filteredEvents; this.filteredEvents = filteredEvents;
initializeSlider(timeUnitSlider, initializeSlider(timeUnitSlider,
() -> { () -> {
TimeUnits requestedUnit = TimeUnits.values()[new Double(timeUnitSlider.getValue()).intValue()]; TimeUnits requestedUnit = TimeUnits.values()[new Double(timeUnitSlider.getValue()).intValue()];
if (requestedUnit == TimeUnits.FOREVER) { if (requestedUnit == TimeUnits.FOREVER) {
controller.showFullRange(); controller.showFullRange();
} else { } else {
controller.pushTimeRange(IntervalUtils.getIntervalAround(IntervalUtils.middleOf(ZoomSettingsPane.this.filteredEvents.timeRange().get()), requestedUnit.getPeriod())); controller.pushTimeRange(IntervalUtils.getIntervalAround(IntervalUtils.middleOf(ZoomSettingsPane.this.filteredEvents.timeRange().get()), requestedUnit.getPeriod()));
} }
}, },
this.filteredEvents.timeRange(), this.filteredEvents.timeRange(),
() -> { () -> {
RangeDivisionInfo rangeInfo = RangeDivisionInfo.getRangeDivisionInfo(this.filteredEvents.timeRange().get()); RangeDivisionInfo rangeInfo = RangeDivisionInfo.getRangeDivisionInfo(this.filteredEvents.timeRange().get());
ChronoUnit chronoUnit = rangeInfo.getPeriodSize().getChronoUnit(); ChronoUnit chronoUnit = rangeInfo.getPeriodSize().getChronoUnit();
timeUnitSlider.setValue(TimeUnits.fromChronoUnit(chronoUnit).ordinal() - 1); timeUnitSlider.setValue(TimeUnits.fromChronoUnit(chronoUnit).ordinal() - 1);
}); });
initializeSlider(descrLODSlider, initializeSlider(descrLODSlider,
() -> { () -> {
DescriptionLOD newLOD = DescriptionLOD.values()[Math.round(descrLODSlider.valueProperty().floatValue())]; DescriptionLOD newLOD = DescriptionLOD.values()[Math.round(descrLODSlider.valueProperty().floatValue())];
controller.pushDescrLOD(newLOD); controller.pushDescrLOD(newLOD);
}, this.filteredEvents.descriptionLOD(), }, this.filteredEvents.descriptionLOD(),
() -> { () -> {
descrLODSlider.setValue(this.filteredEvents.descriptionLOD().get().ordinal()); descrLODSlider.setValue(this.filteredEvents.descriptionLOD().get().ordinal());
}); });
initializeSlider(typeZoomSlider, initializeSlider(typeZoomSlider,
() -> { () -> {
EventTypeZoomLevel newZoomLevel = EventTypeZoomLevel.values()[Math.round(typeZoomSlider.valueProperty().floatValue())]; EventTypeZoomLevel newZoomLevel = EventTypeZoomLevel.values()[Math.round(typeZoomSlider.valueProperty().floatValue())];
controller.pushEventTypeZoom(newZoomLevel); controller.pushEventTypeZoom(newZoomLevel);
}, },
this.filteredEvents.eventTypeZoom(), this.filteredEvents.eventTypeZoom(),
() -> { () -> {
typeZoomSlider.setValue(this.filteredEvents.eventTypeZoom().get().ordinal()); typeZoomSlider.setValue(this.filteredEvents.eventTypeZoom().get().ordinal());
}); });
} }
/** /**
@ -178,7 +178,7 @@ public class ZoomSettingsPane extends TitledPane implements TimeLineView {
slider.valueProperty().removeListener(sliderListener); slider.valueProperty().removeListener(sliderListener);
slider.valueChangingProperty().removeListener(sliderListener); slider.valueChangingProperty().removeListener(sliderListener);
driverChangHandler.run(); Platform.runLater(driverChangHandler);
slider.valueProperty().addListener(sliderListener); slider.valueProperty().addListener(sliderListener);
slider.valueChangingProperty().addListener(sliderListener); slider.valueChangingProperty().addListener(sliderListener);