userinterface.HospitalAdminRole.HospitalAdminWorkAreaJPanel.java Source code

Java tutorial

Introduction

Here is the source code for userinterface.HospitalAdminRole.HospitalAdminWorkAreaJPanel.java

Source

/*
 * 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 userinterface.HospitalAdminRole;

import business.EcoSystem;
import business.Enterprise.BloodBankEnterprise;
import business.Enterprise.Enterprise;
import business.Enterprise.HospitalEnterprise;
import business.Network.Network;
import business.Organization.Organization;
import business.Person.Donor;
import business.UserAccount.UserAccount;
import business.WorkQueue.WorkRequest;
import java.awt.CardLayout;
import java.awt.Color;
import javax.swing.JPanel;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartFrame;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.category.DefaultCategoryDataset;

/**
 *
 * @author PARAKH MAHAJAN
 */
public class HospitalAdminWorkAreaJPanel extends javax.swing.JPanel {

    private JPanel userProcessContainer;
    private UserAccount account;
    private Organization organization;
    private EcoSystem business;
    private Enterprise enterprise;

    /**
     * Creates new form HospitalAdminWorkAreaJPanel
     */

    public HospitalAdminWorkAreaJPanel(JPanel userProcessContainer, UserAccount account, Organization organization,
            EcoSystem business, Enterprise enterprise) {
        initComponents();
        this.userProcessContainer = userProcessContainer;
        this.account = account;
        this.organization = organization;
        this.business = business;
        this.enterprise = enterprise;
        valueJLabel.setText(enterprise.getName());
    }

    /**
     * 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() {

        enterpriseJLabel = new javax.swing.JLabel();
        valueJLabel = new javax.swing.JLabel();
        BtnManageOrganization = new javax.swing.JButton();
        BtnManageEmployee = new javax.swing.JButton();
        BtnManageUser = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        BtnManageUser1 = new javax.swing.JButton();

        setBackground(new java.awt.Color(255, 255, 255));
        setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        enterpriseJLabel.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
        enterpriseJLabel.setText("Enterprise :");
        add(enterpriseJLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(33, 100, 120, 30));

        valueJLabel.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
        valueJLabel.setText("<Value>");
        add(valueJLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(201, 100, 120, 30));

        BtnManageOrganization.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
        BtnManageOrganization.setText("Manage Organization");
        BtnManageOrganization.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BtnManageOrganizationActionPerformed(evt);
            }
        });
        add(BtnManageOrganization, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 260, 205, -1));

        BtnManageEmployee.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
        BtnManageEmployee.setText("Manage Employee");
        BtnManageEmployee.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BtnManageEmployeeActionPerformed(evt);
            }
        });
        add(BtnManageEmployee, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 330, 205, -1));

        BtnManageUser.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
        BtnManageUser.setText("Manage User");
        BtnManageUser.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BtnManageUserActionPerformed(evt);
            }
        });
        add(BtnManageUser, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 400, 205, -1));

        jLabel1.setFont(new java.awt.Font("Calibri", 1, 36)); // NOI18N
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("Hospital Admin Work Area");
        add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(33, 16, 412, 31));

        BtnManageUser1.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
        BtnManageUser1.setText("DataAnalysis");
        BtnManageUser1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BtnManageUser1ActionPerformed(evt);
            }
        });
        add(BtnManageUser1, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 470, 205, -1));
    }// </editor-fold>//GEN-END:initComponents

    private void BtnManageOrganizationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtnManageOrganizationActionPerformed
        // TODO add your handling code here:
        ManageOrganization1JPanel manageOrganization1JPanel = new ManageOrganization1JPanel(userProcessContainer,
                enterprise.getOrganizationDirectory());
        userProcessContainer.add("manageOrganization1JPanel", manageOrganization1JPanel);
        CardLayout layout = (CardLayout) userProcessContainer.getLayout();
        layout.next(userProcessContainer);
    }//GEN-LAST:event_BtnManageOrganizationActionPerformed

    private void BtnManageEmployeeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtnManageEmployeeActionPerformed
        // TODO add your handling code here:
        ManageEmployee1JPanel manageEmployee1JPanel = new ManageEmployee1JPanel(userProcessContainer,
                enterprise.getOrganizationDirectory());
        userProcessContainer.add("manageEmployee1JPanel", manageEmployee1JPanel);
        CardLayout layout = (CardLayout) userProcessContainer.getLayout();
        layout.next(userProcessContainer);
    }//GEN-LAST:event_BtnManageEmployeeActionPerformed

    private void BtnManageUserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtnManageUserActionPerformed
        // TODO add your handling code here:
        ManageUserAccount1JPanel manageUserAccount1JPanel = new ManageUserAccount1JPanel(userProcessContainer,
                enterprise);
        userProcessContainer.add("ManageUserAccount1JPanel", manageUserAccount1JPanel);
        CardLayout layout = (CardLayout) userProcessContainer.getLayout();
        layout.next(userProcessContainer);
    }//GEN-LAST:event_BtnManageUserActionPerformed

    private void BtnManageUser1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtnManageUser1ActionPerformed
        // TODO add your handling code here:

        DataAnalysisHospitalJPanel dataAnalysisHospitalJPanel = new DataAnalysisHospitalJPanel(userProcessContainer,
                enterprise, business);
        userProcessContainer.add("DataAnalysisHospitalJPanel", dataAnalysisHospitalJPanel);
        CardLayout layout = (CardLayout) userProcessContainer.getLayout();
        layout.next(userProcessContainer);

    }//GEN-LAST:event_BtnManageUser1ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BtnManageEmployee;
    private javax.swing.JButton BtnManageOrganization;
    private javax.swing.JButton BtnManageUser;
    private javax.swing.JButton BtnManageUser1;
    private javax.swing.JLabel enterpriseJLabel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel valueJLabel;
    // End of variables declaration//GEN-END:variables
}