Autopsy  4.21.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
PersonaPanel.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2020 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obt ain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.communications.relationships;
20 
21 import java.awt.Dimension;
22 import javax.swing.JButton;
24 
29 public class PersonaPanel extends javax.swing.JPanel {
30 
31  private static final long serialVersionUID = 1L;
32  private final Persona persona;
33 
37  PersonaPanel(Persona persona) {
39  this.persona = persona;
40  personaIDLabel.setText(persona.getName());
41  }
42 
48  Persona getPersona() {
49  return persona;
50  }
51 
57  int getPersonaLabelPreferedWidth() {
58  return personaIDLabel.getPreferredSize().width;
59  }
60 
66  void setPersonalLabelPreferredWidth(int width) {
67  Dimension currentDim = personaIDLabel.getPreferredSize();
68  personaIDLabel.setPreferredSize(new Dimension(Math.max(currentDim.width, width), currentDim.height));
69  }
70 
76  JButton getViewButton() {
77  return viewButton;
78  }
79 
85  @SuppressWarnings("unchecked")
86  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
87  private void initComponents() {
88  java.awt.GridBagConstraints gridBagConstraints;
89 
90  personaIDLabel = new javax.swing.JLabel();
91  viewButton = new javax.swing.JButton();
92 
93  setLayout(new java.awt.GridBagLayout());
94 
95  org.openide.awt.Mnemonics.setLocalizedText(personaIDLabel, org.openide.util.NbBundle.getMessage(PersonaPanel.class, "PersonaPanel.personaIDLabel.text")); // NOI18N
96  gridBagConstraints = new java.awt.GridBagConstraints();
97  gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
98  gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
99  add(personaIDLabel, gridBagConstraints);
100 
101  org.openide.awt.Mnemonics.setLocalizedText(viewButton, org.openide.util.NbBundle.getMessage(PersonaPanel.class, "PersonaPanel.viewButton.text")); // NOI18N
102  viewButton.setMargin(new java.awt.Insets(0, 5, 0, 5));
103  gridBagConstraints = new java.awt.GridBagConstraints();
104  gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
105  gridBagConstraints.weightx = 1.0;
106  gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
107  add(viewButton, gridBagConstraints);
108  }// </editor-fold>//GEN-END:initComponents
109 
110 
111  // Variables declaration - do not modify//GEN-BEGIN:variables
112  private javax.swing.JLabel personaIDLabel;
113  private javax.swing.JButton viewButton;
114  // End of variables declaration//GEN-END:variables
115 }

Copyright © 2012-2022 Basis Technology. Generated on: Tue Feb 6 2024
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.