summaryrefslogtreecommitdiffstats
path: root/Dozentenmodul/src/gui/SearchEditLecture_GUI.java
diff options
context:
space:
mode:
authorunknown2014-04-04 11:55:21 +0200
committerunknown2014-04-04 11:55:21 +0200
commit367db7b0832e1325a0f1d0580baffa28deca86f4 (patch)
treea79a33d3ab4c7e6539d94e4d081f2fd14d414e77 /Dozentenmodul/src/gui/SearchEditLecture_GUI.java
parentneue Version (diff)
downloadtutor-module-367db7b0832e1325a0f1d0580baffa28deca86f4.tar.gz
tutor-module-367db7b0832e1325a0f1d0580baffa28deca86f4.tar.xz
tutor-module-367db7b0832e1325a0f1d0580baffa28deca86f4.zip
test
Diffstat (limited to 'Dozentenmodul/src/gui/SearchEditLecture_GUI.java')
-rw-r--r--Dozentenmodul/src/gui/SearchEditLecture_GUI.java82
1 files changed, 34 insertions, 48 deletions
diff --git a/Dozentenmodul/src/gui/SearchEditLecture_GUI.java b/Dozentenmodul/src/gui/SearchEditLecture_GUI.java
index f0e360cd..9553bc6e 100644
--- a/Dozentenmodul/src/gui/SearchEditLecture_GUI.java
+++ b/Dozentenmodul/src/gui/SearchEditLecture_GUI.java
@@ -15,10 +15,12 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
import java.util.Iterator;
import java.util.List;
import javax.swing.JButton;
-import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
@@ -44,7 +46,8 @@ import javax.swing.event.ChangeListener;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;
-import models.Image;
+
+import models.Lecture;
import models.person;
//import models.person;
@@ -202,7 +205,7 @@ public class SearchEditLecture_GUI extends JFrame {
lblHauptmen.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent arg0) {
- //Öffnet das Hauütmenü
+ //Öffnet das Hauptmenü
con.closeThriftConnection();
SearchEditLecture_GUI.this.setVisible(false);
MainMenue_GUI main=new MainMenue_GUI();
@@ -237,7 +240,6 @@ public class SearchEditLecture_GUI extends JFrame {
if(tabbedPane.getSelectedIndex()==0){
String username= person.verantwortlicher.getName()+" "+person.verantwortlicher.getVorname();
- //String username="Spitzer Tobias";
rowSorterMyLectures.setRowFilter(RowFilter.regexFilter(username, 5));
}
else if(tabbedPane.getSelectedIndex()==1){
@@ -249,8 +251,9 @@ public class SearchEditLecture_GUI extends JFrame {
}
});
- tabbedPane.setBounds(10, 197, 557, 300);
+ tabbedPane.setBounds(10, 197, 557, 323);
contentPanel.add(tabbedPane);
+ System.out.println("haaaaaaaaaaa");
initTableModel(modelMyLectures);
JScrollPane scrollPaneAllImages = new JScrollPane();
@@ -319,39 +322,6 @@ public class SearchEditLecture_GUI extends JFrame {
scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen);
tabbedPane.addTab("\u00D6ffentliche Vorlagen", null, scrollPanePublicVorlagen, null);
tabbedPane.setEnabledAt(4, false);
-
-
-
-
- JButton btnDownload = new JButton("Download");
- btnDownload.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- //Öffnet den Downloader
-
- if(tablemyLectures.getSelectedRow()!=-1)
- {
- String imageid=modelMyLectures.getValueAt(tablemyLectures.convertRowIndexToModel(tablemyLectures.getSelectedRow()), 7).toString();
-
- Image.image.setImageId(imageid);
- String imageversion=modelMyLectures.getValueAt(tablemyLectures.convertRowIndexToModel(tablemyLectures.getSelectedRow()), 8).toString();
-
- Image.image.setVersion(imageversion);
- SearchEditLecture_GUI.this.setVisible(false);
- FTPDownloader_GUI down=new FTPDownloader_GUI();
- down.setVisible(true);
- con.closeThriftConnection();
-
-
-
- }
- else{
- JOptionPane.showMessageDialog(null, "Bitte wählen Sie ein Image für den Download aus", "Message",
- JOptionPane.INFORMATION_MESSAGE);
- }
- }
- });
- btnDownload.setBounds(449, 508, 118, 23);
- contentPanel.add(btnDownload);
{
JPanel buttonPane = new JPanel();
buttonPane.setBounds(0, 640, 597, 33);
@@ -377,16 +347,36 @@ public class SearchEditLecture_GUI extends JFrame {
JButton cancelButton = new JButton("Weiter");
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- con.closeThriftConnection();
+
//Image.image.setImageId(imageid);
if(tabbedPane.getSelectedIndex()==0){
- String imageid=modelMyLectures.getValueAt(tablemyLectures.convertRowIndexToModel(tablemyLectures.getSelectedRow()), 7).toString();
+
+
+ Lecture.lecture.setid(modelMyLectures.getValueAt(tablemyLectures.convertRowIndexToModel(tablemyLectures.getSelectedRow()), 8).toString());
+ Lecture.lecture.setName(modelMyLectures.getValueAt(tablemyLectures.convertRowIndexToModel(tablemyLectures.getSelectedRow()), 0).toString());
+ Lecture.lecture.setDesc(modelMyLectures.getValueAt(tablemyLectures.convertRowIndexToModel(tablemyLectures.getSelectedRow()), 1).toString());
+ String date=modelMyLectures.getValueAt(tablemyLectures.convertRowIndexToModel(tablemyLectures.getSelectedRow()), 2).toString();
+ Lecture.lecture.setLinkedImagename(modelMyLectures.getValueAt(tablemyLectures.convertRowIndexToModel(tablemyLectures.getSelectedRow()), 6).toString());
+ String startdate=date.substring(0,date.indexOf(" "));
+ String enddate=date.substring(date.indexOf(" "));
+ DateFormat df=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
- Image.image.setImageId(imageid);
- String imageversion=modelMyLectures.getValueAt(tablemyLectures.convertRowIndexToModel(tablemyLectures.getSelectedRow()), 8).toString();
+ try {
+ Lecture.lecture.setEnddate(df.parse(enddate));
+ Lecture.lecture.setStartdate(df.parse(startdate));
+ } catch (ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ if(modelMyLectures.getValueAt(tablemyLectures.convertRowIndexToModel(tablemyLectures.getSelectedRow()), 3).toString().equals("1")){
+ Lecture.lecture.setActive(true);
+ }
+ else
+ {
+ Lecture.lecture.setActive(false);
+ }
- Image.image.setVersion(imageversion);
con.closeThriftConnection();
EditImageAllgemein_GUI ea=new EditImageAllgemein_GUI();
ea.setVisible(true);
@@ -430,7 +420,6 @@ public class SearchEditLecture_GUI extends JFrame {
try {
//Hole eine Liste der Images
lectures = client.getLectureList();
-
Iterator<server.Lecture> i=lectures.iterator();
int x=0;
@@ -438,10 +427,7 @@ public class SearchEditLecture_GUI extends JFrame {
while(i.hasNext())
{
//erzeuge Objekte für die Tabelle
- System.out.println(lectures.get(x).lecturename);
- Object [] obj={lectures.get(x).lecturename,lectures.get(x).desc,lectures.get(x).starttime+" "+lectures.get(x).endtime,lectures.get(x).isActive,lectures.get(x).lastused,lectures.get(x).username,lectures.get(x).imagename,lectures.get(x).id};
- //String[] titles= {"Veranstaltungsname", "Beschreibung", "Gültigkeitsdatum", "Aktiv","Letzte Benutzung" ,"Verantwortlicher", "Image", "Schlagwort","ID"};
- //System.out.println("id:"+images.get(x).getId());
+ Object [] obj={lectures.get(x).lecturename,lectures.get(x).desc,lectures.get(x).starttime+" "+lectures.get(x).endtime,lectures.get(x).isActive,lectures.get(x).lastused,lectures.get(x).username," ",lectures.get(x).imagename,lectures.get(x).id};
//Füge diese Objekte der Tabelle hinzu
model.addRow(obj);
x++;