summaryrefslogtreecommitdiffstats
path: root/Dozentenmodul/src/gui/lecture/DeleteLecture_GUI.java
diff options
context:
space:
mode:
Diffstat (limited to 'Dozentenmodul/src/gui/lecture/DeleteLecture_GUI.java')
-rw-r--r--Dozentenmodul/src/gui/lecture/DeleteLecture_GUI.java448
1 files changed, 317 insertions, 131 deletions
diff --git a/Dozentenmodul/src/gui/lecture/DeleteLecture_GUI.java b/Dozentenmodul/src/gui/lecture/DeleteLecture_GUI.java
index 9b3d0ef3..cadb4ca3 100644
--- a/Dozentenmodul/src/gui/lecture/DeleteLecture_GUI.java
+++ b/Dozentenmodul/src/gui/lecture/DeleteLecture_GUI.java
@@ -17,8 +17,11 @@ import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.net.URI;
import java.net.URISyntaxException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import javax.swing.JButton;
import javax.swing.JFrame;
@@ -33,15 +36,19 @@ import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
+import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JTextPane;
import javax.swing.RowFilter;
+import javax.swing.ScrollPaneConstants;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;
@@ -63,16 +70,22 @@ public class DeleteLecture_GUI extends JFrame {
String[] result;
JRadioButton rdbtnInternetJa;
JRadioButton rdbtnInternetNein;
+ JLabel labelAktiv;
+ JLabel labelstartdate;
+ JLabel labelenddate;
+ JLabel labelimageversion;
+ JTextArea labelName;
+ JTextArea labelimage;
+ JTextArea labeldesc;
+ JLabel labelVerantwortlicher;
JTable tableAllLectures;
JTable tablemyLectures;
- JTable tableCoopImages;
- JTable tablePublicImages;
private JTextField textFieldName;
JTabbedPane tabbedPane;
boolean activeSearch=false;
String[] titles = { "Veranstaltungsname", "Beschreibung",
"G\u00fcltigkeitsdatum", "Aktiv", "Letzte Benutzung",
- "Verantwortlicher", "Image", "ID" };
+ "Verantwortlicher", "Image", "Schlagwort", "ID" };
ThriftConnection con = new ThriftConnection();
Client client = models.Client.clientcon.getClient();
final DefaultTableModel modelAll = new DefaultTableModel(titles, 0);
@@ -97,9 +110,51 @@ public class DeleteLecture_GUI extends JFrame {
}
@Override
public void windowOpened(WindowEvent arg0) {
- initTableModel(modelAll);
- initTableModel(modelMyLectures);
textFieldName.requestFocusInWindow();
+ try {
+ initTableModel(modelMyLectures);
+ initTableModel(modelAll);
+
+ } catch (ParseException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ tablemyLectures.getColumnModel().getColumn(1).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(1).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(1).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(2).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(2).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(2).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(3).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(3).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(3).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(6).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(6).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(6).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(7).setWidth(0);
+ tablemyLectures.getColumnModel().getColumn(7).setMinWidth(0);
+ tablemyLectures.getColumnModel().getColumn(7).setMaxWidth(0);
+ tablemyLectures.getColumnModel().getColumn(8).setWidth(0);
+ 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);
+ tableAllLectures.getColumnModel().getColumn(2).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(2).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(2).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(3).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(3).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(3).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(6).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(6).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(6).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(7).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(7).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(7).setMaxWidth(0);
+ tableAllLectures.getColumnModel().getColumn(8).setWidth(0);
+ tableAllLectures.getColumnModel().getColumn(8).setMinWidth(0);
+ tableAllLectures.getColumnModel().getColumn(8).setMaxWidth(0);
}
});
// Verhindert das Vergroessern Des Fensters
@@ -116,16 +171,15 @@ public class DeleteLecture_GUI extends JFrame {
// Setzt den Fenstertitel
setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung l\u00F6schen");
// Zentriert das Fenster in die Bildmitte
- setBounds(0, 0, 603, 722);
+ setBounds(0, 0, 842, 722);
GuiOrganizer.centerGUI(this);
- final DefaultTableModel model = new DefaultTableModel(titles, 0);
getContentPane().setLayout(null);
{
JPanel panel = new JPanel();
panel.setBackground(SystemColor.menu);
- panel.setBounds(10, 11, 577, 57);
+ panel.setBounds(10, 11, 816, 57);
getContentPane().add(panel);
panel.setLayout(null);
{
@@ -144,7 +198,7 @@ public class DeleteLecture_GUI extends JFrame {
txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
panel.add(txtpnBitteWhlenSie);
}
- contentPanel.setBounds(10, 85, 577, 531);
+ contentPanel.setBounds(10, 85, 570, 518);
contentPanel.setBackground(SystemColor.menu);
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel);
@@ -241,12 +295,35 @@ public class DeleteLecture_GUI extends JFrame {
}
});
- tabbedPane.setBounds(10, 124, 557, 373);
+ 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();
+ System.out.println(imageid);
+
+ 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();
@@ -256,6 +333,29 @@ public class DeleteLecture_GUI extends JFrame {
tableAllLectures.setRowSorter(rowSorterAll);
JScrollPane scrollPaneMyImage = new JScrollPane();
tablemyLectures = new JTable();
+ tablemyLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener()
+ {
+ public void valueChanged(ListSelectionEvent e)
+ {
+ String imageid = modelMyLectures
+ .getValueAt(
+ tablemyLectures
+ .convertRowIndexToModel(tablemyLectures
+ .getSelectedRow()), 8)
+ .toString();
+ System.out.println(imageid);
+
+ try {
+ writeLectureData(imageid);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch (ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ }
+ });
tablemyLectures.setModel(modelMyLectures);
tablemyLectures.getColumnModel().getColumn(1).sizeWidthToFit();
@@ -272,121 +372,9 @@ public class DeleteLecture_GUI extends JFrame {
scrollPaneAllImages.setViewportView(tableAllLectures);
tabbedPane.addTab("Alle", null, scrollPaneAllImages, null);
-
- JScrollPane scrollPaneCoopImages = new JScrollPane();
- tableCoopImages = new JTable();
- tableCoopImages.setModel(model);
- tableCoopImages.getColumnModel().getColumn(1).sizeWidthToFit();
- tableCoopImages.getColumnModel().getColumn(2).sizeWidthToFit();
- tableCoopImages.getColumnModel().getColumn(3).sizeWidthToFit();
- tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit();
- tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit();
-
- scrollPaneCoopImages.setViewportView(tableCoopImages);
- tabbedPane.addTab("Kooperative Veranstaltungen", null,
- scrollPaneCoopImages, null);
- tabbedPane.setEnabledAt(2, false);
-
- JScrollPane scrollPanePublicImages = new JScrollPane();
- tablePublicImages = new JTable();
- tablePublicImages.setModel(model);
- tablePublicImages.getColumnModel().getColumn(1).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(2).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(3).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(4).sizeWidthToFit();
- tablePublicImages.getColumnModel().getColumn(5).sizeWidthToFit();
-
- scrollPanePublicImages.setViewportView(tablePublicImages);
- tabbedPane.addTab("\u00D6ffentliche Veranstaltungen", null,
- scrollPanePublicImages, null);
- tabbedPane.setEnabledAt(3, false);
-
- button = new JButton("L\u00F6schen");
- button.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- String lectureID="";
- int eingabe;
- String username = person.verantwortlicher.getName() + " "
- + person.verantwortlicher.getVorname();
- //check if a row is selected
- if (tablemyLectures.getSelectedRowCount() !=0){
- //a row is selected
- //ask for confirmation
- eingabe = JOptionPane.showConfirmDialog(null,
- "Wollen Sie diese Daten l\u00f6schen?", "L\u00f6schen?",
- JOptionPane.YES_NO_OPTION);
-
- if (eingabe == JOptionPane.YES_OPTION) {
- //user has confirmed deletion, now get the ID of the selected lecture
- lectureID = modelMyLectures.getValueAt(tablemyLectures.convertColumnIndexToModel(tablemyLectures.getSelectedRow()), 7).toString();
- System.out.println("L\u00f6sche Lecture "+lectureID);
- try {
- if(client.deleteLecture(lectureID, person.verantwortlicher.getHochschule(),person.verantwortlicher.getUsername())){
- System.out.println("L\u00f6schen erfolgreich");
- //delete successful
-
- DeleteLecture_GUI dl = new DeleteLecture_GUI();
- dl.setVisible(true);
- dispose();
- } else {
- //delete not successful
- JOptionPane
- .showMessageDialog(
- null,
- "L\u00f6schen aus Datenbank fehlgeschlagen.",
- "Fehler",
- JOptionPane.INFORMATION_MESSAGE);
- }
- } catch (TException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }//end delete
- }//end ask for confirmation
-
- }//end check if a row is selected
- else if (tableAllLectures.getSelectedRowCount() !=0 && tableAllLectures.getValueAt(tableAllLectures.getSelectedRow(), 5).toString().equals(username)){
- //a row is selected
- //ask for confirmation
- eingabe = JOptionPane.showConfirmDialog(null,
- "Wollen Sie diese Daten l\u00f6schen?", "L\u00f6schen?",
- JOptionPane.YES_NO_OPTION);
-
- if (eingabe == JOptionPane.YES_OPTION) {
- //user has confirmed deletion, now get the ID of the selected lecture
- lectureID = tableAllLectures.getValueAt(tableAllLectures.convertColumnIndexToModel(tableAllLectures.getSelectedRow()), 7).toString();
- System.out.println("L\u00f6sche Lecture "+lectureID);
- try {
- if(client.deleteLecture(lectureID, person.verantwortlicher.getHochschule(),person.verantwortlicher.getUsername())){
- System.out.println("L\u00f6schen erfolgreich");
- //delete successful
-
- DeleteLecture_GUI dl = new DeleteLecture_GUI();
- dl.setVisible(true);
- dispose();
- } else {
- //delete not successful
- JOptionPane
- .showMessageDialog(
- null,
- "L\u00f6schen aus Datenbank fehlgeschlagen.",
- "Fehler",
- JOptionPane.INFORMATION_MESSAGE);
- }
- } catch (TException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }//end delete
- }//end ask for confirmation
-
- }//end check if a row is selected
-
- }
- });
- button.setBounds(459, 508, 118, 23);
- contentPanel.add(button);
{
JPanel buttonPane = new JPanel();
- buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBounds(0, 640, 826, 33);
buttonPane.setBackground(SystemColor.menu);
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
getContentPane().add(buttonPane);
@@ -408,12 +396,193 @@ public class DeleteLecture_GUI extends JFrame {
}
JSeparator separator = new JSeparator();
- separator.setBounds(0, 78, 597, 2);
+ separator.setBounds(0, 79, 836, 1);
getContentPane().add(separator);
JSeparator separator_1 = new JSeparator();
- separator_1.setBounds(0, 627, 597, 2);
+ separator_1.setBounds(0, 628, 836, 1);
getContentPane().add(separator_1);
+
+ JPanel panel = new JPanel();
+ panel.setLayout(null);
+ panel.setBorder(new TitledBorder(null, "Detailinformationen",
+
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(591, 85, 235, 518);
+ getContentPane().add(panel);
+
+ JLabel lblNewLabel_3 = new JLabel("Name:");
+ lblNewLabel_3.setBounds(10, 27, 104, 14);
+ panel.add(lblNewLabel_3);
+
+ JLabel lblAktiv = new JLabel("Aktiv:");
+ lblAktiv.setBounds(10, 88, 104, 14);
+ panel.add(lblAktiv);
+
+ labelAktiv = new JLabel("");
+ labelAktiv.setBounds(124, 88, 104, 14);
+ panel.add(labelAktiv);
+
+ labelstartdate = new JLabel("");
+ labelstartdate.setBounds(124, 113, 104, 14);
+ panel.add(labelstartdate);
+
+ JLabel lblStartdatum = new JLabel("Startdatum:");
+ lblStartdatum.setBounds(10, 113, 104, 14);
+ panel.add(lblStartdatum);
+
+ labelenddate = new JLabel("");
+ labelenddate.setBounds(124, 138, 104, 14);
+ panel.add(labelenddate);
+
+ JLabel lblEnddatum = new JLabel("Enddatum:");
+ lblEnddatum.setBounds(10, 138, 104, 14);
+ panel.add(lblEnddatum);
+
+ JLabel lblBeschreibung = new JLabel("Beschreibung:");
+ lblBeschreibung.setBounds(10, 163, 104, 14);
+ panel.add(lblBeschreibung);
+
+ JLabel lblImage = new JLabel("Image:");
+ lblImage.setBounds(10, 284, 104, 14);
+ panel.add(lblImage);
+
+ labelVerantwortlicher = new JLabel("");
+ labelVerantwortlicher.setBounds(124, 401, 104, 14);
+ panel.add(labelVerantwortlicher);
+
+ JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:");
+ lblVerantwortlicher.setBounds(10, 401, 104, 14);
+ panel.add(lblVerantwortlicher);
+
+ JLabel lblImageversion = new JLabel("Imageversion:");
+ lblImageversion.setBounds(10, 376, 104, 14);
+ panel.add(lblImageversion);
+
+ labelimageversion = new JLabel("");
+ labelimageversion.setBounds(124, 376, 104, 14);
+ panel.add(labelimageversion);
+
+
+ labeldesc = new JTextArea();
+ labeldesc.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ labeldesc.setEditable(false);
+ labeldesc.setLineWrap(true);
+ labeldesc.setBackground(SystemColor.menu);
+ labeldesc.setBounds(124, 127, 104, 110);
+ JScrollPane scrollPane = new JScrollPane(labeldesc);
+ scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
+ scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
+ scrollPane.setBounds(124, 163, 104, 110);
+ panel.add(scrollPane);
+ //panel.add(labeldesc);
+
+ labelimage = new JTextArea();
+ labelimage.setLineWrap(true);
+ labelimage.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ labelimage.setEditable(false);
+ labelimage.setBackground(SystemColor.menu);
+ labelimage.setBounds(124, 248, 101, 81);
+ JScrollPane scrollPaneImage = new JScrollPane(labelimage);
+ scrollPaneImage.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
+ scrollPaneImage.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
+ scrollPaneImage.setBounds(124, 284, 101, 81);
+ panel.add(scrollPaneImage);
+
+ labelName = new JTextArea();
+ labelName.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ labelName.setBackground(SystemColor.menu);
+ labelName.setBounds(124, 22, 101, 55);
+ JScrollPane scrollPaneName = new JScrollPane(labelName);
+ scrollPaneName.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
+ scrollPaneName.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
+ scrollPaneName.setBounds(124, 22, 101, 55);
+ panel.add(scrollPaneName);
+
+ button = new JButton("L\u00F6schen");
+ button.setBounds(469, 606, 118, 23);
+ getContentPane().add(button);
+ button.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ String lectureID="";
+ int eingabe;
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ //check if a row is selected
+ if (tablemyLectures.getSelectedRowCount() !=0){
+ //a row is selected
+ //ask for confirmation
+ eingabe = JOptionPane.showConfirmDialog(null,
+ "Wollen Sie diese Daten l\u00f6schen?", "L\u00f6schen?",
+ JOptionPane.YES_NO_OPTION);
+
+ if (eingabe == JOptionPane.YES_OPTION) {
+ //user has confirmed deletion, now get the ID of the selected lecture
+ lectureID = modelMyLectures.getValueAt(tablemyLectures.convertColumnIndexToModel(tablemyLectures.getSelectedRow()), 8).toString();
+ System.out.println("L\u00f6sche Lecture "+lectureID);
+ try {
+ if(client.deleteLecture(lectureID, person.verantwortlicher.getHochschule(),person.verantwortlicher.getUsername())){
+ System.out.println("L\u00f6schen erfolgreich");
+ //delete successful
+
+ DeleteLecture_GUI dl = new DeleteLecture_GUI();
+ dl.setVisible(true);
+ dispose();
+ } else {
+ //delete not successful
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "L\u00f6schen aus Datenbank fehlgeschlagen.",
+ "Fehler",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }//end delete
+ }//end ask for confirmation
+
+ }//end check if a row is selected
+ else if (tableAllLectures.getSelectedRowCount() !=0 && tableAllLectures.getValueAt(tableAllLectures.getSelectedRow(), 5).toString().equals(username)){
+ //a row is selected
+ //ask for confirmation
+ eingabe = JOptionPane.showConfirmDialog(null,
+ "Wollen Sie diese Daten l\u00f6schen?", "L\u00f6schen?",
+ JOptionPane.YES_NO_OPTION);
+
+ if (eingabe == JOptionPane.YES_OPTION) {
+ //user has confirmed deletion, now get the ID of the selected lecture
+ lectureID = tableAllLectures.getValueAt(tableAllLectures.convertColumnIndexToModel(tableAllLectures.getSelectedRow()), 8).toString();
+ System.out.println("L\u00f6sche Lecture "+lectureID);
+ try {
+ if(client.deleteLecture(lectureID, person.verantwortlicher.getHochschule(),person.verantwortlicher.getUsername())){
+ System.out.println("L\u00f6schen erfolgreich");
+ //delete successful
+
+ DeleteLecture_GUI dl = new DeleteLecture_GUI();
+ dl.setVisible(true);
+ dispose();
+ } else {
+ //delete not successful
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "L\u00f6schen aus Datenbank fehlgeschlagen.",
+ "Fehler",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }//end delete
+ }//end ask for confirmation
+
+ }//end check if a row is selected
+
+ }
+ });
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
@@ -477,13 +646,14 @@ public class DeleteLecture_GUI extends JFrame {
}
// Initiale Beffuelung eines Table models
- public DefaultTableModel initTableModel(DefaultTableModel model) {
+ public DefaultTableModel initTableModel(DefaultTableModel model) throws ParseException {
List<server.Lecture> lectures;
try {
// Hole eine Liste der Images
lectures = client.getLectureList();
Iterator<server.Lecture> i = lectures.iterator();
-
+ SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+ SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");
int x = 0;
while (i.hasNext()) {
@@ -491,11 +661,11 @@ public class DeleteLecture_GUI extends JFrame {
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,
+ out.format(in.parse(lectures.get(x).starttime)) + " "
+ + out.format(in.parse(lectures.get(x).endtime)),
+ lectures.get(x).isActive, out.format(in.parse(lectures.get(x).lastused)),
lectures.get(x).username,
- lectures.get(x).imagename,lectures.get(x).id };
+ lectures.get(x).imagename," " ,lectures.get(x).id };
// Fuege diese Objekte der Tabelle hinzu
model.addRow(obj);
x++;
@@ -510,4 +680,20 @@ public class DeleteLecture_GUI extends JFrame {
}
return model;
}
+ public void writeLectureData(String id) throws TException, ParseException{
+
+ SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+ SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");
+ Map<String,String> res=client.getLectureData(id);
+ labelName.setText(res.get("name"));
+ labelAktiv.setText(res.get("isActive"));
+ labeldesc.setText(res.get("desc"));
+ labelVerantwortlicher.setText(res.get("owner"));
+ labelstartdate.setText(out.format(in.parse(res.get("startTime"))));
+ labelenddate.setText(out.format(in.parse(res.get("endTime"))));
+ labelimage.setText(res.get("imagepath").substring(res.get("imagepath").indexOf("/")+1));
+ labelimageversion.setText(res.get("imageversion"));
+
+
+}
}