X-Git-Url: https://harishankar.org/repos/?p=habeas.git;a=blobdiff_plain;f=src%2Fhabeas%2FMainFrame.java;h=070a7f7de9d41d01d457dacd13de00082d8ce298;hp=a03494bbfca90417386aff194f4bc800104eff3e;hb=2d04b06ea9a39c05dd3db560f3fc573696c7e36e;hpb=2ec9a68e727e3b67f003b43acd8593660fc90d26 diff --git a/src/habeas/MainFrame.java b/src/habeas/MainFrame.java index a03494b..070a7f7 100644 --- a/src/habeas/MainFrame.java +++ b/src/habeas/MainFrame.java @@ -5,6 +5,9 @@ */ package habeas; +import java.util.ArrayList; +import javax.swing.JOptionPane; + /** * * @author hari @@ -33,8 +36,17 @@ public class MainFrame extends javax.swing.JFrame { menuLawyerNotices = new javax.swing.JMenu(); menuCreateNotice = new javax.swing.JMenuItem(); menuManageNotices = new javax.swing.JMenuItem(); + jSeparator1 = new javax.swing.JPopupMenu.Separator(); + menuGenerateRaisedBills = new javax.swing.JMenuItem(); + menuNoticesReports = new javax.swing.JMenu(); + menuNoticesToBeDrafted = new javax.swing.JMenuItem(); + menuNoticesClarificationPending = new javax.swing.JMenuItem(); + menuNoticeDraftAwaitingApproval = new javax.swing.JMenuItem(); + menuNoticesSentNotYetDelivered = new javax.swing.JMenuItem(); + menuAwaitingPayment = new javax.swing.JMenuItem(); menuSettings = new javax.swing.JMenu(); menuDatabaseSettings = new javax.swing.JMenuItem(); + menuStationery = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Habeas - Law Office Manager"); @@ -43,6 +55,7 @@ public class MainFrame extends javax.swing.JFrame { menuMaster.setMnemonic('M'); menuMaster.setText("Master"); + menuClientMaster.setMnemonic('c'); menuClientMaster.setText("Client Master..."); menuClientMaster.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -73,6 +86,65 @@ public class MainFrame extends javax.swing.JFrame { } }); menuLawyerNotices.add(menuManageNotices); + menuLawyerNotices.add(jSeparator1); + + menuGenerateRaisedBills.setMnemonic('G'); + menuGenerateRaisedBills.setText("Generate Raised Bills..."); + menuGenerateRaisedBills.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + menuGenerateRaisedBillsActionPerformed(evt); + } + }); + menuLawyerNotices.add(menuGenerateRaisedBills); + + menuNoticesReports.setMnemonic('r'); + menuNoticesReports.setText("Reports"); + + menuNoticesToBeDrafted.setText("To Be Drafted..."); + menuNoticesToBeDrafted.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + menuNoticesToBeDraftedActionPerformed(evt); + } + }); + menuNoticesReports.add(menuNoticesToBeDrafted); + + menuNoticesClarificationPending.setMnemonic('c'); + menuNoticesClarificationPending.setText("Clarifications pending..."); + menuNoticesClarificationPending.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + menuNoticesClarificationPendingActionPerformed(evt); + } + }); + menuNoticesReports.add(menuNoticesClarificationPending); + + menuNoticeDraftAwaitingApproval.setMnemonic('d'); + menuNoticeDraftAwaitingApproval.setText("Drafts to be approved..."); + menuNoticeDraftAwaitingApproval.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + menuNoticeDraftAwaitingApprovalActionPerformed(evt); + } + }); + menuNoticesReports.add(menuNoticeDraftAwaitingApproval); + + menuNoticesSentNotYetDelivered.setMnemonic('s'); + menuNoticesSentNotYetDelivered.setText("Notices sent not yet delivered..."); + menuNoticesSentNotYetDelivered.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + menuNoticesSentNotYetDeliveredActionPerformed(evt); + } + }); + menuNoticesReports.add(menuNoticesSentNotYetDelivered); + + menuAwaitingPayment.setMnemonic('a'); + menuAwaitingPayment.setText("Bills awaiting payment..."); + menuAwaitingPayment.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + menuAwaitingPaymentActionPerformed(evt); + } + }); + menuNoticesReports.add(menuAwaitingPayment); + + menuLawyerNotices.add(menuNoticesReports); jMenuBar1.add(menuLawyerNotices); @@ -88,6 +160,15 @@ public class MainFrame extends javax.swing.JFrame { }); menuSettings.add(menuDatabaseSettings); + menuStationery.setMnemonic('S'); + menuStationery.setText("Stationery Settings..."); + menuStationery.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + menuStationeryActionPerformed(evt); + } + }); + menuSettings.add(menuStationery); + jMenuBar1.add(menuSettings); setJMenuBar(jMenuBar1); @@ -130,6 +211,98 @@ public class MainFrame extends javax.swing.JFrame { frm.setVisible(true); }//GEN-LAST:event_menuManageNoticesActionPerformed + private void menuStationeryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuStationeryActionPerformed + // TODO add your handling code here: + StationerySettingsDialog frm = new StationerySettingsDialog(this, true); + frm.setVisible(true); + }//GEN-LAST:event_menuStationeryActionPerformed + + private void menuGenerateRaisedBillsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuGenerateRaisedBillsActionPerformed + // TODO add your handling code here: + GenerateRaisedBillsDialog frm = new GenerateRaisedBillsDialog(this, true); + frm.setVisible(true); + + }//GEN-LAST:event_menuGenerateRaisedBillsActionPerformed + + private void menuAwaitingPaymentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuAwaitingPaymentActionPerformed + // TODO add your handling code here: + NoticesReportViewDialog frm = new NoticesReportViewDialog(this, false); + String [] cols = {"Reference Number", "Description", "Bill Date", "Bill Amount", "Client"}; + int rep = 0; + ArrayList data = Utility.getReportData(rep, -1); + if (data == null) { + JOptionPane.showMessageDialog(this, ERROR_DISPLAYING_REPORT); + return; + } + frm.setupReportTable(rep, REPORT_TITLE_BILLS_AWAITING_PAYMENT, cols, data); + frm.setVisible(true); + }//GEN-LAST:event_menuAwaitingPaymentActionPerformed + + private void menuNoticesSentNotYetDeliveredActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuNoticesSentNotYetDeliveredActionPerformed + // TODO add your handling code here: + NoticesReportViewDialog frm = new NoticesReportViewDialog(this, false); + String[] cols = {"Reference Number", "Description", "Sent Date", "RPAD Reference", "Client"}; + int rep = 1; + ArrayList data = Utility.getReportData (rep, -1); + if (data == null) { + JOptionPane.showMessageDialog(this, ERROR_DISPLAYING_REPORT); + return; + } + frm.setupReportTable(rep, REPORT_TITLE_NOTICES_SENT_NOT_DELIVERED, cols, data); + frm.setVisible (true); + }//GEN-LAST:event_menuNoticesSentNotYetDeliveredActionPerformed + + private void menuNoticeDraftAwaitingApprovalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuNoticeDraftAwaitingApprovalActionPerformed + // TODO add your handling code here: + NoticesReportViewDialog frm = new NoticesReportViewDialog(this, false); + String cols[] = {"Reference Number", "Description", "Entrustment Date", "Client"}; + int rep = 2; + ArrayList data = Utility.getReportData(rep, -1); + if (data == null) { + JOptionPane.showMessageDialog(this, ERROR_DISPLAYING_REPORT); + return; + } + frm.setupReportTable(rep, REPORT_TITLE_DRAFTS_AWAITING_APPROVAL, cols, data); + frm.setVisible(true); + }//GEN-LAST:event_menuNoticeDraftAwaitingApprovalActionPerformed + + private void menuNoticesClarificationPendingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuNoticesClarificationPendingActionPerformed + // TODO add your handling code here: + NoticesReportViewDialog frm = new NoticesReportViewDialog(this, false); + String cols[] = {"Reference Number", "Description", "Entrustment Date", + "Clarification Remarks", "Client" }; + int rep = 3; + ArrayList data = Utility.getReportData(rep, -1); + if (data == null) { + JOptionPane.showMessageDialog(this, ERROR_DISPLAYING_REPORT); + return; + } + frm.setupReportTable(rep, REPORT_TITLE_CLARIFICATIONS_PENDING, cols, data); + frm.setVisible(true); + }//GEN-LAST:event_menuNoticesClarificationPendingActionPerformed + + private void menuNoticesToBeDraftedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuNoticesToBeDraftedActionPerformed + // TODO add your handling code here: + NoticesReportViewDialog frm = new NoticesReportViewDialog(this, false); + String cols[] = {"Reference Number", "Description", "Entrustment Date", + "Clarification Remarks", "Client" }; + int rep = 4; + ArrayList data = Utility.getReportData(rep, -1); + if (data == null) { + JOptionPane.showMessageDialog(this , ERROR_DISPLAYING_REPORT); + return; + } + frm.setupReportTable(rep, REPORT_TITLE_TO_BE_DRAFTED, cols, data); + frm.setVisible(true); + + }//GEN-LAST:event_menuNoticesToBeDraftedActionPerformed + private static final String REPORT_TITLE_TO_BE_DRAFTED = "To Be Drafted"; + private static final String REPORT_TITLE_CLARIFICATIONS_PENDING = "Clarifications Pending"; + private static final String REPORT_TITLE_DRAFTS_AWAITING_APPROVAL = "Drafts To Be Approved"; + public static final String REPORT_TITLE_NOTICES_SENT_NOT_DELIVERED = "Notices Sent Not Yet Delivered"; + public static final String ERROR_DISPLAYING_REPORT = "Error displaying report"; + public static final String REPORT_TITLE_BILLS_AWAITING_PAYMENT = "Bills Awaiting Payment"; + /** * @param args the command line arguments */ @@ -167,12 +340,21 @@ public class MainFrame extends javax.swing.JFrame { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JMenuBar jMenuBar1; + private javax.swing.JPopupMenu.Separator jSeparator1; + private javax.swing.JMenuItem menuAwaitingPayment; private javax.swing.JMenuItem menuClientMaster; private javax.swing.JMenuItem menuCreateNotice; private javax.swing.JMenuItem menuDatabaseSettings; + private javax.swing.JMenuItem menuGenerateRaisedBills; private javax.swing.JMenu menuLawyerNotices; private javax.swing.JMenuItem menuManageNotices; private javax.swing.JMenu menuMaster; + private javax.swing.JMenuItem menuNoticeDraftAwaitingApproval; + private javax.swing.JMenuItem menuNoticesClarificationPending; + private javax.swing.JMenu menuNoticesReports; + private javax.swing.JMenuItem menuNoticesSentNotYetDelivered; + private javax.swing.JMenuItem menuNoticesToBeDrafted; private javax.swing.JMenu menuSettings; + private javax.swing.JMenuItem menuStationery; // End of variables declaration//GEN-END:variables }