19 package org.sleuthkit.autopsy.directorytree;
21 import org.openide.util.NbBundle;
23 import java.awt.Toolkit;
24 import java.awt.Dimension;
26 import java.awt.event.ActionEvent;
27 import java.awt.event.ActionListener;
28 import java.util.ArrayList;
29 import java.util.Arrays;
30 import java.util.Collections;
31 import java.util.List;
32 import java.util.logging.Level;
33 import javax.swing.AbstractAction;
34 import javax.swing.Action;
35 import javax.swing.JDialog;
36 import javax.swing.JFrame;
37 import javax.swing.JLabel;
38 import javax.swing.JTable;
39 import javax.swing.table.DefaultTableModel;
57 List<Action> actions =
new ArrayList<>();
59 actions.addAll(c.
accept(instance));
84 List<Action> lst =
new ArrayList<>();
86 NbBundle.getMessage(
this.getClass(),
"ExplorerNodeActionVisitor.action.imgDetails.title"), img));
88 lst.add(
new ExtractUnallocAction(
89 NbBundle.getMessage(
this.getClass(),
"ExplorerNodeActionVisitor.action.extUnallocToSingleFiles"), img));
96 NbBundle.getMessage(
this.getClass(),
"ExplorerNodeActionVisitor.action.fileSystemDetails.title"), fs));
101 List<AbstractAction> lst =
new ArrayList<>();
103 NbBundle.getMessage(
this.getClass(),
"ExplorerNodeActionVisitor.action.volumeDetails.title"), vol));
104 lst.add(
new ExtractUnallocAction(
105 NbBundle.getMessage(
this.getClass(),
"ExplorerNodeActionVisitor.action.extUnallocToSingleFile"), vol));
111 List<Action> actions =
new ArrayList<>();
119 List<Action> actions =
new ArrayList<>();
127 List<Action> actions =
new ArrayList<>();
136 List<Action> actions =
new ArrayList<>();
145 List<Action> actions =
new ArrayList<>();
154 return Collections.<Action>emptyList();
174 final JFrame frame =
new JFrame(title);
175 final JDialog popUpWindow =
new JDialog(frame, title,
true);
177 Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
180 popUpWindow.setSize(800, 400);
182 int w = popUpWindow.getSize().width;
183 int h = popUpWindow.getSize().height;
186 popUpWindow.setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
188 VolumeDetailsPanel volumeDetailPanel =
new VolumeDetailsPanel();
189 Boolean counter =
false;
191 volumeDetailPanel.setVolumeIDValue(Long.toString(vol.
getAddr()));
192 volumeDetailPanel.setStartValue(Long.toString(vol.
getStart()));
193 volumeDetailPanel.setLengthValue(Long.toString(vol.
getLength()));
200 popUpWindow.add(volumeDetailPanel);
203 JLabel error =
new JLabel(
204 NbBundle.getMessage(
this.getClass(),
"ExplorerNodeActionVisitor.volDetail.noVolMatchErr"));
205 error.setFont(error.getFont().deriveFont(Font.BOLD, 24));
206 popUpWindow.add(error);
210 volumeDetailPanel.setOKButtonActionListener(
new ActionListener() {
213 popUpWindow.dispose();
217 popUpWindow.setResizable(
false);
218 popUpWindow.setVisible(
true);
239 final JFrame frame =
new JFrame(title);
240 final JDialog popUpWindow =
new JDialog(frame, title,
true);
243 Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
246 popUpWindow.setSize(750, 400);
248 int w = popUpWindow.getSize().width;
249 int h = popUpWindow.getSize().height;
252 popUpWindow.setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
254 ImageDetailsPanel imgDetailPanel =
new ImageDetailsPanel();
255 Boolean counter =
false;
257 imgDetailPanel.setImgNameValue(img.
getName());
258 imgDetailPanel.setImgTypeValue(img.
getType().getName());
259 imgDetailPanel.setImgSectorSizeValue(Long.toString(img.
getSsize()));
260 imgDetailPanel.setImgTotalSizeValue(Long.toString(img.
getSize()));
263 imgDetailPanel.setVisibleHashInfo(hash != null);
264 imgDetailPanel.setImgHashValue(hash);
271 popUpWindow.add(imgDetailPanel);
274 JLabel error =
new JLabel(
275 NbBundle.getMessage(
this.getClass(),
"ExplorerNodeActionVisitor.imgDetail.noVolMatchesErr"));
276 error.setFont(error.getFont().deriveFont(Font.BOLD, 24));
277 popUpWindow.add(error);
281 imgDetailPanel.setOKButtonActionListener(
new ActionListener() {
284 popUpWindow.dispose();
290 popUpWindow.setResizable(
false);
291 popUpWindow.setVisible(
true);
311 Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
313 final JFrame frame =
new JFrame(title);
314 final JDialog popUpWindow =
new JDialog(frame, title,
true);
318 popUpWindow.setSize(1000, 500);
320 int w = popUpWindow.getSize().width;
321 int h = popUpWindow.getSize().height;
324 popUpWindow.setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
326 String[] columnNames =
new String[]{
338 Object[][] rowValues =
new Object[1][9];
343 }
catch (Exception ex) {
344 throw new RuntimeException(
345 NbBundle.getMessage(
this.getClass(),
"ExplorerNodeActionVisitor.exception.probGetParent.text",
349 if (parent != null) {
353 Arrays.fill(rowValues, 0, 1,
new Object[]{
366 JTable table =
new JTable(
new DefaultTableModel(rowValues, columnNames));
368 FileSystemDetailsPanel fsdPanel =
new FileSystemDetailsPanel();
371 fsdPanel.setOKButtonActionListener(
new ActionListener() {
374 popUpWindow.dispose();
379 fsdPanel.setFileSystemTypeValue(table.getValueAt(0, 3).toString());
380 fsdPanel.setImageOffsetValue(table.getValueAt(0, 1).toString());
381 fsdPanel.setVolumeIDValue(table.getValueAt(0, 2).toString());
382 fsdPanel.setBlockSizeValue(table.getValueAt(0, 4).toString());
383 fsdPanel.setBlockCountValue(table.getValueAt(0, 5).toString());
384 fsdPanel.setRootInumValue(table.getValueAt(0, 6).toString());
385 fsdPanel.setFirstInumValue(table.getValueAt(0, 7).toString());
386 fsdPanel.setLastInumValue(table.getValueAt(0, 8).toString());
388 popUpWindow.add(fsdPanel);
389 }
catch (Exception ex) {
394 popUpWindow.setResizable(
false);
395 popUpWindow.setVisible(
true);
List<?extends Action > visit(final LocalFile d)
List<?extends Action > visit(final FileSystem fs)
synchronized Content getParent()
List<?extends Action > visit(final Volume vol)
List<?extends Action > visit(final VirtualDirectory d)
List<?extends Action > visit(final Directory d)
static List< Action > getActions(Content c)
void actionPerformed(ActionEvent e)
TskData.TSK_IMG_TYPE_ENUM getType()
static ExplorerNodeActionVisitor instance
String getFlagsAsString()
void actionPerformed(ActionEvent e)
List<?extends Action > visit(final DerivedFile d)
List<?extends Action > visit(final org.sleuthkit.datamodel.File d)
TskData.TSK_FS_TYPE_ENUM getFsType()
public< T > T accept(ContentVisitor< T > v)
void actionPerformed(ActionEvent e)
List<?extends Action > visit(final Image img)
static Logger getLogger(String name)
static synchronized AddContentTagAction getInstance()
List<?extends Action > defaultVisit(Content di)