mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Suppressed some compiler warnings with annotations.
This commit is contained in:
parent
757e1ffa97
commit
341db41da6
@ -60,6 +60,10 @@
|
|||||||
<StringArray count="0"/>
|
<StringArray count="0"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new javax.swing.JComboBox<>()"/>
|
||||||
|
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<LocalDisk>"/>
|
||||||
|
</AuxValues>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="errorLabel">
|
<Component class="javax.swing.JLabel" name="errorLabel">
|
||||||
<Properties>
|
<Properties>
|
||||||
|
@ -46,7 +46,7 @@ import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
|||||||
public class LocalDiskPanel extends ContentTypePanel {
|
public class LocalDiskPanel extends ContentTypePanel {
|
||||||
private static LocalDiskPanel instance;
|
private static LocalDiskPanel instance;
|
||||||
private PropertyChangeSupport pcs = null;
|
private PropertyChangeSupport pcs = null;
|
||||||
private List<LocalDisk> disks = new ArrayList<LocalDisk>();
|
private List<LocalDisk> disks;
|
||||||
private LocalDiskModel model;
|
private LocalDiskModel model;
|
||||||
private boolean enableNext = false;
|
private boolean enableNext = false;
|
||||||
|
|
||||||
@ -54,6 +54,7 @@ public class LocalDiskPanel extends ContentTypePanel {
|
|||||||
* Creates new form LocalDiskPanel
|
* Creates new form LocalDiskPanel
|
||||||
*/
|
*/
|
||||||
public LocalDiskPanel() {
|
public LocalDiskPanel() {
|
||||||
|
this.disks = new ArrayList<LocalDisk>();
|
||||||
initComponents();
|
initComponents();
|
||||||
customInit();
|
customInit();
|
||||||
}
|
}
|
||||||
@ -87,7 +88,7 @@ public class LocalDiskPanel extends ContentTypePanel {
|
|||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
|
|
||||||
diskLabel = new javax.swing.JLabel();
|
diskLabel = new javax.swing.JLabel();
|
||||||
diskComboBox = new javax.swing.JComboBox();
|
diskComboBox = new javax.swing.JComboBox<>();
|
||||||
errorLabel = new javax.swing.JLabel();
|
errorLabel = new javax.swing.JLabel();
|
||||||
|
|
||||||
setMinimumSize(new java.awt.Dimension(0, 65));
|
setMinimumSize(new java.awt.Dimension(0, 65));
|
||||||
@ -120,7 +121,7 @@ public class LocalDiskPanel extends ContentTypePanel {
|
|||||||
);
|
);
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JComboBox diskComboBox;
|
private javax.swing.JComboBox<LocalDisk> diskComboBox;
|
||||||
private javax.swing.JLabel diskLabel;
|
private javax.swing.JLabel diskLabel;
|
||||||
private javax.swing.JLabel errorLabel;
|
private javax.swing.JLabel errorLabel;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
@ -207,21 +208,29 @@ public class LocalDiskPanel extends ContentTypePanel {
|
|||||||
pcs.removePropertyChangeListener(pcl);
|
pcs.removePropertyChangeListener(pcl);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class LocalDiskModel implements ComboBoxModel, ListCellRenderer {
|
private class LocalDiskModel implements ComboBoxModel<LocalDisk>, ListCellRenderer<LocalDisk> {
|
||||||
private Object selected;
|
private LocalDisk selected;
|
||||||
private boolean ready = false;
|
private boolean ready = false;
|
||||||
List<LocalDisk> physical = new ArrayList<LocalDisk>();
|
List<LocalDisk> physical = new ArrayList<>();
|
||||||
List<LocalDisk> partitions = new ArrayList<LocalDisk>();
|
List<LocalDisk> partitions = new ArrayList<>();
|
||||||
|
|
||||||
//private String SELECT = "Select a local disk:";
|
//private String SELECT = "Select a local disk:";
|
||||||
private String LOADING = "Loading local disks...";
|
private String LOADING_STR = "Loading local disks...";
|
||||||
|
|
||||||
|
// Dummy local disk that will be displayed as a loading message
|
||||||
|
private LocalDisk LOADING = new LocalDisk("", "", 0L) {
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return LOADING_STR;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
private void loadDisks() {
|
private void loadDisks() {
|
||||||
// Clear the lists
|
// Clear the lists
|
||||||
errorLabel.setText("");
|
errorLabel.setText("");
|
||||||
disks = new ArrayList<LocalDisk>();
|
disks = new ArrayList<>();
|
||||||
physical = new ArrayList<LocalDisk>();
|
physical = new ArrayList<>();
|
||||||
partitions = new ArrayList<LocalDisk>();
|
partitions = new ArrayList<>();
|
||||||
diskComboBox.setEnabled(false);
|
diskComboBox.setEnabled(false);
|
||||||
ready = false;
|
ready = false;
|
||||||
|
|
||||||
@ -232,7 +241,7 @@ public class LocalDiskPanel extends ContentTypePanel {
|
|||||||
@Override
|
@Override
|
||||||
public void setSelectedItem(Object anItem) {
|
public void setSelectedItem(Object anItem) {
|
||||||
if(ready) {
|
if(ready) {
|
||||||
selected = anItem;
|
selected = (LocalDisk) anItem;
|
||||||
enableNext = true;
|
enableNext = true;
|
||||||
pcs.firePropertyChange(AddImageWizardChooseDataSourceVisual.EVENT.UPDATE_UI.toString(), false, true);
|
pcs.firePropertyChange(AddImageWizardChooseDataSourceVisual.EVENT.UPDATE_UI.toString(), false, true);
|
||||||
}
|
}
|
||||||
@ -249,7 +258,7 @@ public class LocalDiskPanel extends ContentTypePanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getElementAt(int index) {
|
public LocalDisk getElementAt(int index) {
|
||||||
return ready ? disks.get(index) : LOADING;
|
return ready ? disks.get(index) : LOADING;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,7 +271,7 @@ public class LocalDiskPanel extends ContentTypePanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
|
public Component getListCellRendererComponent(JList<? extends LocalDisk> list, LocalDisk value, int index, boolean isSelected, boolean cellHasFocus) {
|
||||||
JPanel panel = new JPanel(new BorderLayout());
|
JPanel panel = new JPanel(new BorderLayout());
|
||||||
JLabel label = new JLabel();
|
JLabel label = new JLabel();
|
||||||
if(index == physical.size() - 1) {
|
if(index == physical.size() - 1) {
|
||||||
@ -277,13 +286,14 @@ public class LocalDiskPanel extends ContentTypePanel {
|
|||||||
label.setForeground(list.getForeground());
|
label.setForeground(list.getForeground());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(value !=null && value.equals(LOADING)) {
|
String localDiskString = value.toString();
|
||||||
|
if(localDiskString.equals(LOADING_STR)) {
|
||||||
Font font = new Font(label.getFont().getName(), Font.ITALIC, label.getFont().getSize());
|
Font font = new Font(label.getFont().getName(), Font.ITALIC, label.getFont().getSize());
|
||||||
label.setText(LOADING);
|
label.setText(LOADING_STR);
|
||||||
label.setFont(font);
|
label.setFont(font);
|
||||||
label.setBackground(Color.GRAY);
|
label.setBackground(Color.GRAY);
|
||||||
} else {
|
} else {
|
||||||
label.setText(value != null ? value.toString() : "");
|
label.setText(value.toString());
|
||||||
}
|
}
|
||||||
label.setOpaque(true);
|
label.setOpaque(true);
|
||||||
label.setBorder(new EmptyBorder(2, 2, 2, 2));
|
label.setBorder(new EmptyBorder(2, 2, 2, 2));
|
||||||
|
@ -115,7 +115,7 @@ public final class NewCaseWizardAction extends CallableSystemAction {
|
|||||||
* Initialize panels representing individual wizard's steps and sets
|
* Initialize panels representing individual wizard's steps and sets
|
||||||
* various properties for them influencing wizard appearance.
|
* various properties for them influencing wizard appearance.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({"unchecked"})
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
private WizardDescriptor.Panel<WizardDescriptor>[] getPanels() {
|
private WizardDescriptor.Panel<WizardDescriptor>[] getPanels() {
|
||||||
if (panels == null) {
|
if (panels == null) {
|
||||||
panels = new WizardDescriptor.Panel[]{
|
panels = new WizardDescriptor.Panel[]{
|
||||||
|
@ -37,6 +37,7 @@ public class Utilities {
|
|||||||
*
|
*
|
||||||
* @return true if jpeg file, false otherwise
|
* @return true if jpeg file, false otherwise
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("cast")
|
||||||
public static boolean isJpegFileHeader(AbstractFile file) {
|
public static boolean isJpegFileHeader(AbstractFile file) {
|
||||||
if (file.getSize() < 100) {
|
if (file.getSize() < 100) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -58,6 +58,7 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer;
|
|||||||
public class DataResultViewerTable extends AbstractDataResultViewer {
|
public class DataResultViewerTable extends AbstractDataResultViewer {
|
||||||
|
|
||||||
private String firstColumnLabel = "Name";
|
private String firstColumnLabel = "Name";
|
||||||
|
@SuppressWarnings("rawtypes")
|
||||||
private Set<Property> propertiesAcc = new LinkedHashSet<>();
|
private Set<Property> propertiesAcc = new LinkedHashSet<>();
|
||||||
private static final Logger logger = Logger.getLogger(DataResultViewerTable.class.getName());
|
private static final Logger logger = Logger.getLogger(DataResultViewerTable.class.getName());
|
||||||
private final DummyNodeListener dummyNodeListener = new DummyNodeListener();
|
private final DummyNodeListener dummyNodeListener = new DummyNodeListener();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user