19 package org.sleuthkit.autopsy.timeline;
21 import java.awt.BorderLayout;
22 import java.util.Collections;
23 import java.util.List;
24 import javafx.application.Platform;
25 import javafx.beans.Observable;
26 import javafx.embed.swing.JFXPanel;
27 import javafx.scene.Scene;
28 import javafx.scene.control.SplitPane;
29 import javafx.scene.control.Tab;
30 import javafx.scene.control.TabPane;
31 import javafx.scene.image.ImageView;
32 import javafx.scene.input.KeyCode;
33 import javafx.scene.input.KeyCodeCombination;
34 import javafx.scene.input.KeyEvent;
35 import javafx.scene.layout.Priority;
36 import javafx.scene.layout.VBox;
37 import org.openide.explorer.ExplorerManager;
38 import org.openide.explorer.ExplorerUtils;
39 import org.openide.util.NbBundle;
40 import org.openide.windows.Mode;
41 import org.openide.windows.TopComponent;
42 import static org.openide.windows.TopComponent.PROP_UNDOCKING_DISABLED;
43 import org.openide.windows.WindowManager;
60 @TopComponent.Description(
61 preferredID =
"TimeLineTopComponent",
63 persistenceType = TopComponent.PERSISTENCE_NEVER)
64 @TopComponent.Registration(mode =
"timeline", openAtStartup =
false)
73 private final ExplorerManager
em =
new ExplorerManager();
80 associateLookup(ExplorerUtils.createLookup(em, getActionMap()));
84 setIcon(WindowManager.getDefault().getMainWindow().getIconImage());
91 dataResultPanel.
open();
92 customizeFXComponents();
95 @NbBundle.Messages({
"TimeLineTopComponent.eventsTab.name=Events",
96 "TimeLineTopComponent.filterTab.name=Filters"})
97 void customizeFXComponents() {
98 Platform.runLater(() -> {
101 final Tab filterTab =
new Tab(Bundle.TimeLineTopComponent_filterTab_name(),
new FilterSetPanel(controller));
102 filterTab.setClosable(
false);
103 filterTab.setGraphic(
new ImageView(
"org/sleuthkit/autopsy/timeline/images/funnel.png"));
105 final EventsTree eventsTree =
new EventsTree(controller);
106 final VisualizationPanel visualizationPanel =
new VisualizationPanel(controller, eventsTree);
107 final Tab eventsTreeTab =
new Tab(Bundle.TimeLineTopComponent_eventsTab_name(), eventsTree);
108 eventsTreeTab.setClosable(
false);
109 eventsTreeTab.setGraphic(
new ImageView(
"org/sleuthkit/autopsy/timeline/images/timeline_marker.png"));
110 eventsTreeTab.disableProperty().bind(controller.
viewModeProperty().isEqualTo(VisualizationMode.COUNTS));
112 final TabPane leftTabPane =
new TabPane(filterTab, eventsTreeTab);
113 VBox.setVgrow(leftTabPane, Priority.ALWAYS);
117 leftTabPane.getSelectionModel().select(filterTab);
121 final TimeZonePanel timeZonePanel =
new TimeZonePanel();
122 VBox.setVgrow(timeZonePanel, Priority.SOMETIMES);
124 final ZoomSettingsPane zoomSettingsPane =
new ZoomSettingsPane(controller);
126 final VBox leftVBox =
new VBox(5, timeZonePanel, zoomSettingsPane, leftTabPane);
127 SplitPane.setResizableWithParent(leftVBox, Boolean.FALSE);
129 final SplitPane mainSplitPane =
new SplitPane(leftVBox, visualizationPanel);
130 mainSplitPane.setDividerPositions(0);
132 final Scene scene =
new Scene(mainSplitPane);
133 scene.addEventFilter(KeyEvent.KEY_PRESSED,
134 (KeyEvent event) -> {
135 if (new KeyCodeCombination(KeyCode.LEFT, KeyCodeCombination.ALT_DOWN).match(event)) {
136 new Back(controller).handle(null);
137 }
else if (
new KeyCodeCombination(KeyCode.BACK_SPACE).match(event)) {
138 new Back(controller).handle(null);
139 }
else if (
new KeyCodeCombination(KeyCode.RIGHT, KeyCodeCombination.ALT_DOWN).match(event)) {
140 new Forward(controller).handle(null);
141 }
else if (
new KeyCodeCombination(KeyCode.BACK_SPACE, KeyCodeCombination.SHIFT_DOWN).match(event)) {
142 new Forward(controller).handle(null);
155 return Collections.emptyList();
166 jFXstatusPanel =
new JFXPanel();
167 splitYPane =
new javax.swing.JSplitPane();
168 jFXVizPanel =
new JFXPanel();
169 lowerSplitXPane =
new javax.swing.JSplitPane();
170 resultContainerPanel =
new javax.swing.JPanel();
171 contentViewerContainerPanel =
new javax.swing.JPanel();
173 jFXstatusPanel.setPreferredSize(
new java.awt.Dimension(100, 16));
175 splitYPane.setDividerLocation(420);
176 splitYPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
177 splitYPane.setResizeWeight(0.9);
178 splitYPane.setPreferredSize(
new java.awt.Dimension(1024, 400));
179 splitYPane.setLeftComponent(jFXVizPanel);
181 lowerSplitXPane.setDividerLocation(600);
182 lowerSplitXPane.setResizeWeight(0.5);
183 lowerSplitXPane.setPreferredSize(
new java.awt.Dimension(1200, 300));
184 lowerSplitXPane.setRequestFocusEnabled(
false);
186 resultContainerPanel.setPreferredSize(
new java.awt.Dimension(700, 300));
187 resultContainerPanel.setLayout(
new java.awt.BorderLayout());
188 lowerSplitXPane.setLeftComponent(resultContainerPanel);
190 contentViewerContainerPanel.setPreferredSize(
new java.awt.Dimension(500, 300));
191 contentViewerContainerPanel.setLayout(
new java.awt.BorderLayout());
192 lowerSplitXPane.setRightComponent(contentViewerContainerPanel);
194 splitYPane.setRightComponent(lowerSplitXPane);
196 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
197 this.setLayout(layout);
198 layout.setHorizontalGroup(
199 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
200 .addComponent(splitYPane, javax.swing.GroupLayout.DEFAULT_SIZE, 972, Short.MAX_VALUE)
201 .addGroup(layout.createSequentialGroup()
203 .addComponent(jFXstatusPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
206 layout.setVerticalGroup(
207 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
208 .addGroup(layout.createSequentialGroup()
209 .addComponent(splitYPane, javax.swing.GroupLayout.DEFAULT_SIZE, 482, Short.MAX_VALUE)
211 .addComponent(jFXstatusPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))
226 WindowManager.getDefault().setTopComponentFloating(
this,
true);
227 putClientProperty(PROP_UNDOCKING_DISABLED,
true);
235 void writeProperties(java.util.Properties p) {
238 p.setProperty(
"version",
"1.0");
242 void readProperties(java.util.Properties p) {
243 String version = p.getProperty(
"version");
TimeLineTopComponent(TimeLineController controller)
synchronized ReadOnlyObjectProperty< VisualizationMode > viewModeProperty()
javax.swing.JPanel contentViewerContainerPanel
static final Logger LOGGER
javafx.embed.swing.JFXPanel jFXVizPanel
final TimeLineController controller
javafx.embed.swing.JFXPanel jFXstatusPanel
javax.swing.JPanel resultContainerPanel
javax.swing.JSplitPane lowerSplitXPane
final TimeLineResultView tlrv
javax.swing.JSplitPane splitYPane
List< Mode > availableModes(List< Mode > modes)
static DataContentPanel createInstance()
final DataContentPanel dataContentPanel
DataResultPanel getDataResultPanel()
ExplorerManager getExplorerManager()
synchronized static Logger getLogger(String name)