19 package org.sleuthkit.autopsy.discovery.ui;
21 import java.awt.Cursor;
28 final class ResultsSplitPaneDivider
extends javax.swing.JPanel {
30 private static final long serialVersionUID = 1L;
35 ResultsSplitPaneDivider() {
44 @SuppressWarnings(
"unchecked")
46 private
void initComponents() {
48 javax.swing.JLabel detailsLabel =
new javax.swing.JLabel();
49 javax.swing.JButton hideButton =
new javax.swing.JButton();
50 javax.swing.JButton showButton =
new javax.swing.JButton();
51 javax.swing.Box.Filler filler1 =
new javax.swing.Box.Filler(
new java.awt.Dimension(0, 0),
new java.awt.Dimension(0, 0),
new java.awt.Dimension(0, 32767));
52 javax.swing.Box.Filler filler2 =
new javax.swing.Box.Filler(
new java.awt.Dimension(0, 0),
new java.awt.Dimension(0, 0),
new java.awt.Dimension(0, 32767));
54 setBackground(
new java.awt.Color(170, 170, 170));
56 org.openide.awt.Mnemonics.setLocalizedText(detailsLabel,
org.openide.util.NbBundle.getMessage(ResultsSplitPaneDivider.class,
"ResultsSplitPaneDivider.detailsLabel.text"));
57 detailsLabel.setFocusable(
false);
59 hideButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/discovery/ui/arrow-down.png")));
60 org.openide.awt.Mnemonics.setLocalizedText(hideButton,
org.openide.util.NbBundle.getMessage(ResultsSplitPaneDivider.class,
"ResultsSplitPaneDivider.hideButton.text"));
61 hideButton.setBorder(null);
62 hideButton.setFocusable(
false);
63 hideButton.setMargin(
new java.awt.Insets(0, 0, 0, 0));
64 hideButton.setCursor(Cursor.getDefaultCursor());
65 hideButton.addActionListener(
new java.awt.event.ActionListener() {
66 public void actionPerformed(java.awt.event.ActionEvent evt) {
67 hideButtonActionPerformed(evt);
71 showButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/discovery/ui/arrow-up.png")));
72 org.openide.awt.Mnemonics.setLocalizedText(showButton,
org.openide.util.NbBundle.getMessage(ResultsSplitPaneDivider.class,
"ResultsSplitPaneDivider.showButton.text"));
73 showButton.setBorder(null);
74 showButton.setFocusable(
false);
75 showButton.setMargin(
new java.awt.Insets(0, 0, 0, 0));
76 showButton.setCursor(Cursor.getDefaultCursor());
77 showButton.addActionListener(
new java.awt.event.ActionListener() {
78 public void actionPerformed(java.awt.event.ActionEvent evt) {
79 showButtonActionPerformed(evt);
83 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
84 this.setLayout(layout);
85 layout.setHorizontalGroup(
86 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
87 .addGroup(layout.createSequentialGroup()
89 .addComponent(detailsLabel)
90 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 199, Short.MAX_VALUE)
91 .addComponent(showButton)
92 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
93 .addComponent(hideButton)
95 .addComponent(filler2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
96 .addComponent(filler1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
98 layout.setVerticalGroup(
99 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
100 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
101 .addComponent(filler2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
103 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
104 .addComponent(hideButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
105 .addComponent(showButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
106 .addComponent(detailsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
108 .addComponent(filler1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
112 private void showButtonActionPerformed(java.awt.event.ActionEvent evt) {
113 DiscoveryEventUtils.getDiscoveryEventBus().post(
new DiscoveryEventUtils.DetailsVisibleEvent(
true));
116 private void hideButtonActionPerformed(java.awt.event.ActionEvent evt) {
117 DiscoveryEventUtils.getDiscoveryEventBus().post(
new DiscoveryEventUtils.DetailsVisibleEvent(
false));