diff options
| author | Michael Wilson | 2014-10-02 14:14:53 +0200 |
|---|---|---|
| committer | Michael Wilson | 2014-10-02 14:14:53 +0200 |
| commit | c5bdd8fd4a633b95e98e179e1286bc78b32dbb88 (patch) | |
| tree | f8794263c831a9263d34bc6ce4ac5bb717cc9a54 /dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java | |
| parent | Verlinkung der Seiten gefixt (diff) | |
| download | tutor-module-c5bdd8fd4a633b95e98e179e1286bc78b32dbb88.tar.gz tutor-module-c5bdd8fd4a633b95e98e179e1286bc78b32dbb88.tar.xz tutor-module-c5bdd8fd4a633b95e98e179e1286bc78b32dbb88.zip | |
-Suchfenster "Image bearbeiten", "Image löschen", Veranstaltung bearbeiten", "Veranstaltung löschen" wurden vereinfacht (nur Anzeige, noch nicht Logik)
-Login speichert nun den gesamten Login als User, nicht nur den String vor dem "@uni......."
-SQL wurde umgebogen um den Login als primary key für den User festzulegen und damit umzugehen
Diffstat (limited to 'dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java')
| -rw-r--r-- | dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java | 102 |
1 files changed, 24 insertions, 78 deletions
diff --git a/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java index b387ab9f..0e2496f3 100644 --- a/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java @@ -82,14 +82,13 @@ public class DeleteLecture_GUI extends JFrame { JTextArea labelimage; JTextArea labeldesc; JLabel labelVerantwortlicher; - JTable tableAllLectures; JTable tablemyLectures; private JTextField textFieldName; - JTabbedPane tabbedPane; boolean activeSearch=false; String[] titles = { "Veranstaltungsname", "Beschreibung", "Gültigkeitsdatum", "Aktiv", "Letzte Benutzung", "Verantwortlicher", "Image", "Schlagwort", "ID" }; + ThriftConnection con = new ThriftConnection(); Client client = models.Client.clientcon.getClient(); final DefaultTableModel modelAll = new DefaultTableModel(titles, 0); @@ -151,6 +150,7 @@ public class DeleteLecture_GUI extends JFrame { tablemyLectures.getColumnModel().getColumn(8).setMinWidth(0); tablemyLectures.getColumnModel().getColumn(8).setMaxWidth(0); + /* tableAllLectures.getColumnModel().getColumn(1).setWidth(0); tableAllLectures.getColumnModel().getColumn(1).setMinWidth(0); tableAllLectures.getColumnModel().getColumn(1).setMaxWidth(0); @@ -169,6 +169,7 @@ public class DeleteLecture_GUI extends JFrame { tableAllLectures.getColumnModel().getColumn(8).setWidth(0); tableAllLectures.getColumnModel().getColumn(8).setMinWidth(0); tableAllLectures.getColumnModel().getColumn(8).setMaxWidth(0); + */ } }); // Verhindert das Vergroessern Des Fensters @@ -301,72 +302,22 @@ public class DeleteLecture_GUI extends JFrame { JLabel lblNewLabel_1 = new JLabel("Veranstaltung löschen"); lblNewLabel_1.setBounds(166, 11, 128, 14); contentPanel.add(lblNewLabel_1); - - tabbedPane = new JTabbedPane(JTabbedPane.TOP); - tabbedPane.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent arg0) { - if (tabbedPane.getSelectedIndex() == 0) { - - String username = person.verantwortlicher.getName() + " " - + person.verantwortlicher.getVorname(); - rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( - username, 5)); - } else if (tabbedPane.getSelectedIndex() == 1) { - rowSorterAll.setRowFilter(null); - } - - } - }); - - tabbedPane.setBounds(10, 123, 557, 397); - contentPanel.add(tabbedPane); - - - JScrollPane scrollPaneAllImages = new JScrollPane(); - tableAllLectures = new JTable(); - tableAllLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener() - { - public void valueChanged(ListSelectionEvent e) - { - String imageid = modelAll - .getValueAt( - tableAllLectures - .convertRowIndexToModel(tableAllLectures - .getSelectedRow()), 8) - .toString(); - - try { - writeLectureData(imageid); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (ParseException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - } - }); - tableAllLectures.setModel(modelAll); - tableAllLectures.getColumnModel().getColumn(1).sizeWidthToFit(); - tableAllLectures.getColumnModel().getColumn(2).sizeWidthToFit(); - tableAllLectures.getColumnModel().getColumn(3).sizeWidthToFit(); - tableAllLectures.getColumnModel().getColumn(4).sizeWidthToFit(); - tableAllLectures.getColumnModel().getColumn(5).sizeWidthToFit(); - tableAllLectures.setRowSorter(rowSorterAll); JScrollPane scrollPaneMyImage = new JScrollPane(); + scrollPaneMyImage.setBounds(10, 120, 552, 369); + contentPanel.add(scrollPaneMyImage); tablemyLectures = new JTable(); - tablemyLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener() - { - public void valueChanged(ListSelectionEvent e) - { - String imageid = modelMyLectures + tablemyLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener() + { + public void valueChanged(ListSelectionEvent e) + { + String imageid = modelMyLectures .getValueAt( tablemyLectures .convertRowIndexToModel(tablemyLectures .getSelectedRow()), 8) .toString(); - try { + try { writeLectureData(imageid); } catch (TException e1) { // TODO Auto-generated catch block @@ -375,24 +326,18 @@ public class DeleteLecture_GUI extends JFrame { // TODO Auto-generated catch block e1.printStackTrace(); } - } - }); + } + }); tablemyLectures.setModel(modelMyLectures); - - tablemyLectures.getColumnModel().getColumn(1).sizeWidthToFit(); - tablemyLectures.getColumnModel().getColumn(2).sizeWidthToFit(); - tablemyLectures.getColumnModel().getColumn(3).sizeWidthToFit(); - tablemyLectures.getColumnModel().getColumn(4).sizeWidthToFit(); - tablemyLectures.getColumnModel().getColumn(5).sizeWidthToFit(); - tablemyLectures.setRowSorter(rowSorterMyLectures); - - scrollPaneMyImage.setViewportView(tablemyLectures); - tabbedPane.addTab("Meine Veranstaltungen", null, scrollPaneMyImage, - null); - - scrollPaneAllImages.setViewportView(tableAllLectures); - tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); + tablemyLectures.getColumnModel().getColumn(1).sizeWidthToFit(); + tablemyLectures.getColumnModel().getColumn(2).sizeWidthToFit(); + tablemyLectures.getColumnModel().getColumn(3).sizeWidthToFit(); + tablemyLectures.getColumnModel().getColumn(4).sizeWidthToFit(); + tablemyLectures.getColumnModel().getColumn(5).sizeWidthToFit(); + tablemyLectures.setRowSorter(rowSorterMyLectures); + + scrollPaneMyImage.setViewportView(tablemyLectures); { JPanel buttonPane = new JPanel(); buttonPane.setBounds(0, 640, 826, 33); @@ -521,6 +466,7 @@ public class DeleteLecture_GUI extends JFrame { getContentPane().add(button); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { + String lectureID=""; int eingabe; String username = person.verantwortlicher.getName() + " " @@ -562,7 +508,7 @@ public class DeleteLecture_GUI extends JFrame { }//end ask for confirmation }//end check if a row is selected - else if (tableAllLectures.getSelectedRowCount() !=0 && tableAllLectures.getValueAt(tableAllLectures.getSelectedRow(), 5).toString().equals(username)){ + /* else if (tableAllLectures.getSelectedRowCount() !=0 && tableAllLectures.getValueAt(tableAllLectures.getSelectedRow(), 5).toString().equals(username)){ //a row is selected //ask for confirmation eingabe = JOptionPane.showConfirmDialog(null, @@ -604,7 +550,7 @@ public class DeleteLecture_GUI extends JFrame { "Bitte wählen Sie ein eigenes Image aus.", "Message", JOptionPane.INFORMATION_MESSAGE); - } + } */ } }); |
