diff --git a/.classpath b/.classpath
new file mode 100644
index 0000000..6007430
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.gitignore b/.gitignore
index 2a074d5..e67f50f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
/ObjectLabSoftware/nbproject/private/
/ObjectLabSoftware/build/
/ObjectLabSoftware/dist/
-*.bak
\ No newline at end of file
+*.bak
+/bin/
diff --git a/.project b/.project
new file mode 100644
index 0000000..b27891d
--- /dev/null
+++ b/.project
@@ -0,0 +1,17 @@
+
+
+ OLI
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/Documentation/new BuildView.docx b/Documentation/new BuildView.docx
new file mode 100644
index 0000000..f27a109
Binary files /dev/null and b/Documentation/new BuildView.docx differ
diff --git a/ObjectLabSoftware/.classpath b/ObjectLabSoftware/.classpath
index e6cd9a1..9f24163 100644
--- a/ObjectLabSoftware/.classpath
+++ b/ObjectLabSoftware/.classpath
@@ -8,6 +8,7 @@
+
diff --git a/ObjectLabSoftware/computername b/ObjectLabSoftware/computername
new file mode 100644
index 0000000..e69de29
diff --git a/ObjectLabSoftware/computername.txt b/ObjectLabSoftware/computername.txt
new file mode 100644
index 0000000..7b9ad53
--- /dev/null
+++ b/ObjectLabSoftware/computername.txt
@@ -0,0 +1 @@
+127.0.0.1
diff --git a/ObjectLabSoftware/lib/postgresql-9.4.1208.jre6.jar b/ObjectLabSoftware/lib/postgresql-9.4.1208.jre6.jar
new file mode 100644
index 0000000..9718d6e
Binary files /dev/null and b/ObjectLabSoftware/lib/postgresql-9.4.1208.jre6.jar differ
diff --git a/ObjectLabSoftware/nbproject/build-impl.xml b/ObjectLabSoftware/nbproject/build-impl.xml
index 4627be4..aab5327 100755
--- a/ObjectLabSoftware/nbproject/build-impl.xml
+++ b/ObjectLabSoftware/nbproject/build-impl.xml
@@ -192,7 +192,12 @@ is divided into following sections:
-
+
+
+
+
+
+
@@ -218,6 +223,7 @@ is divided into following sections:
+
@@ -694,7 +700,7 @@ is divided into following sections:
-
+
@@ -769,7 +775,7 @@ is divided into following sections:
-
+
@@ -796,7 +802,7 @@ is divided into following sections:
-
+
diff --git a/ObjectLabSoftware/nbproject/build-native.xml b/ObjectLabSoftware/nbproject/build-native.xml
index 75448ad..1aa10a0 100644
--- a/ObjectLabSoftware/nbproject/build-native.xml
+++ b/ObjectLabSoftware/nbproject/build-native.xml
@@ -389,11 +389,9 @@ Portions Copyrighted 2013 Sun Microsystems, Inc.
-
-
-
-
-
+
+
+
diff --git a/ObjectLabSoftware/nbproject/build-native.xml~ b/ObjectLabSoftware/nbproject/build-native.xml~
new file mode 100644
index 0000000..75448ad
--- /dev/null
+++ b/ObjectLabSoftware/nbproject/build-native.xml~
@@ -0,0 +1,953 @@
+
+
+
+
+
+
+
+
+ Native Packager Ant calls based on SE support in JavaFX packager
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.addMappedName(
+ (source.indexOf("jfxrt.jar") >= 0) ||
+ (source.indexOf("deploy.jar") >= 0) ||
+ (source.indexOf("javaws.jar") >= 0) ||
+ (source.indexOf("plugin.jar") >= 0)
+ ? "" : source
+ );
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ObjectLabSoftware/nbproject/genfiles.properties b/ObjectLabSoftware/nbproject/genfiles.properties
index b24e8cf..86e5bf5 100755
--- a/ObjectLabSoftware/nbproject/genfiles.properties
+++ b/ObjectLabSoftware/nbproject/genfiles.properties
@@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=8064a381@1.75.2.48
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=2377266f
-nbproject/build-impl.xml.script.CRC32=fc86e766
-nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48
+nbproject/build-impl.xml.script.CRC32=694ae75e
+nbproject/build-impl.xml.stylesheet.CRC32=05530350@1.79.1.48
diff --git a/ObjectLabSoftware/nbproject/project.properties b/ObjectLabSoftware/nbproject/project.properties
index b2936cc..3387488 100755
--- a/ObjectLabSoftware/nbproject/project.properties
+++ b/ObjectLabSoftware/nbproject/project.properties
@@ -37,7 +37,7 @@ file.reference.mysql-connector-java-5.1.23-bin.jar=lib\\mysql-connector-java-5.1
file.reference.ojdbc14.jar-1=lib\\ojdbc14.jar
file.reference.poi-3.11-beta3-20141111.jar-3=lib\\poi-3.11-beta3-20141111.jar
includes=**
-jar.compress=false
+jar.compress=true
javac.classpath=\
${libs.MySQLDriver.classpath}:\
${libs.absolutelayout.classpath}:\
@@ -52,6 +52,7 @@ javac.classpath=\
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
+javac.external.vm=false
javac.processorpath=\
${javac.classpath}
javac.source=1.7
diff --git a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/AddDeviceView.java b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/AddDeviceView.java
index a0badac..d45c9ac 100644
--- a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/AddDeviceView.java
+++ b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/AddDeviceView.java
@@ -1,6 +1,7 @@
package ObjectLabEnterpriseSoftware;
import java.awt.BorderLayout;
+import java.awt.Dimension;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.ArrayList;
@@ -115,7 +116,7 @@ private void initComponents() {
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel1.setFont(new java.awt.Font("Segoe UI", 1, 24)); // NOI18N
- jLabel1.setText("Add Printer");
+ jLabel1.setText("Add Device");
getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 10, -1, -1));
getContentPane().add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 45, 440, 10));
getContentPane().add(printerNameTF, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 60, 124, -1));
@@ -123,7 +124,7 @@ private void initComponents() {
printerNameL.setFont(new java.awt.Font("Segoe UI", 0, 11)); // NOI18N
printerNameL.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
- printerNameL.setText("Printer Name:");
+ printerNameL.setText("Device Name:");
getContentPane().add(printerNameL, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 60, -1, -1));
removeFieldButton.setFont(new java.awt.Font("Segoe UI", 0, 11)); // NOI18N
@@ -214,7 +215,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuBar1.add(EditMenu);
setJMenuBar(jMenuBar1);
-
+ getContentPane().setPreferredSize(new Dimension(475, 125));
+ setSize(new Dimension(475, 125));
pack();
setLocationRelativeTo(null);
}// //GEN-END:initComponents
@@ -265,7 +267,7 @@ private void addFieldButtonActionPerformed(java.awt.event.ActionEvent evt) {//GE
fields.add(tfield);
tlabel = new JLabel();
tlabel.setName("fieldL" + (count - 1));
- tlabel.setText("Field #" + (count - 1));
+ tlabel.setText("Field Name " + (count - 1));
labels.add(tlabel);
cbox = new JCheckBox();
cbox.setName("numberCB" + (count - 2));
diff --git a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/AddStudentView.java b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/AddStudentView.java
index e8b793f..3d20242 100644
--- a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/AddStudentView.java
+++ b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/AddStudentView.java
@@ -9,11 +9,15 @@
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
-import javax.mail.internet.AddressException;
+import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.swing.JOptionPane;
-public class AddStudentView extends javax.swing.JFrame
+public class AddStudentView {
+
+}
+
+/*public class AddStudentView extends javax.swing.JFrame
{
private static final String NAME_OF_PAGE = "New Student";
@@ -59,7 +63,7 @@ public void windowClosing(WindowEvent e)
public void keyTyped(KeyEvent e)
{
char c = e.getKeyChar();
- if (!((c >= '0') && (c <= '9')
+ /* if (!((c >= '0') && (c <= '9')
|| (c == KeyEvent.VK_BACK_SPACE)
|| (c == KeyEvent.VK_DELETE)))
{
@@ -70,8 +74,8 @@ else if (tuIDEntry.getText().length() >= 7)
{
getToolkit().beep();
e.consume();
- }
- }
+ }*/
+/* }
});
}
@@ -80,8 +84,8 @@ else if (tuIDEntry.getText().length() >= 7)
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
- @SuppressWarnings("unchecked")
- // //GEN-BEGIN:initComponents
+ // @SuppressWarnings("unchecked")
+ /* // //GEN-BEGIN:initComponents
private void initComponents() {
newStudentLabel = new javax.swing.JLabel();
@@ -160,7 +164,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
}
});
getContentPane().add(emailEntry, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 170, 170, -1));
-
+
+ backButton.setFocusPainted(false);
backButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ObjectLabEnterpriseSoftware/images/back_arrow_button.png"))); // NOI18N
backButton.setToolTipText("Back");
backButton.setBorderPainted(false);
@@ -216,7 +221,7 @@ else if (!email.isEmpty())
{
if(InputValidation.isNumber(tuID)){
- if ((UtilController.addUser(tuID, firstName, lastName, email)) > 0)
+ /* if ((UtilController.addUser(tuID, firstName, lastName, email)) > 0)
{
JOptionPane.showMessageDialog(this, "Updating student data.");
dispose();
@@ -233,10 +238,10 @@ else if (!email.isEmpty())
}
}
- }
+ } */
- }//GEN-LAST:event_submitActionPerformed
+ /* }//GEN-LAST:event_submitActionPerformed
private void emailEntryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_emailEntryActionPerformed
// TODO add your handling code here:
@@ -270,4 +275,4 @@ private void backButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FI
private javax.swing.JLabel tuID;
private javax.swing.JTextField tuIDEntry;
// End of variables declaration//GEN-END:variables
-}
+} */
diff --git a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/AdminSettingsView.java b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/AdminSettingsView.java
index a115ae5..e1269aa 100755
--- a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/AdminSettingsView.java
+++ b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/AdminSettingsView.java
@@ -5,16 +5,29 @@
*/
package ObjectLabEnterpriseSoftware;
+import java.awt.Dimension;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
+import javax.swing.Box;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+
public class AdminSettingsView extends javax.swing.JFrame
{
- private static final String NAME_OF_PAGE = "Settings";
+ public AdminSettingsView() {
+ }
+ private static final String NAME_OF_PAGE = "\tSettings";
private static final MainView home = new MainView();
-
+ // --nav bar views ~Alex
+ private BuildView buildView;
+ private newJobsMgr jobsView;
+ private ReportsView reportsView;
+ private AdminSettingsView adminSettingsView;
+ //
public void AdminSettingsViewStart() {
initComponents();
+ initNavBar();
setLocationRelativeTo(null);
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
@@ -45,7 +58,7 @@ public void windowClosing(WindowEvent e)
@SuppressWarnings("unchecked")
// //GEN-BEGIN:initComponents
private void initComponents() {
-
+ setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jButton5 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jSeparator1 = new javax.swing.JSeparator();
@@ -60,7 +73,7 @@ private void initComponents() {
userGuide = new javax.swing.JMenuItem();
setTitle(UtilController.getPageName(NAME_OF_PAGE));
- setResizable(false);
+
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ObjectLabEnterpriseSoftware/images/back_arrow_button.png"))); // NOI18N
@@ -68,6 +81,7 @@ private void initComponents() {
jButton5.setBorderPainted(false);
jButton5.setContentAreaFilled(false);
jButton5.setFocusPainted(false);
+ jButton5.setVisible(false); // old backbutton still there but invis ~Alex
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
@@ -82,8 +96,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
- getContentPane().add(jButton4, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 70, 140, -1));
- getContentPane().add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 50, 320, 10));
+ getContentPane().add(jButton4, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 70, 140, -1));
+ getContentPane().add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 50, getContentPane().getWidth(), 10));
jButton1.setFont(new java.awt.Font("Segoe UI", 0, 11)); // NOI18N
jButton1.setText("Archive");
@@ -92,7 +106,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
- getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 130, 140, -1));
+ getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 130, 140, -1));
addPrinterButton.setFont(new java.awt.Font("Segoe UI", 0, 11)); // NOI18N
addPrinterButton.setLabel("Add Device");
@@ -101,20 +115,20 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
addPrinterButtonActionPerformed(evt);
}
});
- getContentPane().add(addPrinterButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 100, 140, -1));
+ getContentPane().add(addPrinterButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 100, 140, -1));
jLabel1.setFont(new java.awt.Font("Segoe UI", 1, 24)); // NOI18N
jLabel1.setText("Settings");
- getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 10, -1, 30));
+ getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 10, -1, 30));
jButton2.setFont(new java.awt.Font("Segoe UI", 0, 11)); // NOI18N
- jButton2.setText("Remove Class/Printer");
+ jButton2.setText("Remove Class/Device");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
- getContentPane().add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 160, 140, -1));
+ getContentPane().add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 160, 140, -1));
jButton3.setFont(new java.awt.Font("Segoe UI", 0, 11)); // NOI18N
jButton3.setText("Change Password");
@@ -123,14 +137,14 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
- getContentPane().add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 190, 140, -1));
+ getContentPane().add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 190, 140, -1));
jLabel2.setBackground(new java.awt.Color(40, 41, 40));
jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ObjectLabEnterpriseSoftware/images/white_bg.jpg"))); // NOI18N
jLabel2.setOpaque(true);
- getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 370, 230));
+ getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 750, 300));
- help.setText("Help");
+ /* help.setText("Help");
userGuide.setText("User Guide");
userGuide.addActionListener(new java.awt.event.ActionListener() {
@@ -142,10 +156,137 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuBar1.add(help);
- setJMenuBar(jMenuBar1);
-
+ setJMenuBar(jMenuBar1);*/
+ setPreferredSize(new Dimension(650,375));
+ setResizable(false);
pack();
}// //GEN-END:initComponents
+
+
+ private void initNavBar()
+ {
+
+ jMenuBar1.setPreferredSize(new Dimension(200, 30));
+ setJMenuBar(jMenuBar1);
+
+ navBtn_jobsMgr = new JButton("Jobs Manager");
+ navBtn_jobsMgr.setIcon(new ImageIcon(JobsView.class.getResource("/ObjectLabEnterpriseSoftware/images/view_file_icon.png")));
+ navBtn_jobsMgr.setPreferredSize(new Dimension(100,24));
+ //spacing
+ jMenuBar1.add(Box.createRigidArea(new Dimension(35,0)));
+ //
+ jMenuBar1.add(navBtn_jobsMgr);
+
+ navBtn_build = new JButton("Enter Build");
+ navBtn_build.setIcon(new ImageIcon(JobsView.class.getResource("/ObjectLabEnterpriseSoftware/images/hammer_icon.png")));
+
+ navBtn_build.setPreferredSize(new Dimension(100,24));
+ jMenuBar1.add(navBtn_build);
+
+ navBtn_reports = new JButton("Reports");
+ navBtn_reports.setIcon(new ImageIcon(JobsView.class.getResource("/ObjectLabEnterpriseSoftware/images/reports_icon.png")));
+ navBtn_reports.setPreferredSize(new Dimension(100,24));
+ jMenuBar1.add(navBtn_reports);
+
+ navBtn_settings = new JButton("Settings");
+ navBtn_settings.setIcon(new ImageIcon(JobsView.class.getResource("/ObjectLabEnterpriseSoftware/images/cog_icon.png")));
+ navBtn_settings.setPreferredSize(new Dimension(100,24));
+ jMenuBar1.add(navBtn_settings);
+
+
+ navBtn_jobsMgr.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ navBtn_jobsMgrActionPerformed(evt);
+ }
+ });
+
+ navBtn_build.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ navBtn_buildActionPerformed(evt);
+ }
+ });
+
+ navBtn_reports.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ navBtn_reportsActionPerformed(evt);
+ }
+ });
+
+ navBtn_settings.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ navBtn_settingsActionPerformed(evt);
+ }
+ });
+
+ }
+
+
+ private void navBtn_jobsMgrActionPerformed(java.awt.event.ActionEvent evt)
+ {
+ jobsView = new newJobsMgr();
+ jobsView.setVisible(true);
+ dispose();
+
+ }
+
+ private void navBtn_buildActionPerformed(java.awt.event.ActionEvent evt)
+ {
+ buildView = new BuildView();
+ buildView.startMakeBuildProcess();
+ dispose();
+
+ }
+
+ private void navBtn_reportsActionPerformed(java.awt.event.ActionEvent evt)
+ {
+ reportsView = new ReportsView();
+ reportsView.ReportsPage();
+ dispose();
+
+ }
+
+ private void navBtn_settingsActionPerformed(java.awt.event.ActionEvent evt)
+ {
+ adminSettingsView = new AdminSettingsView();
+ adminSettingsView.AdminSettingsViewStart();
+ dispose();
+
+ }
+
+
+
+ /////// Nav Bar ~Alex /////
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
// TODO add your handling code here:
@@ -201,5 +342,9 @@ private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JMenuItem userGuide;
+ private JButton navBtn_jobsMgr;
+ private JButton navBtn_build;
+ private JButton navBtn_reports;
+ private JButton navBtn_settings;
// End of variables declaration//GEN-END:variables
}
diff --git a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/BalanceView.form b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/BalanceView.form
new file mode 100644
index 0000000..9880e5d
--- /dev/null
+++ b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/BalanceView.form
@@ -0,0 +1,233 @@
+
+
+
diff --git a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/BalanceView.java b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/BalanceView.java
new file mode 100644
index 0000000..2b493a9
--- /dev/null
+++ b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/BalanceView.java
@@ -0,0 +1,504 @@
+/*
+ * 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 ObjectLabEnterpriseSoftware;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Point;
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import javax.swing.Box;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JTable;
+import javax.swing.table.DefaultTableModel;
+import javax.sql.*;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+
+
+/**
+ *
+ * @author Russell
+ */
+public class BalanceView extends javax.swing.JFrame {
+
+ private BuildView buildView;
+ private newJobsMgr jobsView;
+ private ReportsView reportsView;
+ private BalanceView balanceView;
+ private newSettingsMenu adminSettingsView;
+ private MaterialTransactionHistoryView materialTransView;
+ private double amount = 0;
+ //private String firstName = "";
+ //private String lastName = "";
+ //private String id = "";
+ private String enteredValue = "";
+ /**
+ * Creates new form BalanceView
+ */
+ //private static final String NAME_OF_PAGE = "Build File Creator";
+ private static DefaultTableModel model;
+ private static MainView home = new MainView();
+ public BalanceView() {
+
+ getContentPane().setBackground(Color.WHITE);
+ initComponents();
+ initNavBar();
+ model = (DefaultTableModel) jTable1.getModel();
+ updateBalanceWindow(enteredValue);
+ setVisible(true);
+ }
+
+
+protected void updateBalanceWindow(String enteredValue) {
+
+ model.setRowCount(0);
+
+ try {
+ SQLMethods dbconn = new SQLMethods();
+ ResultSet queryResult;
+
+ /*if (!id.isEmpty())
+ {
+ System.out.println(id);
+ queryResult = dbconn.searchStudentBalanceId(id);
+ }
+ else if (!lastName.isEmpty())
+ {
+ queryResult = dbconn.searchStudentBalanceLName(lastName);
+ }
+ else if (!firstName.isEmpty())
+ {
+ queryResult = dbconn.searchStudentBalanceFName(firstName);
+ }
+ else
+ {
+ queryResult = dbconn.searchStudentBalance();
+ }
+ */
+ if (!enteredValue.isEmpty())
+ {
+ queryResult = dbconn.searchStudentBalanceAll(enteredValue);
+ }
+ else
+ {
+ queryResult = dbconn.searchStudentBalance();
+ }
+
+ while(queryResult.next())
+ {
+ String first_name = queryResult.getString(1);
+ String last_name= queryResult.getString(2);
+ String towson_id = queryResult.getString(3);
+ String material1 = queryResult.getString(4);
+ String material2 = queryResult.getString(5);
+ String material3 = queryResult.getString(6);
+ System.out.println("Adding row...");
+ model.addRow(new Object[] {first_name, last_name, towson_id, material1, material2, material3});
+ }
+ jTable1.setModel(model);
+ jTable1.repaint();
+ dbconn.closeDBConnection();
+ } catch(Exception e)
+ {
+ System.out.println("Error: " + e);
+ }
+}
+ /**
+ * 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")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jMenuItem1 = new javax.swing.JMenuItem();
+ jButton1 = new javax.swing.JButton();
+ jScrollPane1 = new javax.swing.JScrollPane();
+ jTable1 = new javax.swing.JTable();
+ jTextField1 = new javax.swing.JTextField();
+ jButton2 = new javax.swing.JButton();
+ jLabel4 = new javax.swing.JLabel();
+ jLabel5 = new javax.swing.JLabel();
+ jTextField4 = new javax.swing.JTextField();
+ jButton3 = new javax.swing.JButton();
+ jComboBox1 = new javax.swing.JComboBox();
+ jLabel1 = new javax.swing.JLabel();
+ jLabel2 = new javax.swing.JLabel();
+ jMenuBar1 = new javax.swing.JMenuBar();
+
+ jMenuItem1.setText("jMenuItem1");
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+ setTitle("Student Balance ");
+
+ jButton1.setText("Logout");
+ jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseClicked(java.awt.event.MouseEvent evt) {
+ jButton1MouseClicked(evt);
+ }
+ });
+
+ jTable1.setAutoCreateRowSorter(true);
+ jTable1.setModel(new javax.swing.table.DefaultTableModel(
+ new Object [][] {
+ {null, null, null, null, null, null},
+ {null, null, null, null, null, null},
+ {null, null, null, null, null, null},
+ {null, null, null, null, null, null}
+ },
+ new String [] {
+ "First Name", "Last Name", "Towson ID", "Z Corp Plaster", "Objet Build", "Objet Support"
+ }
+ ) {
+ boolean[] canEdit = new boolean [] {
+ false, false, false, false, false, false
+ };
+
+ public boolean isCellEditable(int rowIndex, int columnIndex) {
+ return canEdit [columnIndex];
+ }
+ });
+ jTable1.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseClicked(java.awt.event.MouseEvent evt) {
+ jTable1MouseClicked(evt);
+ }
+ });
+ jScrollPane1.setViewportView(jTable1);
+
+ jButton2.setText("Search");
+ jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseClicked(java.awt.event.MouseEvent evt) {
+ jButton2MouseClicked(evt);
+ }
+ });
+
+ jLabel4.setText("Search by first name, last name, or Towson ID:");
+
+ jLabel5.setFont(new java.awt.Font("Segoe UI", 1, 24)); // NOI18N
+ jLabel5.setText("Student Balance");
+
+ jButton3.setText("Add");
+ jButton3.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseClicked(java.awt.event.MouseEvent evt) {
+ jButton3MouseClicked(evt);
+ }
+ });
+
+ jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Z Corp Plaster", "Objet Build", "Objet Support" }));
+
+ jLabel1.setText("Select Material:");
+
+ jLabel2.setText("Enter Amount:");
+ setJMenuBar(jMenuBar1);
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jScrollPane1)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jButton1)
+ .addGroup(layout.createSequentialGroup()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 227, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(18, 18, 18)
+ .addComponent(jButton2)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 43, Short.MAX_VALUE)
+ .addComponent(jLabel2))
+ .addComponent(jLabel1))
+ .addGap(18, 18, 18)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(18, 18, 18)
+ .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addComponent(jComboBox1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
+ .addComponent(jLabel4)))
+ .addContainerGap())
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(jLabel5)
+ .addGap(210, 210, 210))
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(jLabel5)
+ .addGap(18, 18, 18)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel1))
+ .addGap(1, 1, 1)
+ .addComponent(jLabel4)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jButton2)
+ .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jButton3)
+ .addComponent(jLabel2))
+ .addGap(18, 18, 18)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(18, 18, 18)
+ .addComponent(jButton1)
+ .addContainerGap())
+ );
+
+ pack();
+ setLocationRelativeTo(null);
+ }// //GEN-END:initComponents
+
+ private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked
+ dispose();
+ home.setVisible(true);
+ }//GEN-LAST:event_jButton1MouseClicked
+
+ private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked
+ enteredValue = "";
+ //firstName = "";
+ //lastName = "";
+ //id = "";
+ enteredValue = jTextField1.getText();
+ //firstName = jTextField1.getText();
+ //lastName = jTextField2.getText();
+ //id = jTextField3.getText();
+ //updateBalanceWindow(firstName, lastName, id);
+ updateBalanceWindow(enteredValue);
+ }//GEN-LAST:event_jButton2MouseClicked
+
+ private void jButton3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton3MouseClicked
+ String stringTemp = jTextField4.getText();
+ amount = Double.valueOf(stringTemp);
+ String studentId = null;
+ SQLMethods dbconn = new SQLMethods();
+ if (jTable1.getRowCount() == 1 && !jTable1.contains(jTable1.getSelectedRow(),2))
+ {
+ studentId = jTable1.getModel().getValueAt(0, 2).toString();
+ }
+ else if (jTable1.contains(jTable1.getSelectedRow(), 2))
+ {
+ studentId = jTable1.getModel().getValueAt(jTable1.getSelectedRow(), 2).toString();
+ }
+
+ if(jComboBox1.getSelectedItem().toString().equalsIgnoreCase("Z Corp Plaster"))
+ {
+ dbconn.addMaterial(studentId, amount, "z_corp_plaster");
+ dbconn.addTransactionHistory(studentId, "z_corp_plaster", amount);
+ }
+ else if(jComboBox1.getSelectedItem().toString().equalsIgnoreCase("Objet Build"))
+ {
+ dbconn.addMaterial(studentId, amount, "objet_build");
+ dbconn.addTransactionHistory(studentId, "objet_build", amount);
+ }
+ else if(jComboBox1.getSelectedItem().toString().equalsIgnoreCase("Objet Support"))
+ {
+ dbconn.addMaterial(studentId, amount, "objet_support");
+ dbconn.addTransactionHistory(studentId, "objet_support", amount);
+ }
+ else
+ {
+ System.out.println("ERROR");
+ }
+
+
+ dbconn.closeDBConnection();
+ updateBalanceWindow(enteredValue);
+ }//GEN-LAST:event_jButton3MouseClicked
+
+ private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable1MouseClicked
+ JTable table =(JTable) evt.getSource();
+ Point p = evt.getPoint();
+ int row = table.rowAtPoint(p);
+ if (evt.getClickCount() == 2) {
+ // double-click a row
+ System.out.println("double clicked...");
+ System.out.println(table.getValueAt(table.getSelectedRow(), 0).toString());
+
+ String fName = table.getValueAt(table.getSelectedRow(), 0).toString();
+ String lName = table.getValueAt(table.getSelectedRow(), 1).toString();
+ String id = table.getValueAt(table.getSelectedRow(), 2).toString();
+
+ materialTransView = new MaterialTransactionHistoryView();
+ materialTransView.showHistory(fName, lName, id);
+ //dispose();
+ }
+ }//GEN-LAST:event_jTable1MouseClicked
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String args[]) {
+ /* Set the Nimbus look and feel */
+ //
+ /* 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(BalanceView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (InstantiationException ex) {
+ java.util.logging.Logger.getLogger(BalanceView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (IllegalAccessException ex) {
+ java.util.logging.Logger.getLogger(BalanceView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (javax.swing.UnsupportedLookAndFeelException ex) {
+ java.util.logging.Logger.getLogger(BalanceView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ }
+ //
+ //
+
+ /* Create and display the form */
+ java.awt.EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ new BalanceView().setVisible(true);
+ }
+ });
+ }
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton jButton1;
+ private javax.swing.JButton jButton2;
+ private javax.swing.JButton jButton3;
+ private javax.swing.JComboBox jComboBox1;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JLabel jLabel4;
+ private javax.swing.JLabel jLabel5;
+ private javax.swing.JMenuBar jMenuBar1;
+ private javax.swing.JMenuItem jMenuItem1;
+ private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JTable jTable1;
+ private javax.swing.JTextField jTextField1;
+ private javax.swing.JTextField jTextField4;
+ // End of variables declaration//GEN-END:variables
+ private void initNavBar()
+ {
+
+ jMenuBar1.setPreferredSize(new Dimension(275, 30));
+ setJMenuBar(jMenuBar1);
+
+ navBtn_jobsMgr = new JButton("Jobs Manager");
+ navBtn_jobsMgr.setIcon(new ImageIcon(JobsView.class.getResource("/ObjectLabEnterpriseSoftware/images/view_file_icon.png")));
+ navBtn_jobsMgr.setPreferredSize(new Dimension(100,24));
+
+ jMenuBar1.add(Box.createRigidArea(new Dimension(42,12)));
+ jMenuBar1.add(navBtn_jobsMgr);
+
+ navBtn_build = new JButton("Enter Build");
+ navBtn_build.setIcon(new ImageIcon(JobsView.class.getResource("/ObjectLabEnterpriseSoftware/images/hammer_icon.png")));
+ navBtn_build.setPreferredSize(new Dimension(100,24));
+ jMenuBar1.add(navBtn_build);
+
+ navBtn_reports = new JButton("Reports");
+ navBtn_reports.setIcon(new ImageIcon(JobsView.class.getResource("/ObjectLabEnterpriseSoftware/images/reports_icon.png")));
+ navBtn_reports.setPreferredSize(new Dimension(100,24));
+ jMenuBar1.add(navBtn_reports);
+
+ navBtn_balance = new JButton("Balance");
+ navBtn_balance.setIcon(new ImageIcon(JobsView.class.getResource("/ObjectLabEnterpriseSoftware/images/stats_icon.png")));
+ navBtn_balance.setPreferredSize(new Dimension(100,24));
+
+ jMenuBar1.add(navBtn_balance);
+
+
+ navBtn_settings = new JButton("Settings");
+ navBtn_settings.setIcon(new ImageIcon(JobsView.class.getResource("/ObjectLabEnterpriseSoftware/images/cog_icon.png")));
+ navBtn_settings.setPreferredSize(new Dimension(100,24));
+ jMenuBar1.add(navBtn_settings);
+
+ navBtn_jobsMgr.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ navBtn_jobsMgrActionPerformed(evt);
+ }
+ });
+
+ navBtn_build.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ navBtn_buildActionPerformed(evt);
+ }
+ });
+
+ navBtn_reports.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ navBtn_reportsActionPerformed(evt);
+ }
+ });
+
+ navBtn_balance.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ navBtn_balanceActionPerformed(evt);
+ }
+ });
+
+
+ navBtn_settings.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ navBtn_settingsActionPerformed(evt);
+ }
+ });
+
+ }
+
+
+ private void navBtn_jobsMgrActionPerformed(java.awt.event.ActionEvent evt)
+ {
+ jobsView = new newJobsMgr();
+ jobsView.setVisible(true);
+ dispose();
+
+ }
+
+ private void navBtn_buildActionPerformed(java.awt.event.ActionEvent evt)
+ {
+ buildView = new BuildView();
+ buildView.startMakeBuildProcess();
+ dispose();
+
+ }
+
+ private void navBtn_reportsActionPerformed(java.awt.event.ActionEvent evt)
+ {
+ reportsView = new ReportsView();
+ reportsView.ReportsPage();
+ dispose();
+
+ }
+
+ private void navBtn_balanceActionPerformed(java.awt.event.ActionEvent evt)
+ {
+ balanceView = new BalanceView();
+ balanceView.setVisible(true);
+ dispose();
+
+ }
+
+ private void navBtn_settingsActionPerformed(java.awt.event.ActionEvent evt)
+ {
+ adminSettingsView = new newSettingsMenu();
+ adminSettingsView.setVisible(true);
+ dispose();
+
+ }
+
+ private JButton navBtn_jobsMgr;
+ private JButton navBtn_build;
+ private JButton navBtn_reports;
+ private JButton navBtn_settings;
+ private JButton navBtn_balance;
+}
diff --git a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/BuildView.form b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/BuildView.form
index 59ba4ba..ed2e910 100755
--- a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/BuildView.form
+++ b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/BuildView.form
@@ -52,42 +52,7 @@
- //GEN-END:initComponents
+
- userGuide.setText("User Guide");
- userGuide.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- userGuideActionPerformed(evt);
- }
- });
- helpMenu.add(userGuide);
+ private void initNavBar()
+ {
- jMenuBar1.add(helpMenu);
+ jMenuBar2.setPreferredSize(new Dimension(275, 30));
+ setJMenuBar(jMenuBar2);
+
+ navBtn_jobsMgr = new JButton("Jobs Manager");
+ navBtn_jobsMgr.setIcon(new ImageIcon(JobsView.class.getResource("/ObjectLabEnterpriseSoftware/images/view_file_icon.png")));
+ navBtn_jobsMgr.setPreferredSize(new Dimension(100,24));
+
+ jMenuBar2.add(Box.createRigidArea(new Dimension(170,12)));
+ jMenuBar2.add(navBtn_jobsMgr);
+
+ navBtn_build = new JButton("Enter Build");
+ navBtn_build.setIcon(new ImageIcon(JobsView.class.getResource("/ObjectLabEnterpriseSoftware/images/hammer_icon.png")));
+ navBtn_build.setPreferredSize(new Dimension(100,24));
+ jMenuBar2.add(navBtn_build);
+
+ navBtn_reports = new JButton("Reports");
+ navBtn_reports.setIcon(new ImageIcon(JobsView.class.getResource("/ObjectLabEnterpriseSoftware/images/reports_icon.png")));
+ navBtn_reports.setPreferredSize(new Dimension(100,24));
+ jMenuBar2.add(navBtn_reports);
+
+ navBtn_balance = new JButton("Balance");
+ navBtn_balance.setIcon(new ImageIcon(JobsView.class.getResource("/ObjectLabEnterpriseSoftware/images/stats_icon.png")));
+ navBtn_balance.setPreferredSize(new Dimension(100,24));
+
+ jMenuBar2.add(navBtn_balance);
+
+
+ navBtn_settings = new JButton("Settings");
+ navBtn_settings.setIcon(new ImageIcon(JobsView.class.getResource("/ObjectLabEnterpriseSoftware/images/cog_icon.png")));
+ navBtn_settings.setPreferredSize(new Dimension(100,24));
+ jMenuBar2.add(navBtn_settings);
+
+ navBtn_jobsMgr.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ navBtn_jobsMgrActionPerformed(evt);
+ }
+ });
+
+ navBtn_build.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ navBtn_buildActionPerformed(evt);
+ }
+ });
+
+ navBtn_reports.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ navBtn_reportsActionPerformed(evt);
+ }
+ });
+
+ navBtn_balance.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ navBtn_balanceActionPerformed(evt);
+ }
+ });
+
+
+ navBtn_settings.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ navBtn_settingsActionPerformed(evt);
+ }
+ });
- setJMenuBar(jMenuBar1);
+ }
+
+
+ private void navBtn_jobsMgrActionPerformed(java.awt.event.ActionEvent evt)
+ {
+ jobsView = new newJobsMgr();
+ jobsView.setVisible(true);
+ dispose();
+
+ }
+
+ private void navBtn_buildActionPerformed(java.awt.event.ActionEvent evt)
+ {
+ buildView = new BuildView();
+ buildView.startMakeBuildProcess();
+ dispose();
+
+ }
+
+ private void navBtn_reportsActionPerformed(java.awt.event.ActionEvent evt)
+ {
+ reportsView = new ReportsView();
+ reportsView.ReportsPage();
+ dispose();
+
+ }
+
+ private void navBtn_balanceActionPerformed(java.awt.event.ActionEvent evt)
+ {
+ balanceView= new BalanceView();
+ balanceView.setVisible(true);
+ dispose();
- pack();
- setLocationRelativeTo(null);
- }// //GEN-END:initComponents
+ }
+
+ private void navBtn_settingsActionPerformed(java.awt.event.ActionEvent evt)
+ {
+ adminSettingsView = new newSettingsMenu();
+ adminSettingsView.setVisible(true);
+ dispose();
+
+ }
+
+
+
+ /////// Nav Bar ~Alex /////
+
+
private void Submit_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Submit_ButtonActionPerformed
//add stl information to build table zcorp and create incomplete entry
if (!submit())
@@ -503,10 +636,19 @@ private void Submit_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN
} else
{
dispose();
- home.resetAdminMode();
+ //Rajewski
+ //Will now reload build view instead of go to jobs manager.
+ //home.resetAdminMode();
+ navBtn_buildActionPerformed(evt);
}
}//GEN-LAST:event_Submit_ButtonActionPerformed
+ private void logoutButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logoutButtonActionPerformed
+//GEN-HEADEREND:event_logoutButtonActionPerformed
+ dispose();
+ home.setVisible(true);
+ }//GEN-LAST:event_logoutButtonActionPerformed
+
private void filepathToSelectedDeviceBuildActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_filepathToSelectedDeviceBuildActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_filepathToSelectedDeviceBuildActionPerformed
@@ -516,11 +658,17 @@ private void filepathToSelectedDeviceBuildActionPerformed(java.awt.event.ActionE
*
* @param evt
*/
+ //this might be what brings up the page
+ //Rajewski
private void browseBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseBtnActionPerformed
JFileChooser chooser = new JFileChooser();//Select Default
+ ///?
+ //Rajewski
File defaultBuildDirectory;
String device = (String)deviceNameComboBox.getSelectedItem();
device.toLowerCase();
+ //RAJEWSKI
+ //WHAT DOES THIS DO?
defaultBuildDirectory = new File(FileManager.getDeviceToPrint(device));
chooser.setPreferredSize(new Dimension(800, 500));
chooser.setCurrentDirectory(defaultBuildDirectory);
@@ -535,47 +683,79 @@ private void browseBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIR
if (!filepathToSelectedDeviceBuild.getText().isEmpty() && deviceModel != null)
{
+ //checks that new build file is unique
if (!UtilController.isBuildFileLocationUsed(filepathToSelectedDeviceBuild.getText()))
{
- setupUserInputBuildData();
+ //Rajewski
+ //create new function for making the list of builds table visible/populated for selected device
+ //call it here
+ //setupUserInputBuildData();
} else
{
filepathToSelectedDeviceBuild.setText("");
buildFileLocationErrorStatusText.setText("Select a unique build file location");
buildFileLocationErrorStatusText.setVisible(true);
- invalidBuildLocationSelectedColumnModel.setColumnIdentifiers(errorTextColumnHeader);
- deviceInputTable.setModel(invalidBuildLocationSelectedColumnModel);
- deviceInputTable.setVisible(false);
+ //Rajewski
+ //deviceInputTable was removed and replaced with table of previous builds
+
+ //invalidBuildLocationSelectedColumnModel.setColumnIdentifiers(errorTextColumnHeader);
+ //deviceInputTable.setModel(invalidBuildLocationSelectedColumnModel);
+ //deviceInputTable.setVisible(false);
}
}
}//GEN-LAST:event_browseBtnActionPerformed
- private void userGuideActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_userGuideActionPerformed
- // TODO add your handling code here:
- UtilController.openAdminHelpPage();
- }//GEN-LAST:event_userGuideActionPerformed
-
+ //Rajewski
+ //Removed because no longer used/needed for input table
+ /*
private void setupUserInputBuildData()
{
buildFileLocationErrorStatusText.setVisible(false);
- deviceModel.addField("Run time", 0); /* Should later remove this and make it a seperate parameter in the function submitBuild call (so the backend knows less about how the UI stores its data) */
- /*
+ deviceModel.addField("Run time", 0); /* Should later remove this and make it a seperate parameter in the function submitBuild call (so the backend knows less about how the UI stores its data)
+
deviceModel.addField("Hours", 0);
deviceModel.addField("Minutes", 0);
deviceModel.addField("Seconds", 0);
- */
+
trackableFields = deviceModel.getFieldNames();
deviceDataModel = new DefaultTableModel(trackableFields.toArray(), 1);
+
deviceInputTable.setModel(deviceDataModel);
deviceInputTable.setVisible(true);
}
+ */
+
private void deviceNameComboBoxActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_deviceNameComboBoxActionPerformed
{//GEN-HEADEREND:event_deviceNameComboBoxActionPerformed
/* When a device is selected we put the info into the Device class and then detrmine how we update our view from here
From here we can determine how we update our display and what type of data we require from the user as well as the
column data to display.
*/
+
+
+ clearEntries(fileTableModel);
+ clearEntries(fileTableModel2);
+ clearEntries(fileTableModel3);
+ studentSubmissionApprovedTableList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ submissionsToBuildList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+
+
+ /*
+ studentSubmissionApprovedTableList.setRowSelectionAllowed(true);
+ studentSubmissionApprovedTableList.setColumnSelectionAllowed(true);
+ studentSubmissionApprovedTableList.setCellSelectionEnabled(false);
+
+ studentSubmissionApprovedTableList.setSelectionBackground(Color.BLUE);
+ studentSubmissionApprovedTableList.setSelectionForeground(Color.BLUE);
+
+ submissionsToBuildList.setRowSelectionAllowed(true);
+ submissionsToBuildList.setColumnSelectionAllowed(true);
+ submissionsToBuildList.setCellSelectionEnabled(false);
+
+ submissionsToBuildList.setSelectionBackground(Color.BLUE);
+ submissionsToBuildList.setSelectionForeground(Color.BLUE);
+ */
deviceModel = UtilController.getPrinterInfo((String) deviceNameComboBox.getSelectedItem());
if (deviceModel.getTrackSubmission())
@@ -586,22 +766,42 @@ private void deviceNameComboBoxActionPerformed(java.awt.event.ActionEvent evt)//
{
fileTableModel.setColumnIdentifiers(new String[]
{
- "", "Job ID", "File name", "First name", "Last name", "Submission date", "Printer name", "Class name", "Class section"
+ "Job ID", "File name", "First name", "Last name", "Submission date", "Printer name", "Class name", "Class section"
+
});
+
+ fileTableModel2.setColumnIdentifiers(new String[]
+ {
+ "Job ID", "File name", "First name", "Last name", "Submission date", "Printer name", "Class name", "Class section"
+ });
+ for(int i = 0; i < approvedStudentSubmissions.size(); i++)
+ {
+ fileTableModel.addRow(new Object[] {approvedStudentSubmissions.get(i).get(0), approvedStudentSubmissions.get(i).get(1),
+ approvedStudentSubmissions.get(i).get(2), approvedStudentSubmissions.get(i).get(3), approvedStudentSubmissions.get(i).get(4),
+ approvedStudentSubmissions.get(i).get(5), approvedStudentSubmissions.get(i).get(6), approvedStudentSubmissions.get(i).get(7)
+ });
+ //Rajewski
+ //development purposes
+ /*System.out.println(approvedStudentSubmissions.get(i).get(0) + "\t" + approvedStudentSubmissions.get(i).get(1) + "\t" +
+ approvedStudentSubmissions.get(i).get(2) + "\t" + approvedStudentSubmissions.get(i).get(3) + "\t" + approvedStudentSubmissions.get(i).get(4) + "\t" +
+ approvedStudentSubmissions.get(i).get(5) + "\t" + approvedStudentSubmissions.get(i).get(6) + "\t" + approvedStudentSubmissions.get(i).get(7));*/
+ }
- updateViewData(fileTableModel, approvedStudentSubmissions);
-
- /* Set UI to display the next steps in completing a build for student submissions that are tracked */
+ submissionsToBuildList.setModel(fileTableModel2);
+ studentSubmissionApprovedTableList.setModel(fileTableModel);
+ submissionsToBuildList.setVisible(true);
studentSubmissionApprovedTableList.setVisible(true);
buildLbl.setVisible(true);
browseBtn.setVisible(true);
filepathToSelectedDeviceBuild.setVisible(true);
+ repaint();
} else
{
fileTableModel.setColumnIdentifiers(new String[]
{
- "There are no approved student submissions for the device " + deviceModel.getDeviceName()
+ "There are no approved student submissions for the " + deviceModel.getDeviceName()
});
+ submissionsToBuildList.setVisible(false);
studentSubmissionApprovedTableList.setVisible(false);
buildLbl.setVisible(false);
browseBtn.setVisible(false);
@@ -610,9 +810,12 @@ private void deviceNameComboBoxActionPerformed(java.awt.event.ActionEvent evt)//
} else
{
- setupUserInputBuildData();
+ //Rajewski
+ //deleted function
+ //setupUserInputBuildData();
studentSubmissionTracked = false;
+ submissionsToBuildList.setVisible(false);
studentSubmissionApprovedTableList.setVisible(false);
filepathToSelectedDeviceBuild.setVisible(false);
buildLbl.setVisible(false);
@@ -623,67 +826,273 @@ private void deviceNameComboBoxActionPerformed(java.awt.event.ActionEvent evt)//
"Student submission for the " + deviceModel.getDeviceName() + " was added to Opt-Out of approval/denal of jobs"
});
}
+
+ setupBuildRecordsTable();
+
}//GEN-LAST:event_deviceNameComboBoxActionPerformed
- private void backToMainMenuActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_backToMainMenuActionPerformed
- {//GEN-HEADEREND:event_backToMainMenuActionPerformed
- dispose();
- home.resetAdminMode();
- }//GEN-LAST:event_backToMainMenuActionPerformed
+ private void setupBuildRecordsTable(){
+ //Rajewski
+ //Setting up table of previous builds
+ fileTableModel3.setColumnIdentifiers(new String[]
+ {
+ "Build File Name", "Date", "Number of Files"
- private void removeBuildOpenActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_removeBuildOpenActionPerformed
- {//GEN-HEADEREND:event_removeBuildOpenActionPerformed
+ });
+ buildsForCurrentDeviceTable.getColumnModel().getColumn(0).setPreferredWidth(410);
+ String currentDevice = (String) deviceNameComboBox.getSelectedItem();
+ ArrayList> buildList = UtilController.arrayListOfBuilds(currentDevice);
+ for(int i = 0; i < buildList.size(); i++)
+ {
+ fileTableModel3.addRow(new Object[] { buildList.get(i).get(0), buildList.get(i).get(1),
+ buildList.get(i).get(2)
+ });
+ //Rajewski
+ //line for testing
+ //System.out.println(buildList.get(i).get(0) + "\t" + buildList.get(i).get(1) + "\t" + buildList.get(i).get(2));
+ }
+
+ }
+
+ private void swapButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_swapButtonActionPerformed
+
+ }//GEN-LAST:event_swapButtonActionPerformed
+
+ private void swapButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_swapButtonMouseClicked
+ // TODO add your handling code here:
+ //Rajewski
+ //Optimize this function later
+ /*studentSubmissionApprovedTableList.setRowSelectionAllowed(true);
+ studentSubmissionApprovedTableList.setColumnSelectionAllowed(true);
+ studentSubmissionApprovedTableList.setCellSelectionEnabled(true);
+ studentSubmissionApprovedTableList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+
+ submissionsToBuildList.setRowSelectionAllowed(true);
+ submissionsToBuildList.setColumnSelectionAllowed(true);
+ submissionsToBuildList.setCellSelectionEnabled(true);
+ submissionsToBuildList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+ */
+ //Rajewski
+ //This is not good error checking.
+ /*
+ if (studentSubmissionApprovedTableList.equals(submissionsToBuildList.getSelectedRow())) //believe this check works //No, it does not Spring 2016. - Rajewski
+ {
+ JOptionPane.showMessageDialog(null, "File is already in the current jobs list!",
+ "Add Error", JOptionPane.ERROR_MESSAGE);
+ }
+ */
+
+ /*if(submissionsToBuildList.getSelectedRow() == 0)
+ {
+ ((MutableComboBoxModel) studentSubmissionApprovedTableList).addElement(submissionsToBuildList.getSelectedRow());
+ ((MutableComboBoxModel) submissionsToBuildList).removeElement(submissionsToBuildList.getSelectedRow());
+ }*/
+
+ //removed else if block becuase not having a selection could still mean that the other table has a selected row
+ /*
+ else if(submissionsToBuildList.getSelectedRow() == -1)
+ {
+ JOptionPane.showMessageDialog(null, "No file selected!",
+ "Add Error", JOptionPane.ERROR_MESSAGE);
+ }
+ */
+ //gets all info for selected row to add to build table
+
+ int k;
+
+ /*
+ while(k < studentSubmissionApprovedTableList.getRowCount()){
+
+
+ //k--;
+ }
+ k++;
+ //System.out.print(k + "\t");
+ }
+ //System.out.println();
+ */
+ k = studentSubmissionApprovedTableList.getSelectedRow();
+ System.out.println(k);
+ if(k != -1){
+ fileTableModel2.addRow(new Object[] {
+ studentSubmissionApprovedTableList.getValueAt(k, 0),
+ studentSubmissionApprovedTableList.getValueAt(k, 1),
+ studentSubmissionApprovedTableList.getValueAt(k, 2),
+ studentSubmissionApprovedTableList.getValueAt(k, 3),
+ studentSubmissionApprovedTableList.getValueAt(k, 4),
+ studentSubmissionApprovedTableList.getValueAt(k, 5),
+ studentSubmissionApprovedTableList.getValueAt(k, 6),
+ studentSubmissionApprovedTableList.getValueAt(k, 7)
+ });
+ fileTableModel.removeRow(k);
+ }
+
+
+ studentSubmissionApprovedTableList.setModel(fileTableModel);
+ submissionsToBuildList.setModel(fileTableModel2);
- }//GEN-LAST:event_removeBuildOpenActionPerformed
+ /*
+ *
+ * removeClassListModel.addElement(currentClassListRC.getSelectedValue());
+ currentDeviceListModel.removeElement(currentClassListRC.getSelectedValue());
+ //((MutableComboBoxModel) studentSubmissionApprovedTableList).addElement(submissionsToBuildList.getSelectedRow());
+ //((MutableComboBoxModel) submissionsToBuildList).removeElement(submissionsToBuildList.getSelectedRow());
+ //removeClassList.setModel(removeClassListModel);
+ *
+ * */
+
+
+ //Rajewski
+ //logic for moving a row from the new build table back to the approved files table
+ int j;
+/*
+ while(j < submissionsToBuildList.getRowCount()){
+
+ //j--;
+ }
+ j++;
+ }
+ */
+
+ j = submissionsToBuildList.getSelectedRow();
+ if(j != -1){
+ fileTableModel.addRow(new Object[] {
+ submissionsToBuildList.getValueAt(j, 0),
+ submissionsToBuildList.getValueAt(j, 1),
+ submissionsToBuildList.getValueAt(j, 2),
+ submissionsToBuildList.getValueAt(j, 3),
+ submissionsToBuildList.getValueAt(j, 4),
+ submissionsToBuildList.getValueAt(j, 5),
+ submissionsToBuildList.getValueAt(j, 6),
+ submissionsToBuildList.getValueAt(j, 7)
- private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jMenuItem1ActionPerformed
- {//GEN-HEADEREND:event_jMenuItem1ActionPerformed
- dispose();
- removeWindow.init();
- }//GEN-LAST:event_jMenuItem1ActionPerformed
+ });
+ fileTableModel2.removeRow(j);
+ }
+
- private void minuteFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_minuteFieldActionPerformed
+ studentSubmissionApprovedTableList.setModel(fileTableModel);
+ submissionsToBuildList.setModel(fileTableModel2);
+
+
+ setupBuildRecordsTable();
+ }//GEN-LAST:event_swapButtonMouseClicked
+/*
+ private void logoutButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
- }//GEN-LAST:event_minuteFieldActionPerformed
+ }//GEN-LAST:event_jButton1ActionPerformed
+
+ */
+ private void addArrowActionPerformed (java.awt.event.ActionEvent evt)
+ {
+ if (studentSubmissionApprovedTableList.equals(submissionsToBuildList.getSelectedRow())) //believe this check works
+ {
+ JOptionPane.showMessageDialog(null, "File is already in the current jobs list!",
+ "Add Error", JOptionPane.ERROR_MESSAGE);
+ }
+
+ /*if(submissionsToBuildList.getSelectedRow() == 0)
+ {
+ ((MutableComboBoxModel) studentSubmissionApprovedTableList).addElement(submissionsToBuildList.getSelectedRow());
+ ((MutableComboBoxModel) submissionsToBuildList).removeElement(submissionsToBuildList.getSelectedRow());
+ }*/
+
+ else if(submissionsToBuildList.getSelectedRow() == -1)
+ {
+ JOptionPane.showMessageDialog(null, "No file selected!",
+ "Add Error", JOptionPane.ERROR_MESSAGE);
+ }
+ else
+ {
+ fileTableModel2.addRow(new Object[] { submissionsToBuildList.getValueAt(submissionsToBuildList.getSelectedRow(), 0),
+ submissionsToBuildList.getValueAt(submissionsToBuildList.getSelectedRow(), 1),
+ submissionsToBuildList.getValueAt(submissionsToBuildList.getSelectedRow(), 2),
+ submissionsToBuildList.getValueAt(submissionsToBuildList.getSelectedRow(), 3),
+ submissionsToBuildList.getValueAt(submissionsToBuildList.getSelectedRow(), 4),
+ submissionsToBuildList.getValueAt(submissionsToBuildList.getSelectedRow(), 5),
+ submissionsToBuildList.getValueAt(submissionsToBuildList.getSelectedRow(), 6),
+ submissionsToBuildList.getValueAt(submissionsToBuildList.getSelectedRow(), 7)
+
+ });
+
+
+
+
+ fileTableModel.removeRow(submissionsToBuildList.getSelectedRow());
+
+ submissionsToBuildList.setModel(fileTableModel);
+ studentSubmissionApprovedTableList.setModel(fileTableModel2);
+ /*
+ *
+ * removeClassListModel.addElement(currentClassListRC.getSelectedValue());
+ currentDeviceListModel.removeElement(currentClassListRC.getSelectedValue());
+ //((MutableComboBoxModel) studentSubmissionApprovedTableList).addElement(submissionsToBuildList.getSelectedRow());
+ //((MutableComboBoxModel) submissionsToBuildList).removeElement(submissionsToBuildList.getSelectedRow());
+ //removeClassList.setModel(removeClassListModel);
+ *
+ * */
+
+
+ }
+ }
+
+ private void removeArrowActionPerformed (java.awt.event.ActionEvent evt)
+ {
+ fileTableModel.addRow(new Object[] { studentSubmissionApprovedTableList.getValueAt(studentSubmissionApprovedTableList.getSelectedRow(), 0),
+ studentSubmissionApprovedTableList.getValueAt(studentSubmissionApprovedTableList.getSelectedRow(), 1),
+ studentSubmissionApprovedTableList.getValueAt(studentSubmissionApprovedTableList.getSelectedRow(), 2),
+ studentSubmissionApprovedTableList.getValueAt(studentSubmissionApprovedTableList.getSelectedRow(), 3),
+ studentSubmissionApprovedTableList.getValueAt(studentSubmissionApprovedTableList.getSelectedRow(), 4),
+ studentSubmissionApprovedTableList.getValueAt(studentSubmissionApprovedTableList.getSelectedRow(), 5),
+ studentSubmissionApprovedTableList.getValueAt(studentSubmissionApprovedTableList.getSelectedRow(), 6),
+ studentSubmissionApprovedTableList.getValueAt(studentSubmissionApprovedTableList.getSelectedRow(), 7)
+
+ });
+
+
+
+
+ fileTableModel2.removeRow(studentSubmissionApprovedTableList.getSelectedRow());
+ submissionsToBuildList.setModel(fileTableModel);
+ studentSubmissionApprovedTableList.setModel(fileTableModel2);
+ }
+ private JButton navBtn_balance;
+ private JButton navBtn_jobsMgr;
+ private JButton navBtn_build;
+ private JButton navBtn_reports;
+ private JButton navBtn_settings;
+ //Rajewski
+ //refactored submissionsToBuildList to submissionsToBuildList
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel ErrorText;
private javax.swing.JButton Submit_Button;
- private javax.swing.JButton backToMainMenu;
private javax.swing.JButton browseBtn;
private javax.swing.JLabel buildFileLocationErrorStatusText;
private javax.swing.JLabel buildLbl;
- private javax.swing.JTable deviceInputTable;
+ private javax.swing.JTable buildsForCurrentDeviceTable;
private javax.swing.JComboBox deviceNameComboBox;
private javax.swing.JTextField filepathToSelectedDeviceBuild;
- private javax.swing.JMenu helpMenu;
- private javax.swing.JTextField hourField;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
- private javax.swing.JLabel jLabel5;
- private javax.swing.JLabel jLabel6;
- private javax.swing.JLabel jLabel7;
- private javax.swing.JLabel jLabel8;
- private javax.swing.JLabel jLabel9;
private javax.swing.JList jList1;
- private javax.swing.JMenuBar jMenuBar1;
- private javax.swing.JMenuItem jMenuItem1;
+ private javax.swing.JMenuBar jMenuBar2;
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.JSeparator jSeparator1;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JTextPane jTextPane1;
- private javax.swing.JTextField minuteField;
- private javax.swing.JMenu removeBuildOpen;
- private javax.swing.JLabel runtimeLabel;
- private javax.swing.JTextField secondField;
+ private javax.swing.JButton logoutButton;
private javax.swing.JTable studentSubmissionApprovedTableList;
- private javax.swing.JMenuItem userGuide;
+ private javax.swing.JTable submissionsToBuildList;
+ private javax.swing.JButton swapButton;
// End of variables declaration//GEN-END:variables
}
+
diff --git a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/ChangePasswordView.java b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/ChangePasswordView.java
index 6bea42c..51c106b 100644
--- a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/ChangePasswordView.java
+++ b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/ChangePasswordView.java
@@ -17,6 +17,7 @@
public class ChangePasswordView extends javax.swing.JFrame {
+
AdminSettingsView settings = new AdminSettingsView();
public void passwordChangeStart() {
initComponents();
diff --git a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/ClassMgr.java b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/ClassMgr.java
new file mode 100644
index 0000000..875787f
--- /dev/null
+++ b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/ClassMgr.java
@@ -0,0 +1,486 @@
+package ObjectLabEnterpriseSoftware;
+
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import java.awt.Font;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.util.ArrayList;
+
+import javax.swing.JComboBox;
+import javax.swing.JList;
+import javax.swing.JOptionPane;
+
+import java.awt.Color;
+import javax.swing.JScrollPane;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import javax.swing.ListModel;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.JButton;
+import javax.swing.JTabbedPane;
+import java.awt.Component;
+import javax.swing.Box;
+import javax.swing.DefaultListModel;
+import javax.swing.JSplitPane;
+import java.awt.Dimension;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import javax.swing.JDesktopPane;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import javax.swing.ImageIcon;
+import java.awt.Toolkit;
+
+public class ClassMgr extends JFrame {
+ public static final String [] arrayOfTowsonDepartments = {"AFST","AHLT","AMST","ANTH",
+ "ARAB","ARED","ART","ARTH","ASST","ASTR","BCLA","BIOL","BUSX","CDCE","CHEM","CHNS",
+ "CIS","CLST","COMM","COSC","CRMJ","DANC","DFST","DVMT","DVRD","DVWR","EBTM","ECED",
+ "ECON","ECSE","EDUC","EESE","ELED","EMF","ENGL","ENTR","ENVS","ESOL","FIN","FLPN","FMST",
+ "FREN","FRSC","GENL","GEOG","GEOL","GERM","GERO","GRK","HCMN","HEBR","HIST",
+ "HLTH","HONR","IDFA","IDHP","IDIS","IDNM","INLA","INST","ISTC","ITAL","ITEC",
+ "JPNS","KNES","LAST","LATN","LEGL","LGBT","LWAC","MATH","MBBB","MCOM","MKTG",
+ "MNGT","MTRO","MUED","MUSA","MUSC","NURS","OCTH","PHEA","PHIL","PHSC","PHYS",
+ "PORT","POSC","PSYC","REED","RLST","RUSS","SCED","SCIE","SOCI","SOSC","SPAN",
+ "SPED","SPPA","THEA","WMST","WRIT"};
+
+
+
+
+ public ClassMgr() {
+ setIconImage(Toolkit.getDefaultToolkit().getImage(ClassMgr.class.getResource("/ObjectLabEnterpriseSoftware/images/icon.ico")));
+ setPreferredSize(new Dimension(550, 370));
+ setResizable(false);
+ setFont(new Font("Segoe UI", Font.PLAIN, 14));
+ setTitle("Class Manager");
+ getContentPane().setBackground(Color.WHITE);
+ initWindow();
+ updateView();
+ } // end of constructor
+
+ private void initWindow()
+ {
+
+
+
+ JLabel titleLabel = new JLabel("Class Manager");
+ titleLabel.setBounds(189, 11, 178, 40);
+ titleLabel.setFont(new Font("Segoe UI", Font.BOLD, 24));
+ titleLabel.setVisible(true);
+ getContentPane().setLayout(null);
+ getContentPane().add(titleLabel);
+
+ JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.LEFT);
+ tabbedPane.setBounds(10, 59, 516, 264);
+ tabbedPane.setBackground(Color.LIGHT_GRAY);
+ getContentPane().add(tabbedPane);
+ tabbedPane.setVisible(true);
+ JPanel manageClassPanel = new JPanel();
+ tabbedPane.addTab("Manage Classes", null, manageClassPanel, null);
+ manageClassPanel.setLayout(null);
+
+ JLabel jLabel3 = new JLabel();
+ jLabel3.setText("Inactive Classes");
+ jLabel3.setFont(new Font("Segoe UI", Font.BOLD, 12));
+ jLabel3.setBounds(20, 25, 110, 19);
+ manageClassPanel.add(jLabel3);
+
+ jScrollPane3 = new JScrollPane();
+ jScrollPane3.setBounds(20, 44, 139, 189);
+ manageClassPanel.add(jScrollPane3);
+
+ allClassList = new JList();
+ jScrollPane3.setViewportView(allClassList);
+
+ addArrow = new JButton();
+ addArrow.setText("--->");
+ addArrow.setPreferredSize(new Dimension(60, 23));
+ addArrow.setFont(new Font("Segoe UI", Font.PLAIN, 11));
+ addArrow.setBounds(169, 99, 90, 23);
+ manageClassPanel.add(addArrow);
+
+ removeArrow = new JButton();
+ removeArrow.setText("<---");
+ removeArrow.setFont(new Font("Segoe UI", Font.PLAIN, 11));
+ removeArrow.setBounds(169, 129, 90, 23);
+ removeArrow.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent evt) {
+ removeArrowActionPerformed(evt);
+ }
+ });
+ manageClassPanel.add(removeArrow);
+
+ jScrollPane4 = new JScrollPane();
+ jScrollPane4.setBounds(269, 44, 139, 190);
+ manageClassPanel.add(jScrollPane4);
+
+ currentClassList = new JList();
+ jScrollPane4.setViewportView(currentClassList);
+
+ JLabel lblActiveClasses = new JLabel();
+ lblActiveClasses.setText("Active Classes");
+ lblActiveClasses.setFont(new Font("Segoe UI", Font.BOLD, 12));
+ lblActiveClasses.setBounds(269, 28, 129, 19);
+ manageClassPanel.add(lblActiveClasses);
+
+ saveBtn = new JButton();
+ saveBtn.setText("Apply Changes");
+ saveBtn.setFont(new Font("Segoe UI", Font.PLAIN, 11));
+ saveBtn.setBounds(157, 236, 109, 23);
+ manageClassPanel.add(saveBtn);
+
+ JPanel addClassPanel = new JPanel();
+ tabbedPane.addTab("Add Class", null, addClassPanel, null);
+ addClassPanel.setBorder(null);
+ addClassPanel.setLayout(null);
+
+ JLabel classNumLabel = new JLabel("Class Number:");
+ classNumLabel.setBounds(0, 97, 95, 20);
+ classNumLabel.setFont(new Font("Segoe UI", Font.PLAIN, 14));
+ addClassPanel.add(classNumLabel);
+
+ JLabel lblNewLabel = new JLabel("Department:");
+ lblNewLabel.setBounds(0, 11, 82, 20);
+ addClassPanel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Segoe UI", Font.PLAIN, 14));
+
+ JScrollPane classScrollPane = new JScrollPane();
+ classScrollPane.setBounds(112, 14, 86, 75);
+ addClassPanel.add(classScrollPane);
+
+ classList = new JList(arrayOfTowsonDepartments);
+ classScrollPane.setViewportView(classList);
+ classList.setBackground(Color.LIGHT_GRAY);
+
+ classNumberInput = new JTextField();
+ classNumberInput.setBounds(112, 99, 118, 20);
+ classNumLabel.setLabelFor(classNumberInput);
+ addClassPanel.add(classNumberInput);
+ classNumberInput.setColumns(10);
+
+ JLabel sectionNumberLabel = new JLabel("Section Number:");
+ sectionNumberLabel.setBounds(0, 124, 105, 20);
+ sectionNumberLabel.setFont(new Font("Segoe UI", Font.PLAIN, 14));
+ addClassPanel.add(sectionNumberLabel);
+
+ SectionNumberInput = new JTextField();
+ SectionNumberInput.setBounds(112, 126, 118, 20);
+ SectionNumberInput.setColumns(10);
+ addClassPanel.add(SectionNumberInput);
+
+ JLabel professorInputLabel = new JLabel("Professor:");
+ professorInputLabel.setBounds(0, 155, 105, 20);
+ professorInputLabel.setFont(new Font("Segoe UI", Font.PLAIN, 14));
+ addClassPanel.add(professorInputLabel);
+
+ professorInput = new JTextField();
+ professorInput.setBounds(112, 157, 118, 20);
+ professorInputLabel.setLabelFor(professorInput);
+ addClassPanel.add(professorInput);
+ professorInput.setColumns(10);
+
+ JLabel lbllastName = new JLabel("(last name)");
+ lbllastName.setBounds(0, 173, 72, 20);
+ lbllastName.setFont(new Font("Segoe UI", Font.PLAIN, 14));
+ addClassPanel.add(lbllastName);
+
+ addClassButton = new JButton("Add Class");
+ addClassButton.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ addClass(arg0);
+ }
+ });
+ addClassButton.setBounds(233, 187, 89, 23);
+ addClassPanel.add(addClassButton);
+
+ JPanel removeClassPanel = new JPanel();
+ tabbedPane.addTab("Remove Class", null, removeClassPanel, null);
+ removeClassPanel.setLayout(null);
+
+ removePrinterButton = new JButton("Remove");
+ removePrinterButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ removeClassButtonActionPerformed(arg0);
+ }
+ });
+ removePrinterButton.setBounds(159, 236, 89, 23);
+ removeClassPanel.add(removePrinterButton);
+
+ lblAvailableClasses = new JLabel();
+ lblAvailableClasses.setText("Available Classes");
+ lblAvailableClasses.setFont(new Font("Segoe UI", Font.BOLD, 12));
+ lblAvailableClasses.setBounds(10, 25, 110, 19);
+ removeClassPanel.add(lblAvailableClasses);
+
+ spAvaiableClassesRC = new JScrollPane();
+ spAvaiableClassesRC.setBounds(10, 44, 139, 189);
+ removeClassPanel.add(spAvaiableClassesRC);
+
+ currentClassListRC = new JList();
+ spAvaiableClassesRC.setViewportView(currentClassListRC);
+
+ addArrowRC = new JButton();
+ addArrowRC.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent evt) {
+ addArrowRCActionPerformed(evt);
+ }
+ });
+ addArrowRC.setText("->");
+ addArrowRC.setPreferredSize(new Dimension(60, 23));
+ addArrowRC.setFont(new Font("Segoe UI", Font.PLAIN, 11));
+ addArrowRC.setBounds(159, 99, 90, 23);
+ removeClassPanel.add(addArrowRC);
+
+ removeArrowRC = new JButton();
+ removeArrowRC.setText("<-");
+ removeArrowRC.setFont(new Font("Segoe UI", Font.PLAIN, 11));
+ removeArrowRC.setBounds(159, 143, 90, 23);
+ removeArrowRC.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent evt) {
+ removeArrowRCActionPerformed(evt);
+ }
+ });
+ removeClassPanel.add(removeArrowRC);
+
+ JScrollPane spToBeRemovedRC = new JScrollPane();
+ spToBeRemovedRC.setBounds(259, 44, 139, 190);
+ removeClassPanel.add(spToBeRemovedRC);
+
+ removeClassList = new JList();
+ spToBeRemovedRC.setViewportView(removeClassList);
+
+ JLabel lblClassesToRemove = new JLabel();
+ lblClassesToRemove.setText("Classes to remove");
+ lblClassesToRemove.setFont(new Font("Segoe UI", Font.BOLD, 12));
+ lblClassesToRemove.setBounds(259, 28, 129, 19);
+ removeClassPanel.add(lblClassesToRemove);
+
+ backButton = new JLabel("");
+ backButton.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ newSettingsMenu ns = new newSettingsMenu();
+ ns.setVisible(true);
+ dispose();
+ }
+ });
+ backButton.setIcon(new ImageIcon(ClassMgr.class.getResource("/ObjectLabEnterpriseSoftware/images/back_arrow_button.png")));
+ backButton.setBounds(21, 11, 32, 33);
+ getContentPane().add(backButton);
+
+
+ addArrow.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ addArrowActionPerformed(evt);
+ }
+ });
+
+ saveBtn.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ saveBtnActionPerformed(evt);
+ }
+ });
+
+ pack();
+
+ setLocationRelativeTo(null);
+ }
+
+
+ protected void addClass(MouseEvent arg0) {
+ if (InputValidation.isEmpty(classList.getSelectedValue().toString()) | InputValidation.isEmpty(classNumberInput.getText())
+ | InputValidation.isEmpty(SectionNumberInput.getText()) | InputValidation.isEmpty(professorInput.getText()))
+ {
+ JOptionPane.showMessageDialog(null, "Please enter all Class Values",
+ "Add Error", JOptionPane.ERROR_MESSAGE);
+ } else if (classList.getSelectedValue().toString().contains(" ") | classNumberInput.getText().contains(" ")
+ | SectionNumberInput.getText().contains(" ") | professorInput.getText().contains(" "))
+ {
+ JOptionPane.showMessageDialog(null, "Values can only be one word each",
+ "Add Error", JOptionPane.ERROR_MESSAGE);
+ } else if (!InputValidation.isNumber(classNumberInput.getText())
+ | !InputValidation.isNumber(SectionNumberInput.getText()))
+ {
+ JOptionPane.showMessageDialog(null, "Class Number and Section Numbers must "
+ + "contain only numbers",
+ "Add Error", JOptionPane.ERROR_MESSAGE);
+ } else if (!InputValidation.isAlpha(classList.getSelectedValue().toString()) | !InputValidation.isAlpha(professorInput.getText()))
+ {
+ JOptionPane.showMessageDialog(null, "Names must only contain letters.",
+ "Add Error", JOptionPane.ERROR_MESSAGE);
+ } else
+ {
+ String input = classList.getSelectedValue().toString().toUpperCase() + " "
+ + classNumberInput.getText() + " " + SectionNumberInput.getText();
+ DefaultListModel temp = new DefaultListModel();
+ temp.addElement(input);
+
+ if (allClassListModel.contains(temp.elementAt(0)) || currentClassListModel.contains(temp.elementAt(0)))
+ {
+ JOptionPane.showMessageDialog(null, "Class already in all class list",
+ "Add Error", JOptionPane.ERROR_MESSAGE);
+ } else
+ {
+ allClassListModel.addElement(input.toUpperCase());
+ UtilController.insertNewClass(classList.getSelectedValue().toString().toUpperCase(), classNumberInput.getText(), SectionNumberInput.getText(), professorInput.getText().trim());
+ }
+
+ temp.clear();
+ JOptionPane.showMessageDialog(null, "Successfully added class!");
+ updateView();
+ }
+
+ }
+
+
+ private DefaultListModel allClassListModel;
+ private DefaultListModel currentClassListModel;
+ private DefaultListModel removeClassListModel = new DefaultListModel();
+ newSettingsMenu settings;
+ private static FileManager inst = null;
+
+ private void updateView()
+ {
+ if(allClassListModel != null)
+ allClassListModel.clear();
+
+ if(currentClassListModel != null)
+ currentClassListModel.clear();
+
+ allClassListModel = UtilController.returnNonCurrentClasses(); /* false */
+ currentClassListModel = UtilController.returnCurrentClasses(); /* true */
+
+ allClassList.setModel(allClassListModel);
+ currentClassList.setModel(currentClassListModel);
+ currentClassListRC.setModel(allClassListModel);
+ removeClassList.setModel(removeClassListModel);
+ }
+
+
+
+
+
+ private void addArrowActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addArrowActionPerformed
+ if (currentClassListModel.contains(allClassList.getSelectedValue()))
+ {
+ JOptionPane.showMessageDialog(null, "Class already in current class list",
+ "Add Error", JOptionPane.ERROR_MESSAGE);
+ }
+ else if(allClassList.getSelectedValue() == null)
+ {
+ JOptionPane.showMessageDialog(null, "No class selected!",
+ "Add Error", JOptionPane.ERROR_MESSAGE);
+ }
+ else
+ {
+ currentClassListModel.addElement(allClassList.getSelectedValue());
+ allClassListModel.removeElement(allClassList.getSelectedValue());
+ }
+ }//GEN-LAST:event_addArrowActionPerformed
+
+ private void addArrowRCActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addArrowActionPerformed
+ if (removeClassListModel.contains(currentClassListRC.getSelectedValue()))
+ {
+ JOptionPane.showMessageDialog(null, "Class already in current class list",
+ "Add Error", JOptionPane.ERROR_MESSAGE);
+ }
+ else if(currentClassListRC.getSelectedValue() == null)
+ {
+ JOptionPane.showMessageDialog(null, "No class selected!",
+ "Add Error", JOptionPane.ERROR_MESSAGE);
+ }
+ else
+ {
+ removeClassListModel.addElement(currentClassListRC.getSelectedValue());
+ allClassListModel.removeElement(currentClassListRC.getSelectedValue());
+
+ removeClassList.setModel(removeClassListModel);
+
+ }
+ }//GEN-LAST:event_addArrowActionPerformed
+
+
+ private void saveBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveBtnActionPerformed
+ ArrayList classes = new ArrayList<>();
+
+ for (int i = 0; i < currentClassListModel.getSize(); i++)
+ classes.add(currentClassListModel.elementAt(i).toString());
+
+ UtilController.updateAvailableClasses(classes);
+ updateView();
+ }//GEN-LAST:event_saveBtnActionPerformed
+
+
+
+ private void removeArrowActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeArrowActionPerformed
+ int i;
+ for (i = 0; i < currentClassListModel.getSize(); i++)
+ {
+ if (currentClassListModel.elementAt(i).equals(currentClassList.getSelectedValue()))
+ {
+ allClassListModel.addElement(currentClassListModel.elementAt(i));
+ currentClassListModel.removeElementAt(i);
+ }
+ }
+ }//GEN-LAST:event_removeArrowActionPerformed
+
+
+
+
+ private void removeArrowRCActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeArrowActionPerformed
+ int i;
+ for (i = 0; i < removeClassListModel.getSize(); i++)
+ {
+ if (removeClassListModel.elementAt(i).equals(removeClassList.getSelectedValue()))
+ {
+ allClassListModel.addElement(removeClassListModel.elementAt(i));
+ removeClassListModel.removeElementAt(i);
+ }
+ }
+ }//GEN-LAST:event_removeArrowActionPerformed
+
+
+
+ private void removeClassButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeClassButtonActionPerformed
+
+ if(JOptionPane.showConfirmDialog(null, "Continue? If you delete this class you will no longer be able "
+ + "to select this class when building jobs.\nFiles associated with this class will not be deleted "
+ + "but they will no longer be associated with this class. Click 'YES' to CONFIRM DELETION this is permanent!","Warning",JOptionPane.YES_OPTION)==JOptionPane.YES_OPTION){
+ for (int i = 0; i < removeClassListModel.getSize(); i++)
+ {
+ String selected = (String) removeClassListModel.elementAt(i);
+ System.out.println(selected);
+ int id = Integer.parseInt(selected.split(" ")[0]);
+ System.out.println(id);
+ UtilController.removeClass(id);
+ }
+ removeClassListModel.clear();
+ updateView();
+ }
+ else
+ JOptionPane.showMessageDialog(null, "Please select a class to remove.");
+ }//GEN-LAST:event_removeClassButtonActionPerformed
+
+ private javax.swing.JScrollPane jScrollPane3;
+ private javax.swing.JScrollPane jScrollPane4;
+ private javax.swing.JButton saveBtn;
+ private javax.swing.JList allClassList;
+ private javax.swing.JList currentClassList;
+ private javax.swing.JButton addArrow;
+ private javax.swing.JButton removeArrow;
+ private JList removeClassList;
+ private JButton addArrowRC;
+ private JButton removeArrowRC;
+ private JButton addClassButton;
+
+ private JTextField classNumberInput;
+ private JTextField SectionNumberInput;
+ private JTextField professorInput;
+ private JList currentClassListRC;
+ private JScrollPane spAvaiableClassesRC ;
+ private JLabel lblAvailableClasses;
+ private JButton removePrinterButton;
+ private JList classList ;
+ private JLabel backButton;
+}// end of class
\ No newline at end of file
diff --git a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/CommentView.form b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/CommentView.form
new file mode 100644
index 0000000..57e2c6a
--- /dev/null
+++ b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/CommentView.form
@@ -0,0 +1,88 @@
+
+
+
diff --git a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/CommentView.java b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/CommentView.java
new file mode 100644
index 0000000..d727bdc
--- /dev/null
+++ b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/CommentView.java
@@ -0,0 +1,144 @@
+/*
+ * 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 ObjectLabEnterpriseSoftware;
+
+import java.awt.Color;
+
+/**
+ *
+ * @author Russell
+ */
+public class CommentView extends javax.swing.JFrame {
+
+ private static String comment;
+ private static String file;
+ //private static boolean isFinished;
+
+ /**
+ * Creates new form CommentView
+ */
+ public CommentView() {
+
+ }
+ public CommentView(String studentFile)
+ {
+
+ getContentPane().setBackground(Color.WHITE);
+ initComponents();
+ file = studentFile;
+ setVisible(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")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jButton1 = new javax.swing.JButton();
+ jLabel1 = new javax.swing.JLabel();
+ jComboBox1 = new javax.swing.JComboBox();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+ setTitle("Rejected File Comment");
+
+ jButton1.setText("Done");
+ jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseClicked(java.awt.event.MouseEvent evt) {
+ jButton1MouseClicked(evt);
+ }
+ });
+
+ jLabel1.setFont(new java.awt.Font("Segoe UI", 1, 24)); // NOI18N
+ jLabel1.setText("Rejected Comment");
+
+ jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Inccorect File Type\t\t\t", "Not Enough Materail", "Invalid File ", "Other " }));
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addGap(0, 0, Short.MAX_VALUE)
+ .addComponent(jButton1))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel1)
+ .addGap(0, 0, Short.MAX_VALUE))
+ .addComponent(jComboBox1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jLabel1)
+ .addGap(40, 40, 40)
+ .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 77, Short.MAX_VALUE)
+ .addComponent(jButton1)
+ .addContainerGap())
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked
+
+ comment = jComboBox1.getSelectedItem().toString();
+ SQLMethods dbconn = new SQLMethods();
+ dbconn.updateFileComment(file, comment);
+ System.out.println("Comment");
+ dbconn.closeDBConnection();
+ //isFinished = true;
+ dispose();
+
+ }//GEN-LAST:event_jButton1MouseClicked
+
+
+
+ /*public static void main(String args[]) {
+ /* Set the Nimbus look and feel */
+ //
+ /* 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(CommentView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (InstantiationException ex) {
+ java.util.logging.Logger.getLogger(CommentView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (IllegalAccessException ex) {
+ java.util.logging.Logger.getLogger(CommentView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (javax.swing.UnsupportedLookAndFeelException ex) {
+ java.util.logging.Logger.getLogger(CommentView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ }
+ //
+ */
+ /* Create and display the form */
+ /* java.awt.EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ new CommentView().setVisible(true);
+ }
+ });
+ }*/
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton jButton1;
+ private javax.swing.JComboBox jComboBox1;
+ private javax.swing.JLabel jLabel1;
+ // End of variables declaration//GEN-END:variables
+}
diff --git a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/DeviceMgr.java b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/DeviceMgr.java
new file mode 100644
index 0000000..64d0d2e
--- /dev/null
+++ b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/DeviceMgr.java
@@ -0,0 +1,725 @@
+package ObjectLabEnterpriseSoftware;
+
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import java.awt.Font;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import javax.swing.JComboBox;
+import javax.swing.JList;
+import javax.swing.JOptionPane;
+
+import java.awt.Color;
+import javax.swing.JScrollPane;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import javax.swing.ListModel;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JTabbedPane;
+import java.awt.Component;
+import javax.swing.Box;
+import javax.swing.DefaultListModel;
+import javax.swing.JSplitPane;
+import java.awt.Dimension;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import javax.swing.JDesktopPane;
+import javax.swing.JDialog;
+
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import javax.swing.ImageIcon;
+import javax.swing.JTextArea;
+import java.awt.SystemColor;
+import javax.swing.AbstractListModel;
+import java.awt.Toolkit;
+
+
+/*
+ *
+ * Device Manager
+ * @author=M. Alex Boyd
+ *
+ * TO DOS
+ * 1. Add error text for empty textfields when adding device
+ */
+public class DeviceMgr extends JFrame {
+
+
+ //Current count of labels and fields
+ ArrayList currentDevices = UtilController.getListOfCurrentDevices();
+ ListModel removeTable;
+ private int count = 0;
+ private boolean trackingSelected = true;
+
+
+ private DefaultListModel allClassListModel;
+ private DefaultListModel currentClassListModel;
+ private DefaultListModel removeClassListModel = new DefaultListModel();
+ private DefaultListModel currentDeviceListModel = new DefaultListModel();
+ newSettingsMenu settings;
+ private static FileManager inst = null;
+ public DeviceMgr() {
+ setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+ setIconImage(Toolkit.getDefaultToolkit().getImage(DeviceMgr.class.getResource("/ObjectLabEnterpriseSoftware/images/icon.ico")));
+ setPreferredSize(new Dimension(550, 370));
+ setResizable(false);
+ setFont(new Font("Segoe UI", Font.PLAIN, 14));
+ setTitle("Device Manager");
+ getContentPane().setBackground(Color.WHITE);
+ initWindow();
+ updateView();
+
+ addWindowListener(
+ new WindowAdapter()
+ {
+ @Override
+ public void windowClosing(WindowEvent we)
+ {
+ settings = new newSettingsMenu();
+ settings.setVisible(true);
+ dispose();
+ }
+ }
+ );
+
+ for(int i = 0; i < currentDevices.size(); i++)
+ {
+ currentDeviceListModel.addElement(currentDevices.get(i));
+ }
+
+
+ } // end of constructor
+
+ private void initWindow()
+ {
+
+
+
+ JLabel titleLabel = new JLabel("Device Manager");
+ titleLabel.setBounds(177, 8, 200, 40);
+ titleLabel.setFont(new Font("Segoe UI", Font.BOLD, 24));
+ titleLabel.setVisible(true);
+ getContentPane().setLayout(null);
+ getContentPane().add(titleLabel);
+
+ tabbedPane = new JTabbedPane(JTabbedPane.LEFT);
+ tabbedPane.setBounds(10, 55, 516, 287);
+ tabbedPane.setBackground(Color.LIGHT_GRAY);
+ getContentPane().add(tabbedPane);
+ tabbedPane.setVisible(true);
+
+ addDevicePanel = new JPanel();
+ tabbedPane.addTab("Add Device", null, addDevicePanel, null);
+ addDevicePanel.setBorder(null);
+ addDevicePanel.setLayout(null);
+
+ deviceNameLabel = new JLabel("Device Name:");
+ deviceNameLabel.setBounds(0, 11, 95, 20);
+ deviceNameLabel.setFont(new Font("Segoe UI", Font.PLAIN, 14));
+ addDevicePanel.add(deviceNameLabel);
+
+
+ deviceNameInput = new JTextField();
+ deviceNameInput.setBounds(92, 13, 118, 20);
+ deviceNameLabel.setLabelFor(deviceNameInput);
+ addDevicePanel.add(deviceNameInput);
+ deviceNameInput.setColumns(10);
+
+ fileExtLabel = new JLabel("Accepted File Extension:");
+ fileExtLabel.setBounds(0, 42, 153, 20);
+ fileExtLabel.setFont(new Font("Segoe UI", Font.PLAIN, 14));
+ addDevicePanel.add(fileExtLabel);
+
+ fileExtInput = new JTextField();
+ fileExtInput.setBounds(155, 44, 118, 20);
+ fileExtInput.setColumns(10);
+ addDevicePanel.add(fileExtInput);
+
+ JTextArea txtDirections = new JTextArea();
+ txtDirections.setBackground(SystemColor.menu);
+ txtDirections.setFont(new Font("Segoe UI", Font.PLAIN, 12));
+ txtDirections.setWrapStyleWord(true);
+ txtDirections.setText("Enter types of data this device requires: \n If it's a numerical value, enter field name and unit of measurement \n ex) Volume (g) \n If it's a non-numerical, just enter field name \n ex) Color");
+ txtDirections.setBounds(0, 73, 401, 91);
+ addDevicePanel.add(txtDirections);
+
+ fieldL1Label = new JLabel("Field name 2:");
+ fieldL1Label.setFont(new Font("Tahoma", Font.PLAIN, 9));
+ fieldL1Label.setBounds(10, 186, 70, 14);
+ fieldL1Label.setVisible(false);
+ addDevicePanel.add(fieldL1Label);
+
+ fieldL0 = new JTextField();
+ fieldL0.setFont(new Font("Tahoma", Font.PLAIN, 10));
+ fieldL0.setColumns(10);
+ fieldL1Label.setLabelFor(fieldL0);
+ fieldL0.setBounds(80, 167, 86, 14);
+ addDevicePanel.add(fieldL0);
+
+ numberValCheck0 = new JCheckBox("Numerical value");
+ numberValCheck0.setFont(new Font("Tahoma", Font.PLAIN, 9));
+ numberValCheck0.setBounds(174, 163, 101, 23);
+ addDevicePanel.add(numberValCheck0);
+
+ addFieldButton = new JButton("Add Field");
+ addFieldButton.setFont(new Font("Tahoma", Font.PLAIN, 9));
+ addFieldButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ addFieldButtonActionPerformed(arg0);
+ }
+ });
+ addFieldButton.setBounds(0, 262, 89, 20);
+ addDevicePanel.add(addFieldButton);
+
+ saveButton = new JButton("Add Device");
+ saveButton.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ addDevice();
+ }
+ });
+ saveButton.setBounds(332, 259, 89, 23);
+ addDevicePanel.add(saveButton);
+
+ JPanel removeClassPanel = new JPanel();
+ tabbedPane.addTab("Remove Device", null, removeClassPanel, null);
+ removeClassPanel.setLayout(null);
+
+ removePrinterButton = new JButton("Remove");
+ removePrinterButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ removeClassButtonActionPerformed(arg0);
+ }
+ });
+ removePrinterButton.setBounds(159, 236, 89, 23);
+ removeClassPanel.add(removePrinterButton);
+
+ lblAvailableClasses = new JLabel();
+ lblAvailableClasses.setText("Available Devices");
+ lblAvailableClasses.setFont(new Font("Segoe UI", Font.BOLD, 12));
+ lblAvailableClasses.setBounds(10, 25, 110, 19);
+ removeClassPanel.add(lblAvailableClasses);
+
+ spAvaiableClassesRC = new JScrollPane();
+ spAvaiableClassesRC.setBounds(10, 44, 139, 189);
+ removeClassPanel.add(spAvaiableClassesRC);
+
+ currentClassListRC = new JList();
+ currentClassListRC.setModel(currentDeviceListModel);
+ spAvaiableClassesRC.setViewportView(currentClassListRC);
+
+ addArrowRC = new JButton();
+ addArrowRC.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent evt) {
+ addArrowRCActionPerformed(evt);
+ }
+ });
+ addArrowRC.setText("--->");
+ addArrowRC.setPreferredSize(new Dimension(60, 23));
+ addArrowRC.setFont(new Font("Segoe UI", Font.PLAIN, 11));
+ addArrowRC.setBounds(159, 99, 90, 23);
+ removeClassPanel.add(addArrowRC);
+
+ removeArrowRC = new JButton();
+ removeArrowRC.setText("<---");
+ removeArrowRC.setFont(new Font("Segoe UI", Font.PLAIN, 11));
+ removeArrowRC.setBounds(159, 143, 90, 23);
+ removeArrowRC.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent evt) {
+ removeArrowRCActionPerformed(evt);
+ }
+ });
+ removeClassPanel.add(removeArrowRC);
+
+ JScrollPane spToBeRemovedRC = new JScrollPane();
+ spToBeRemovedRC.setBounds(259, 44, 139, 190);
+ removeClassPanel.add(spToBeRemovedRC);
+
+ removeClassList = new JList();
+ spToBeRemovedRC.setViewportView(removeClassList);
+
+ JLabel lblClassesToRemove = new JLabel();
+ lblClassesToRemove.setText("Devices to remove");
+ lblClassesToRemove.setFont(new Font("Segoe UI", Font.BOLD, 12));
+ lblClassesToRemove.setBounds(259, 28, 129, 19);
+ removeClassPanel.add(lblClassesToRemove);
+
+ backButton = new JLabel("");
+ backButton.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ newSettingsMenu ns = new newSettingsMenu();
+ ns.setVisible(true);
+ dispose();
+ }
+ });
+ backButton.setIcon(new ImageIcon(DeviceMgr.class.getResource("/ObjectLabEnterpriseSoftware/images/back_arrow_button.png")));
+ backButton.setBounds(21, 11, 45, 37);
+ getContentPane().add(backButton);
+
+ fieldL0Label = new JLabel("Field name 1:");
+ fieldL0Label.setFont(new Font("Tahoma", Font.PLAIN, 10));
+ fieldL0Label.setBounds(10, 167, 70, 14);
+ addDevicePanel.add(fieldL0Label);
+
+ field1 = new JTextField();
+ field1.setFont(new Font("Tahoma", Font.PLAIN, 9));
+ field1.setColumns(10);
+ field1.setBounds(80, 186, 86, 14);
+ field1.setVisible(false);
+ addDevicePanel.add(field1);
+
+ numberValCheck1 = new JCheckBox("Numerical value");
+ numberValCheck1.setFont(new Font("Tahoma", Font.PLAIN, 9));
+ numberValCheck1.setBounds(174, 182, 101, 23);
+ numberValCheck1.setVisible(false);
+ addDevicePanel.add(numberValCheck1);
+
+ fieldL2Label = new JLabel("Field name 3:");
+ fieldL2Label.setFont(new Font("Tahoma", Font.PLAIN, 9));
+ fieldL2Label.setBounds(10, 200, 70, 23);
+ fieldL2Label.setVisible(false);
+ addDevicePanel.add(fieldL2Label);
+
+ field2 = new JTextField();
+ field2.setFont(new Font("Tahoma", Font.PLAIN, 9));
+ field2.setColumns(10);
+ field2.setBounds(80, 204, 86, 14);
+ field2.setVisible(false);
+ addDevicePanel.add(field2);
+
+ numberValCheck2 = new JCheckBox("Numerical value");
+ numberValCheck2.setFont(new Font("Tahoma", Font.PLAIN, 9));
+ numberValCheck2.setBounds(174, 200, 101, 23);
+ numberValCheck2.setVisible(false);
+ addDevicePanel.add(numberValCheck2);
+
+ fieldL3Label = new JLabel("Field name 4:");
+ fieldL3Label.setFont(new Font("Tahoma", Font.PLAIN, 9));
+ fieldL3Label.setBounds(10, 222, 70, 14);
+ fieldL3Label.setVisible(false);
+ addDevicePanel.add(fieldL3Label);
+
+ field3 = new JTextField();
+ field3.setFont(new Font("Tahoma", Font.PLAIN, 9));
+ field3.setColumns(10);
+ field3.setBounds(80, 222, 86, 14);
+ field3.setVisible(false);
+ addDevicePanel.add(field3);
+
+ numberValCheck3 = new JCheckBox("Numerical value");
+ numberValCheck3.setFont(new Font("Tahoma", Font.PLAIN, 9));
+ numberValCheck3.setBounds(174, 218, 101, 23);
+ numberValCheck3.setVisible(false);
+ addDevicePanel.add(numberValCheck3);
+
+ fieldL4Label = new JLabel("Field name 5:");
+ fieldL4Label.setFont(new Font("Tahoma", Font.PLAIN, 9));
+ fieldL4Label.setBounds(10, 243, 70, 14);
+ fieldL4Label.setVisible(false);
+ addDevicePanel.add(fieldL4Label);
+
+ field4 = new JTextField();
+ field4.setFont(new Font("Tahoma", Font.PLAIN, 9));
+ field4.setColumns(10);
+ field4.setBounds(80, 243, 86, 14);
+ field4.setVisible(false);
+ addDevicePanel.add(field4);
+
+ numberValCheck4 = new JCheckBox("Numerical value");
+ numberValCheck4.setFont(new Font("Tahoma", Font.PLAIN, 9));
+ numberValCheck4.setBounds(174, 239, 101, 23);
+ numberValCheck4.setVisible(false);
+ addDevicePanel.add(numberValCheck4);
+
+ removeFieldButton = new JButton("Remove Field");
+ removeFieldButton.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ removeFields();
+ }
+
+ });
+ removeFieldButton.setFont(new Font("Tahoma", Font.PLAIN, 9));
+ removeFieldButton.setBounds(100, 262, 110, 20);
+ addDevicePanel.add(removeFieldButton);
+ pack();
+
+ setLocationRelativeTo(null);
+ }
+
+
+ protected void addDevice() { // this is quick and dirty and ugly, validation should be seperated into seperate methods ~Alex
+
+ String deviceName = null;
+ String fileExt = null;
+ ArrayList fields = new ArrayList();
+ int[] boxes = new int[5];
+ if(!deviceNameInput.getText().isEmpty())
+ {
+ deviceName = deviceNameInput.getText();
+ }
+ else
+ {
+ System.out.println("Device name empty! ADD ERROR TXT");
+ }
+
+ if(!fileExtInput.getText().isEmpty())
+ {
+ fileExt = fileExtInput.getText();
+ }
+ else
+ {
+ System.out.println("File extension field empty! ADD ERROR TXT");
+ }
+
+
+ if(count >= 0) // count keeps track of visible fields (see removeFieldButton)
+ {
+ if(!fieldL0.getText().isEmpty())
+ {
+ fields.add(fieldL0.getText());
+ if(numberValCheck0.isSelected())
+ {
+ boxes[0] = 1;// 1 = selected numerical value
+ }
+ }
+ else // field 0 will always be visible because remove button doesn't allow for it to be removed. (Need at least 1 field).
+ {
+ System.out.println("Field 1 Empty!");
+ }
+
+
+ if(!field1.getText().isEmpty())
+ {
+ fields.add(field1.getText());
+ if(numberValCheck1.isSelected())
+ {
+ boxes[1] = 1;// 1 = selected numerical value
+ }
+ }
+ else if( field1.isVisible() )
+ {
+ System.out.println("Field 2 Empty!");
+ }
+
+ if(!field2.getText().isEmpty())
+ {
+ fields.add(field2.getText());
+ if(numberValCheck2.isSelected())
+ {
+ boxes[2] = 1;// 1 = selected numerical value
+ }
+ }
+ else if( field2.isVisible() )
+ {
+ System.out.println("Field 3 Empty!");
+ }
+
+ if(!field3.getText().isEmpty())
+ {
+ fields.add(field3.getText());
+ if(numberValCheck3.isSelected())
+ {
+ boxes[3] = 1;// 1 = selected numerical value
+ }
+ }
+ else if( field3.isVisible() )
+ {
+ System.out.println("Field 4 Empty!");
+ }
+
+ if(!field4.getText().isEmpty())
+ {
+ fields.add(field4.getText());
+ if(numberValCheck4.isSelected())
+ {
+ boxes[4] = 1;// 1 = selected numerical value
+ }
+ }
+ else if( field4.isVisible() )
+ {
+ System.out.println("Field 5 Empty!");
+ }
+
+ }
+
+ if(!deviceName.equals(null) && !fileExt.equals(null))
+ {
+ device = new Device(deviceName,
+ new ArrayList(Arrays.asList(fileExt.split(" "))), trackingSelected);
+
+ for(int i = 0; i < fields.size(); i++)
+ {
+ if(boxes[i] == 1) // numerical value field
+ {
+ device.addField(fields.get(i), new Double("0"));
+ }
+ else
+ {
+ device.addField(fields.get(i), "");
+ }
+ }
+
+ if (currentDevices.contains(device.getDeviceName()))
+ {
+ JOptionPane.showMessageDialog(this, "Could not save! Device '" + device.getDeviceName() + "' already exists!");
+ } else if (UtilController.addDevice(device) == true)
+ {
+ JOptionPane.showMessageDialog(this, "Device '" + device.getDeviceName() + "' was saved and added to the printer list!");
+ repaint();
+ } else
+ {
+ JOptionPane.showMessageDialog(this, "There was an error while saving the printer.");
+ }
+ }
+
+
+ } // end of addDevice()
+
+
+
+
+ private void updateView()
+ {
+ if(allClassListModel != null)
+ allClassListModel.clear();
+
+ if(currentClassListModel != null)
+ currentClassListModel.clear();
+
+ allClassListModel = new javax.swing.DefaultListModel(); /* false */
+ currentClassListModel = UtilController.returnCurrentClasses();
+ removeClassList.setModel(removeClassListModel);
+ currentClassListRC.setModel(currentDeviceListModel);
+
+ }
+
+ private void addArrowRCActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addArrowActionPerformed
+ if (removeClassListModel.contains(currentClassListRC.getSelectedValue()))
+ {
+ JOptionPane.showMessageDialog(null, "Class already in current class list",
+ "Add Error", JOptionPane.ERROR_MESSAGE);
+ }
+ else if(currentClassListRC.getSelectedValue() == null)
+ {
+ JOptionPane.showMessageDialog(null, "No class selected!",
+ "Add Error", JOptionPane.ERROR_MESSAGE);
+ }
+ else
+ {
+ removeClassListModel.addElement(currentClassListRC.getSelectedValue());
+ currentDeviceListModel.removeElement(currentClassListRC.getSelectedValue());
+
+ removeClassList.setModel(removeClassListModel);
+
+ }
+ }//GEN-LAST:event_addArrowActionPerformed
+
+
+
+
+ private void removeArrowRCActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeArrowActionPerformed
+ int i;
+ for (i = 0; i < removeClassListModel.getSize(); i++)
+ {
+ if (removeClassListModel.elementAt(i).equals(removeClassList.getSelectedValue()))
+ {
+ currentDeviceListModel.addElement(removeClassListModel.elementAt(i));
+ removeClassListModel.removeElementAt(i);
+ }
+ }
+ }//GEN-LAST:event_removeArrowActionPerformed
+
+
+
+ private void removeClassButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeClassButtonActionPerformed
+
+ if(JOptionPane.showConfirmDialog(null, "Continue? If you delete this device you will no longer be able "
+ + "to select this device when building jobs.\nFiles associated with this device will not be deleted "
+ + "but they will no longer be associated with this device. \n Click 'YES' to CONFIRM DELETION this is permanent!","Warning",JOptionPane.YES_OPTION)==JOptionPane.YES_OPTION){
+ for (int i = 0; i < removeClassListModel.getSize(); i++)
+ {
+ String selected = (String) removeClassListModel.elementAt(i);
+ final String id = selected;
+ Thread runner = new Thread() {
+
+ public void run()
+ {
+ UtilController.removeDevice(id);
+ }
+ };
+
+ runner.run();
+
+
+ }
+ removeClassListModel.clear();
+ updateView();
+ }
+ else
+ JOptionPane.showMessageDialog(null, "Please select a class to remove.");
+ }//GEN-LAST:event_removeClassButtonActionPerformed
+
+
+ private void addFieldButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addFieldButtonActionPerformed
+ switch(count)
+ {
+ case 0:
+ fieldL1Label.setVisible(true);
+ field1.setVisible(true);
+ numberValCheck1.setVisible(true);
+ count++;
+ break;
+ case 1:
+ fieldL2Label.setVisible(true);
+ field2.setVisible(true);
+ numberValCheck2.setVisible(true);
+ count++;
+ break;
+ case 2:
+ fieldL3Label.setVisible(true);
+ field3.setVisible(true);
+ numberValCheck3.setVisible(true);
+ count++;
+ break;
+ case 3:
+ fieldL4Label.setVisible(true);
+ field4.setVisible(true);
+ numberValCheck4.setVisible(true);
+ count++;
+ break;
+ default:
+ JOptionPane op = new JOptionPane("The maximum number of fields has been reached. Sorry, please use 5 fields or less.", JOptionPane.INFORMATION_MESSAGE);
+ JDialog dialog = op.createDialog("Device Manager: Maximum Fields!");
+ dialog.setAlwaysOnTop(true);
+ dialog.setModal(true);
+ dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+ dialog.setVisible(true);
+ count = 4;
+ break;
+
+ }
+ }
+
+ private void removeFields()
+ {
+ switch(count)
+ {
+ case 1:
+ fieldL1Label.setVisible(false);
+ field1.setVisible(false);
+ numberValCheck1.setVisible(false);
+ count--;
+ break;
+ case 2:
+ fieldL2Label.setVisible(false);
+ field2.setVisible(false);
+ numberValCheck2.setVisible(false);
+ count--;
+ break;
+ case 3:
+ fieldL3Label.setVisible(false);
+ field3.setVisible(false);
+ numberValCheck3.setVisible(false);
+ count--;
+ break;
+ case 4:
+ fieldL4Label.setVisible(false);
+ field4.setVisible(false);
+ numberValCheck4.setVisible(false);
+ count--;
+ break;
+ default:
+ JOptionPane op = new JOptionPane("The Minimum number of fields has been reached. Sorry, please use 1 field or more.", JOptionPane.INFORMATION_MESSAGE);
+ JDialog dialog = op.createDialog("Device Manager: Minimum Fields!");
+ dialog.setAlwaysOnTop(true);
+ dialog.setModal(true);
+ dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+ dialog.setVisible(true);
+ count = 0;
+ break;
+
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ JTextField tfield;
+ Device device;
+ JLabel tlabel;
+ JCheckBox cbox;
+ private JList removeClassList;
+ private JButton addArrowRC;
+ private JButton removeArrowRC;
+ private JPanel addDevicePanel;
+ private JTextField deviceNameInput;
+ private JTextField fileExtInput;
+ private JList currentClassListRC;
+ private JScrollPane spAvaiableClassesRC ;
+ private JLabel lblAvailableClasses;
+ private JButton removePrinterButton;
+ private JList classList ;
+ private JLabel backButton;
+ private JLabel deviceNameLabel;
+ private JLabel fileExtLabel;
+ private JLabel fieldL1Label;
+ private JTextField fieldL0;
+ private JCheckBox numberValCheck0;
+ private JButton addFieldButton;
+ private JButton saveButton;
+ private JTabbedPane tabbedPane;
+ private JLabel fieldL0Label;
+ private JTextField field1;
+ private JCheckBox numberValCheck1;
+ private JLabel fieldL2Label;
+ private JTextField field2;
+ private JCheckBox numberValCheck2;
+ private JLabel fieldL3Label;
+ private JTextField field3;
+ private JCheckBox numberValCheck3;
+ private JLabel fieldL4Label;
+ private JTextField field4;
+ private JCheckBox numberValCheck4;
+ private JButton removeFieldButton;
+}// end of class
diff --git a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/EmailUtils.java b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/EmailUtils.java
index d453fda..80dd29a 100644
--- a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/EmailUtils.java
+++ b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/EmailUtils.java
@@ -16,18 +16,20 @@
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
+import javax.mail.Authenticator;
+import javax.mail.PasswordAuthentication;
public class EmailUtils
{
- private Session smtpSession = null;
- private Properties emailSessionProperties = null;
- private Message emailContent = null;
- private String username = null;
- private String password = null;
- private String emailAdrTo = null;
- private String emailMessageContent = null;
+ private static Session smtpSession = null;
+ //private static Properties emailSessionProperties = null;
+ private static Message emailContent = null;
+ private static String username = null;
+ private static String password = null;
+ private static String emailAdrTo = null;
+ private static String emailMessageContent = null;
- private Message setEmailContents()
+ /*private Message setEmailContents()
{
Message message = new MimeMessage(smtpSession);
try
@@ -43,20 +45,52 @@ private Message setEmailContents()
Logger.getLogger(EmailUtils.class.getName()).log(Level.SEVERE, null, ex);
}
return message;
- }
+ }*/
- public EmailUtils(String emailAdrSend, String accountName, String pw, String emailTextMsg)
+ public static void send(String emailAdrSend, String accountName, String pw, String emailTextMsg)
{
username = accountName;
password = pw;
emailAdrTo = emailAdrSend;
emailMessageContent = emailTextMsg;
+ Properties emailSessionProperties = System.getProperties();
+
+ //****
+ Session session = Session.getInstance(emailSessionProperties, new javax.mail.Authenticator() {
+ protected PasswordAuthentication getPasswordAuthentication() {
+ return new PasswordAuthentication(username, password);
+ }
+ });
+ session.setDebug(true);
+
- emailSessionProperties = new Properties();
+ //emailSessionProperties = new Properties();
emailSessionProperties.put("mail.smtp.starttls.enable", "true");
emailSessionProperties.put("mail.smtp.auth", "true");
emailSessionProperties.put("mail.smtp.host", "smtp.gmail.com");
emailSessionProperties.put("mail.smtp.port", "587");
+
+
+
+ Message message = new MimeMessage(smtpSession);
+
+ try
+ {
+ message.setFrom(new InternetAddress(username));
+ //Students Email Should go here
+ message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(emailAdrTo));
+ message.setSubject("Towson University Object Lab: No_Reply");
+ message.setText(emailMessageContent);
+ //****
+ Transport trans = session.getTransport("smtp");
+ trans.connect("smtp.gmail.com", 587, "TowsonuObjectLab@gmail.com", "oblabsoftware");
+ trans.sendMessage(message, message.getAllRecipients());
+ }
+ catch (MessagingException ex)
+ {
+ Logger.getLogger(EmailUtils.class.getName()).log(Level.SEVERE, null, ex);
+ ex.printStackTrace();
+ }
smtpSession = Session.getInstance
(
@@ -74,10 +108,10 @@ protected PasswordAuthentication getPasswordAuthentication()
This MUST be the last thing initalized since there are so
many vars to init prior to setting the contents of the email
*/
- emailContent = setEmailContents();
+ //emailContent = setEmailContents();
}
- public boolean send()
+ /* public boolean send()
{
try
{
@@ -94,5 +128,5 @@ public boolean send()
return false;
}
return true;
- }
-}
+ } */
+}
\ No newline at end of file
diff --git a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/FileManager.java b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/FileManager.java
index fe0afaa..c153d20 100644
--- a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/FileManager.java
+++ b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/FileManager.java
@@ -22,8 +22,9 @@
public class FileManager
{
- private static final String drive = "C:\\Sync";
- private static final String drive2 = "C:\\Sync\\ObjectLabPrinters";
+
+ private static final String drive = MainView.getStorageDir() +":\\Sync";
+ private static final String drive2 = MainView.getStorageDir() +":\\Sync\\ObjectLabPrinters";
private static final String submission = drive + "\\ObjectLabPrinters\\Submissions\\";
private static final String rejected = drive + "\\ObjectLabPrinters\\Rejected\\";
private static final String excelFilePath = drive + "\\Export\\";
diff --git a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/JobsView.java b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/JobsView.java
index deeb29d..790d180 100755
--- a/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/JobsView.java
+++ b/ObjectLabSoftware/src/ObjectLabEnterpriseSoftware/JobsView.java
@@ -1,6 +1,10 @@
package ObjectLabEnterpriseSoftware;
+import java.awt.Checkbox;
+import java.awt.CheckboxGroup;
import java.awt.Desktop;
+import java.awt.Dimension;
+import java.awt.Insets;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
@@ -13,8 +17,15 @@
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
-
+import javax.swing.JTabbedPane;
import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableColumn;
+import javax.swing.Box;
+import javax.swing.ImageIcon;
+import java.awt.Color;
+import javax.swing.JMenu;
+import javax.swing.JButton;
+import javax.swing.JLabel;
public class JobsView extends javax.swing.JFrame
{
@@ -29,28 +40,38 @@ public class JobsView extends javax.swing.JFrame
private ArrayList printers;
private String selectedPrinter;
private String[] completedHeaders = new String[]{"File Name","First Name","Last Name","Submission Date","Class","Section","Volume"};
-
+ // --nav bar views ~Alex
+ private BuildView buildView;
+ private JobsView jobsView;
+ private ReportsView reportsView;
+ private AdminSettingsView adminSettingsView;
+ //
private static final MainView home = new MainView();
private DefaultTableModel allFileTableModel;
private void updateView(String status, DefaultTableModel pendingJobsView, ArrayList> view)
{
- pendingJobsView.setColumnIdentifiers(UtilController.getStatusJobsHeaders(status));
+ pendingJobsView.setColumnIdentifiers(UtilController.getStatusJobsHeaders(status));
/* Clears up the rows in the view's model. */
for (int rows = pendingJobsView.getRowCount() - 1; rows >= 0; rows--)
{
pendingJobsView.removeRow(rows);
}
-
+ int rowSelector = 0;
/* Inserts data found in (ArrayList -> listOfRows) by row into the UI model to display */
for (ArrayList