Java tutorial
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package UI; import DataManagement.GZDecompression; import Metrics.Metric1; import Metrics.Metric2; import Metrics.Metric3; import Metrics.Metric4; import Metrics.Metric5; import Metrics.Metric6; import Metrics.Metric7; import Metrics.Metric8; import Visuals.AreaChart; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.Toolkit; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.Properties; import javax.swing.BorderFactory; import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.JTextArea; import javax.swing.border.Border; import javax.swing.border.LineBorder; import org.jfree.chart.ChartMouseEvent; import org.jfree.chart.ChartMouseListener; import org.jfree.chart.ChartPanel; /** * * @author allenmamo */ public class SecurityDashboard extends javax.swing.JFrame { JFileChooser selectDatabaseLocation; String databaseFileLocationDialogTitle = "Select Scan Results File Location"; String databaseFileLocationDialogButton = "Select Location"; Properties properties = new Properties(); /** * Creates new form Main */ public SecurityDashboard() { //this.setUndecorated(true); //this.setAlwaysOnTop(true); this.setVisible(true); initComponents(); MainViewPanel mvp = new MainViewPanel(); performMetric1(mvp); performMetric2(mvp); performMetric3(mvp); performMetric4(mvp); performMetric5(mvp); performMetric6(mvp); performMetric7(mvp); performMetric8(mvp); performMetric9(); // Metric6Panel.setVisible(false); // Metric7Panel.setVisible(false); // Metric8Panel.setVisible(false); // Metric9Panel.setVisible(false); Toolkit tk; tk = Toolkit.getDefaultToolkit(); this.setSize((int) tk.getScreenSize().getWidth(), (int) tk.getScreenSize().getHeight()); this.setTitle("Security Dashboard"); sourceFolder.setBorder(new LineBorder(Color.BLACK)); sourceFolder.setBorderPainted(true); } /** * 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() { jRadioButtonMenuItem1 = new javax.swing.JRadioButtonMenuItem(); jMenuItem1 = new javax.swing.JMenuItem(); dashboardTabs = new javax.swing.JTabbedPane(); jScrollPane4 = new javax.swing.JScrollPane(); DashboardPanel = new javax.swing.JPanel(); Metric1Panel = new javax.swing.JPanel(); Metric2Panel = new javax.swing.JPanel(); Metric5Panel = new javax.swing.JPanel(); Metric6Panel = new javax.swing.JPanel(); Metric3Panel = new javax.swing.JPanel(); Metric7Panel = new javax.swing.JPanel(); Metric4Panel = new javax.swing.JPanel(); Metric8Panel = new javax.swing.JPanel(); Metric9Panel = new javax.swing.JPanel(); jPanel5 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); DevicePanel = new javax.swing.JPanel(); Test = new javax.swing.JPanel(); jScrollPane3 = new javax.swing.JScrollPane(); PatchPanel = new javax.swing.JPanel(); jScrollPane7 = new javax.swing.JScrollPane(); AntiVirusPanel = new javax.swing.JPanel(); MalwarePanel = new javax.swing.JPanel(); jScrollPane5 = new javax.swing.JScrollPane(); NetworkPanel = new javax.swing.JPanel(); jScrollPane9 = new javax.swing.JScrollPane(); DefencePanel = new javax.swing.JPanel(); jScrollPane6 = new javax.swing.JScrollPane(); PortPanel = new javax.swing.JPanel(); jScrollPane8 = new javax.swing.JScrollPane(); AccountPanel = new javax.swing.JPanel(); AuditPanel = new javax.swing.JPanel(); jScrollPane2 = new javax.swing.JScrollPane(); MenuBar = new javax.swing.JMenuBar(); sourceFolder = new javax.swing.JMenu(); jMenuItem2 = new javax.swing.JMenuItem(); jRadioButtonMenuItem1.setSelected(true); jRadioButtonMenuItem1.setText("jRadioButtonMenuItem1"); jMenuItem1.setText("jMenuItem1"); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPane4.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); DashboardPanel.setBackground(new java.awt.Color(255, 255, 255)); Metric1Panel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); Metric1Panel.setMaximumSize(new java.awt.Dimension(300, 300)); Metric1Panel.setMinimumSize(new java.awt.Dimension(300, 300)); Metric1Panel.setPreferredSize(new java.awt.Dimension(300, 300)); Metric1Panel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { Metric1PanelMouseClicked(evt); } }); javax.swing.GroupLayout Metric1PanelLayout = new javax.swing.GroupLayout(Metric1Panel); Metric1Panel.setLayout(Metric1PanelLayout); Metric1PanelLayout.setHorizontalGroup(Metric1PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 349, Short.MAX_VALUE)); Metric1PanelLayout.setVerticalGroup(Metric1PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); Metric2Panel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); Metric2Panel.setMaximumSize(new java.awt.Dimension(300, 300)); Metric2Panel.setMinimumSize(new java.awt.Dimension(300, 300)); Metric2Panel.setPreferredSize(new java.awt.Dimension(300, 300)); Metric2Panel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { Metric2PanelMouseClicked(evt); } }); javax.swing.GroupLayout Metric2PanelLayout = new javax.swing.GroupLayout(Metric2Panel); Metric2Panel.setLayout(Metric2PanelLayout); Metric2PanelLayout.setHorizontalGroup(Metric2PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 331, Short.MAX_VALUE)); Metric2PanelLayout.setVerticalGroup(Metric2PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); Metric5Panel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); Metric5Panel.setMaximumSize(new java.awt.Dimension(300, 300)); Metric5Panel.setMinimumSize(new java.awt.Dimension(300, 300)); Metric5Panel.setPreferredSize(new java.awt.Dimension(300, 300)); Metric5Panel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { Metric5PanelMouseClicked(evt); } }); javax.swing.GroupLayout Metric5PanelLayout = new javax.swing.GroupLayout(Metric5Panel); Metric5Panel.setLayout(Metric5PanelLayout); Metric5PanelLayout.setHorizontalGroup(Metric5PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 349, Short.MAX_VALUE)); Metric5PanelLayout.setVerticalGroup(Metric5PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); Metric6Panel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); Metric6Panel.setMaximumSize(new java.awt.Dimension(300, 300)); Metric6Panel.setMinimumSize(new java.awt.Dimension(300, 300)); Metric6Panel.setPreferredSize(new java.awt.Dimension(300, 300)); Metric6Panel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { Metric6PanelMouseClicked(evt); } }); javax.swing.GroupLayout Metric6PanelLayout = new javax.swing.GroupLayout(Metric6Panel); Metric6Panel.setLayout(Metric6PanelLayout); Metric6PanelLayout.setHorizontalGroup(Metric6PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); Metric6PanelLayout.setVerticalGroup(Metric6PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); Metric3Panel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); Metric3Panel.setMaximumSize(new java.awt.Dimension(300, 300)); Metric3Panel.setMinimumSize(new java.awt.Dimension(300, 300)); Metric3Panel.setPreferredSize(new java.awt.Dimension(350, 300)); Metric3Panel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { Metric3PanelMouseClicked(evt); } }); javax.swing.GroupLayout Metric3PanelLayout = new javax.swing.GroupLayout(Metric3Panel); Metric3Panel.setLayout(Metric3PanelLayout); Metric3PanelLayout.setHorizontalGroup(Metric3PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); Metric3PanelLayout.setVerticalGroup(Metric3PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 321, Short.MAX_VALUE)); Metric7Panel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); Metric7Panel.setMaximumSize(new java.awt.Dimension(300, 300)); Metric7Panel.setMinimumSize(new java.awt.Dimension(300, 300)); Metric7Panel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { Metric7PanelMouseClicked(evt); } }); javax.swing.GroupLayout Metric7PanelLayout = new javax.swing.GroupLayout(Metric7Panel); Metric7Panel.setLayout(Metric7PanelLayout); Metric7PanelLayout.setHorizontalGroup(Metric7PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); Metric7PanelLayout.setVerticalGroup(Metric7PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); Metric4Panel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); Metric4Panel.setMaximumSize(new java.awt.Dimension(270, 300)); Metric4Panel.setMinimumSize(new java.awt.Dimension(270, 300)); Metric4Panel.setPreferredSize(new java.awt.Dimension(270, 323)); Metric4Panel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { Metric4PanelMouseClicked(evt); } }); javax.swing.GroupLayout Metric4PanelLayout = new javax.swing.GroupLayout(Metric4Panel); Metric4Panel.setLayout(Metric4PanelLayout); Metric4PanelLayout.setHorizontalGroup(Metric4PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); Metric4PanelLayout.setVerticalGroup(Metric4PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); Metric8Panel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); Metric8Panel.setMaximumSize(new java.awt.Dimension(300, 300)); Metric8Panel.setMinimumSize(new java.awt.Dimension(300, 300)); Metric8Panel.setPreferredSize(new java.awt.Dimension(300, 300)); Metric8Panel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { Metric8PanelMouseClicked(evt); } }); javax.swing.GroupLayout Metric8PanelLayout = new javax.swing.GroupLayout(Metric8Panel); Metric8Panel.setLayout(Metric8PanelLayout); Metric8PanelLayout.setHorizontalGroup(Metric8PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); Metric8PanelLayout.setVerticalGroup(Metric8PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); Metric9Panel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); Metric9Panel.setMaximumSize(new java.awt.Dimension(300, 300)); Metric9Panel.setMinimumSize(new java.awt.Dimension(300, 300)); Metric9Panel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { Metric9PanelMouseClicked(evt); } }); javax.swing.GroupLayout Metric9PanelLayout = new javax.swing.GroupLayout(Metric9Panel); Metric9Panel.setLayout(Metric9PanelLayout); Metric9PanelLayout.setHorizontalGroup(Metric9PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); Metric9PanelLayout.setVerticalGroup(Metric9PanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); javax.swing.GroupLayout DashboardPanelLayout = new javax.swing.GroupLayout(DashboardPanel); DashboardPanel.setLayout(DashboardPanelLayout); DashboardPanelLayout.setHorizontalGroup( DashboardPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(DashboardPanelLayout.createSequentialGroup().addContainerGap() .addGroup(DashboardPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(Metric1Panel, javax.swing.GroupLayout.PREFERRED_SIZE, 351, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Metric5Panel, javax.swing.GroupLayout.PREFERRED_SIZE, 351, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(DashboardPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(Metric2Panel, javax.swing.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE) .addComponent(Metric6Panel, javax.swing.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(DashboardPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(Metric7Panel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 284, Short.MAX_VALUE) .addComponent(Metric9Panel, javax.swing.GroupLayout.PREFERRED_SIZE, 284, Short.MAX_VALUE) .addComponent(Metric3Panel, javax.swing.GroupLayout.PREFERRED_SIZE, 284, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(DashboardPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(Metric4Panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(Metric8Panel, javax.swing.GroupLayout.PREFERRED_SIZE, 270, Short.MAX_VALUE)) .addContainerGap(32, Short.MAX_VALUE))); DashboardPanelLayout.setVerticalGroup( DashboardPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(DashboardPanelLayout.createSequentialGroup().addContainerGap() .addGroup(DashboardPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(Metric3Panel, javax.swing.GroupLayout.DEFAULT_SIZE, 323, Short.MAX_VALUE) .addComponent(Metric1Panel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 323, Short.MAX_VALUE) .addComponent(Metric2Panel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 323, Short.MAX_VALUE) .addComponent(Metric4Panel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(DashboardPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(DashboardPanelLayout.createSequentialGroup() .addComponent(Metric7Panel, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(Metric9Panel, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) .addComponent(Metric5Panel, javax.swing.GroupLayout.DEFAULT_SIZE, 332, Short.MAX_VALUE) .addComponent(Metric6Panel, javax.swing.GroupLayout.DEFAULT_SIZE, 332, Short.MAX_VALUE) .addComponent(Metric8Panel, javax.swing.GroupLayout.DEFAULT_SIZE, 332, Short.MAX_VALUE)) .addGap(102, 102, 102))); jScrollPane4.setViewportView(DashboardPanel); dashboardTabs.addTab("Dashboard", jScrollPane4); DevicePanel.setEnabled(false); javax.swing.GroupLayout DevicePanelLayout = new javax.swing.GroupLayout(DevicePanel); DevicePanel.setLayout(DevicePanelLayout); DevicePanelLayout.setHorizontalGroup(DevicePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 1272, Short.MAX_VALUE)); DevicePanelLayout.setVerticalGroup(DevicePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 708, Short.MAX_VALUE)); jScrollPane1.setViewportView(DevicePanel); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup(jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup().addGap(12, 12, 12) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1257, Short.MAX_VALUE) .addContainerGap())); jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 633, Short.MAX_VALUE) .addContainerGap())); dashboardTabs.addTab("Devices & Vulnerabilities", jPanel5); javax.swing.GroupLayout PatchPanelLayout = new javax.swing.GroupLayout(PatchPanel); PatchPanel.setLayout(PatchPanelLayout); PatchPanelLayout.setHorizontalGroup(PatchPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 1278, Short.MAX_VALUE)); PatchPanelLayout.setVerticalGroup(PatchPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 708, Short.MAX_VALUE)); jScrollPane3.setViewportView(PatchPanel); javax.swing.GroupLayout TestLayout = new javax.swing.GroupLayout(Test); Test.setLayout(TestLayout); TestLayout .setHorizontalGroup( TestLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, TestLayout .createSequentialGroup().addContainerGap().addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 1263, Short.MAX_VALUE) .addContainerGap())); TestLayout .setVerticalGroup( TestLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, TestLayout .createSequentialGroup().addContainerGap().addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 633, Short.MAX_VALUE) .addContainerGap())); dashboardTabs.addTab("Unpatched Software", Test); javax.swing.GroupLayout AntiVirusPanelLayout = new javax.swing.GroupLayout(AntiVirusPanel); AntiVirusPanel.setLayout(AntiVirusPanelLayout); AntiVirusPanelLayout.setHorizontalGroup(AntiVirusPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 1271, Short.MAX_VALUE)); AntiVirusPanelLayout.setVerticalGroup(AntiVirusPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 641, Short.MAX_VALUE)); jScrollPane7.setViewportView(AntiVirusPanel); dashboardTabs.addTab("AntiVirus Check", jScrollPane7); javax.swing.GroupLayout MalwarePanelLayout = new javax.swing.GroupLayout(MalwarePanel); MalwarePanel.setLayout(MalwarePanelLayout); MalwarePanelLayout.setHorizontalGroup(MalwarePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 1275, Short.MAX_VALUE)); MalwarePanelLayout.setVerticalGroup(MalwarePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 645, Short.MAX_VALUE)); dashboardTabs.addTab("Malware Detection", MalwarePanel); javax.swing.GroupLayout NetworkPanelLayout = new javax.swing.GroupLayout(NetworkPanel); NetworkPanel.setLayout(NetworkPanelLayout); NetworkPanelLayout.setHorizontalGroup(NetworkPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 1290, Short.MAX_VALUE)); NetworkPanelLayout.setVerticalGroup(NetworkPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 720, Short.MAX_VALUE)); jScrollPane5.setViewportView(NetworkPanel); dashboardTabs.addTab("Web Applications", jScrollPane5); javax.swing.GroupLayout DefencePanelLayout = new javax.swing.GroupLayout(DefencePanel); DefencePanel.setLayout(DefencePanelLayout); DefencePanelLayout.setHorizontalGroup(DefencePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 1271, Short.MAX_VALUE)); DefencePanelLayout.setVerticalGroup(DefencePanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 641, Short.MAX_VALUE)); jScrollPane9.setViewportView(DefencePanel); dashboardTabs.addTab("Network Defence", jScrollPane9); javax.swing.GroupLayout PortPanelLayout = new javax.swing.GroupLayout(PortPanel); PortPanel.setLayout(PortPanelLayout); PortPanelLayout.setHorizontalGroup(PortPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 1271, Short.MAX_VALUE)); PortPanelLayout.setVerticalGroup(PortPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 641, Short.MAX_VALUE)); jScrollPane6.setViewportView(PortPanel); dashboardTabs.addTab("Open Ports", jScrollPane6); javax.swing.GroupLayout AccountPanelLayout = new javax.swing.GroupLayout(AccountPanel); AccountPanel.setLayout(AccountPanelLayout); AccountPanelLayout.setHorizontalGroup(AccountPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 1271, Short.MAX_VALUE)); AccountPanelLayout.setVerticalGroup(AccountPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 641, Short.MAX_VALUE)); jScrollPane8.setViewportView(AccountPanel); dashboardTabs.addTab("User Accounts", jScrollPane8); javax.swing.GroupLayout AuditPanelLayout = new javax.swing.GroupLayout(AuditPanel); AuditPanel.setLayout(AuditPanelLayout); AuditPanelLayout.setHorizontalGroup(AuditPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 1275, Short.MAX_VALUE)); AuditPanelLayout.setVerticalGroup(AuditPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 645, Short.MAX_VALUE)); dashboardTabs.addTab("Log Audit", AuditPanel); sourceFolder.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); sourceFolder.setText("File"); sourceFolder.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { sourceFolderMouseClicked(evt); } }); jMenuItem2.setText("Choose Source Folder.."); jMenuItem2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem2ActionPerformed(evt); } }); sourceFolder.add(jMenuItem2); MenuBar.add(sourceFolder); setJMenuBar(MenuBar); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(dashboardTabs, javax.swing.GroupLayout.DEFAULT_SIZE, 1296, Short.MAX_VALUE) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(dashboardTabs, javax.swing.GroupLayout.DEFAULT_SIZE, 691, Short.MAX_VALUE) .addContainerGap())); pack(); }// </editor-fold>//GEN-END:initComponents private void sourceFolderMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_sourceFolderMouseClicked }//GEN-LAST:event_sourceFolderMouseClicked private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed //Saving location where to get CSV files from selectDatabaseLocation = new JFileChooser(); selectDatabaseLocation.setCurrentDirectory(new java.io.File(".")); selectDatabaseLocation.setDialogTitle(databaseFileLocationDialogTitle); selectDatabaseLocation.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); selectDatabaseLocation.setAcceptAllFileFilterUsed(false); if (selectDatabaseLocation.showDialog(sourceFolder, databaseFileLocationDialogButton) == JFileChooser.APPROVE_OPTION) { System.out.println("getCurrentDirectory(): " + selectDatabaseLocation.getCurrentDirectory()); System.out.println("getSelectedFile() : " + selectDatabaseLocation.getSelectedFile()); } else { System.out.println("No Selection "); } // // TreeModel model = new FileTreeModel((new File("/"))); // final JTree tree = new JTree(model); // final JFrame treeFrame = new JFrame(); // JScrollPane scrollPane = new JScrollPane(tree); // JPanel treePanel = new JPanel(); // treePanel.setLayout(new BorderLayout()); // treePanel.add(scrollPane, BorderLayout.CENTER); // // treeFrame.setAlwaysOnTop(true); // JButton selectButton = new JButton(); // selectButton.setText("Select"); // selectButton.addActionListener(new ActionListener() { // // public void actionPerformed(ActionEvent e) // { // //Execute when button is pressed // treeFrame.setVisible(false); // TreePath s = tree.getSelectionPath(); // System.out.println(s.toString()); // } // }); // treeFrame.add(selectButton, BorderLayout.SOUTH); // treeFrame.add(treePanel); // treeFrame.setVisible(true); // treeFrame.setSize(400, 400); // System.out.println(selectDatabaseLocation.getCurrentDirectory().getPath()); File currentFile = selectDatabaseLocation.getCurrentDirectory(); Properties prop = new Properties(); OutputStream output = null; try { output = new FileOutputStream("config.properties"); // set the properties value prop.setProperty("location", currentFile.getAbsolutePath()); // save properties to project root folder prop.store(output, null); } catch (IOException io) { io.printStackTrace(); } finally { if (output != null) { try { output.close(); } catch (IOException e) { e.printStackTrace(); } } } }//GEN-LAST:event_jMenuItem2ActionPerformed private void Metric9PanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_Metric9PanelMouseClicked dashboardTabs.setSelectedIndex(9); }//GEN-LAST:event_Metric9PanelMouseClicked private void Metric8PanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_Metric8PanelMouseClicked dashboardTabs.setSelectedIndex(8); }//GEN-LAST:event_Metric8PanelMouseClicked private void Metric4PanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_Metric4PanelMouseClicked dashboardTabs.setSelectedIndex(4); }//GEN-LAST:event_Metric4PanelMouseClicked private void Metric7PanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_Metric7PanelMouseClicked dashboardTabs.setSelectedIndex(7); }//GEN-LAST:event_Metric7PanelMouseClicked private void Metric3PanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_Metric3PanelMouseClicked dashboardTabs.setSelectedIndex(3); }//GEN-LAST:event_Metric3PanelMouseClicked private void Metric6PanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_Metric6PanelMouseClicked dashboardTabs.setSelectedIndex(6); }//GEN-LAST:event_Metric6PanelMouseClicked private void Metric5PanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_Metric5PanelMouseClicked dashboardTabs.setSelectedIndex(5); }//GEN-LAST:event_Metric5PanelMouseClicked private void Metric2PanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_Metric2PanelMouseClicked dashboardTabs.setSelectedIndex(2); }//GEN-LAST:event_Metric2PanelMouseClicked private void Metric1PanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_Metric1PanelMouseClicked dashboardTabs.setSelectedIndex(1); }//GEN-LAST:event_Metric1PanelMouseClicked public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(SecurityDashboard.class.getName()) .log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(SecurityDashboard.class.getName()) .log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(SecurityDashboard.class.getName()) .log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(SecurityDashboard.class.getName()) .log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new SecurityDashboard().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JPanel AccountPanel; private javax.swing.JPanel AntiVirusPanel; private javax.swing.JPanel AuditPanel; private javax.swing.JPanel DashboardPanel; private javax.swing.JPanel DefencePanel; private javax.swing.JPanel DevicePanel; private javax.swing.JPanel MalwarePanel; private javax.swing.JMenuBar MenuBar; private javax.swing.JPanel Metric1Panel; private javax.swing.JPanel Metric2Panel; private javax.swing.JPanel Metric3Panel; private javax.swing.JPanel Metric4Panel; private javax.swing.JPanel Metric5Panel; private javax.swing.JPanel Metric6Panel; private javax.swing.JPanel Metric7Panel; private javax.swing.JPanel Metric8Panel; private javax.swing.JPanel Metric9Panel; private javax.swing.JPanel NetworkPanel; private javax.swing.JPanel PatchPanel; private javax.swing.JPanel PortPanel; private javax.swing.JPanel Test; private javax.swing.JTabbedPane dashboardTabs; private javax.swing.JMenuItem jMenuItem1; private javax.swing.JMenuItem jMenuItem2; private javax.swing.JPanel jPanel5; private javax.swing.JRadioButtonMenuItem jRadioButtonMenuItem1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JScrollPane jScrollPane3; private javax.swing.JScrollPane jScrollPane4; private javax.swing.JScrollPane jScrollPane5; private javax.swing.JScrollPane jScrollPane6; private javax.swing.JScrollPane jScrollPane7; private javax.swing.JScrollPane jScrollPane8; private javax.swing.JScrollPane jScrollPane9; private javax.swing.JMenu sourceFolder; // End of variables declaration//GEN-END:variables private void performMetric1(MainViewPanel mvp) { Metric1 metric1 = new Metric1(); JPanel graphPanel1 = new JPanel(); graphPanel1.setLayout(new BorderLayout()); graphPanel1.add(metric1.run(), BorderLayout.NORTH); DevicePanel.setLayout(new BorderLayout()); JTextArea header = new JTextArea( "\nThe Network Vulnerability test scans the entire network for all existing vulnerabilities that may " + "exist within and display the vulnerabilities (if any) for each device (computer, tablet or mobile device).\n"); //header.setLineWrap(true); //header.setWrapStyleWord(true); header.setEditable(false); header.setMaximumSize(new Dimension(DevicePanel.getWidth(), 3)); DevicePanel.add(header, BorderLayout.NORTH); DevicePanel.add(graphPanel1, BorderLayout.CENTER); ChartPanel firstPanel = mvp.getPanel1(metric1); firstPanel.addChartMouseListener(new ChartMouseListener() { @Override public void chartMouseClicked(ChartMouseEvent cme) { dashboardTabs.setSelectedIndex(1); } @Override public void chartMouseMoved(ChartMouseEvent cme) { } }); Metric1Panel.setLayout(new BorderLayout()); Font titleFont = new Font("Calibri", Font.BOLD, 27); JLabel vulnerabilitiesTitleLabel = new JLabel(" Vulnerabilities"); vulnerabilitiesTitleLabel.setFont(titleFont); Metric1Panel.add(vulnerabilitiesTitleLabel, BorderLayout.PAGE_START); Font devCountFont = new Font("Calibri", Font.BOLD, 16); String devCount = " Device Count: " + metric1.deviceCount; JLabel devCountLabel = new JLabel(devCount); devCountLabel.setFont(devCountFont); Metric1Panel.add(devCountLabel, BorderLayout.SOUTH); Metric1Panel.add(firstPanel, BorderLayout.CENTER); Metric1Panel.setBackground(Color.white); Metric1Panel.setEnabled(false); } private void performMetric2(MainViewPanel mvp) { Metric2 metric2 = new Metric2(); JPanel graphPanel2 = new JPanel(); graphPanel2.setLayout(new BorderLayout()); graphPanel2.add(metric2.run(), BorderLayout.NORTH); PatchPanel.setLayout(new BorderLayout()); JTextArea header = new JTextArea( "\nThe Unpatched Software tab focuses on identifying all software on each device that is missing " + "updates, or devices that are running software which is no longer supported.\n"); //header.setLineWrap(true); //header.setWrapStyleWord(true); header.setEditable(false); PatchPanel.add(header, BorderLayout.NORTH); PatchPanel.add(graphPanel2, BorderLayout.CENTER); ChartPanel secondPanel = mvp.getPanel2(metric2); secondPanel.addChartMouseListener(new ChartMouseListener() { @Override public void chartMouseClicked(ChartMouseEvent cme) { dashboardTabs.setSelectedIndex(2); } @Override public void chartMouseMoved(ChartMouseEvent cme) { } }); Metric2Panel.setLayout(new BorderLayout()); Font titleFont = new Font("Calibri", Font.BOLD, 27); JLabel patchTitleLabel = new JLabel(" Unpatched Software"); patchTitleLabel.setFont(titleFont); Metric2Panel.add(patchTitleLabel, BorderLayout.NORTH); Metric2Panel.add(secondPanel, BorderLayout.CENTER); Metric2Panel.setBackground(Color.white); } private void performMetric3(MainViewPanel mvp) { Metric3 metric3 = new Metric3(); JPanel graphPanel3 = new JPanel(); graphPanel3.setLayout(new BorderLayout()); graphPanel3.add(metric3.run(), BorderLayout.NORTH); AntiVirusPanel.setLayout(new BorderLayout()); JTextArea header = new JTextArea( "\nThis page lists all devices on the network, divided into two tables. The top table shows the " + "critical issues where the devices listed are either not running an anti-virus solution or the solution is not updated. It " + "will also list those anti-virus solutions which have services which are not running (Scanning is disabled). The bottom " + "table shows the updated table where the devices listed have updated and running anti-virus solutions.\n"); header.setLineWrap(true); header.setWrapStyleWord(true); header.setEditable(false); AntiVirusPanel.add(header, BorderLayout.NORTH); AntiVirusPanel.add(graphPanel3, BorderLayout.CENTER); ChartPanel thirdPanel = mvp.getPanel3(metric3); thirdPanel.addChartMouseListener(new ChartMouseListener() { @Override public void chartMouseClicked(ChartMouseEvent cme) { dashboardTabs.setSelectedIndex(3); } @Override public void chartMouseMoved(ChartMouseEvent cme) { } }); Metric3Panel.setLayout(new BorderLayout()); Font titleFont = new Font("Calibri", Font.BOLD, 27); JLabel avTitleLabel = new JLabel(" AV Scan Check"); avTitleLabel.setFont(titleFont); Metric3Panel.add(avTitleLabel, BorderLayout.NORTH); Metric3Panel.add(thirdPanel, BorderLayout.CENTER); Metric3Panel.setBackground(Color.white); } private void performMetric4(MainViewPanel mvp) { Metric4 metric4 = new Metric4(); JPanel graphPanel4 = new JPanel(); graphPanel4.setLayout(new BorderLayout()); metric4.run(); graphPanel4.add(mvp.getPanel4(metric4), BorderLayout.CENTER); MalwarePanel.setLayout(new BorderLayout()); JTextArea header = new JTextArea( "\nThe Malware detection will scan for viruses, trojans, and worms that may have affected a device.\n"); header.setLineWrap(true); header.setWrapStyleWord(true); header.setEditable(false); MalwarePanel.add(header, BorderLayout.NORTH); if (metric4.getTotalCount() == 0) { Font noMalwareFont = new Font("Calibri", Font.BOLD, 40); JLabel noMalwareLabel = new JLabel( " No Malware Detected"); noMalwareLabel.setFont(noMalwareFont); noMalwareLabel.setPreferredSize(new Dimension(WIDTH, 100)); graphPanel4.add(noMalwareLabel, BorderLayout.NORTH); JPanel emptyPanel = new JPanel(); emptyPanel.setPreferredSize(new Dimension(50, 200)); emptyPanel.setOpaque(true); graphPanel4.add(emptyPanel, BorderLayout.SOUTH); } MalwarePanel.add(graphPanel4, BorderLayout.CENTER); ChartPanel fourthPanel = mvp.getPanel4(metric4); fourthPanel.addChartMouseListener(new ChartMouseListener() { @Override public void chartMouseClicked(ChartMouseEvent cme) { dashboardTabs.setSelectedIndex(4); } @Override public void chartMouseMoved(ChartMouseEvent cme) { } }); Metric4Panel.setLayout(new BorderLayout()); Font titleFont = new Font("Calibri", Font.BOLD, 27); JLabel malwareTitleLabel = new JLabel(" Malware Detection"); malwareTitleLabel.setFont(titleFont); Metric4Panel.add(malwareTitleLabel, BorderLayout.PAGE_START); Metric4Panel.add(fourthPanel, BorderLayout.CENTER); if (metric4.getTotalCount() == 0) { Font noMalwareFont = new Font("Calibri", Font.BOLD, 20); JLabel noMalwareLabel = new JLabel(" No Malware Detected"); noMalwareLabel.setFont(noMalwareFont); Metric4Panel.add(noMalwareLabel, BorderLayout.SOUTH); } Metric4Panel.setBackground(Color.white); } private void performMetric5(MainViewPanel mvp) { Metric5 metric5 = new Metric5(); JPanel graphPanel5 = new JPanel(); graphPanel5.setLayout(new BorderLayout()); graphPanel5.add(metric5.run(), BorderLayout.NORTH); NetworkPanel.setLayout(new BorderLayout()); JTextArea header = new JTextArea( "\nThe web application page will scan all remote servers running a web program in search of any " + "vulnerabilities present.\n"); //header.setLineWrap(true); //header.setWrapStyleWord(true); header.setEditable(false); NetworkPanel.add(header, BorderLayout.NORTH); NetworkPanel.add(graphPanel5, BorderLayout.CENTER); ChartPanel fifthPanel = mvp.getPanel5(metric5); fifthPanel.addChartMouseListener(new ChartMouseListener() { @Override public void chartMouseClicked(ChartMouseEvent cme) { dashboardTabs.setSelectedIndex(5); } @Override public void chartMouseMoved(ChartMouseEvent cme) { } }); Metric5Panel.setLayout(new BorderLayout()); Font titleFont = new Font("Calibri", Font.BOLD, 27); JLabel netAppTitleLabel = new JLabel(" Web Applications"); netAppTitleLabel.setFont(titleFont); Metric5Panel.add(netAppTitleLabel, BorderLayout.NORTH); Metric5Panel.add(fifthPanel, BorderLayout.CENTER); Metric5Panel.setBackground(Color.white); } private void performMetric6(MainViewPanel mvp) { Metric6 metric6 = new Metric6(); JPanel graphPanel6 = new JPanel(); graphPanel6.setLayout(new BorderLayout()); graphPanel6.add(metric6.run(), BorderLayout.NORTH); DefencePanel.setLayout(new BorderLayout()); JTextArea header = new JTextArea( "\nThe network defence panel is designated to analysing network devices such as Firewalls, Routers, " + "and Switches, and helps to ensure that the boundary defence is the work is well maintained. These devices must be updated " + "correctly configured in order to prevent unauthorised external access.\n"); header.setLineWrap(true); header.setWrapStyleWord(true); header.setEditable(false); DefencePanel.add(header, BorderLayout.NORTH); DefencePanel.add(graphPanel6, BorderLayout.CENTER); ChartPanel sixthPanel = mvp.getPanel6(metric6); sixthPanel.addChartMouseListener(new ChartMouseListener() { @Override public void chartMouseClicked(ChartMouseEvent cme) { dashboardTabs.setSelectedIndex(6); } @Override public void chartMouseMoved(ChartMouseEvent cme) { } }); Metric6Panel.setLayout(new BorderLayout()); Font titleFont = new Font("Calibri", Font.BOLD, 27); JLabel netDefTitleLabel = new JLabel(" Network Defence"); netDefTitleLabel.setFont(titleFont); Metric6Panel.add(netDefTitleLabel, BorderLayout.NORTH); Metric6Panel.add(sixthPanel, BorderLayout.CENTER); Metric6Panel.setBackground(Color.white); } private void performMetric7(MainViewPanel mvp) { Metric7 metric7 = new Metric7(); JPanel graphPanel7 = new JPanel(); graphPanel7.setLayout(new BorderLayout()); graphPanel7.add(metric7.run(), BorderLayout.NORTH); PortPanel.setLayout(new BorderLayout()); JTextArea header = new JTextArea( "\nOpen ports that are not being used by a secure service on a system may result in a malicious " + "attacker gaining access to the network. By listing all open ports on each device, this can aid in ensuring that ports " + "currently open are know of.\n"); header.setLineWrap(true); header.setWrapStyleWord(true); header.setEditable(false); PortPanel.add(header, BorderLayout.NORTH); PortPanel.add(graphPanel7, BorderLayout.CENTER); Metric7Panel.setBackground(Color.WHITE); Metric7Panel.setLayout(new BorderLayout()); Font titleFont = new Font("Calibri", Font.BOLD, 27); JLabel portTitleLabel = new JLabel(" Open Ports"); portTitleLabel.setFont(titleFont); Metric7Panel.add(portTitleLabel, BorderLayout.NORTH); JPanel p = new JPanel(); p.setLayout(new BorderLayout()); JLabel emptyLabel = new JLabel(" "); JLabel emptyLabel2 = new JLabel(" "); JLabel emptyLabel3 = new JLabel(" "); JLabel emptyLabel4 = new JLabel(" "); emptyLabel.setBackground(Color.white); emptyLabel2.setBackground(Color.white); emptyLabel3.setBackground(Color.white); emptyLabel4.setBackground(Color.white); emptyLabel.setOpaque(true); emptyLabel2.setOpaque(true); emptyLabel3.setOpaque(true); emptyLabel4.setOpaque(true); p.add(emptyLabel, BorderLayout.NORTH); p.add(emptyLabel3, BorderLayout.WEST); p.add(mvp.getPanel7(metric7), BorderLayout.CENTER); p.add(emptyLabel4, BorderLayout.EAST); p.add(emptyLabel2, BorderLayout.SOUTH); Metric7Panel.add(p, BorderLayout.CENTER); Metric7Panel.setBackground(Color.white); } private void performMetric8(MainViewPanel mvp) { Metric8 metric8 = new Metric8(); JPanel graphPanel8 = new JPanel(); graphPanel8.setLayout(new BorderLayout()); graphPanel8.add(metric8.run(), BorderLayout.NORTH); AccountPanel.setLayout(new BorderLayout()); JTextArea header = new JTextArea( "\nVulnerable user accounts can be exploited due to weak policies. This scan will visit all user " + "accounts on each device to list user privilidges and administrator rights, as well as look for default or weak passwords " + "that \ncan leave the account susceptible to brute-force attacks.\n"); //header.setLineWrap(true); //header.setWrapStyleWord(true); header.setEditable(false); AccountPanel.add(header, BorderLayout.NORTH); AccountPanel.add(graphPanel8, BorderLayout.CENTER); ChartPanel eighthPanel = mvp.getPanel8(metric8); eighthPanel.addChartMouseListener(new ChartMouseListener() { @Override public void chartMouseClicked(ChartMouseEvent cme) { dashboardTabs.setSelectedIndex(8); } @Override public void chartMouseMoved(ChartMouseEvent cme) { } }); Metric8Panel.setLayout(new BorderLayout()); Metric8Panel.setBackground(Color.white); Font titleFont = new Font("Calibri", Font.BOLD, 27); JLabel portTitleLabel = new JLabel(" User Account"); portTitleLabel.setFont(titleFont); Metric8Panel.add(portTitleLabel, BorderLayout.NORTH); Metric8Panel.add(eighthPanel, BorderLayout.CENTER); } private void performMetric9() { GZDecompression m9 = new GZDecompression(); String[][] counts = m9.getMetric9(); Font titleFont = new Font("Calibri", Font.BOLD, 27); JLabel logAuditTitleLabel = new JLabel(" Log Audit"); logAuditTitleLabel.setFont(titleFont); AreaChart areaChart = new AreaChart(m9.getLogCount(), m9.getSuccessCount(), m9.getFailCount()); ChartPanel thisChart = areaChart.drawAreaChart(); thisChart.setBackground(Color.white); thisChart.addChartMouseListener(new ChartMouseListener() { @Override public void chartMouseClicked(ChartMouseEvent cme) { dashboardTabs.setSelectedIndex(9); } @Override public void chartMouseMoved(ChartMouseEvent cme) { } }); Metric9Panel.setBackground(Color.WHITE); Metric9Panel.setLayout(new BorderLayout()); Metric9Panel.add(logAuditTitleLabel, BorderLayout.NORTH); Metric9Panel.add(thisChart, BorderLayout.CENTER); Metric9Panel.setEnabled(false); String[] columns = { "Log Failure" }; JTable table = new JTable(counts, columns); table.setShowHorizontalLines(true); table.setRowHeight(40); table.setEnabled(false); JScrollPane tableScrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); AuditPanel.setLayout(new BorderLayout()); JTextArea header = new JTextArea( "\nThrough the analysis of security logs, this page will show an audit of the attack attempts and " + "security breaches. The logs provide critical information related to system events that can be used to track suspicicous " + "activities.\n"); header.setLineWrap(true); header.setWrapStyleWord(true); header.setEditable(false); AuditPanel.add(header, BorderLayout.NORTH); AuditPanel.add(tableScrollPane, BorderLayout.CENTER); } }