/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * InstrRoom.java * * Created on Dec 8, 2010, 11:11:00 PM */ package scheduletool; /** * * @author Adriel */ public class InstrRoom extends javax.swing.JFrame { public InstrTime itime; /** Creates new form InstrRoom */ public InstrRoom() { initComponents(); itime = new InstrTime(); } /** 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() { mainPanel = new javax.swing.JPanel(); Generate = new java.awt.Button(); jScrollPane2 = new javax.swing.JScrollPane(); jTable2 = new javax.swing.JTable(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jComboBox1 = new javax.swing.JComboBox(); jCheckBox1 = new javax.swing.JCheckBox(); jCheckBox2 = new javax.swing.JCheckBox(); jCheckBox3 = new javax.swing.JCheckBox(); jCheckBox4 = new javax.swing.JCheckBox(); jCheckBox5 = new javax.swing.JCheckBox(); jCheckBox6 = new javax.swing.JCheckBox(); jCheckBox7 = new javax.swing.JCheckBox(); jCheckBox8 = new javax.swing.JCheckBox(); jTextField1 = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); jTextField2 = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); menuBar = new javax.swing.JMenuBar(); javax.swing.JMenu fileMenu = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem(); Edit = new javax.swing.JMenu(); jMenuItem2 = new javax.swing.JMenuItem(); jMenuItem3 = new javax.swing.JMenuItem(); View = new javax.swing.JMenu(); Course = new javax.swing.JMenuItem(); Time = new javax.swing.JMenuItem(); Room = new javax.swing.JMenuItem(); javax.swing.JMenu helpMenu = new javax.swing.JMenu(); javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setName("Form"); // NOI18N org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(scheduletool.ScheduletoolApp.class).getContext().getResourceMap(InstrRoom.class); mainPanel.setToolTipText(resourceMap.getString("mainPanel.toolTipText")); // NOI18N mainPanel.setName("mainPanel"); // NOI18N Generate.setActionCommand(resourceMap.getString("Generate.actionCommand")); // NOI18N Generate.setLabel(resourceMap.getString("Generate.label")); // NOI18N Generate.setName("Generate"); // NOI18N Generate.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { GenerateActionPerformed(evt); } }); jScrollPane2.setName("jScrollPane2"); // NOI18N jTable2.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {new Integer(14), new Integer(100), "N"}, {new Integer(14), new Integer(101), "N"}, {new Integer(14), new Integer(102), "N"}, {new Integer(14), new Integer(103), "N"}, {new Integer(14), new Integer(104), "N"}, {new Integer(14), new Integer(105), "N"}, {new Integer(14), new Integer(106), "N"}, {new Integer(14), new Integer(107), "N"}, {new Integer(14), new Integer(108), "N"}, {new Integer(14), new Integer(109), "N"}, {new Integer(14), new Integer(201), "N"}, {new Integer(14), new Integer(202), "N"}, {new Integer(14), new Integer(203), "N"}, {new Integer(14), new Integer(204), "N"}, {new Integer(14), new Integer(205), "N"} }, new String [] { "Building Number", "Room Number", "Preference Rating" } ) { Class[] types = new Class [] { java.lang.Integer.class, java.lang.Integer.class, java.lang.String.class }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } }); jTable2.setName("jTable2"); // NOI18N jScrollPane2.setViewportView(jTable2); jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N jLabel1.setName("jLabel1"); // NOI18N jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N jLabel2.setName("jLabel2"); // NOI18N jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Frank E. Pilling", "Graphic Arts", "Math and Science" })); jComboBox1.setName("jComboBox1"); // NOI18N jCheckBox1.setText(resourceMap.getString("jCheckBox1.text")); // NOI18N jCheckBox1.setName("jCheckBox1"); // NOI18N jCheckBox2.setText(resourceMap.getString("jCheckBox2.text")); // NOI18N jCheckBox2.setName("jCheckBox2"); // NOI18N jCheckBox3.setText(resourceMap.getString("jCheckBox3.text")); // NOI18N jCheckBox3.setName("jCheckBox3"); // NOI18N jCheckBox4.setText(resourceMap.getString("jCheckBox4.text")); // NOI18N jCheckBox4.setName("jCheckBox4"); // NOI18N jCheckBox5.setText(resourceMap.getString("jCheckBox5.text")); // NOI18N jCheckBox5.setName("jCheckBox5"); // NOI18N jCheckBox6.setText(resourceMap.getString("jCheckBox6.text")); // NOI18N jCheckBox6.setName("jCheckBox6"); // NOI18N jCheckBox7.setText(resourceMap.getString("jCheckBox7.text")); // NOI18N jCheckBox7.setName("jCheckBox7"); // NOI18N jCheckBox8.setText(resourceMap.getString("jCheckBox8.text")); // NOI18N jCheckBox8.setName("jCheckBox8"); // NOI18N jTextField1.setText(resourceMap.getString("jTextField1.text")); // NOI18N jTextField1.setName("jTextField1"); // NOI18N jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N jLabel3.setName("jLabel3"); // NOI18N jTextField2.setName("jTextField2"); // NOI18N jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N jButton1.setName("jButton1"); // NOI18N javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel); mainPanel.setLayout(mainPanelLayout); mainPanelLayout.setHorizontalGroup( mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainPanelLayout.createSequentialGroup() .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 422, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Generate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainPanelLayout.createSequentialGroup() .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainPanelLayout.createSequentialGroup() .addGap(74, 74, 74) .addComponent(jLabel1)) .addGroup(mainPanelLayout.createSequentialGroup() .addGap(18, 18, 18) .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainPanelLayout.createSequentialGroup() .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jCheckBox6) .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jCheckBox1) .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jCheckBox3) .addComponent(jCheckBox2) .addComponent(jCheckBox4) .addComponent(jCheckBox5))) .addComponent(jCheckBox7) .addGroup(mainPanelLayout.createSequentialGroup() .addComponent(jCheckBox8) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(mainPanelLayout.createSequentialGroup() .addGap(50, 50, 50) .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 155, Short.MAX_VALUE))))) .addContainerGap(54, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(mainPanelLayout.createSequentialGroup() .addGap(26, 26, 26) .addComponent(jLabel3) .addContainerGap())) .addGroup(mainPanelLayout.createSequentialGroup() .addGap(76, 76, 76) .addComponent(jButton1) .addContainerGap()))) ); mainPanelLayout.setVerticalGroup( mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainPanelLayout.createSequentialGroup() .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, mainPanelLayout.createSequentialGroup() .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 298, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(Generate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(mainPanelLayout.createSequentialGroup() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jCheckBox1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jCheckBox2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jCheckBox3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jCheckBox4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jCheckBox5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jCheckBox6) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jCheckBox7) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jCheckBox8) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1))) .addContainerGap(51, Short.MAX_VALUE)) ); menuBar.setName("menuBar"); // NOI18N fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N fileMenu.setName("fileMenu"); // NOI18N jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK)); jMenuItem1.setText(resourceMap.getString("jMenuItem1.text")); // NOI18N jMenuItem1.setName("jMenuItem1"); // NOI18N fileMenu.add(jMenuItem1); javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(scheduletool.ScheduletoolApp.class).getContext().getActionMap(InstrRoom.class, this); exitMenuItem.setAction(actionMap.get("quit")); // NOI18N exitMenuItem.setName("exitMenuItem"); // NOI18N fileMenu.add(exitMenuItem); menuBar.add(fileMenu); Edit.setText(resourceMap.getString("Edit.text")); // NOI18N Edit.setName("Edit"); // NOI18N jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z, java.awt.event.InputEvent.META_MASK)); jMenuItem2.setText(resourceMap.getString("jMenuItem2.text")); // NOI18N jMenuItem2.setName("jMenuItem2"); // NOI18N Edit.add(jMenuItem2); jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Y, java.awt.event.InputEvent.META_MASK)); jMenuItem3.setText(resourceMap.getString("jMenuItem3.text")); // NOI18N jMenuItem3.setName("jMenuItem3"); // NOI18N Edit.add(jMenuItem3); menuBar.add(Edit); View.setText(resourceMap.getString("View.text")); // NOI18N View.setName("View"); // NOI18N Course.setText(resourceMap.getString("Course.text")); // NOI18N Course.setName("Course"); // NOI18N View.add(Course); Time.setText(resourceMap.getString("Time.text")); // NOI18N Time.setName("Time"); // NOI18N Time.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { TimeActionPerformed(evt); } }); View.add(Time); Room.setText(resourceMap.getString("Room.text")); // NOI18N Room.setName("Room"); // NOI18N View.add(Room); menuBar.add(View); helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N helpMenu.setName("helpMenu"); // NOI18N aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N aboutMenuItem.setText(resourceMap.getString("aboutMenuItem.text")); // NOI18N aboutMenuItem.setName("aboutMenuItem"); // NOI18N 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) .addGap(0, 733, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(mainPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(24, Short.MAX_VALUE))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 406, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(mainPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(12, Short.MAX_VALUE))) ); pack(); }// //GEN-END:initComponents private void GenerateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GenerateActionPerformed //this.setVisible(false); // TODO add your handling code here: }//GEN-LAST:event_GenerateActionPerformed private void TimeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TimeActionPerformed itime.setVisible(true); this.setVisible(false);// TODO add your handling code here: }//GEN-LAST:event_TimeActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new InstrRoom().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JMenuItem Course; private javax.swing.JMenu Edit; private java.awt.Button Generate; private javax.swing.JMenuItem Room; private javax.swing.JMenuItem Time; private javax.swing.JMenu View; private javax.swing.JButton jButton1; private javax.swing.JCheckBox jCheckBox1; private javax.swing.JCheckBox jCheckBox2; private javax.swing.JCheckBox jCheckBox3; private javax.swing.JCheckBox jCheckBox4; private javax.swing.JCheckBox jCheckBox5; private javax.swing.JCheckBox jCheckBox6; private javax.swing.JCheckBox jCheckBox7; private javax.swing.JCheckBox jCheckBox8; private javax.swing.JComboBox jComboBox1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JMenuItem jMenuItem1; private javax.swing.JMenuItem jMenuItem2; private javax.swing.JMenuItem jMenuItem3; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JTable jTable2; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JPanel mainPanel; private javax.swing.JMenuBar menuBar; // End of variables declaration//GEN-END:variables }