Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package grades;
- import java.awt.Component;
- import java.awt.event.ContainerEvent;
- import static java.awt.image.ImageObserver.WIDTH;
- import javax.swing.ButtonModel;
- import javax.swing.ComboBoxModel;
- import javax.swing.event.ChangeEvent;
- /**
- *
- * @author Nicholas
- */
- public class gradesui extends javax.swing.JFrame {
- boolean addingTab=false, addingProfile=false;
- int numProfiles, index;
- double gradePointScaleSelectedValue=0;
- String gradePointScaleSelectedName, termTypeSelectedName, termTypeSelectedValue;
- Profile blankProfile=new Profile("test","semester",4);
- Profile currentProfile;
- Profile profiles[]=new Profile[0];
- /**
- * Creates new form gradesui
- */
- public gradesui() {
- currentProfile = blankProfile;
- initComponents();
- }
- /**
- * This method is called from within the constructor to initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is always
- * regenerated by the Form Editor.
- */
- @SuppressWarnings("unchecked")
- // <editor-fold defaultstate="collapsed" desc="Generated Code">
- private void initComponents() {
- bindingGroup = new org.jdesktop.beansbinding.BindingGroup();
- addProfile = new javax.swing.JDialog();
- profileNameInput = new javax.swing.JFormattedTextField();
- addProfileConfirm = new javax.swing.JButton();
- jLabel2 = new javax.swing.JLabel();
- jPanel3 = new javax.swing.JPanel();
- jLabel3 = new javax.swing.JLabel();
- termTypeSemester = new javax.swing.JRadioButton();
- termTypeTrimester = new javax.swing.JRadioButton();
- termTypeQuarter = new javax.swing.JRadioButton();
- jPanel5 = new javax.swing.JPanel();
- jLabel4 = new javax.swing.JLabel();
- pointScale12 = new javax.swing.JRadioButton();
- pointScale10 = new javax.swing.JRadioButton();
- pointScale4 = new javax.swing.JRadioButton();
- addProfileCancel = new javax.swing.JButton();
- addTerm = new javax.swing.JDialog();
- jLabel5 = new javax.swing.JLabel();
- jSlider1 = new javax.swing.JSlider();
- jFormattedTextField2 = new javax.swing.JFormattedTextField();
- deleteProfile = new javax.swing.JDialog();
- deleteProfile1 = new javax.swing.JOptionPane();
- newTabFormat = new javax.swing.JPanel();
- courseTabPane = new javax.swing.JTabbedPane();
- jButton6 = new javax.swing.JButton();
- addProfileTrimester = new javax.swing.JPanel();
- jLabel13 = new javax.swing.JLabel();
- trimester1 = new javax.swing.JRadioButton();
- trimester2 = new javax.swing.JRadioButton();
- trimester3 = new javax.swing.JRadioButton();
- trimesterOther = new javax.swing.JRadioButton();
- addProfileSemester = new javax.swing.JPanel();
- jLabel12 = new javax.swing.JLabel();
- semesterFall = new javax.swing.JRadioButton();
- semesterSpring = new javax.swing.JRadioButton();
- semesterOther = new javax.swing.JRadioButton();
- addProfileQuarter = new javax.swing.JPanel();
- jLabel14 = new javax.swing.JLabel();
- quarter1 = new javax.swing.JRadioButton();
- quarter2 = new javax.swing.JRadioButton();
- quarterOther = new javax.swing.JRadioButton();
- quarter3 = new javax.swing.JRadioButton();
- quarter4 = new javax.swing.JRadioButton();
- termType = new javax.swing.ButtonGroup();
- addProfileGradePointScale = new javax.swing.ButtonGroup();
- addProfileTermType = new javax.swing.ButtonGroup();
- jLabel1 = new javax.swing.JLabel();
- jPanel1 = new javax.swing.JPanel();
- profileComboBox = new javax.swing.JComboBox();
- jButton1 = new javax.swing.JButton();
- jPanel4 = new javax.swing.JPanel();
- profileDetailsTermTypeLabel = new javax.swing.JLabel();
- profileDetailsTermType = new javax.swing.JLabel();
- profileDetailsGradePointScaleLabel = new javax.swing.JLabel();
- profileDetailsGradePointScale = new javax.swing.JLabel();
- profileDetailsNumCoursesLabel = new javax.swing.JLabel();
- profileDetailsNumCourses = new javax.swing.JLabel();
- jPanel6 = new javax.swing.JPanel();
- profileDetailGPALabel = new javax.swing.JLabel();
- profileDetailsGPA = new javax.swing.JLabel();
- profileDetailsCreditsTakenLabel = new javax.swing.JLabel();
- profileDetailsCreditsTaken = new javax.swing.JLabel();
- profileDetailsGradePointsLabel = new javax.swing.JLabel();
- profileDetailsGradePoints = new javax.swing.JLabel();
- jButton7 = new javax.swing.JButton();
- jButton9 = new javax.swing.JButton();
- jButton8 = new javax.swing.JButton();
- filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(10, 0), new java.awt.Dimension(10, 0), new java.awt.Dimension(10, 32767));
- termTabPane = new javax.swing.JTabbedPane();
- jButton5 = new javax.swing.JButton();
- menuBar = new javax.swing.JMenuBar();
- fileMenu = new javax.swing.JMenu();
- exitMenuItem = new javax.swing.JMenuItem();
- helpMenu = new javax.swing.JMenu();
- aboutMenuItem = new javax.swing.JMenuItem();
- addProfile.setTitle("Create New Profile");
- addProfile.setAlwaysOnTop(true);
- addProfile.setBounds(new java.awt.Rectangle(0, 0, 480, 230));
- addProfile.setLocationRelativeTo(null);
- profileNameInput.setToolTipText("");
- profileNameInput.setName("profileNameInput"); // NOI18N
- addProfileConfirm.setText("Create Profile");
- addProfileConfirm.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- addProfileConfirmActionPerformed(evt);
- }
- });
- jLabel2.setText("Profile Name: ");
- jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder());
- jLabel3.setText("Academic Term Type");
- addProfileTermType.add(termTypeSemester);
- termTypeSemester.setSelected(true);
- termTypeSemester.setText("Semester");
- addProfileTermType.add(termTypeTrimester);
- termTypeTrimester.setText("Trimester");
- addProfileTermType.add(termTypeQuarter);
- termTypeQuarter.setText("Quarter");
- javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
- jPanel3.setLayout(jPanel3Layout);
- jPanel3Layout.setHorizontalGroup(
- jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel3Layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jLabel3)
- .addGroup(jPanel3Layout.createSequentialGroup()
- .addGap(10, 10, 10)
- .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(termTypeTrimester)
- .addComponent(termTypeSemester)
- .addComponent(termTypeQuarter))))
- .addContainerGap(84, Short.MAX_VALUE))
- );
- jPanel3Layout.setVerticalGroup(
- jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel3Layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jLabel3)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(termTypeSemester)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(termTypeTrimester)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(termTypeQuarter)
- .addContainerGap(15, Short.MAX_VALUE))
- );
- jPanel5.setBorder(javax.swing.BorderFactory.createEtchedBorder());
- jLabel4.setText("Grade Point Scale");
- addProfileGradePointScale.add(pointScale12);
- pointScale12.setText("12 Point Scale");
- addProfileGradePointScale.add(pointScale10);
- pointScale10.setText("10 Point Scale");
- addProfileGradePointScale.add(pointScale4);
- pointScale4.setSelected(true);
- pointScale4.setText("4 Point Scale (Most Common)");
- javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
- jPanel5.setLayout(jPanel5Layout);
- jPanel5Layout.setHorizontalGroup(
- jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel5Layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jLabel4)
- .addGroup(jPanel5Layout.createSequentialGroup()
- .addGap(10, 10, 10)
- .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(pointScale10)
- .addComponent(pointScale4)
- .addComponent(pointScale12))))
- .addContainerGap(27, Short.MAX_VALUE))
- );
- jPanel5Layout.setVerticalGroup(
- jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel5Layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jLabel4)
- .addGap(7, 7, 7)
- .addComponent(pointScale4)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(pointScale10)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(pointScale12)
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
- addProfileCancel.setText("Cancel");
- addProfileCancel.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- addProfileCancelActionPerformed(evt);
- }
- });
- javax.swing.GroupLayout addProfileLayout = new javax.swing.GroupLayout(addProfile.getContentPane());
- addProfile.getContentPane().setLayout(addProfileLayout);
- addProfileLayout.setHorizontalGroup(
- addProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
- .addGroup(addProfileLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(addProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGroup(addProfileLayout.createSequentialGroup()
- .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(profileNameInput, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGroup(addProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
- .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGroup(addProfileLayout.createSequentialGroup()
- .addComponent(addProfileCancel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(addProfileConfirm)))
- .addContainerGap())
- );
- addProfileLayout.setVerticalGroup(
- addProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, addProfileLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(addProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(addProfileLayout.createSequentialGroup()
- .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addGroup(addProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(addProfileConfirm)
- .addComponent(addProfileCancel))
- .addGap(18, 18, 18))
- .addGroup(addProfileLayout.createSequentialGroup()
- .addGroup(addProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
- .addComponent(profileNameInput)
- .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addGap(18, 18, 18)
- .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addContainerGap())))
- );
- addTerm.setTitle("Add a Term...");
- addTerm.setAlwaysOnTop(true);
- addTerm.setBounds(new java.awt.Rectangle(410, 280, 410, 280));
- addTerm.setType(java.awt.Window.Type.POPUP);
- switch(currentProfile.getTermType()){
- case "semester":
- addTerm.add(addProfileSemester);
- break;
- case "trimester":
- addTerm.add(addProfileTrimester);
- break;
- case "quarter":
- addTerm.add(addProfileQuarter);
- break;
- default:
- break;
- }
- addTerm.setLocationRelativeTo(null);
- addTerm.addWindowListener(new java.awt.event.WindowAdapter() {
- public void windowActivated(java.awt.event.WindowEvent evt) {
- addTermWindowActivated(evt);
- }
- public void windowOpened(java.awt.event.WindowEvent evt) {
- addTermWindowOpened(evt);
- }
- });
- addTerm.addFocusListener(new java.awt.event.FocusAdapter() {
- public void focusGained(java.awt.event.FocusEvent evt) {
- addTermFocusGained(evt);
- }
- });
- jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
- jLabel5.setText("Term Year: ");
- jSlider1.setMajorTickSpacing(5);
- jSlider1.setMaximum(2015);
- jSlider1.setMinimum(2000);
- jSlider1.setMinorTickSpacing(1);
- jSlider1.setPaintLabels(true);
- jSlider1.setPaintTicks(true);
- jSlider1.setSnapToTicks(true);
- jSlider1.setToolTipText("");
- jSlider1.setValue(2013);
- jFormattedTextField2.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("####"))));
- jFormattedTextField2.setHorizontalAlignment(javax.swing.JTextField.CENTER);
- jFormattedTextField2.setMargin(new java.awt.Insets(1, 1, 1, 1));
- org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jSlider1, org.jdesktop.beansbinding.ELProperty.create("${value}"), jFormattedTextField2, org.jdesktop.beansbinding.BeanProperty.create("value"));
- bindingGroup.addBinding(binding);
- javax.swing.GroupLayout addTermLayout = new javax.swing.GroupLayout(addTerm.getContentPane());
- addTerm.getContentPane().setLayout(addTermLayout);
- addTermLayout.setHorizontalGroup(
- addTermLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(addTermLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jLabel5)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jFormattedTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jSlider1, javax.swing.GroupLayout.DEFAULT_SIZE, 260, Short.MAX_VALUE)
- .addContainerGap())
- );
- addTermLayout.setVerticalGroup(
- addTermLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(addTermLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(addTermLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jSlider1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGroup(addTermLayout.createSequentialGroup()
- .addGap(9, 9, 9)
- .addGroup(addTermLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jFormattedTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel5))))
- .addContainerGap(152, Short.MAX_VALUE))
- );
- deleteProfile.setAlwaysOnTop(true);
- deleteProfile.setBounds(new java.awt.Rectangle(0, 0, 500, 200));
- deleteProfile.setIconImage(null);
- deleteProfile1.setMessage("Are you sure you want to Delete Profile" + currentProfile.getName());
- deleteProfile1.setMessageType(2);
- deleteProfile1.setOptionType(0);
- deleteProfile1.setToolTipText("");
- javax.swing.GroupLayout deleteProfileLayout = new javax.swing.GroupLayout(deleteProfile.getContentPane());
- deleteProfile.getContentPane().setLayout(deleteProfileLayout);
- deleteProfileLayout.setHorizontalGroup(
- deleteProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGap(0, 500, Short.MAX_VALUE)
- .addGroup(deleteProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(deleteProfileLayout.createSequentialGroup()
- .addGap(0, 119, Short.MAX_VALUE)
- .addComponent(deleteProfile1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(0, 119, Short.MAX_VALUE)))
- );
- deleteProfileLayout.setVerticalGroup(
- deleteProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGap(0, 200, Short.MAX_VALUE)
- .addGroup(deleteProfileLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(deleteProfileLayout.createSequentialGroup()
- .addGap(0, 55, Short.MAX_VALUE)
- .addComponent(deleteProfile1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(0, 55, Short.MAX_VALUE)))
- );
- newTabFormat.setName("newC"); // NOI18N
- javax.swing.GroupLayout newTabFormatLayout = new javax.swing.GroupLayout(newTabFormat);
- newTabFormat.setLayout(newTabFormatLayout);
- newTabFormatLayout.setHorizontalGroup(
- newTabFormatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGap(0, 676, Short.MAX_VALUE)
- );
- newTabFormatLayout.setVerticalGroup(
- newTabFormatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGap(0, 448, Short.MAX_VALUE)
- );
- newTabFormat.getAccessibleContext().setAccessibleName("newTabFormat");
- courseTabPane.setToolTipText("");
- courseTabPane.setName(""); // NOI18N
- courseTabPane.setPreferredSize(new java.awt.Dimension(681, 454));
- courseTabPane.addChangeListener(new javax.swing.event.ChangeListener() {
- public void stateChanged(javax.swing.event.ChangeEvent evt) {
- courseTabPaneStateChanged(evt);
- }
- });
- courseTabPane.addComponentListener(new java.awt.event.ComponentAdapter() {
- public void componentShown(java.awt.event.ComponentEvent evt) {
- courseTabPaneComponentShown(evt);
- }
- });
- courseTabPane.addContainerListener(new java.awt.event.ContainerAdapter() {
- public void componentAdded(java.awt.event.ContainerEvent evt) {
- courseTabPaneComponentAdded(evt);
- }
- });
- courseTabPane.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
- public void propertyChange(java.beans.PropertyChangeEvent evt) {
- courseTabPanePropertyChange(evt);
- }
- });
- jButton6.setFont(new java.awt.Font("Lucida Calligraphy", 1, 36)); // NOI18N
- jButton6.setText("Click Here to Add a Course");
- courseTabPane.addTab("+", jButton6);
- courseTabPane.getAccessibleContext().setAccessibleName("courseTabPane");
- addProfileTrimester.setPreferredSize(new java.awt.Dimension(296, 70));
- jLabel13.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
- jLabel13.setText("Trimester:");
- termType.add(trimester1);
- trimester1.setText("1");
- trimester1.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- trimester1ActionPerformed(evt);
- }
- });
- termType.add(trimester2);
- trimester2.setText("2");
- termType.add(trimester3);
- trimester3.setText("3");
- termType.add(trimesterOther);
- trimesterOther.setText("Other");
- javax.swing.GroupLayout addProfileTrimesterLayout = new javax.swing.GroupLayout(addProfileTrimester);
- addProfileTrimester.setLayout(addProfileTrimesterLayout);
- addProfileTrimesterLayout.setHorizontalGroup(
- addProfileTrimesterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(addProfileTrimesterLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jLabel13)
- .addGap(18, 18, 18)
- .addComponent(trimester1)
- .addGap(18, 18, 18)
- .addComponent(trimester2)
- .addGap(18, 18, 18)
- .addComponent(trimester3)
- .addGap(18, 18, 18)
- .addComponent(trimesterOther)
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
- addProfileTrimesterLayout.setVerticalGroup(
- addProfileTrimesterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(addProfileTrimesterLayout.createSequentialGroup()
- .addGap(23, 23, 23)
- .addGroup(addProfileTrimesterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel13)
- .addComponent(trimester1)
- .addComponent(trimester2)
- .addComponent(trimester3)
- .addComponent(trimesterOther))
- .addContainerGap(24, Short.MAX_VALUE))
- );
- addProfileSemester.setPreferredSize(new java.awt.Dimension(296, 44));
- jLabel12.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
- jLabel12.setText("Semester:");
- termType.add(semesterFall);
- semesterFall.setText("Fall");
- termType.add(semesterSpring);
- semesterSpring.setText("Spring");
- termType.add(semesterOther);
- semesterOther.setText("Other");
- javax.swing.GroupLayout addProfileSemesterLayout = new javax.swing.GroupLayout(addProfileSemester);
- addProfileSemester.setLayout(addProfileSemesterLayout);
- addProfileSemesterLayout.setHorizontalGroup(
- addProfileSemesterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(addProfileSemesterLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jLabel12)
- .addGap(18, 18, 18)
- .addComponent(semesterFall)
- .addGap(18, 18, 18)
- .addComponent(semesterSpring)
- .addGap(18, 18, 18)
- .addComponent(semesterOther)
- .addContainerGap(21, Short.MAX_VALUE))
- );
- addProfileSemesterLayout.setVerticalGroup(
- addProfileSemesterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(addProfileSemesterLayout.createSequentialGroup()
- .addGap(22, 22, 22)
- .addGroup(addProfileSemesterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel12)
- .addComponent(semesterFall)
- .addComponent(semesterSpring)
- .addComponent(semesterOther))
- .addContainerGap(25, Short.MAX_VALUE))
- );
- addProfileQuarter.setPreferredSize(new java.awt.Dimension(296, 70));
- jLabel14.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
- jLabel14.setText("Quarter:");
- termType.add(quarter1);
- quarter1.setText("One");
- termType.add(quarter2);
- quarter2.setText("Two");
- termType.add(quarterOther);
- quarterOther.setText("Other");
- termType.add(quarter3);
- quarter3.setText("Three");
- termType.add(quarter4);
- quarter4.setText("Four");
- javax.swing.GroupLayout addProfileQuarterLayout = new javax.swing.GroupLayout(addProfileQuarter);
- addProfileQuarter.setLayout(addProfileQuarterLayout);
- addProfileQuarterLayout.setHorizontalGroup(
- addProfileQuarterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(addProfileQuarterLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(18, 18, 18)
- .addGroup(addProfileQuarterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(addProfileQuarterLayout.createSequentialGroup()
- .addComponent(quarter4)
- .addGap(18, 18, 18)
- .addComponent(quarterOther))
- .addGroup(addProfileQuarterLayout.createSequentialGroup()
- .addComponent(quarter1)
- .addGap(18, 18, 18)
- .addComponent(quarter2)
- .addGap(18, 18, 18)
- .addComponent(quarter3)))
- .addContainerGap(36, Short.MAX_VALUE))
- );
- addProfileQuarterLayout.setVerticalGroup(
- addProfileQuarterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(addProfileQuarterLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(addProfileQuarterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel14)
- .addComponent(quarter1)
- .addComponent(quarter2)
- .addComponent(quarter3))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addGroup(addProfileQuarterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(quarter4)
- .addComponent(quarterOther))
- .addContainerGap(11, Short.MAX_VALUE))
- );
- setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
- setBounds(new java.awt.Rectangle(0, 0, 683, 736));
- addWindowStateListener(new java.awt.event.WindowStateListener() {
- public void windowStateChanged(java.awt.event.WindowEvent evt) {
- formWindowStateChanged(evt);
- }
- });
- jLabel1.setText("created by Nick Bolles");
- jLabel1.setToolTipText("");
- jLabel1.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
- jLabel1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
- jLabel1.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
- jLabel1.setName(""); // NOI18N
- jLabel1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
- jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Profile", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 0, 18))); // NOI18N
- profileComboBox.setMaximumRowCount(10);
- profileComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Create a Profile>>" }));
- profileComboBox.setToolTipText("Click The '+' To Add A Profile");
- profileComboBox.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent evt) {
- profileComboBoxItemStateChanged(evt);
- }
- });
- profileComboBox.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- profileComboBoxActionPerformed(evt);
- }
- });
- jButton1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
- jButton1.setText("+");
- jButton1.setAlignmentY(0.0F);
- jButton1.setBorder(null);
- jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
- jButton1.setMaximumSize(new java.awt.Dimension(24, 27));
- jButton1.setMinimumSize(new java.awt.Dimension(24, 27));
- jButton1.setPreferredSize(new java.awt.Dimension(24, 27));
- jButton1.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jButton1ActionPerformed(evt);
- }
- });
- jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Profile Information"));
- profileDetailsTermTypeLabel.setText("Academic Term Type:");
- profileDetailsTermType.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
- profileDetailsGradePointScaleLabel.setText("Grade Point Scale: ");
- profileDetailsGradePointScale.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
- profileDetailsNumCoursesLabel.setText("Number of Courses: ");
- profileDetailsNumCourses.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
- javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
- jPanel4.setLayout(jPanel4Layout);
- jPanel4Layout.setHorizontalGroup(
- jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel4Layout.createSequentialGroup()
- .addContainerGap(12, Short.MAX_VALUE)
- .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(profileDetailsTermTypeLabel)
- .addComponent(profileDetailsGradePointScaleLabel)
- .addComponent(profileDetailsNumCoursesLabel))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
- .addComponent(profileDetailsGradePointScale, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE)
- .addComponent(profileDetailsNumCourses, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(profileDetailsTermType, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addGap(10, 10, 10))
- );
- jPanel4Layout.setVerticalGroup(
- jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel4Layout.createSequentialGroup()
- .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(profileDetailsTermTypeLabel)
- .addComponent(profileDetailsTermType, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
- .addComponent(profileDetailsGradePointScaleLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(profileDetailsGradePointScale, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(profileDetailsNumCoursesLabel)
- .addComponent(profileDetailsNumCourses, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
- jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Grade Information"));
- profileDetailGPALabel.setText("Grade Point Average");
- profileDetailsGPA.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
- profileDetailsCreditsTakenLabel.setText("Credits Taken");
- profileDetailsCreditsTaken.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
- profileDetailsGradePointsLabel.setText("Grade Points");
- profileDetailsGradePoints.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
- javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
- jPanel6.setLayout(jPanel6Layout);
- jPanel6Layout.setHorizontalGroup(
- jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(profileDetailGPALabel)
- .addComponent(profileDetailsCreditsTakenLabel)
- .addComponent(profileDetailsGradePointsLabel))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
- .addComponent(profileDetailsGPA, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(profileDetailsCreditsTaken, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(profileDetailsGradePoints, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addContainerGap())
- );
- jPanel6Layout.setVerticalGroup(
- jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel6Layout.createSequentialGroup()
- .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(profileDetailGPALabel)
- .addComponent(profileDetailsGPA, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
- .addComponent(profileDetailsCreditsTakenLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(profileDetailsCreditsTaken, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(profileDetailsGradePointsLabel)
- .addComponent(profileDetailsGradePoints, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addContainerGap(32, Short.MAX_VALUE))
- );
- jButton7.setText("Delete");
- jButton7.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jButton7ActionPerformed(evt);
- }
- });
- jButton9.setText("Details");
- jButton8.setText("Edit");
- jButton8.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jButton8ActionPerformed(evt);
- }
- });
- javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
- jPanel1.setLayout(jPanel1Layout);
- jPanel1Layout.setHorizontalGroup(
- jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel1Layout.createSequentialGroup()
- .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel1Layout.createSequentialGroup()
- .addGap(0, 4, Short.MAX_VALUE)
- .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(profileComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(26, 26, 26)
- .addComponent(jButton8)
- .addGap(18, 18, 18)
- .addComponent(jButton9)
- .addGap(18, 18, 18)
- .addComponent(jButton7)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
- .addGap(4, 4, 4))
- );
- jPanel1Layout.setVerticalGroup(
- jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel1Layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(profileComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jButton7)
- .addComponent(jButton9)
- .addComponent(jButton8)))
- .addGap(10, 10, 10)
- .addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addGap(4, 4, 4))
- );
- termTabPane.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
- termTabPane.setToolTipText("");
- termTabPane.setEnabled(false);
- termTabPane.setName(""); // NOI18N
- termTabPane.setNextFocusableComponent(courseTabPane);
- termTabPane.setOpaque(true);
- termTabPane.setPreferredSize(new java.awt.Dimension(681, 454));
- termTabPane.addChangeListener(new javax.swing.event.ChangeListener() {
- public void stateChanged(javax.swing.event.ChangeEvent evt) {
- termTabPaneStateChanged(evt);
- }
- });
- termTabPane.addComponentListener(new java.awt.event.ComponentAdapter() {
- public void componentShown(java.awt.event.ComponentEvent evt) {
- termTabPaneComponentShown(evt);
- }
- });
- termTabPane.addContainerListener(new java.awt.event.ContainerAdapter() {
- public void componentAdded(java.awt.event.ContainerEvent evt) {
- termTabPaneComponentAdded(evt);
- }
- });
- termTabPane.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
- public void propertyChange(java.beans.PropertyChangeEvent evt) {
- termTabPanePropertyChange(evt);
- }
- });
- jButton5.setFont(new java.awt.Font("Lucida Calligraphy", 1, 36)); // NOI18N
- jButton5.setText("Click Here to Add a Course");
- termTabPane.addTab("+", jButton5);
- jButton5.getAccessibleContext().setAccessibleName("addCourseButton");
- fileMenu.setMnemonic('f');
- fileMenu.setText("File");
- exitMenuItem.setMnemonic('x');
- exitMenuItem.setText("Exit");
- exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- exitMenuItemActionPerformed(evt);
- }
- });
- fileMenu.add(exitMenuItem);
- menuBar.add(fileMenu);
- helpMenu.setMnemonic('h');
- helpMenu.setText("Help");
- aboutMenuItem.setMnemonic('a');
- aboutMenuItem.setText("About");
- helpMenu.add(aboutMenuItem);
- menuBar.add(helpMenu);
- setJMenuBar(menuBar);
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
- getContentPane().setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
- .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(0, 0, Short.MAX_VALUE)
- .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(6, 6, 6))
- .addComponent(termTabPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
- .addContainerGap())
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
- .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addGap(15, 15, 15)
- .addComponent(termTabPane, javax.swing.GroupLayout.PREFERRED_SIZE, 495, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(75, Short.MAX_VALUE))
- );
- termTabPane.getAccessibleContext().setAccessibleName("termTabPane");
- bindingGroup.bind();
- pack();
- setLocationRelativeTo(null);
- }// </editor-fold>
- private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {
- System.exit(0);
- }
- private void termTabPaneStateChanged(javax.swing.event.ChangeEvent evt) {
- if (addingTab!=false){
- return;
- }
- System.out.println("state change tripped");
- if (termTabPane.getTitleAt(termTabPane.getSelectedIndex()).equals("+")){
- System.out.println("before changing tabs");
- if (addingTab!=false){
- System.out.println("skipped add new tab: allready in progress");
- addNewTab("term",null,null,0);
- }
- else{
- addingTab=true;
- addNewTab("term",null,null,0);
- }
- }
- else{
- System.out.println("failed adding tab");
- } }
- private void addTermWindowOpened(java.awt.event.WindowEvent evt) {
- setLocationRelativeTo(null);
- // TODO add your handling code here:
- }
- private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {
- deleteProfile.setLocationRelativeTo(null);
- deleteProfile.setVisible(true);
- Object response=deleteProfile1.getValue();
- }
- private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
- addProfile.setVisible(true);
- }
- private void addProfileConfirmActionPerformed(java.awt.event.ActionEvent evt) {
- //remove filler "Create a Profile>>" item
- addingProfile=true;
- if (profileComboBox.getItemAt(0).equals("Create a Profile>>")){
- profileComboBox.removeItem("Create a Profile>>");
- }
- //find length of profiles array and set it to numProfiles for easier use
- profiles=new Profile[profiles.length+1];
- numProfiles = profiles.length;
- //getting selected button and
- if (pointScale4.isSelected()==true){
- gradePointScaleSelectedValue=4.0;
- }
- else if(pointScale10.isSelected()==true){
- gradePointScaleSelectedValue=10;
- }
- else if(pointScale12.isSelected()==true){
- gradePointScaleSelectedValue=12;
- }
- else{System.out.println("error: grade scale if statement went to else");}
- //setting TermType
- if (termTypeSemester.isSelected()==true){
- termTypeSelectedValue="semester";
- }
- else if(termTypeQuarter.isSelected()==true){
- termTypeSelectedValue="quarter";
- }
- else if(termTypeTrimester.isSelected()==true){
- termTypeSelectedValue="trimester";
- }
- else{System.out.println("error: termtype if statement went to else");}
- profiles[(numProfiles-1)]=new Profile(profileNameInput.getText(),termTypeSelectedValue,gradePointScaleSelectedValue);
- //TROUBLESHOOTING
- //System.out.println("termType="+termTypeSelectedValue+" gradepointscale="+gradePointScaleSelectedValue);
- //System.out.println(profiles[(numProfiles-1)].getName());
- //add created profile to combo box and set it as selected profile
- addingProfile=false;
- profileComboBox.addItem(profiles[numProfiles-1].getName());
- profileComboBox.setSelectedIndex((numProfiles-1));
- //TROUBLESHOOTING
- //System.out.println("profiles.termType="+profiles[numProfiles-1].getTermType()+" profiles.gradepointscale="+profiles[numProfiles-1].getGpaScale());
- //hiding window and clearing values
- addProfile.setVisible(false);
- profileNameInput.setText("");
- addProfileTermType.clearSelection();
- addProfileGradePointScale.clearSelection();
- termTabPane.setEnabled(true);
- }
- private void addProfileCancelActionPerformed(java.awt.event.ActionEvent evt) {
- addProfile.setVisible(false); // TODO add your handling code here:
- }
- private void profileComboBoxItemStateChanged(java.awt.event.ItemEvent evt) {
- try{
- if(currentProfile==profiles[profileComboBox.getSelectedIndex()]){
- }
- else if(addingProfile!=false){
- //Troubleshooting
- System.out.println("skipped update combobox: adding profile in progress");
- }
- else {
- currentProfile=profiles[profileComboBox.getSelectedIndex()];
- System.out.println("selected index "+profileComboBox.getSelectedIndex());
- for(int i=0;i<profiles.length;i++){
- index=i;
- System.out.println("index is "+index);
- System.out.println("profiles length is "+profiles.length);
- System.out.println("name is: "+profiles[i].getName());
- System.out.println("termType is: "+profiles[i].getTermType());
- }
- //Printout for this is here:
- //***I add a profile named "nick" with term type "semester"
- //selected index 0
- //***Combobox selected index
- //index is 0
- //***profiles array index
- //profiles length is 1
- //***length of profiles array
- //name is: nick
- //termType is: semester
- //***correctly prints out profiles[0].getName() and getTermType()
- //***Add another profile named "john" with term type "quarter" and set combobox selection to new profile
- //selected index 1
- //***"john" is selected in combobox, index is 1
- //index is 0
- //***printing out profiles[0]
- /profiles length is 2
- //***profiles array length is 2
- //error: null pointer exception at 0
- //***null pointer of profiles[0]
- updateLabels();
- }
- }catch(ArrayIndexOutOfBoundsException e){
- //Troubleshooting
- }catch(NullPointerException n){
- System.out.println("error: null pointer exception at "+index);
- //System.out.println("arrayOutOfbounds index was" + (profileComboBox.getSelectedIndex()+1));
- } }
- /**
- * @param args the command line arguments
- */
- private void addNewTab(String type,String title, Component compt, int index){
- if (addingTab!=false){
- //Finding number of tabs and adding tab at that index, replacing the + tab
- //this next line will push the + tab over, allowing us to keep the + tab
- switch(type){
- //type 1 comes from course tab
- case "course":
- int courseTabPaneNumTabs=(int) courseTabPane.getTabCount();
- courseTabPane.insertTab("New Class", null, newTabFormat, null, (courseTabPaneNumTabs-1));
- //Just added a tab above so dont need to compensate for index starting at 0
- courseTabPane.setSelectedIndex(courseTabPaneNumTabs-1);
- break;
- //type2 comes from term tab
- case "term":
- int termTabPaneNumTabs=(int) termTabPane.getTabCount();
- termTabPane.insertTab("New Term", null, courseTabPane, null, (termTabPaneNumTabs-1));
- //Just added a tab above so dont need to compensate for index starting at 0
- termTabPane.setSelectedIndex(termTabPaneNumTabs-1);
- addTerm.setVisible(true);
- break;
- case "custom":
- //making use of this method to add tabs that are defined in a different area, such as bulk add
- break;
- default: System.out.println("error passing addTabType to addNewTab() method");
- }
- addingTab=false;
- //TODO add new class tab here prompting for info
- //Show window asking for class name, credits, and total points(if known)
- }
- }
- private void updateLabels(){
- //convert all values to be used in details pane to a string
- /*String gpaType=Double.toString(currentProfile.getGpaScale());
- String gpa=Double.toString(currentProfile.getGPA());
- String numCourses=Integer.toString(currentProfile.getNumCourses());
- String credits=Integer.toString(currentProfile.getCredits());
- String gradePoints=Integer.toString(currentProfile.getGradePoints());
- //Troubleshooting
- System.out.println("gpaType"+gpaType+" gpa"+gpa+" numCourses"+numCourses+" credits "+credits+" gradepoints"+gradePoints);
- profileDetailsGradePointScale.setText(gpaType);
- profileDetailsGPA.setText(gpa);
- profileDetailsNumCourses.setText(numCourses);
- profileDetailsCreditsTaken.setText(credits);
- profileDetailsGradePoints.setText(gradePoints);
- profileDetailsTermType.setText(currentProfile.getTermType());
- }
- public static void main(String args[]) {
- /* Set the Nimbus look and feel */
- //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
- /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
- * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
- */
- try {
- for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
- if ("Nimbus".equals(info.getName())) {
- javax.swing.UIManager.setLookAndFeel(info.getClassName());
- break;
- }
- }
- } catch (ClassNotFoundException ex) {
- java.util.logging.Logger.getLogger(gradesui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (InstantiationException ex) {
- java.util.logging.Logger.getLogger(gradesui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (IllegalAccessException ex) {
- java.util.logging.Logger.getLogger(gradesui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (javax.swing.UnsupportedLookAndFeelException ex) {
- java.util.logging.Logger.getLogger(gradesui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- }
- //</editor-fold>
- /* Create and display the form */
- java.awt.EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- new gradesui().setVisible(true);
- }
- });
- //Profile profiles[]=new Profile[];
- }
- // Variables declaration - do not modify
- private javax.swing.JMenuItem aboutMenuItem;
- private javax.swing.JDialog addProfile;
- private javax.swing.JButton addProfileCancel;
- private javax.swing.JButton addProfileConfirm;
- private javax.swing.ButtonGroup addProfileGradePointScale;
- private javax.swing.JPanel addProfileQuarter;
- private javax.swing.JPanel addProfileSemester;
- private javax.swing.ButtonGroup addProfileTermType;
- private javax.swing.JPanel addProfileTrimester;
- private javax.swing.JDialog addTerm;
- private javax.swing.JTabbedPane courseTabPane;
- private javax.swing.JDialog deleteProfile;
- private javax.swing.JOptionPane deleteProfile1;
- private javax.swing.JMenuItem exitMenuItem;
- private javax.swing.JMenu fileMenu;
- private javax.swing.Box.Filler filler1;
- private javax.swing.JMenu helpMenu;
- private javax.swing.JButton jButton1;
- private javax.swing.JButton jButton5;
- private javax.swing.JButton jButton6;
- private javax.swing.JButton jButton7;
- private javax.swing.JButton jButton8;
- private javax.swing.JButton jButton9;
- private javax.swing.JFormattedTextField jFormattedTextField2;
- private javax.swing.JLabel jLabel1;
- private javax.swing.JLabel jLabel12;
- private javax.swing.JLabel jLabel13;
- private javax.swing.JLabel jLabel14;
- private javax.swing.JLabel jLabel2;
- private javax.swing.JLabel jLabel3;
- private javax.swing.JLabel jLabel4;
- private javax.swing.JLabel jLabel5;
- private javax.swing.JPanel jPanel1;
- private javax.swing.JPanel jPanel3;
- private javax.swing.JPanel jPanel4;
- private javax.swing.JPanel jPanel5;
- private javax.swing.JPanel jPanel6;
- private javax.swing.JSlider jSlider1;
- private javax.swing.JMenuBar menuBar;
- private javax.swing.JPanel newTabFormat;
- private javax.swing.JRadioButton pointScale10;
- private javax.swing.JRadioButton pointScale12;
- private javax.swing.JRadioButton pointScale4;
- private javax.swing.JComboBox profileComboBox;
- private javax.swing.JLabel profileDetailGPALabel;
- private javax.swing.JLabel profileDetailsCreditsTaken;
- private javax.swing.JLabel profileDetailsCreditsTakenLabel;
- private javax.swing.JLabel profileDetailsGPA;
- private javax.swing.JLabel profileDetailsGradePointScale;
- private javax.swing.JLabel profileDetailsGradePointScaleLabel;
- private javax.swing.JLabel profileDetailsGradePoints;
- private javax.swing.JLabel profileDetailsGradePointsLabel;
- private javax.swing.JLabel profileDetailsNumCourses;
- private javax.swing.JLabel profileDetailsNumCoursesLabel;
- private javax.swing.JLabel profileDetailsTermType;
- private javax.swing.JLabel profileDetailsTermTypeLabel;
- private javax.swing.JFormattedTextField profileNameInput;
- private javax.swing.JRadioButton quarter1;
- private javax.swing.JRadioButton quarter2;
- private javax.swing.JRadioButton quarter3;
- private javax.swing.JRadioButton quarter4;
- private javax.swing.JRadioButton quarterOther;
- private javax.swing.JRadioButton semesterFall;
- private javax.swing.JRadioButton semesterOther;
- private javax.swing.JRadioButton semesterSpring;
- private javax.swing.JTabbedPane termTabPane;
- private javax.swing.ButtonGroup termType;
- private javax.swing.JRadioButton termTypeQuarter;
- private javax.swing.JRadioButton termTypeSemester;
- private javax.swing.JRadioButton termTypeTrimester;
- private javax.swing.JRadioButton trimester1;
- private javax.swing.JRadioButton trimester2;
- private javax.swing.JRadioButton trimester3;
- private javax.swing.JRadioButton trimesterOther;
- private org.jdesktop.beansbinding.BindingGroup bindingGroup;
- // End of variables declaration
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement