/* * Autopsy Forensic Browser * * Copyright 2011-2013 Basis Technology Corp. * Contact: carrier <at> sleuthkit <dot> org * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.sleuthkit.autopsy.ingest; import java.awt.CardLayout; import org.sleuthkit.autopsy.coreutils.Logger; /** * the main layered pane container for messages table (IngestMessagePanel) and * details view (IngestMessageDetailsPanel) */ class IngestMessageMainPanel extends javax.swing.JPanel { private IngestMessagePanel messagePanel; private IngestMessageDetailsPanel detailsPanel; private Logger logger = Logger.getLogger(IngestMessageMainPanel.class.getName()); //the 2 layer names private static final String MESSAGES_VIEWER_LAYER = "MESSAGES"; //NON-NLS private static final String DETAILS_VIEWER_LAYER = "DETAILS"; //NON-NLS /** * Creates new form IngestMessageMainPanel */ public IngestMessageMainPanel() { initComponents(); customizeComponents(); } public void markAllSeen() { messagePanel.markAllSeen(); } private void customizeComponents() { messagePanel = new IngestMessagePanel(this); detailsPanel = new IngestMessageDetailsPanel(this); messagePanel.setOpaque(true); detailsPanel.setOpaque(true); add(messagePanel, MESSAGES_VIEWER_LAYER); add(detailsPanel, DETAILS_VIEWER_LAYER); this.setOpaque(true); } IngestMessagePanel getMessagePanel() { return messagePanel; } IngestMessageDetailsPanel getDetailsPanel() { return detailsPanel; } void showMessages() { CardLayout layout = (CardLayout) this.getLayout(); layout.show(this, MESSAGES_VIEWER_LAYER); } void showDetails(int rowNumber) { detailsPanel.showDetails(rowNumber); CardLayout layout = (CardLayout) this.getLayout(); layout.show(this, DETAILS_VIEWER_LAYER); } public void addMessage(IngestMessage ingestMessage) { messagePanel.addMessage(ingestMessage); } public void clearMessages() { messagePanel.clearMessages(); } public int getMessagesCount() { return messagePanel.getMessagesCount(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { setLayout(new java.awt.CardLayout()); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables // End of variables declaration//GEN-END:variables }