Autopsy 4.22.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
RejView.java
Go to the documentation of this file.
1/*
2 * Autopsy
3 *
4 * Copyright 2019 Basis Technology Corp.
5 * Contact: carrier <at> sleuthkit <dot> org
6 *
7 * Copyright 2013 Willi Ballenthin
8 * Contact: willi.ballenthin <at> gmail <dot> com
9 *
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
13 *
14 * http://www.apache.org/licenses/LICENSE-2.0
15 *
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
21 */
22package org.sleuthkit.autopsy.rejview;
23
24import com.williballenthin.rejistry.RegistryHive;
25import com.williballenthin.rejistry.RegistryHiveBuffer;
26import java.awt.Dimension;
27import java.awt.BorderLayout;
28import java.nio.ByteBuffer;
29import javax.swing.JPanel;
30import javax.swing.JSplitPane;
31
35public final class RejView extends JPanel implements RejTreeNodeSelectionListener {
36
37 private static final long serialVersionUID = 1L;
38 private final RegistryHive hive;
39 private final RejTreeView treeView;
40 private final JSplitPane splitPane;
41
47 public RejView(RegistryHive hive) {
48 super(new BorderLayout());
49 this.hive = hive;
50 // have to do these cause they're final
51 this.treeView = new RejTreeView(this.hive);
52 this.splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
53 this.treeView, new JPanel());
54 this.setupUI();
55 }
56
62 public RejView(ByteBuffer buf) {
63 super(new BorderLayout());
64 this.hive = new RegistryHiveBuffer(buf);
65
66 // have to do these cause they're final
67 this.treeView = new RejTreeView(this.hive);
68 this.splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
69 this.treeView, new JPanel());
70 this.setupUI();
71 }
72
76 private void setupUI() {
77 this.splitPane.setResizeWeight(0);
78 this.splitPane.setOneTouchExpandable(true);
79 this.splitPane.setContinuousLayout(true);
80 this.add(this.splitPane, BorderLayout.CENTER);
81 this.setPreferredSize(new Dimension(0, 0));
82 this.treeView.addRejTreeNodeSelectionListener(this);
83 }
84
90 @Override
92 RejTreeNodeView view = event.getNode().getView();
93 int curDividerLocation = this.splitPane.getDividerLocation();
94 this.splitPane.setRightComponent(view);
95 this.splitPane.setDividerLocation(curDividerLocation);
96 }
97}
void nodeSelected(RejTreeNodeSelectionEvent event)
Definition RejView.java:91

Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.