SE450:Part2 G1 GUIMain
package CIGS.GUI;
import java.awt.BorderLayout; import java.awt.Component; import java.awt.Container; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.List;
import javax.swing.ComboBoxModel; import javax.swing.DefaultComboBoxModel; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JDesktopPane; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JOptionPane;
import javax.swing.JSeparator; import javax.swing.JTabbedPane; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.ListModel; import javax.swing.JMenuItem; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener;
import CIGS.*; import CIGS.Event.Break; //////////////////////////////////////////////////// //TODO Zee's changes: //Added presentationID to Table:Presentation //Added boolean isPresenterPResent to Table:Presentation //Added paperID to Table:Presentation //Changed CIGS.Presentation.java // //
/**
- This code was edited or generated using CloudGarden's Jigloo
- SWT/Swing GUI Builder, which is free for non-commercial
- use. If Jigloo is being used commercially (ie, by a corporation,
- company or business for any purpose whatever) then you
- should purchase a license for each developer using Jigloo.
- Please visit www.cloudgarden.com for details.
- Use of Jigloo implies acceptance of these licensing terms.
- A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
- THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
- LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
- /
public class GUIMain extends JFrame implements ActionListener, ListSelectionListener {
private JTabbedPane Conference; private JButton SetThresholdButton; private JLabel Overview_ConferenceEndDateTime; private JTextField jTextField5; private JTextField Conferences_StartDateTime; private JButton Participants_DeleteParticipant; private JTextField jTextField6; private JTextField Presentations_startTF; private JTextField paperIDTextField; private JLabel paperIDLable; private JTextField Breaks_ConferenceIDTF; private JLabel Breaks_ConferenceIDLabel; private JTextField Presentations_SessionIDTF; private JLabel Presentations_SessionIDLabel; private JList RF_ChairpersonList; private JLabel RF_ChairpersonLabel; private JTextField ChairpersonPresentTF; private JLabel ChairpersonPresent; private JButton Man_Out; private JList Manual_Absent; private JLabel jLabel6; private JButton Manual_In; private JLabel jLabel5; private JList Manual_Present; private JList jList2; private JLabel jLabel4; private JButton Rooms_MapBrowse; private JButton Rooms_SaveChanges; private JLabel Rooms_Map; private JButton Breaks_SaveChanges; private JDesktopPane ManualScan; private JButton Presentations_SaveChanges; private JCheckBox Presentations_PresenterPresentNo; private JCheckBox Presentations_PresenterPresentYes; private JLabel Presentations_PresenterPresentLabel; private JTextField Presentations_AR; private JTextField Presentations_PaperID; private JLabel Presentations_ARLabel; private JLabel Sessions_Clock; private JList jList7; private JLabel jLabel3; private JLabel jLabel2; private JList jList1; private JButton Sessions_SaveChanges; private JButton Participants_SaveChanges; private JButton Conferences_SaveChanges; private JButton Overview_SaveChanges; private JButton RFTags_SaveChanges; private JTextField jTextField2; private JLabel RFTags_ParticipantIDLabel; private JTextField RFTags_TagIDTextField; private JLabel RFTags_TagIDLabel; private JButton jButton2; private JButton jButton1; private JList RFTags_RFTagsList; private JLabel RFTags_RFTagsLabel; private JLabel Breaks_BreakEndLabel; private JTextField Breaks_BreakEndTextField; private JTextField Breaks_BreakStartTextField; private JLabel Breaks_BreakStartLabel; private JButton jButton12; private JButton Breaks_DeleteBreak; private JLabel Breaks_BreakIDLabel; private JTextField Breaks_BreakIDTextField; private JList Breaks_NewBreak; private JLabel Breaks_BreaksLabel; private JLabel Rooms_BNLabel; private JTextField Rooms_BNTextField; private JTextField Rooms_CapacityTextField; private JLabel Rooms_CapacityLabel; private JButton Rooms_NewRoom; private JButton jButton9; private JLabel Rooms_FacLabel; private JTextField Rooms_FacTF; private JLabel Rooms_RoomIDLabel; private JTextField Rooms_RoomIDTextField; private JList Rooms_List; private JLabel Rooms_RoomList; private JButton Papers_New; private JButton Papers_Delete; private JLabel Papers_TopicLabel; private JTextField Papers_TopicTF; private JList Paper_List; private JLabel jLabel17; private JLabel Presentations_EndLabel; private JTextField Presentations_EndTextField; private JTextField Presentations_Start; private JLabel Presentations_StartTextField; private JButton Presentations_NewPresentation; private JButton Presentations_DeletePresentation; private JLabel Presentations_PaperIDLabel; private JTextField Presentations_PaperIDTextField; private JLabel Presentations_PresentationIDLabel; private JTextField Presentations_PresentationIDTextField; private JList Presentations_PresentationList; private JLabel Presentations_PresentationsLabel; private JLabel Sessions_SessionEndLabel; private JTextField Sessions_SessionEndTextField; private JTextField Sessions_SessionStartTextField; private JLabel Sessions_SessionStartLabel; private JButton Sessions_NewSession; private JButton Sessions_DeleteSession; private JLabel Sessions_SessionNameLabel; private JTextField jTextField7; private JLabel Sessions_SessionIDTextField; private JList Sessions_SessionList; private JLabel Sessions_SessionLabel; private JLabel Participants_Participants; private JTextField Participants_OrganizationTextField; private JLabel Participants_OrganizationLabel; private JTextField Participants_IDTextField; private JLabel Participants_IDLabel; private JTextField Participants_NameTextField; private JLabel Participants_NameLabel; private JButton Participants_NewParticipant; private JList Participants_ParticipantsList; private JTextField Conferences_ConferenceNameTextField; private JLabel Conferences_ConferenceName; private JButton Conferences_newConference; private JLabel Conferences_ConferenceID; private JList Conferences_AbsentPresenters; private JLabel jLabel1; private JTextField Overview_ConferenceStartDateTimeTextfield; private JLabel Conferences_ConferenceStartDateTimeLabel; private JButton Overview_DeleteConference; private JList Conferences_ConferencesList; private JLabel Conferences_ConferencesListLabel; private JDesktopPane ConferencesTab; private JLabel AvailableParticipantsLabel; private JButton ParticipantsRemoveButton; private JButton ParticipantsAddButton; private JList ParticipantsAvailableList; private JList ParticipantsAddedList; private JLabel AssociatedParticipantsList; private JLabel ThresholdLabel; private JTextField Threshold; private JLabel AvailableBreaksLabel; private JLabel AvailableSessionsLabel; private JButton RemoveBreakButton; private JButton AddBreakButton; private JList BreaksAvailableList; private JList BreaksAddedList; private JLabel BreaksLabel; private JButton RemoveSession; private JButton AddSession; private JList SessionsAddedList; private JList SessionsAvailableList; private JDesktopPane BreaksTab; private JLabel SessionsListLabel; private JLabel ConferencesListLabel; private JList ConferencesList; private JDesktopPane RoomsTab; private JDesktopPane PapersTab; private JDesktopPane PresentationsTab; private JDesktopPane SessionsTab; private JDesktopPane RFTagTab; private JDesktopPane ParticipantsTab; private JDesktopPane OverviewTab; private JMenuBar jMenuBar1;
private List<Participant> pList; private List<RFTag> rftagList; private List<Room> roomList;
//TODO ranny start -------------------------------------------------------------- private List<Paper> paperList; private List<Break> bkList; private List<Presentation> presentationList; //TODO ranny end --------------------------------------------------------------
/** * Auto-generated main method to display this JFrame */ public static void main(String[] args) { GUIMain inst = new GUIMain(); inst.setVisible(true); inst.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); }
public GUIMain() { super(); initGUI(); }
private void initGUI() { try { { Conference = new JTabbedPane(); getContentPane().add(Conference, BorderLayout.CENTER); { OverviewTab = new JDesktopPane(); Conference.addTab("Overview", null, OverviewTab, null); OverviewTab.setPreferredSize(new java.awt.Dimension(756, 707)); OverviewTab.setEnabled(false); OverviewTab.setBackground(new java.awt.Color(128,128,255)); { ListModel ConferencesListModel = new DefaultComboBoxModel( new String[] { "Item One", "Item Two" }); ConferencesList = new JList(); OverviewTab.add(ConferencesList); ConferencesList.setModel(ConferencesListModel); ConferencesList.setBounds(7, 35, 315, 119); } { ConferencesListLabel = new JLabel(); OverviewTab.add(ConferencesListLabel); ConferencesListLabel.setText("Conferences"); ConferencesListLabel.setBounds(7, 7, 315, 28); } { SessionsListLabel = new JLabel(); OverviewTab.add(SessionsListLabel); SessionsListLabel.setText("Associated Sessions"); SessionsListLabel.setBounds(14, 168, 301, 28); } { ListModel SessionsAvailableListModel = new DefaultComboBoxModel( new String[] { "Item One", "Item Two" }); SessionsAvailableList = new JList(); OverviewTab.add(SessionsAvailableList); SessionsAvailableList .setModel(SessionsAvailableListModel); SessionsAvailableList.setBounds(448, 196, 294, 112); } { ListModel SessionsAddedListModel = new DefaultComboBoxModel( new String[] { "Item One", "Item Two" }); SessionsAddedList = new JList(); OverviewTab.add(SessionsAddedList); SessionsAddedList.setModel(SessionsAddedListModel); SessionsAddedList.setBounds(14, 196, 308, 112); } { AddSession = new JButton(); OverviewTab.add(AddSession); AddSession.setText("<< Add"); AddSession.setBounds(329, 217, 112, 28); } { RemoveSession = new JButton(); OverviewTab.add(RemoveSession); RemoveSession.setText("Remove >>"); RemoveSession.setBounds(329, 259, 112, 28); } { BreaksLabel = new JLabel(); OverviewTab.add(BreaksLabel); BreaksLabel.setText("Associated Breaks"); BreaksLabel.setBounds(14, 343, 266, 28); } { ListModel BreaksAddedListModel = new DefaultComboBoxModel( new String[] { "Item One", "Item Two" }); BreaksAddedList = new JList(); OverviewTab.add(BreaksAddedList); BreaksAddedList.setModel(BreaksAddedListModel); BreaksAddedList.setBounds(14, 371, 308, 98); } { ListModel BreaksAvailableListModel = new DefaultComboBoxModel( new String[] { "Item One", "Item Two" }); BreaksAvailableList = new JList(); OverviewTab.add(BreaksAvailableList); BreaksAvailableList.setModel(BreaksAvailableListModel); BreaksAvailableList.setBounds(448, 371, 294, 98); } { AddBreakButton = new JButton(); OverviewTab.add(AddBreakButton); AddBreakButton.setText("<< Add"); AddBreakButton.setBounds(336, 378, 105, 28); } { RemoveBreakButton = new JButton(); OverviewTab.add(RemoveBreakButton); RemoveBreakButton.setText("Remove >>"); RemoveBreakButton.setBounds(336, 420, 105, 28); } { AvailableSessionsLabel = new JLabel(); OverviewTab.add(AvailableSessionsLabel); AvailableSessionsLabel.setText("Available Sessions"); AvailableSessionsLabel.setBounds(448, 168, 280, 28); } { AvailableBreaksLabel = new JLabel(); OverviewTab.add(AvailableBreaksLabel); AvailableBreaksLabel.setText("Available Breaks"); AvailableBreaksLabel.setBounds(448, 343, 245, 28); } { Threshold = new JTextField(); OverviewTab.add(Threshold); Threshold.setText("Threshold"); Threshold.setBounds(448, 42, 133, 28); } { ThresholdLabel = new JLabel(); OverviewTab.add(ThresholdLabel); ThresholdLabel.setText("Minimum presence at presentation to count for attendance (mins)"); ThresholdLabel.setBounds(343, 7, 406, 35); } { SetThresholdButton = new JButton(); OverviewTab.add(SetThresholdButton); SetThresholdButton.setText("Set Threshold"); SetThresholdButton.setBounds(588, 42, 133, 28); } { AssociatedParticipantsList = new JLabel(); OverviewTab.add(AssociatedParticipantsList); AssociatedParticipantsList.setText("Associated Participants"); AssociatedParticipantsList.setBounds(14, 483, 301, 28); } { ListModel ParticipantsAddedListModel = new DefaultComboBoxModel( new String[] { "Item One", "Item Two" }); ParticipantsAddedList = new JList(); OverviewTab.add(ParticipantsAddedList); ParticipantsAddedList .setModel(ParticipantsAddedListModel); ParticipantsAddedList.setBounds(21, 511, 301, 77); } { ListModel ParticipantsAvailableListModel = new DefaultComboBoxModel( new String[] { "Item One", "Item Two" }); ParticipantsAvailableList = new JList(); OverviewTab.add(ParticipantsAvailableList); ParticipantsAvailableList .setModel(ParticipantsAvailableListModel); ParticipantsAvailableList.setBounds(448, 504, 294, 84); } { ParticipantsAddButton = new JButton(); OverviewTab.add(ParticipantsAddButton); ParticipantsAddButton.setText("<< Add"); ParticipantsAddButton.setBounds(336, 518, 105, 28); } { ParticipantsRemoveButton = new JButton(); OverviewTab.add(ParticipantsRemoveButton); ParticipantsRemoveButton.setText("Remove >>"); ParticipantsRemoveButton.setBounds(336, 553, 105, 28); } { AvailableParticipantsLabel = new JLabel(); OverviewTab.add(AvailableParticipantsLabel); AvailableParticipantsLabel.setText("Available Participants"); AvailableParticipantsLabel.setBounds(448, 476, 259, 28); } { Overview_SaveChanges = new JButton(); OverviewTab.add(Overview_SaveChanges); Overview_SaveChanges.setText("Save Changes"); Overview_SaveChanges.setBounds(448, 98, 273, 28); } } { ConferencesTab = new JDesktopPane(); Conference.addTab("Conferences", null, ConferencesTab, null); ConferencesTab.setBackground(new java.awt.Color(128,128,255)); { Conferences_ConferencesListLabel = new JLabel(); ConferencesTab.add(Conferences_ConferencesListLabel); Conferences_ConferencesListLabel.setText("Conferences"); Conferences_ConferencesListLabel.setBounds(14, 7, 252, 28); } { ListModel Overview_ConferencesListModel = new DefaultComboBoxModel( new String[] { "Soft Realtime Parallel Computing", "How to build a Rocket" }); Conferences_ConferencesList = new JList(); ConferencesTab.add(Conferences_ConferencesList); Conferences_ConferencesList .setModel(Overview_ConferencesListModel); Conferences_ConferencesList.setBounds(14, 35, 280, 168); } { Overview_DeleteConference = new JButton(); ConferencesTab.add(Overview_DeleteConference); Overview_DeleteConference.setText("Delete Conference"); Overview_DeleteConference.setBounds(161, 210, 133, 28); } { Conferences_ConferenceStartDateTimeLabel = new JLabel(); ConferencesTab .add(Conferences_ConferenceStartDateTimeLabel); Conferences_ConferenceStartDateTimeLabel.setText("Start Date/Time (e.g. 3/02/2007 12:12:00 p.m.)"); Conferences_ConferenceStartDateTimeLabel.setBounds(14, 259, 287, 28); } { Overview_ConferenceStartDateTimeTextfield = new JTextField(); ConferencesTab .add(Overview_ConferenceStartDateTimeTextfield); Overview_ConferenceStartDateTimeTextfield.setBounds(350, 35, 287, 28); } { Conferences_StartDateTime = new JTextField(); ConferencesTab.add(Conferences_StartDateTime); Conferences_StartDateTime.setBounds(14, 287, 287, 28); } { jTextField5 = new JTextField(); ConferencesTab.add(jTextField5); jTextField5.setBounds(14, 371, 287, 28); } { Overview_ConferenceEndDateTime = new JLabel(); ConferencesTab.add(Overview_ConferenceEndDateTime); Overview_ConferenceEndDateTime.setText("End Date/Time (e.g. 3/02/2007 12:12:00 p.m.M)"); Overview_ConferenceEndDateTime.setBounds(14, 343, 280, 28); } { jLabel1 = new JLabel(); ConferencesTab.add(jLabel1); jLabel1.setText("Absent Presenters"); jLabel1.setBounds(14, 420, 210, 28); } { ListModel Conferences_AbsentPresentersModel = new DefaultComboBoxModel( new String[] { "<Presenter ID, Session ID>", "<Presenter ID, Session ID>" }); Conferences_AbsentPresenters = new JList(); ConferencesTab.add(Conferences_AbsentPresenters); Conferences_AbsentPresenters .setModel(Conferences_AbsentPresentersModel); Conferences_AbsentPresenters.setBounds(14, 448, 287, 147); } { Conferences_ConferenceID = new JLabel(); ConferencesTab.add(Conferences_ConferenceID); Conferences_ConferenceID.setText("Conference ID"); Conferences_ConferenceID.setBounds(350, 7, 266, 28); } { Conferences_newConference = new JButton(); ConferencesTab.add(Conferences_newConference); Conferences_newConference.setText("New Conference"); Conferences_newConference.setBounds(14, 210, 133, 28); } { Conferences_ConferenceName = new JLabel(); ConferencesTab.add(Conferences_ConferenceName); Conferences_ConferenceName.setText("Conference Name"); Conferences_ConferenceName.setBounds(350, 77, 175, 28); } { Conferences_ConferenceNameTextField = new JTextField(); ConferencesTab.add(Conferences_ConferenceNameTextField); Conferences_ConferenceNameTextField.setBounds(350, 105, 287, 28); } { Conferences_SaveChanges = new JButton(); ConferencesTab.add(Conferences_SaveChanges); Conferences_SaveChanges.setText("Save Changes"); Conferences_SaveChanges.setBounds(350, 168, 287, 28); } } { ParticipantsTab = new JDesktopPane(); Conference.addTab( "Participants", null, ParticipantsTab, null); ParticipantsTab.setBackground(new java.awt.Color(128,128,255)); { //TODO Participants_ParticipantsList = new JList(); ParticipantsTab.add(Participants_ParticipantsList); Participants_ParticipantsList.setModel(getParticipantList()); Participants_ParticipantsList.setBounds(14, 35, 280, 168);
Participants_ParticipantsList.setName("Participants_ParticipantsList"); Participants_ParticipantsList.addListSelectionListener(this); } { Participants_NewParticipant = new JButton(); ParticipantsTab.add(Participants_NewParticipant); Participants_NewParticipant.setText("New Participant"); Participants_NewParticipant.setBounds(14, 210, 133, 28); Participants_NewParticipant.setActionCommand("Participants_New"); Participants_NewParticipant.addActionListener(this); } { Participants_DeleteParticipant = new JButton(); ParticipantsTab.add(Participants_DeleteParticipant); Participants_DeleteParticipant.setText("Delete Participant"); Participants_DeleteParticipant.setBounds(161, 210, 133, 28); Participants_DeleteParticipant.setActionCommand("Participants_Delete"); Participants_DeleteParticipant.addActionListener(this); } { Participants_NameLabel = new JLabel(); ParticipantsTab.add(Participants_NameLabel); Participants_NameLabel.setText("Name"); Participants_NameLabel.setBounds(14, 259, 210, 28); } { Participants_NameTextField = new JTextField(); ParticipantsTab.add(Participants_NameTextField); Participants_NameTextField.setBounds(14, 287, 287, 28); } { Participants_IDLabel = new JLabel(); ParticipantsTab.add(Participants_IDLabel); Participants_IDLabel.setText("ID"); Participants_IDLabel.setBounds(14, 343, 210, 28); } { Participants_IDTextField = new JTextField(); ParticipantsTab.add(Participants_IDTextField); Participants_IDTextField.setBounds(14, 371, 287, 28); } { Participants_OrganizationLabel = new JLabel(); ParticipantsTab.add(Participants_OrganizationLabel); Participants_OrganizationLabel.setText("Organization"); Participants_OrganizationLabel.setBounds(350, 7, 266, 28); } { Participants_OrganizationTextField = new JTextField(); ParticipantsTab.add(Participants_OrganizationTextField); Participants_OrganizationTextField.setBounds(350, 35, 287, 28); } { Participants_Participants = new JLabel(); ParticipantsTab.add(Participants_Participants); Participants_Participants.setText("Participants"); Participants_Participants.setBounds(14, 7, 252, 28); } { Participants_SaveChanges = new JButton(); ParticipantsTab.add(Participants_SaveChanges); Participants_SaveChanges.setText("Save Changes"); Participants_SaveChanges.setBounds(350, 84, 287, 28); Participants_SaveChanges.setActionCommand("Participants_SaveChanges"); Participants_SaveChanges.addActionListener(this); } } { RFTagTab = new JDesktopPane(); Conference.addTab("RF Tags", null, RFTagTab, null); RFTagTab.setBackground(new java.awt.Color(128,128,255)); { RFTags_RFTagsLabel = new JLabel(); RFTagTab.add(RFTags_RFTagsLabel); RFTags_RFTagsLabel.setText("RF Tags"); RFTags_RFTagsLabel.setBounds(14, 7, 252, 28); } { RFTags_RFTagsList = new JList(); RFTagTab.add(RFTags_RFTagsList); RFTags_RFTagsList.setModel(getRFTagList()); RFTags_RFTagsList.setBounds(14, 35, 280, 168); RFTags_RFTagsList.setName("RFTags_RFTagsList"); RFTags_RFTagsList.addListSelectionListener(this); } { jButton1 = new JButton(); RFTagTab.add(jButton1); jButton1.setText("New Tag"); jButton1.setBounds(14, 210, 133, 28); jButton1.setActionCommand("RFTags_New"); jButton1.addActionListener(this); } { jButton2 = new JButton(); RFTagTab.add(jButton2); jButton2.setText("Delete Tag"); jButton2.setBounds(161, 210, 133, 28); jButton2.setActionCommand("RFTags_Delete"); jButton2.addActionListener(this); } { RFTags_TagIDLabel = new JLabel(); RFTagTab.add(RFTags_TagIDLabel); RFTags_TagIDLabel.setText("Tag ID"); RFTags_TagIDLabel.setBounds(14, 259, 210, 28); } { RFTags_TagIDTextField = new JTextField(); RFTagTab.add(RFTags_TagIDTextField); RFTags_TagIDTextField.setBounds(14, 287, 287, 28); } { RFTags_ParticipantIDLabel = new JLabel(); RFTagTab.add(RFTags_ParticipantIDLabel); RFTags_ParticipantIDLabel.setText("Participant ID"); RFTags_ParticipantIDLabel.setBounds(14, 343, 210, 28); } { jTextField2 = new JTextField(); RFTagTab.add(jTextField2); jTextField2.setBounds(14, 371, 287, 28); } { RFTags_SaveChanges = new JButton(); RFTagTab.add(RFTags_SaveChanges); RFTags_SaveChanges.setText("Save Changes"); RFTags_SaveChanges.setBounds(14, 441, 287, 28); RFTags_SaveChanges.setActionCommand("RFTags_SaveChanges"); RFTags_SaveChanges.addActionListener(this); } } { SessionsTab = new JDesktopPane(); Conference.addTab("Sessions", null, SessionsTab, null); SessionsTab.setBackground(new java.awt.Color(128,128,255)); { Sessions_SessionLabel = new JLabel(); SessionsTab.add(Sessions_SessionLabel); Sessions_SessionLabel.setText("Sessions"); Sessions_SessionLabel.setBounds(14, 7, 252, 28); } { ListModel jList2Model = new DefaultComboBoxModel( new String[] { "Item One", "Item Two" }); Sessions_SessionList = new JList(); SessionsTab.add(Sessions_SessionList); Sessions_SessionList.setModel(jList2Model); Sessions_SessionList.setBounds(14, 35, 280, 168); } { jTextField6 = new JTextField(); SessionsTab.add(jTextField6); jTextField6.setBounds(350, 35, 287, 28); } { Sessions_SessionIDTextField = new JLabel(); SessionsTab.add(Sessions_SessionIDTextField); Sessions_SessionIDTextField.setText("Session ID"); Sessions_SessionIDTextField.setBounds(350, 7, 266, 28); } { jTextField7 = new JTextField(); SessionsTab.add(jTextField7); jTextField7.setBounds(350, 105, 287, 28); } { Sessions_SessionNameLabel = new JLabel(); SessionsTab.add(Sessions_SessionNameLabel); Sessions_SessionNameLabel.setText("Session Name"); Sessions_SessionNameLabel.setBounds(350, 77, 175, 28); } { Sessions_DeleteSession = new JButton(); SessionsTab.add(Sessions_DeleteSession); Sessions_DeleteSession.setText("Delete Session"); Sessions_DeleteSession.setBounds(161, 210, 133, 28); } { Sessions_NewSession = new JButton(); SessionsTab.add(Sessions_NewSession); Sessions_NewSession.setText("New Session"); Sessions_NewSession.setBounds(14, 210, 133, 28); } { Sessions_SessionStartLabel = new JLabel(); SessionsTab.add(Sessions_SessionStartLabel); Sessions_SessionStartLabel.setText("Start Date/Time (e.g. 3/02/2007 12:12:00 p.m.)"); Sessions_SessionStartLabel.setBounds(14, 259, 280, 28); } { Sessions_SessionStartTextField = new JTextField(); SessionsTab.add(Sessions_SessionStartTextField); Sessions_SessionStartTextField.setBounds(14, 287, 287, 28); } { Sessions_SessionEndTextField = new JTextField(); SessionsTab.add(Sessions_SessionEndTextField); Sessions_SessionEndTextField.setBounds(14, 371, 287, 28); } { Sessions_SessionEndLabel = new JLabel(); SessionsTab.add(Sessions_SessionEndLabel); Sessions_SessionEndLabel.setText("End Date/Time (e.g. 3/02/2007 12:12:00 p.m.)"); Sessions_SessionEndLabel.setBounds(14, 343, 280, 28); } { Sessions_SaveChanges = new JButton(); SessionsTab.add(Sessions_SaveChanges); Sessions_SaveChanges.setText("Save Changes"); Sessions_SaveChanges.setBounds(350, 161, 287, 28); } { ListModel jList1Model = new DefaultComboBoxModel( new String[] { "Item One", "Item Two" }); jList1 = new JList(); SessionsTab.add(jList1); jList1.setModel(jList1Model); jList1.setBounds(14, 35, 280, 168); } { jLabel2 = new JLabel(); SessionsTab.add(jLabel2); jLabel2.setText("Sessions"); jLabel2.setBounds(14, 7, 252, 28); } { jLabel3 = new JLabel(); SessionsTab.add(jLabel3); jLabel3.setText("Sessions taking place now"); jLabel3.setBounds(350, 259, 252, 28); } { ListModel jList7Model = new DefaultComboBoxModel( new String[] { "Session-thats-going-on-now", "Session-thats-going-on-now" }); jList7 = new JList(); SessionsTab.add(jList7); jList7.setModel(jList7Model); jList7.setBounds(350, 287, 280, 119); } { Sessions_Clock = new JLabel(); SessionsTab.add(Sessions_Clock); SessionsTab.add(getChairpersonPresent()); SessionsTab.add(getChairpersonPresentTF()); Sessions_Clock.setIcon(new ImageIcon(getClass().getClassLoader().getResource("aniclock.gif"))); Sessions_Clock.setBounds(567, 420, 182, 189); } } { PapersTab = new JDesktopPane(); Conference.addTab("Papers", null, PapersTab, null); PapersTab.setBackground(new java.awt.Color(128,128,255)); { jLabel17 = new JLabel(); PapersTab.add(jLabel17); jLabel17.setText("Papers"); jLabel17.setBounds(14, 7, 252, 28); } { //TODO paper_label renamed to paper_List Paper_List = new JList(); Paper_List.setName("Paper_List"); Paper_List.addListSelectionListener(this); PapersTab.add(Paper_List); Paper_List.setModel(getPaperList()); Paper_List.setBounds(14, 35, 280, 168); } { Papers_TopicTF = new JTextField(); PapersTab.add(Papers_TopicTF); Papers_TopicTF.setBounds(350, 35, 287, 28); } { Papers_TopicLabel = new JLabel(); PapersTab.add(Papers_TopicLabel); Papers_TopicLabel.setText("Topic"); Papers_TopicLabel.setBounds(350, 7, 266, 28); } { Papers_Delete = new JButton(); PapersTab.add(Papers_Delete); Papers_Delete.setText("Delete Paper"); Papers_Delete.setBounds(161, 210, 133, 28); Papers_Delete.setActionCommand("Papers_Delete"); Papers_Delete.addActionListener(this); } { Papers_New = new JButton(); PapersTab.add(Papers_New); PapersTab.add(getPaperIDLable()); PapersTab.add(getPaperIDTextField()); Papers_New.setText("New Paper"); Papers_New.setBounds(14, 210, 133, 28); Papers_New.setActionCommand("Papers_New"); Papers_New.addActionListener(this); //TODO ranny end } } { RoomsTab = new JDesktopPane(); Conference.addTab("Rooms", null, RoomsTab, null); RoomsTab.setBackground(new java.awt.Color(128,128,255)); { Rooms_RoomList = new JLabel(); RoomsTab.add(Rooms_RoomList); Rooms_RoomList.setText("Rooms"); Rooms_RoomList.setBounds(14, 7, 252, 28); } { Rooms_List = new JList(); RoomsTab.add(Rooms_List); Rooms_List.setModel(getRoomList()); Rooms_List.setBounds(14, 35, 280, 168); Rooms_List.setName("Rooms_List"); Rooms_List.addListSelectionListener(this); } { Rooms_RoomIDTextField = new JTextField(); RoomsTab.add(Rooms_RoomIDTextField); Rooms_RoomIDTextField.setBounds(350, 35, 287, 28); } { Rooms_RoomIDLabel = new JLabel(); RoomsTab.add(Rooms_RoomIDLabel); Rooms_RoomIDLabel.setText("Room ID"); Rooms_RoomIDLabel.setBounds(350, 7, 266, 28); } { Rooms_FacTF = new JTextField(); RoomsTab.add(Rooms_FacTF); Rooms_FacTF.setBounds(350, 105, 287, 28); } { Rooms_FacLabel = new JLabel(); RoomsTab.add(Rooms_FacLabel); Rooms_FacLabel.setText("Facilities"); Rooms_FacLabel.setBounds(350, 77, 175, 28); } { jButton9 = new JButton(); RoomsTab.add(jButton9); jButton9.setText("Delete Room"); jButton9.setBounds(161, 210, 133, 28);
jButton9.setActionCommand("Rooms_Delete"); jButton9.addActionListener(this); } { Rooms_NewRoom = new JButton(); RoomsTab.add(Rooms_NewRoom); Rooms_NewRoom.setText("New Room"); Rooms_NewRoom.setBounds(14, 210, 133, 28);
Rooms_NewRoom.setActionCommand("Rooms_New"); Rooms_NewRoom.addActionListener(this); } { Rooms_CapacityLabel = new JLabel(); RoomsTab.add(Rooms_CapacityLabel); Rooms_CapacityLabel.setText("Capacity"); Rooms_CapacityLabel.setBounds(14, 259, 210, 28); } { Rooms_CapacityTextField = new JTextField(); RoomsTab.add(Rooms_CapacityTextField); Rooms_CapacityTextField.setBounds(14, 287, 287, 28); } { Rooms_BNTextField = new JTextField(); RoomsTab.add(Rooms_BNTextField); Rooms_BNTextField.setBounds(14, 371, 287, 28); } { Rooms_BNLabel = new JLabel(); RoomsTab.add(Rooms_BNLabel); Rooms_BNLabel.setText("Building Name"); Rooms_BNLabel.setBounds(14, 343, 210, 28); } { Rooms_Map = new JLabel(); RoomsTab.add(Rooms_Map); Rooms_Map.setIcon(new ImageIcon(getClass().getClassLoader().getResource("map.jpg"))); Rooms_Map.setBounds(343, 161, 308, 147); } { Rooms_SaveChanges = new JButton(); RoomsTab.add(Rooms_SaveChanges); Rooms_SaveChanges.setText("Save Changes"); Rooms_SaveChanges.setBounds(343, 371, 308, 28);
Rooms_SaveChanges.setActionCommand("Rooms_SaveChanges"); Rooms_SaveChanges.addActionListener(this); } { Rooms_MapBrowse = new JButton(); RoomsTab.add(Rooms_MapBrowse); Rooms_MapBrowse.setText("Browse"); Rooms_MapBrowse.setBounds(658, 217, 91, 28); } } { BreaksTab = new JDesktopPane(); Conference.addTab("Breaks", null, BreaksTab, null); BreaksTab.setBackground(new java.awt.Color(128,128,255)); { Breaks_BreaksLabel = new JLabel(); BreaksTab.add(Breaks_BreaksLabel); Breaks_BreaksLabel.setText("Breaks"); Breaks_BreaksLabel.setBounds(14, 7, 252, 28); } { //TODO ranny start ------------ Breaks_NewBreak = new JList(); Breaks_NewBreak.setName("Break_List"); Breaks_NewBreak.addListSelectionListener(this); BreaksTab.add(Breaks_NewBreak); Breaks_NewBreak.setModel(getBreakList()); Breaks_NewBreak.setBounds(14, 35, 280, 168); } { Breaks_BreakIDTextField = new JTextField(); BreaksTab.add(Breaks_BreakIDTextField); Breaks_BreakIDTextField.setBounds(350, 35, 287, 28); } { Breaks_BreakIDLabel = new JLabel(); BreaksTab.add(Breaks_BreakIDLabel); Breaks_BreakIDLabel.setText("Break ID"); Breaks_BreakIDLabel.setBounds(350, 7, 266, 28); } { Breaks_DeleteBreak = new JButton(); BreaksTab.add(Breaks_DeleteBreak); Breaks_DeleteBreak.setText("Delete Break"); Breaks_DeleteBreak.setBounds(161, 210, 133, 28); Breaks_DeleteBreak.setActionCommand("Break_Delete"); Breaks_DeleteBreak.addActionListener(this); } { jButton12 = new JButton(); BreaksTab.add(jButton12); jButton12.setText("New Break"); jButton12.setBounds(14, 210, 133, 28); jButton12.setActionCommand("Break_New"); jButton12.addActionListener(this); } { Breaks_BreakStartLabel = new JLabel(); BreaksTab.add(Breaks_BreakStartLabel); Breaks_BreakStartLabel.setText("Start Date/Time (e.g. 3/02/2007 12:12:00 p.m.)"); Breaks_BreakStartLabel.setBounds(14, 259, 266, 28); } { Breaks_BreakStartTextField = new JTextField(); BreaksTab.add(Breaks_BreakStartTextField); Breaks_BreakStartTextField.setBounds(14, 287, 287, 28); } { Breaks_BreakEndTextField = new JTextField(); BreaksTab.add(Breaks_BreakEndTextField); Breaks_BreakEndTextField.setBounds(14, 371, 287, 28); } { Breaks_BreakEndLabel = new JLabel(); BreaksTab.add(Breaks_BreakEndLabel); Breaks_BreakEndLabel.setText("End Date/Time (e.g. 3/02/2007 12:12:00 p.m.)"); Breaks_BreakEndLabel.setBounds(14, 343, 266, 28); } { Breaks_SaveChanges = new JButton(); BreaksTab.add(Breaks_SaveChanges); BreaksTab.add(getBreaks_ConferenceIDLabel()); BreaksTab.add(getBreaks_ConferenceIDTF()); Breaks_SaveChanges.setText("Save Changes"); Breaks_SaveChanges.setBounds(350, 182, 287, 28); // TODO ranny start ------------ } } { ManualScan = new JDesktopPane(); Conference.addTab("Manual RF Scan", null, ManualScan, null); ManualScan.setBackground(new java.awt.Color(128,128,255)); { jLabel4 = new JLabel(); ManualScan.add(jLabel4); jLabel4.setText("Rooms"); jLabel4.setBounds(7, 7, 252, 28); } { ListModel jList2Model = new DefaultComboBoxModel( new String[] { "Item One", "Item Two" }); jList2 = new JList(); ManualScan.add(jList2); jList2.setModel(jList2Model); jList2.setBounds(7, 42, 280, 168); } { ListModel jList3Model = new DefaultComboBoxModel( new String[] { "Item One", "Item Two" }); Manual_Present = new JList(); ManualScan.add(Manual_Present); Manual_Present.setModel(jList3Model); Manual_Present.setBounds(7, 266, 280, 168); } { jLabel5 = new JLabel(); ManualScan.add(jLabel5); jLabel5.setText("Present Participants / Presenters"); jLabel5.setBounds(7, 231, 252, 28); } { Manual_In = new JButton(); ManualScan.add(Manual_In); Manual_In.setText("<< Sign In"); Manual_In.setBounds(294, 399, 119, 28); } { jLabel6 = new JLabel(); ManualScan.add(jLabel6); jLabel6.setText("Participants not in the Room"); jLabel6.setBounds(425, 233, 252, 28); } { ListModel jList4Model = new DefaultComboBoxModel( new String[] { "Item One", "Item Two" }); Manual_Absent = new JList(); ManualScan.add(Manual_Absent); Manual_Absent.setModel(jList4Model); Manual_Absent.setBounds(420, 266, 280, 238); } { Man_Out = new JButton(); ManualScan.add(Man_Out); ManualScan.add(getRF_ChairpersonLabel()); ManualScan.add(getRF_ChairpersonList()); Man_Out.setText("Sign Out >>"); Man_Out.setBounds(294, 441, 119, 28); } } { PresentationsTab = new JDesktopPane(); Conference.addTab("Presentations", null, PresentationsTab, null); PresentationsTab.setBackground(new java.awt.Color( 128, 128, 255)); { Presentations_PresentationsLabel = new JLabel(); PresentationsTab.add(Presentations_PresentationsLabel); Presentations_PresentationsLabel .setText("Presentations"); Presentations_PresentationsLabel.setBounds( 14, 7, 252, 28); } {
Presentations_PresentationList = new JList(); PresentationsTab.add(Presentations_PresentationList); Presentations_PresentationList.setModel(getPresentationList()); Presentations_PresentationList.setBounds( 14, 35, 280, 168); Presentations_PresentationList.addListSelectionListener(this); } { Presentations_PresentationIDTextField = new JTextField(); PresentationsTab .add(Presentations_PresentationIDTextField); Presentations_PresentationIDTextField.setBounds( 350, 35, 287, 28); } { Presentations_PresentationIDLabel = new JLabel(); PresentationsTab.add(Presentations_PresentationIDLabel); Presentations_PresentationIDLabel .setText("Presentation ID"); Presentations_PresentationIDLabel.setBounds( 350, 7, 266, 28); } { Presentations_PaperIDTextField = new JTextField(); PresentationsTab.add(Presentations_PaperIDTextField); Presentations_PaperIDTextField.setBounds( 350, 105, 287, 28); } { Presentations_PaperIDLabel = new JLabel(); PresentationsTab.add(Presentations_PaperIDLabel); Presentations_PaperIDLabel.setText("Paper ID"); Presentations_PaperIDLabel.setBounds(350, 77, 175, 28); } { Presentations_DeletePresentation = new JButton(); PresentationsTab.add(Presentations_DeletePresentation); Presentations_DeletePresentation .setText("Delete Presentation"); Presentations_DeletePresentation.setBounds( 161, 210, 133, 28); //TODO Zee Presentations_DeletePresentation.addActionListener(this); } { Presentations_NewPresentation = new JButton(); PresentationsTab.add(Presentations_NewPresentation); Presentations_NewPresentation .setText("New Presentation"); Presentations_NewPresentation.setBounds( 14, 210, 133, 28); Presentations_NewPresentation.addActionListener(this); } { Presentations_StartTextField = new JLabel(); PresentationsTab.add(Presentations_StartTextField); Presentations_StartTextField .setText("Start Date/Time (e.g. 3/02/2007 12:12:00 p.m.)"); Presentations_StartTextField.setBounds(14, 259, 273, 28); } { Presentations_EndTextField = new JTextField(); PresentationsTab.add(Presentations_EndTextField); Presentations_EndTextField.setBounds(14, 371, 287, 28); } { Presentations_EndLabel = new JLabel(); PresentationsTab.add(Presentations_EndLabel); Presentations_EndLabel .setText("End Date/Time (e.g. 3/02/2007 12:12:00 p.m.)"); Presentations_EndLabel.setBounds(14, 343, 266, 28); } { Presentations_ARLabel = new JLabel(); PresentationsTab.add(Presentations_ARLabel); Presentations_ARLabel.setText("Attendance Record"); Presentations_ARLabel.setBounds(350, 161, 175, 28); } { Presentations_PaperID = new JTextField(); PresentationsTab.add(Presentations_PaperID); Presentations_PaperID.setBounds(350, 105, 287, 28); } { Presentations_AR = new JTextField(); PresentationsTab.add(Presentations_AR); Presentations_AR.setBounds(349, 188, 287, 28); Presentations_AR.setEditable(false); } { Presentations_PresenterPresentLabel = new JLabel(); PresentationsTab .add(Presentations_PresenterPresentLabel); Presentations_PresenterPresentLabel .setText("Presenter Present?"); Presentations_PresenterPresentLabel.setBounds( 350, 259, 175, 28); } { Presentations_PresenterPresentYes = new JCheckBox(); PresentationsTab.add(Presentations_PresenterPresentYes); Presentations_PresenterPresentYes.setText("Yes"); Presentations_PresenterPresentYes.setBounds( 350, 287, 63, 28); } { Presentations_PresenterPresentNo = new JCheckBox(); PresentationsTab.add(Presentations_PresenterPresentNo); Presentations_PresenterPresentNo.setText("No"); Presentations_PresenterPresentNo.setBounds( 427, 287, 63, 28); } { Presentations_SaveChanges = new JButton(); PresentationsTab.add(Presentations_SaveChanges); PresentationsTab.add(getPresentations_SessionIDLabel()); PresentationsTab.add(getPresentations_SessionIDTF()); PresentationsTab.add(getPresentations_startTF()); Presentations_SaveChanges.setText("Save Changes"); Presentations_SaveChanges.setBounds(350, 371, 280, 28); //TODO Zee Presentations_SaveChanges.addActionListener(this); } }
} this.setSize(766, 675); { jMenuBar1 = new JMenuBar(); setJMenuBar(jMenuBar1); } } catch (Exception e) { e.printStackTrace(); } }
public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("Participants_New")) { int ID = Integer.parseInt(Participants_IDTextField.getText()); String name = Participants_NameTextField.getText(); String organisation = Participants_OrganizationTextField.getText();
CIGS.newParticipant(ID, name, organisation);
updateParticipantList(); showSuccessMsg("Add Successfully"); clearParticipantFields(); } else if (e.getActionCommand().equals("Participants_Delete")) { int confirm = showConfirmMsg("Delete " + Participants_ParticipantsList.getSelectedValue().toString() + "?"); if (confirm != JOptionPane.YES_OPTION) { return; } Participant p = pList.get(Participants_ParticipantsList.getSelectedIndex()); Participant.deleteParticipant(p.getID());
updateParticipantList(); showSuccessMsg("Delete Successfully"); clearParticipantFields(); } else if (e.getActionCommand().equals("Participants_SaveChanges")) { System.out.println("Participants Save Change Clicked"); }
else if (e.getActionCommand().equals("RFTags_New")) { int ID = Integer.parseInt(RFTags_TagIDTextField.getText()); CIGS.newRFTag(ID);
if (jTextField2.getText().length() != 0) { CIGS.newRFTag(ID); int delegateID = Integer.parseInt(jTextField2.getText()); CIGS.associateTags(ID, delegateID); }
updateRFTagList(); showSuccessMsg("Add Successfully"); clearRFTagFields(); } else if (e.getActionCommand().equals("RFTags_Delete")) { int confirm = showConfirmMsg("Delete " + RFTags_RFTagsList.getSelectedValue().toString() + "?"); if (confirm != JOptionPane.YES_OPTION) { return; } RFTag r = rftagList.get(RFTags_RFTagsList.getSelectedIndex()); RFTag.deleteRFTag(r.getID());
updateRFTagList(); showSuccessMsg("Delete Successfully"); clearRFTagFields(); } else if (e.getActionCommand().equals("RFTags_SaveChanges")) { int ID = Integer.parseInt(RFTags_TagIDTextField.getText()); int delegateID = Integer.parseInt(jTextField2.getText()); CIGS.associateTags(ID, delegateID);
updateRFTagList(); showSuccessMsg("Save Successfully"); clearRFTagFields(); } else if (e.getActionCommand().equals("Rooms_New")) { String roomID = Rooms_RoomIDTextField.getText(); int capacity = Integer.parseInt(Rooms_CapacityTextField.getText()); String facilities = Rooms_FacTF.getText(); String buildingName = Rooms_BNTextField.getText();
CIGS.newRoom(roomID, capacity, facilities, buildingName);
updateRoomList(); showSuccessMsg("Add Successfully"); clearRoomFields(); } else if (e.getActionCommand().equals("Rooms_Delete")) { int confirm = showConfirmMsg("Delete " + Rooms_List.getSelectedValue().toString() + "?"); if (confirm != JOptionPane.YES_OPTION) { return; } Room r = roomList.get(Rooms_List.getSelectedIndex()); Room.deleteRoom(r.getID());
updateRoomList(); showSuccessMsg("Delete Successfully"); clearRoomFields(); } else if (e.getActionCommand().equals("Rooms_SaveChanges")) { System.out.println("Rooms Save Change Clicked"); } // TODO--Ranny Start -------------------------------------------------------------- else if (e.getActionCommand().equals("Papers_New")) { String topic = Papers_TopicTF.getText(); int id = Integer.parseInt(paperIDTextField.getText());
CIGS.newPaper(topic, id);
updatePaperList(); showSuccessMsg("Add Successfully"); clearPaperFields(); } else if (e.getActionCommand().equals("Papers_Delete")) { int confirm = showConfirmMsg("Delete " + Paper_List.getSelectedValue().toString() + "?"); if (confirm != JOptionPane.YES_OPTION) { return; } Paper paper = paperList.get(Paper_List.getSelectedIndex()); Paper.deletePaper(paper.getPaperID());
updatePaperList(); showSuccessMsg("Delete Successfully"); clearPaperFields(); } //TODO Zee else if (e.getSource() == Presentations_DeletePresentation) { int confirm = showConfirmMsg("Delete " + Presentations_PresentationList.getSelectedValue().toString() + "?"); if (confirm != JOptionPane.YES_OPTION) { return; } Presentation presentation = presentationList.get(Presentations_PresentationList.getSelectedIndex()); Presentation.deletePresentation(presentation.getPresentationID());
updatePresentationList(); showSuccessMsg("Delete Successfully"); Presentations_startTF.setText(""); Presentations_EndTextField.setText(""); Presentations_SessionIDTF.setText(""); Presentations_PresentationIDTextField.setText(""); Presentations_PaperID.setText(""); Presentations_AR.setText(""); Presentations_PresenterPresentYes.setSelected(false); Presentations_PresenterPresentNo.setSelected(false); } else if (e.getActionCommand().equals("Break_New")) { String startTime = Breaks_BreakStartTextField.getText(); String endTime = Breaks_BreakEndTextField.getText(); int breakID = Integer.parseInt(Breaks_BreakIDTextField.getText()); int conferenceID = Integer.parseInt(Breaks_ConferenceIDTF.getText());
CIGS.newBreak(breakID, conferenceID, startTime, endTime);
updateBreakList(); showSuccessMsg("Add Successfully"); clearBreakFields(); } else if (e.getActionCommand().equals("Break_Delete")) { int confirm = showConfirmMsg("Delete " + Breaks_NewBreak.getSelectedValue().toString() + "?"); if (confirm != JOptionPane.YES_OPTION) { return; } Break bk = bkList.get(Breaks_NewBreak.getSelectedIndex()); Break.deleteBreak(bk.getID());
updateBreakList(); showSuccessMsg("Delete Successfully"); clearBreakFields(); } // TODO--Ranny End-------------------------------------------------------------- else if (e.getSource() == Presentations_NewPresentation) { // int sessionID = Integer.parseInt(Presentations_SessionIDTF.getText()); // int presenterID = Integer.parseInt(Presentations_PresentationIDTextField.getText()); // String presentationName = ; // String startDateTime; // String endDateTime; System.out.println("New presentation...");
CIGS.newPresentation((int)(Math.random()*99999));
updatePresentationList(); showSuccessMsg("Add Successfully"); }
}
private void updatePresentationList() { Presentations_PresentationList.setModel(getPresentationList()); Presentations_PresentationList.revalidate(); Presentations_PresentationList.repaint();
}
private ListModel getParticipantList() { // Retrieve a list of participants in the database. pList = Participant.getParticipantList(); String[] list = new String[pList.size()]; for (int i = 0; i < pList.size(); i++) { list[i] = pList.get(i).getName(); }
return new DefaultComboBoxModel(list); }
private ListModel getRFTagList() { // Retrieve a list of RFTags in the database. rftagList = RFTag.getRFTagList(); String[] list = new String[rftagList.size()]; for (int i = 0; i < rftagList.size(); i++) { list[i] = "" + rftagList.get(i).getID(); }
return new DefaultComboBoxModel(list); }
private ListModel getRoomList() { // Retrieve a list of RFTags in the database. roomList = Room.getRoomList(); String[] list = new String[roomList.size()]; for (int i = 0; i < roomList.size(); i++) { list[i] = roomList.get(i).getID(); }
return new DefaultComboBoxModel(list); }
// TODO--Ranny Start -------------------------------------------------------------- private ListModel getPaperList() { paperList = Paper.getPaperList(); String[] list = new String[paperList.size()]; for (int i = 0; i < paperList.size(); i++) { list[i] = paperList.get(i).getTopic(); }
return new DefaultComboBoxModel(list); } private ListModel getBreakList() { bkList = Break.getBreakList(); String[] list = new String[bkList.size()]; for (int i = 0; i < bkList.size(); i++) { list[i] = "" + bkList.get(i).getID(); }
return new DefaultComboBoxModel(list); }
// TODO--Ranny End-------------------------------------------------------------- // Zee private ListModel getPresentationList() { // Retrieve a list of participants in the database. presentationList = Presentation.getPresentationList(); String[] list = new String[presentationList.size()]; for (int i = 0; i < presentationList.size(); i++) { list[i] = presentationList.get(i).getName(); }
return new DefaultComboBoxModel(list); } private void updateParticipantList() { Participants_ParticipantsList.setModel(getParticipantList()); Participants_ParticipantsList.revalidate(); Participants_ParticipantsList.repaint(); }
private void clearParticipantFields() { Participants_IDTextField.setText(""); Participants_NameTextField.setText(""); Participants_OrganizationTextField.setText(""); }
private void updateRFTagList() { RFTags_RFTagsList.setModel(getRFTagList()); RFTags_RFTagsList.revalidate(); RFTags_RFTagsList.repaint(); }
private void clearRFTagFields() { RFTags_TagIDTextField.setText(""); jTextField2.setText(""); } private void updateRoomList() { Rooms_List.setModel(getRoomList()); Rooms_List.revalidate(); Rooms_List.repaint(); } private void clearRoomFields() { Rooms_RoomIDTextField.setText(""); Rooms_FacTF.setText(""); Rooms_CapacityTextField.setText(""); Rooms_BNTextField.setText(""); }
// TODO--Ranny start-------------------------------------------------------------- private void updatePaperList() { Paper_List.setModel(getPaperList()); Paper_List.revalidate(); Paper_List.repaint(); } private void clearPaperFields() { Papers_TopicTF.setText(""); paperIDTextField.setText(""); } private void updateBreakList() { Breaks_NewBreak.setModel(getBreakList()); Breaks_NewBreak.revalidate(); Breaks_NewBreak.repaint(); } private void clearBreakFields() { Breaks_BreakIDTextField.setText(""); Breaks_BreakStartTextField.setText(""); Breaks_BreakEndTextField.setText(""); Breaks_ConferenceIDTF.setText(""); } // TODO--Ranny End--------------------------------------------------------------
public void showErrorMsg(String error) { JOptionPane.showMessageDialog(this, error, "Error", JOptionPane.ERROR_MESSAGE); }
public void showErrorMsg(JComponent parent, String error) { JOptionPane.showMessageDialog(parent, error, "Error", JOptionPane.ERROR_MESSAGE); }
public void showSuccessMsg(String msg) { JOptionPane.showMessageDialog(this, msg); }
public int showConfirmMsg(String msg) { return JOptionPane.showConfirmDialog(this, msg); }
public void showInfoMsg(String title, String info) { JOptionPane.showMessageDialog(this, info, title, JOptionPane.INFORMATION_MESSAGE); }
public Object showSelectionDialog(String msg, Object[] options) { return JOptionPane.showInputDialog(this, msg, "???", JOptionPane.QUESTION_MESSAGE, null, options, options[0]); }
public void valueChanged(ListSelectionEvent e) { String listName = ((JList)e.getSource()).getName(); if (listName.equals("Participants_ParticipantsList")) { Participant p = pList.get(Participants_ParticipantsList.getSelectedIndex());
Participants_IDTextField.setText("" + p.getID()); Participants_NameTextField.setText(p.getName()); Participants_OrganizationTextField.setText(p.getOrganisation()); } else if(listName.equals("RFTags_RFTagsList")) { RFTag r = rftagList.get(RFTags_RFTagsList.getSelectedIndex());
RFTags_TagIDTextField.setText("" + r.getID());
// !!!!!! If the deletegateID is 0, then dont display it. if (r.getParticipantID() != 0) { jTextField2.setText("" + r.getParticipantID()); } else { jTextField2.setText(""); } } else if (listName.equals("Rooms_List")) { Room r = roomList.get(Rooms_List.getSelectedIndex());
Rooms_RoomIDTextField.setText(r.getID()); Rooms_FacTF.setText(r.getFacilities()); Rooms_CapacityTextField.setText("" + r.getCapacity()); Rooms_BNTextField.setText(r.getBuildingName()); } // TODO--Ranny start-------------------------------------------------------------- else if (listName.equals("Paper_List")) { Paper paper = paperList.get(Paper_List.getSelectedIndex());
Papers_TopicTF.setText(paper.getTopic()); paperIDTextField.setText("" + paper.getPaperID());
} else if (listName.equals("Presentations_PresentationList")) { Presentation presentation = presentationList.get(Presentations_PresentationList.getSelectedIndex());
Presentations_startTF.setText(presentation.getStart()); Presentations_EndTextField.setText(presentation.getEnd()); Presentations_SessionIDTF.setText(""+presentation.getSessionID()); Presentations_PresentationIDTextField.setText(""+presentation.getPresentationID()); Presentations_PaperID.setText(""+presentation.getPaperID()); Presentations_AR.setText(""+presentation.getAR()); if(presentation.isPresenterPresent()) { Presentations_PresenterPresentYes.setSelected(true); Presentations_PresenterPresentNo.setSelected(false); } else { Presentations_PresenterPresentYes.setSelected(false); Presentations_PresenterPresentNo.setSelected(true); } }
else if (listName.equals("Break_List")) {
Break bk = bkList.get(Breaks_NewBreak.getSelectedIndex());
Breaks_BreakIDTextField.setText("" + bk.getID()); Breaks_ConferenceIDTF.setText("" + bk.getConferenceID()); Breaks_BreakEndTextField.setText(bk.getStartDateTime()); Breaks_BreakStartTextField.setText(bk.getEndDateTime()); } // TODO--Ranny End-------------------------------------------------------------- }
private JLabel getChairpersonPresent() { if (ChairpersonPresent == null) { ChairpersonPresent = new JLabel(); ChairpersonPresent.setText("Chairperson Present"); ChairpersonPresent.setBounds(14, 420, 287, 28); } return ChairpersonPresent; }
private JTextField getChairpersonPresentTF() { if (ChairpersonPresentTF == null) { ChairpersonPresentTF = new JTextField(); ChairpersonPresentTF.setText("No"); ChairpersonPresentTF.setBounds(14, 448, 77, 28); ChairpersonPresentTF.setEditable(false); } return ChairpersonPresentTF; }
private JLabel getRF_ChairpersonLabel() { if (RF_ChairpersonLabel == null) { RF_ChairpersonLabel = new JLabel(); RF_ChairpersonLabel.setText("Present Chairperson"); RF_ChairpersonLabel.setBounds(7, 448, 196, 28); } return RF_ChairpersonLabel; }
private JList getRF_ChairpersonList() { if (RF_ChairpersonList == null) { ListModel RF_ChairpersonListModel = new DefaultComboBoxModel( new String[] { "Item One" }); RF_ChairpersonList = new JList(); RF_ChairpersonList.setModel(RF_ChairpersonListModel); RF_ChairpersonList.setBounds(7, 476, 280, 21); } return RF_ChairpersonList; }
private JLabel getPresentations_SessionIDLabel() { if (Presentations_SessionIDLabel == null) { Presentations_SessionIDLabel = new JLabel(); Presentations_SessionIDLabel.setText("Session ID"); Presentations_SessionIDLabel.setBounds(14, 420, 280, 28); } return Presentations_SessionIDLabel; }
private JTextField getPresentations_SessionIDTF() { if (Presentations_SessionIDTF == null) { Presentations_SessionIDTF = new JTextField(); Presentations_SessionIDTF.setText("1234545"); Presentations_SessionIDTF.setBounds(14, 448, 287, 28); } return Presentations_SessionIDTF; }
private JLabel getBreaks_ConferenceIDLabel() { if (Breaks_ConferenceIDLabel == null) { Breaks_ConferenceIDLabel = new JLabel(); Breaks_ConferenceIDLabel.setText("Conference ID"); Breaks_ConferenceIDLabel.setBounds(350, 84, 154, 28); } return Breaks_ConferenceIDLabel; }
private JTextField getBreaks_ConferenceIDTF() { if (Breaks_ConferenceIDTF == null) { Breaks_ConferenceIDTF = new JTextField(); Breaks_ConferenceIDTF.setBounds(350, 112, 287, 28); } return Breaks_ConferenceIDTF; }
private JLabel getPaperIDLable() { if (paperIDLable == null) { paperIDLable = new JLabel(); paperIDLable.setText("ID"); paperIDLable.setBounds(350, 77, 63, 28); } return paperIDLable; }
private JTextField getPaperIDTextField() { if (paperIDTextField == null) { paperIDTextField = new JTextField(); paperIDTextField.setBounds(350, 105, 140, 28); } return paperIDTextField; }
private JTextField getPresentations_startTF() { if (Presentations_startTF == null) { Presentations_startTF = new JTextField(); Presentations_startTF.setBounds(14, 287, 287, 28); } return Presentations_startTF; }
}