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.event.ActionEvent;
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.netbeans.api.settings.ConvertAsProperties;
38 import org.openide.explorer.ExplorerManager;
39 import org.openide.explorer.ExplorerUtils;
40 import org.openide.util.NbBundle;
41 import org.openide.windows.Mode;
42 import org.openide.windows.TopComponent;
43 import static org.openide.windows.TopComponent.PROP_UNDOCKING_DISABLED;
44 import org.openide.windows.WindowManager;
62 dtd =
"-//org.sleuthkit.autopsy.timeline//TimeLine//EN",
64 @TopComponent.Description(
65 preferredID =
"TimeLineTopComponent",
67 persistenceType = TopComponent.PERSISTENCE_NEVER)
68 @TopComponent.Registration(mode =
"timeline", openAtStartup =
false)
77 private final ExplorerManager
em =
new ExplorerManager();
96 private final TabPane
tabPane =
new TabPane();
109 associateLookup(ExplorerUtils.createLookup(em, getActionMap()));
113 setIcon(WindowManager.getDefault().getMainWindow().getIconImage());
115 timeZonePanel.setText(NbBundle.getMessage(
this.getClass(),
"TimeLineTopComponent.timeZonePanel.text"));
126 dataResultPanel.
open();
128 Platform.runLater(() -> {
132 splitPane.setDividerPositions(0);
135 filterTab.setClosable(
false);
136 filterTab.setContent(filtersPanel);
137 filterTab.setGraphic(
new ImageView(
"org/sleuthkit/autopsy/timeline/images/funnel.png"));
139 eventsTab.setClosable(
false);
140 eventsTab.setContent(navPanel);
141 eventsTab.setGraphic(
new ImageView(
"org/sleuthkit/autopsy/timeline/images/timeline_marker.png"));
143 tabPane.getTabs().addAll(filterTab, eventsTab);
144 VBox.setVgrow(tabPane, Priority.ALWAYS);
146 VBox.setVgrow(timeZonePanel, Priority.SOMETIMES);
147 leftVBox.getChildren().addAll(timeZonePanel, zoomSettingsPane, tabPane);
149 SplitPane.setResizableWithParent(leftVBox, Boolean.FALSE);
150 splitPane.getItems().addAll(leftVBox, visualizationPanel);
159 Platform.runLater(() -> {
160 jFXVizPanel.getScene().addEventFilter(KeyEvent.KEY_PRESSED, (
162 if (new KeyCodeCombination(KeyCode.LEFT, KeyCodeCombination.ALT_DOWN).match(event)) {
163 new Back(controller).handle(new ActionEvent());
164 }
else if (
new KeyCodeCombination(KeyCode.BACK_SPACE).match(event)) {
165 new Back(controller).handle(
new ActionEvent());
166 }
else if (
new KeyCodeCombination(KeyCode.RIGHT, KeyCodeCombination.ALT_DOWN).match(event)) {
167 new Forward(controller).handle(
new ActionEvent());
168 }
else if (
new KeyCodeCombination(KeyCode.BACK_SPACE, KeyCodeCombination.SHIFT_DOWN).match(event)) {
169 new Forward(controller).handle(
new ActionEvent());
172 controller.
getViewMode().addListener((Observable observable) -> {
174 tabPane.getSelectionModel().select(filterTab);
188 return Collections.emptyList();
199 jFXstatusPanel =
new javafx.embed.swing.JFXPanel();
200 splitYPane =
new javax.swing.JSplitPane();
201 jFXVizPanel =
new javafx.embed.swing.JFXPanel();
202 lowerSplitXPane =
new javax.swing.JSplitPane();
203 resultContainerPanel =
new javax.swing.JPanel();
204 contentViewerContainerPanel =
new javax.swing.JPanel();
206 jFXstatusPanel.setPreferredSize(
new java.awt.Dimension(100, 16));
208 splitYPane.setDividerLocation(420);
209 splitYPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
210 splitYPane.setResizeWeight(0.9);
211 splitYPane.setPreferredSize(
new java.awt.Dimension(1024, 400));
212 splitYPane.setLeftComponent(jFXVizPanel);
214 lowerSplitXPane.setDividerLocation(600);
215 lowerSplitXPane.setResizeWeight(0.5);
216 lowerSplitXPane.setPreferredSize(
new java.awt.Dimension(1200, 300));
217 lowerSplitXPane.setRequestFocusEnabled(
false);
219 resultContainerPanel.setPreferredSize(
new java.awt.Dimension(700, 300));
220 resultContainerPanel.setLayout(
new java.awt.BorderLayout());
221 lowerSplitXPane.setLeftComponent(resultContainerPanel);
223 contentViewerContainerPanel.setPreferredSize(
new java.awt.Dimension(500, 300));
224 contentViewerContainerPanel.setLayout(
new java.awt.BorderLayout());
225 lowerSplitXPane.setRightComponent(contentViewerContainerPanel);
227 splitYPane.setRightComponent(lowerSplitXPane);
229 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
230 this.setLayout(layout);
231 layout.setHorizontalGroup(
232 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
233 .addComponent(splitYPane, javax.swing.GroupLayout.DEFAULT_SIZE, 972, Short.MAX_VALUE)
234 .addGroup(layout.createSequentialGroup()
236 .addComponent(jFXstatusPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
239 layout.setVerticalGroup(
240 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
241 .addGroup(layout.createSequentialGroup()
242 .addComponent(splitYPane, javax.swing.GroupLayout.DEFAULT_SIZE, 482, Short.MAX_VALUE)
244 .addComponent(jFXstatusPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))
259 WindowManager.getDefault().setTopComponentFloating(
this,
true);
261 putClientProperty(PROP_UNDOCKING_DISABLED,
true);
269 void writeProperties(java.util.Properties p) {
272 p.setProperty(
"version",
"1.0");
276 void readProperties(java.util.Properties p) {
277 String version = p.getProperty(
"version");
final StatusBar statusBar
void setController(TimeLineController controller)
javax.swing.JPanel contentViewerContainerPanel
synchronized void setController(TimeLineController controller)
final FilterSetPanel filtersPanel
static final Logger LOGGER
javafx.embed.swing.JFXPanel jFXVizPanel
synchronized void setController(TimeLineController controller)
TimeLineController controller
javafx.embed.swing.JFXPanel jFXstatusPanel
javax.swing.JPanel resultContainerPanel
javax.swing.JSplitPane lowerSplitXPane
final ZoomSettingsPane zoomSettingsPane
javax.swing.JSplitPane splitYPane
List< Mode > availableModes(List< Mode > modes)
final SplitPane splitPane
static DataContentPanel createInstance()
void setController(TimeLineController timeLineController)
final VisualizationPanel visualizationPanel
DataContentPanel dataContentPanel
DataResultPanel getDataResultPanel()
final TimeZonePanel timeZonePanel
synchronized void setController(TimeLineController controller)
void setController(TimeLineController controller)
ExplorerManager getExplorerManager()
synchronized void customizeComponents()
synchronized ReadOnlyObjectProperty< VisualizationMode > getViewMode()
void setController(TimeLineController controller)
static Logger getLogger(String name)