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
class AutopsyCaseListener implements PropertyChangeListener {
private class AutopsyCaseListener implements PropertyChangeListener {
@Override
public void propertyChange(PropertyChangeEvent evt) {

View File

@ -18,6 +18,7 @@
*/
package org.sleuthkit.autopsy.timeline.ui;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutionException;
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
* this visualization's header */
protected List<Node> getSettingsNodes() {
return settingsNodes;
return Collections.unmodifiableList(settingsNodes);
}
/** @param value a value along this visualization's x axis

View File

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

View File

@ -16,4 +16,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#this is the label for the vetical axis
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.Pane;
import javafx.scene.layout.Region;
import javax.swing.JOptionPane;
import org.controlsfx.control.action.ActionGroup;
import org.controlsfx.control.action.ActionUtils;
import org.joda.time.DateTime;
import org.joda.time.Interval;
import org.joda.time.Seconds;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.coreutils.ColorUtilities;
import org.sleuthkit.autopsy.coreutils.LoggedTask;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.timeline.FXMLConstructor;
import org.sleuthkit.autopsy.timeline.TimeLineController;
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.Forward;
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
if (interval.toDuration().isLongerThan(Seconds.ONE.toStandardDuration())) {
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
private RadioButton logRadio;
@FXML
private RadioButton sqrtRadio;
@FXML
private RadioButton linearRadio;
@ -474,15 +502,13 @@ public class CountsViewPane extends AbstractVisualization<String, Number, Node,
@FXML
void initialize() {
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'.";
logRadio.setSelected(true);
scaleGroup.selectedToggleProperty().addListener(observable -> {
if (scaleGroup.getSelectedToggle() == linearRadio) {
scale.set(ScaleType.LINEAR);
} else if (scaleGroup.getSelectedToggle() == sqrtRadio) {
scale.set(ScaleType.SQUARE_ROOT);
} else if (scaleGroup.getSelectedToggle() == logRadio) {
}
if (scaleGroup.getSelectedToggle() == logRadio) {
scale.set(ScaleType.LOGARITHMIC);
}
});
@ -496,7 +522,6 @@ public class CountsViewPane extends AbstractVisualization<String, Number, Node,
private static enum ScaleType {
LINEAR(t -> t.doubleValue()),
SQUARE_ROOT(t -> Math.sqrt(t)),
LOGARITHMIC(t -> Math.log10(t) + 1);
private final Function<Long, Double> func;

View File

@ -5,25 +5,24 @@
<?import javafx.scene.control.*?>
<?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">
<children><FlowPane alignment="CENTER_LEFT" hgap="5.0" prefWrapLength="250.0" vgap="5.0" HBox.hgrow="ALWAYS">
<children><Label minHeight="-Infinity" minWidth="-Infinity" text="Scale: ">
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</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>
<fx:root alignment="CENTER_LEFT" type="HBox" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<children>
<HBox alignment="CENTER_LEFT" spacing="5.0">
<children>
<Label minHeight="-Infinity" minWidth="-Infinity" text="Scale: ">
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin>
<FlowPane.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</FlowPane.margin></FlowPane>
</Label>
<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" />
</children>
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin></FlowPane>
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
</HBox.margin>
</HBox>
</children></fx:root>

View File

@ -38,6 +38,7 @@ import javafx.scene.chart.Axis;
import javafx.scene.chart.BarChart;
import javafx.scene.chart.XYChart;
import javafx.scene.control.CheckBox;
import javafx.scene.control.Label;
import javafx.scene.control.MultipleSelectionModel;
import javafx.scene.control.RadioButton;
import javafx.scene.control.ScrollBar;
@ -60,9 +61,9 @@ import javafx.scene.layout.Priority;
import javafx.scene.layout.Region;
import javafx.scene.layout.VBox;
import org.joda.time.DateTime;
import org.sleuthkit.autopsy.timeline.FXMLConstructor;
import org.sleuthkit.autopsy.coreutils.LoggedTask;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.timeline.FXMLConstructor;
import org.sleuthkit.autopsy.timeline.TimeLineController;
import org.sleuthkit.autopsy.timeline.events.AggregateEvent;
import org.sleuthkit.autopsy.timeline.events.FilteredEventsModel;
@ -391,6 +392,9 @@ public class DetailViewPane extends AbstractVisualization<DateTime, AggregateEve
@FXML
private Slider truncateWidthSlider;
@FXML
private Label truncateSliderLabel;
public DetailViewSettingsPane() {
FXMLConstructor.construct(this, "DetailViewSettingsPane.fxml");
}
@ -404,7 +408,7 @@ public class DetailViewPane extends AbstractVisualization<DateTime, AggregateEve
bandByTypeBox.selectedProperty().bindBidirectional(chart.getBandByType());
truncateAllBox.selectedProperty().bindBidirectional(chart.getTruncateAll());
oneEventPerRowBox.selectedProperty().bindBidirectional(chart.getOneEventPerRow());
truncateWidthSlider.disableProperty().bind(truncateAllBox.selectedProperty().not());
truncateSliderLabel.disableProperty().bind(truncateAllBox.selectedProperty().not());
final InvalidationListener sliderListener = o -> {
if (truncateWidthSlider.isValueChanging() == false) {
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">
<children>
<FlowPane alignment="CENTER_LEFT" hgap="5.0" prefHeight="-1.0" prefWidth="-1.0" prefWrapLength="220.0" vgap="5.0" HBox.hgrow="ALWAYS">
<children><Label text="Layout Options:" />
<HBox spacing="5.0">
<children>
<CheckBox fx:id="bandByTypeBox" mnemonicParsing="false" text="Band by Type" />
<CheckBox fx:id="oneEventPerRowBox" mnemonicParsing="false" text="One Event Per Row" />
</children>
<FlowPane.margin>
<MenuButton mnemonicParsing="false" text="Advanced Layout Options">
<items>
<CustomMenuItem hideOnClick="false" mnemonicParsing="false" text="Band by Type">
<content>
<CheckBox fx:id="bandByTypeBox" mnemonicParsing="false" text="Band by Type">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</FlowPane.margin>
</HBox>
</children>
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" />
</HBox.margin>
</FlowPane>
<Separator orientation="VERTICAL" prefHeight="-1.0" />
<FlowPane columnHalignment="CENTER" hgap="5.0" prefHeight="-1.0" prefWidth="-1.0" prefWrapLength="350.0" vgap="5.0" HBox.hgrow="ALWAYS">
<children>
<CheckBox fx:id="truncateAllBox" mnemonicParsing="false" text="Truncate Descriptions to (px):" />
<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">
<FlowPane.margin>
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
</FlowPane.margin></Slider>
</children>
</FlowPane>
<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">
<children><Label text="Description Visbility:" />
<HBox spacing="5.0">
<children><RadioButton fx:id="showRadio" mnemonicParsing="false" selected="true" text="Show">
</padding></CheckBox>
</content>
</CustomMenuItem>
<CustomMenuItem hideOnClick="false" mnemonicParsing="false" text="One Event Per Row">
<content>
<CheckBox fx:id="oneEventPerRowBox" mnemonicParsing="false" text="One Event Per Row">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding></CheckBox>
</content>
</CustomMenuItem>
<SeparatorMenuItem mnemonicParsing="false" />
<CustomMenuItem hideOnClick="false" mnemonicParsing="false" text="Truncate Descriptions ">
<content>
<CheckBox fx:id="truncateAllBox" mnemonicParsing="false" text="Truncate Descriptions ">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding></CheckBox>
</content>
</CustomMenuItem>
<CustomMenuItem hideOnClick="false" mnemonicParsing="false" text="max description width (px)">
<content>
<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 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" />
</children>
<FlowPane.margin>
</toggleGroup>
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</FlowPane.margin>
</HBox>
</children>
<HBox.margin>
<Insets />
</HBox.margin></FlowPane>
</padding>
</RadioButton>
</content>
</CustomMenuItem>
<CustomMenuItem hideOnClick="false" mnemonicParsing="false" text="Show Counts Only">
<content>
<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>
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />

View File

@ -178,7 +178,7 @@ public class ZoomSettingsPane extends TitledPane implements TimeLineView {
slider.valueProperty().removeListener(sliderListener);
slider.valueChangingProperty().removeListener(sliderListener);
driverChangHandler.run();
Platform.runLater(driverChangHandler);
slider.valueProperty().addListener(sliderListener);
slider.valueChangingProperty().addListener(sliderListener);