/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * CSTutorTeacher.java * * Created on Nov 21, 2009, 6:24:02 PM */ package cstutor; /** * * @author Kareem */ public class CSTutorTeacher extends javax.swing.JFrame { /** Creates new form CSTutorTeacher */ public CSTutorTeacher() { 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") // //GEN-BEGIN:initComponents private void initComponents() { jInternalFrame1 = new javax.swing.JInternalFrame(); CreateTButton = new javax.swing.JButton(); CreateQButton = new javax.swing.JButton(); EditButton = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); ToolBar = new javax.swing.JButton(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); jMenuItem2 = new javax.swing.JMenuItem(); jMenuItem3 = new javax.swing.JMenuItem(); jSeparator1 = new javax.swing.JSeparator(); jMenu2 = new javax.swing.JMenu(); jMenuItem4 = new javax.swing.JMenuItem(); jMenuItem5 = new javax.swing.JMenuItem(); jMenuItem6 = new javax.swing.JMenuItem(); jMenuItem7 = new javax.swing.JMenuItem(); jMenuItem8 = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jInternalFrame1.setClosable(true); jInternalFrame1.setVisible(true); CreateTButton.setText("Create Tutorial"); CreateTButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { CreateTButtonActionPerformed(evt); } }); CreateQButton.setText("Create Quiz"); CreateQButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { CreateQButtonActionPerformed(evt); } }); EditButton.setText("Edit Tutorial or Quiz"); EditButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { EditButtonActionPerformed(evt); } }); javax.swing.GroupLayout jInternalFrame1Layout = new javax.swing.GroupLayout(jInternalFrame1.getContentPane()); jInternalFrame1.getContentPane().setLayout(jInternalFrame1Layout); jInternalFrame1Layout.setHorizontalGroup( jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jInternalFrame1Layout.createSequentialGroup() .addContainerGap() .addGroup(jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(CreateQButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(EditButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(CreateTButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jInternalFrame1Layout.setVerticalGroup( jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jInternalFrame1Layout.createSequentialGroup() .addContainerGap() .addComponent(CreateTButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(CreateQButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(EditButton) .addContainerGap(19, Short.MAX_VALUE)) ); jLabel1.setText("Welcome to the CSTutor Teacher"); ToolBar.setText("ToolBar"); ToolBar.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { ToolBarMousePressed(evt); } }); ToolBar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ToolBarActionPerformed(evt); } }); jMenu1.setText("File"); jMenuItem1.setText("Save"); jMenu1.add(jMenuItem1); jMenuItem2.setText("Save As."); jMenu1.add(jMenuItem2); jMenuItem3.setText("View Statistics"); jMenuItem3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { viewstats(evt); } }); jMenu1.add(jMenuItem3); jMenu1.add(jSeparator1); jMenuBar1.add(jMenu1); jMenu2.setText("Edit"); jMenuItem4.setText("Undo"); jMenuItem4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { undo(evt); } }); jMenu2.add(jMenuItem4); jMenuItem5.setText("Redo"); jMenu2.add(jMenuItem5); jMenuItem6.setText("Cut"); jMenu2.add(jMenuItem6); jMenuItem7.setText("Copy"); jMenu2.add(jMenuItem7); jMenuItem8.setText("Paste"); jMenu2.add(jMenuItem8); jMenuBar1.add(jMenu2); 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() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(ToolBar)) .addGroup(layout.createSequentialGroup() .addGap(111, 111, 111) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jInternalFrame1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1)))) .addContainerGap(126, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jInternalFrame1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(157, 157, 157) .addComponent(ToolBar) .addContainerGap()) ); pack(); }// //GEN-END:initComponents private void CreateTButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CreateTButtonActionPerformed // TODO add your handling code here: new cstutor.CreateTutorialGUI().setVisible(true); }//GEN-LAST:event_CreateTButtonActionPerformed private void CreateQButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CreateQButtonActionPerformed // TODO add your handling code here: new cstutor.quizcreation.QuizCreationView().setVisible(true); }//GEN-LAST:event_CreateQButtonActionPerformed private void EditButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EditButtonActionPerformed // TODO add your handling code here: System.out.println("Edit Tutorial/Quiz"); }//GEN-LAST:event_EditButtonActionPerformed private void ToolBarMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ToolBarMousePressed // TODO add your handling code here: }//GEN-LAST:event_ToolBarMousePressed private void ToolBarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ToolBarActionPerformed // TODO add your handling code here: jInternalFrame1.setVisible(true); }//GEN-LAST:event_ToolBarActionPerformed private void undo(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_undo // TODO add your handling code here: System.out.println("undo"); }//GEN-LAST:event_undo private void viewstats(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewstats // TODO add your handling code here: System.out.println("view stats"); }//GEN-LAST:event_viewstats /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new CSTutorTeacher().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton CreateQButton; private javax.swing.JButton CreateTButton; private javax.swing.JButton EditButton; private javax.swing.JButton ToolBar; private javax.swing.JInternalFrame jInternalFrame1; private javax.swing.JLabel jLabel1; private javax.swing.JMenu jMenu1; private javax.swing.JMenu jMenu2; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JMenuItem jMenuItem1; private javax.swing.JMenuItem jMenuItem2; private javax.swing.JMenuItem jMenuItem3; private javax.swing.JMenuItem jMenuItem4; private javax.swing.JMenuItem jMenuItem5; private javax.swing.JMenuItem jMenuItem6; private javax.swing.JMenuItem jMenuItem7; private javax.swing.JMenuItem jMenuItem8; private javax.swing.JSeparator jSeparator1; // End of variables declaration//GEN-END:variables }