diff options
Diffstat (limited to 'dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java')
| -rw-r--r-- | dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java | 59 |
1 files changed, 50 insertions, 9 deletions
diff --git a/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java b/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java index af2ef7e6..415aea3c 100644 --- a/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java @@ -147,7 +147,8 @@ public class EditLectureLink_GUI extends JFrame { try { initTableModel(modelAll); initTableModel(modelMyImages); - initTableModel(modelPublicVorlagen); + //initTableModel(modelPublicVorlagen); + initTableModelTemplates(modelPublicVorlagen); } catch (TException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -442,7 +443,7 @@ public class EditLectureLink_GUI extends JFrame { public void valueChanged(ListSelectionEvent e) { String imageid = modelMyImages.getValueAt( tablemyImages - .convertRowIndexToModel(tablemyImages + .convertRowIndexToModel(tablemyImages //selber fehler wie bei image .getSelectedRow()), 6) .toString(); String version = modelMyImages.getValueAt( @@ -551,7 +552,7 @@ public class EditLectureLink_GUI extends JFrame { .toString(); try { DateFormat formatter = new SimpleDateFormat( - "yyyy-MM-dd hh:mm:ss"); + "yyyy-MM-dd HH:mm:ss"); // update the lecture client.updateLecturedata( @@ -670,7 +671,7 @@ public class EditLectureLink_GUI extends JFrame { .toString(); try { DateFormat formatter = new SimpleDateFormat( - "yyyy-MM-dd hh:mm:ss"); + "yyyy-MM-dd HH:mm:ss"); client.updateLecturedata( Lecture.lecture.getName(), Lecture.lecture.getNewName(), @@ -780,7 +781,7 @@ public class EditLectureLink_GUI extends JFrame { .toString(); try { DateFormat formatter = new SimpleDateFormat( - "yyyy-MM-dd hh:mm:ss"); + "yyyy-MM-dd HH:mm:ss"); client.updateLecturedata( Lecture.lecture.getName(), Lecture.lecture.getNewName(), @@ -1107,8 +1108,8 @@ public class EditLectureLink_GUI extends JFrame { .getUserID()); Iterator<server.generated.Image> i = images.iterator(); - SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); + 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()) { @@ -1130,11 +1131,51 @@ public class EditLectureLink_GUI extends JFrame { return model; } + + + // Initiale Beffuelung eines Table models + public DefaultTableModel initTableModelTemplates(DefaultTableModel model) + throws TException, ParseException { + List<server.generated.Image> images; + + // Hole eine Liste der Images + //images = client.getImageListPermissionLink(person.verantwortlicher.getUserID()); + images = client.getImageListAllTemplates(); + + Iterator<server.generated.Image> i = images.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()) { + // erzeuge Objekte fuer die Tabelle + Object[] obj = { images.get(x).getImageName(), + images.get(x).getLicenseRestriction(), + images.get(x).getOsName(), images.get(x).getLectureName(), + images.get(x).getUserData(), + out.format(in.parse(images.get(x).updateTime)), + images.get(x).id, images.get(x).getVersion(), + images.get(x).getIsTemplate() }; + // Fuege diese Objekte der Tabelle hinzu + model.addRow(obj); + x++; + i.next(); + + } + + return model; + + } + + + + + public void writeImageData(String id, String version) { try { - SimpleDateFormat in = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - SimpleDateFormat out = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss"); + 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.getImageData(id, version); labelName.setText(res.get("name")); labelOS.setText(res.get("os")); |
