summaryrefslogtreecommitdiffstats
path: root/Dozentenmodul/src/gui/lecture/EditLectureSearch_GUI.java
diff options
context:
space:
mode:
Diffstat (limited to 'Dozentenmodul/src/gui/lecture/EditLectureSearch_GUI.java')
-rw-r--r--Dozentenmodul/src/gui/lecture/EditLectureSearch_GUI.java567
1 files changed, 285 insertions, 282 deletions
diff --git a/Dozentenmodul/src/gui/lecture/EditLectureSearch_GUI.java b/Dozentenmodul/src/gui/lecture/EditLectureSearch_GUI.java
index 7484915e..f6a381c3 100644
--- a/Dozentenmodul/src/gui/lecture/EditLectureSearch_GUI.java
+++ b/Dozentenmodul/src/gui/lecture/EditLectureSearch_GUI.java
@@ -84,29 +84,27 @@ public class EditLectureSearch_GUI extends JFrame {
JTable tablemyLectures;
private JTextField textFieldName;
JTabbedPane tabbedPane;
- boolean activeSearch=false;
+ boolean activeSearch = false;
String[] titles = { "Veranstaltungsname", "Beschreibung",
"G\u00fcltigkeitsdatum", "Aktiv", "Letzte Benutzung",
"Verantwortlicher", "Image", "Schlagwort", "ID" };
ThriftConnection con = new ThriftConnection();
Client client = models.Client.clientcon.getClient();
- final DefaultTableModel modelAll = new DefaultTableModel(titles, 0){
- public boolean isCellEditable(int rowIndex, int mColIndex) {
- return false;
- }
+ final DefaultTableModel modelAll = new DefaultTableModel(titles, 0) {
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
};
- final DefaultTableModel modelMyLectures = new DefaultTableModel(titles, 0){
- public boolean isCellEditable(int rowIndex, int mColIndex) {
- return false;
- }
+ final DefaultTableModel modelMyLectures = new DefaultTableModel(titles, 0) {
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
};
final TableRowSorter<TableModel> rowSorterAll = new TableRowSorter<TableModel>(
modelAll);
final TableRowSorter<TableModel> rowSorterMyLectures = new TableRowSorter<TableModel>(
modelMyLectures);
-
-
/**
* Create the dialog.
*/
@@ -118,6 +116,7 @@ public class EditLectureSearch_GUI extends JFrame {
con.closeThriftConnection();
System.exit(0);
}
+
@Override
public void windowOpened(WindowEvent arg0) {
textFieldName.requestFocusInWindow();
@@ -129,6 +128,14 @@ public class EditLectureSearch_GUI extends JFrame {
// TODO Auto-generated catch block
e.printStackTrace();
}
+
+ // auszublendende Angaben
+ // 1=Beschreibung
+ // 2=G\u00fcltigkeitsdatum
+ // 3=Aktiv
+ // 6=Image
+ // 7=Schlagwort
+ // 8=ID
tablemyLectures.getColumnModel().getColumn(1).setWidth(0);
tablemyLectures.getColumnModel().getColumn(1).setMinWidth(0);
tablemyLectures.getColumnModel().getColumn(1).setMaxWidth(0);
@@ -147,6 +154,7 @@ public class EditLectureSearch_GUI extends JFrame {
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);
@@ -233,15 +241,15 @@ public class EditLectureSearch_GUI extends JFrame {
String stext = textFieldName.getText();
// Wenn Textfield nicht leer
if (stext != "") {
- activeSearch=true;
+ activeSearch = true;
// Filtere nach der Eingabe
rowSorterAll.setRowFilter(RowFilter.regexFilter(
textFieldName.getText(), 0));
rowSorterMyLectures.setRowFilter(RowFilter.regexFilter(
textFieldName.getText(), 0));
- }else{
- activeSearch=false;
+ } else {
+ activeSearch = false;
String username = person.verantwortlicher.getName() + " "
+ person.verantwortlicher.getVorname();
rowSorterMyLectures.setRowFilter(RowFilter.regexFilter(
@@ -260,7 +268,7 @@ public class EditLectureSearch_GUI extends JFrame {
@Override
public void mouseClicked(MouseEvent arg0) {
// oeffnet das Hauptmenue
-
+
EditLectureSearch_GUI.this.setVisible(false);
MainMenue_GUI main = new MainMenue_GUI();
main.setVisible(true);
@@ -305,66 +313,61 @@ public class EditLectureSearch_GUI extends JFrame {
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.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();
tableAllLectures.getColumnModel().getColumn(3).sizeWidthToFit();
tableAllLectures.getColumnModel().getColumn(4).sizeWidthToFit();
tableAllLectures.getColumnModel().getColumn(5).sizeWidthToFit();
-
JScrollPane scrollPaneMyImage = new JScrollPane();
tablemyLectures = new JTable();
- tablemyLectures.getSelectionModel().addListSelectionListener( new ListSelectionListener()
- {
- public void valueChanged(ListSelectionEvent e)
- {
- String imageid = modelMyLectures
- .getValueAt(
+ 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();
- }
- }
- });
+ .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();
@@ -392,7 +395,7 @@ public class EditLectureSearch_GUI extends JFrame {
btnBack.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// oeffnet das Hauptmenue
-
+
MainMenue_GUI main = new MainMenue_GUI();
main.setVisible(true);
dispose();
@@ -406,186 +409,185 @@ public class EditLectureSearch_GUI extends JFrame {
JButton btnContinue = new JButton("Weiter");
btnContinue.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- String username = person.verantwortlicher.getName() + " "
- + person.verantwortlicher.getVorname();
+ String username = person.verantwortlicher.getName()
+ + " " + person.verantwortlicher.getVorname();
// check if a row is selected
if (tablemyLectures.getSelectedRow() != -1) {
// a row is selected, do operations
-
-
- 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
+ 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());
+
+ int zweitesLeerzeichen = date.indexOf(" ",
+ date.indexOf(" ") + 1);
+
+ String startdate = date.substring(0,
+ zweitesLeerzeichen);
+ String enddate = date.substring(zweitesLeerzeichen);
+ SimpleDateFormat out = new SimpleDateFormat(
+ "yyyy-MM-dd HH:mm:ss");
+ SimpleDateFormat in = new SimpleDateFormat(
+ "dd.MM.yyyy HH:mm:ss");
+ try {
+ enddate = out.format(in.parse(enddate));
+ startdate = out.format(in.parse(startdate));
+ } catch (ParseException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
+
+ DateFormat df = new SimpleDateFormat(
+ "yyyy-MM-dd HH:mm:ss");
+
+ try {
+ // Format has to be "yyyy-MM-dd HH:mm:ss"
+ 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);
+ }
+
+ // EditImageAllgemein_GUI ea=new
+ // EditImageAllgemein_GUI();
+ EditLectureAllgemein_GUI el = new EditLectureAllgemein_GUI();
+ el.setVisible(true);
+ dispose();
+ } else if (tableAllLectures.getSelectedRow() != -1
+ && tableAllLectures
.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());
-
- int zweitesLeerzeichen = date.indexOf(" ",
- date.indexOf(" ") + 1);
-
- String startdate = date.substring(0,
- zweitesLeerzeichen);
- String enddate = date
- .substring(zweitesLeerzeichen);
- SimpleDateFormat out=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- SimpleDateFormat in=new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
- try {
- enddate=out.format(in.parse(enddate));
- startdate=out.format(in.parse(startdate));
- } catch (ParseException e2) {
- // TODO Auto-generated catch block
- e2.printStackTrace();
- }
-
- DateFormat df = new SimpleDateFormat(
- "yyyy-MM-dd HH:mm:ss");
-
- try {
- // Format has to be "yyyy-MM-dd HH:mm:ss"
- 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);
- }
-
-
- // EditImageAllgemein_GUI ea=new
- // EditImageAllgemein_GUI();
- EditLectureAllgemein_GUI el = new EditLectureAllgemein_GUI();
- el.setVisible(true);
- dispose();
- } else if (tableAllLectures.getSelectedRow() != -1 && tableAllLectures.getValueAt(tableAllLectures.getSelectedRow(), 5).toString().equals(username)) {
-
- // a row is selected, do operations
-
-
-
- Lecture.lecture.setid(modelAll
- .getValueAt(
- tableAllLectures
- .convertRowIndexToModel(tableAllLectures
- .getSelectedRow()),
- 8).toString());
- Lecture.lecture.setName(modelAll
- .getValueAt(
- tableAllLectures
- .convertRowIndexToModel(tableAllLectures
- .getSelectedRow()),
- 0).toString());
- Lecture.lecture.setDesc(modelAll
- .getValueAt(
- tableAllLectures
- .convertRowIndexToModel(tableAllLectures
- .getSelectedRow()),
- 1).toString());
- String date = modelAll
- .getValueAt(
- tableAllLectures
- .convertRowIndexToModel(tableAllLectures
- .getSelectedRow()),
- 2).toString();
-
- Lecture.lecture.setLinkedImagename(modelAll
- .getValueAt(
- tableAllLectures
- .convertRowIndexToModel(tableAllLectures
- .getSelectedRow()),
- 6).toString());
-
- int zweitesLeerzeichen = date.indexOf(" ",
- date.indexOf(" ") + 1);
-
- String startdate = date.substring(0,
- zweitesLeerzeichen);
- String enddate = date
- .substring(zweitesLeerzeichen);
- SimpleDateFormat out=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- SimpleDateFormat in=new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
- try {
- enddate=out.format(in.parse(enddate));
- startdate=out.format(in.parse(startdate));
- } catch (ParseException e2) {
- // TODO Auto-generated catch block
- e2.printStackTrace();
- }
- DateFormat df = new SimpleDateFormat(
- "yyyy-MM-dd HH:mm:ss");
-
- try {
- // Format has to be "yyyy-MM-dd HH:mm:ss"
- Lecture.lecture.setEnddate(df
- .parse(enddate));
- Lecture.lecture.setStartdate(df
- .parse(startdate));
- } catch (ParseException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- if (modelAll
- .getValueAt(
- tableAllLectures
- .convertRowIndexToModel(tableAllLectures
- .getSelectedRow()),
- 3).toString().equals("1")) {
- Lecture.lecture.setActive(true);
- } else {
- Lecture.lecture.setActive(false);
- }
-
- EditLectureAllgemein_GUI el = new EditLectureAllgemein_GUI();
- el.setVisible(true);
- dispose();
- }else {
- JOptionPane
- .showMessageDialog(
- null,
- "Bitte w\u00e4hlen Sie ein eigenes Image aus.",
- "Message",
- JOptionPane.INFORMATION_MESSAGE);
- } //End Else
- } //Action
-
-
+ tableAllLectures
+ .getSelectedRow(), 5)
+ .toString().equals(username)) {
+
+ // a row is selected, do operations
+
+ Lecture.lecture.setid(modelAll
+ .getValueAt(
+ tableAllLectures
+ .convertRowIndexToModel(tableAllLectures
+ .getSelectedRow()),
+ 8).toString());
+ Lecture.lecture.setName(modelAll
+ .getValueAt(
+ tableAllLectures
+ .convertRowIndexToModel(tableAllLectures
+ .getSelectedRow()),
+ 0).toString());
+ Lecture.lecture.setDesc(modelAll
+ .getValueAt(
+ tableAllLectures
+ .convertRowIndexToModel(tableAllLectures
+ .getSelectedRow()),
+ 1).toString());
+ String date = modelAll
+ .getValueAt(
+ tableAllLectures
+ .convertRowIndexToModel(tableAllLectures
+ .getSelectedRow()),
+ 2).toString();
+
+ Lecture.lecture.setLinkedImagename(modelAll
+ .getValueAt(
+ tableAllLectures
+ .convertRowIndexToModel(tableAllLectures
+ .getSelectedRow()),
+ 6).toString());
+
+ int zweitesLeerzeichen = date.indexOf(" ",
+ date.indexOf(" ") + 1);
+
+ String startdate = date.substring(0,
+ zweitesLeerzeichen);
+ String enddate = date.substring(zweitesLeerzeichen);
+ SimpleDateFormat out = new SimpleDateFormat(
+ "yyyy-MM-dd HH:mm:ss");
+ SimpleDateFormat in = new SimpleDateFormat(
+ "dd.MM.yyyy HH:mm:ss");
+ try {
+ enddate = out.format(in.parse(enddate));
+ startdate = out.format(in.parse(startdate));
+ } catch (ParseException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
+ DateFormat df = new SimpleDateFormat(
+ "yyyy-MM-dd HH:mm:ss");
+
+ try {
+ // Format has to be "yyyy-MM-dd HH:mm:ss"
+ Lecture.lecture.setEnddate(df.parse(enddate));
+ Lecture.lecture.setStartdate(df
+ .parse(startdate));
+ } catch (ParseException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ if (modelAll
+ .getValueAt(
+ tableAllLectures
+ .convertRowIndexToModel(tableAllLectures
+ .getSelectedRow()),
+ 3).toString().equals("1")) {
+ Lecture.lecture.setActive(true);
+ } else {
+ Lecture.lecture.setActive(false);
+ }
+
+ EditLectureAllgemein_GUI el = new EditLectureAllgemein_GUI();
+ el.setVisible(true);
+ dispose();
+ } else {
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Bitte w\u00e4hlen Sie ein eigenes Image aus.",
+ "Message",
+ JOptionPane.INFORMATION_MESSAGE);
+ } // End Else
+ } // Action
+
});
btnContinue.setActionCommand("Cancel");
buttonPane.add(btnContinue);
@@ -604,64 +606,63 @@ public class EditLectureSearch_GUI extends JFrame {
panel.setLayout(null);
panel.setBorder(new TitledBorder(null, "Detailinformationen",
- TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ 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, 98, 104, 14);
panel.add(lblAktiv);
-
+
labelAktiv = new JLabel("");
labelAktiv.setBounds(10, 114, 218, 14);
panel.add(labelAktiv);
-
+
labelstartdate = new JLabel("");
labelstartdate.setBounds(10, 147, 218, 14);
panel.add(labelstartdate);
-
+
JLabel lblStartdatum = new JLabel("Startdatum:");
lblStartdatum.setBounds(10, 129, 104, 14);
panel.add(lblStartdatum);
-
+
labelenddate = new JLabel("");
labelenddate.setBounds(10, 175, 218, 14);
panel.add(labelenddate);
-
+
JLabel lblEnddatum = new JLabel("Enddatum:");
lblEnddatum.setBounds(10, 161, 104, 14);
panel.add(lblEnddatum);
-
+
JLabel lblBeschreibung = new JLabel("Beschreibung:");
lblBeschreibung.setBounds(10, 189, 104, 14);
panel.add(lblBeschreibung);
-
+
JLabel lblImage = new JLabel("Image:");
lblImage.setBounds(10, 293, 104, 14);
panel.add(lblImage);
-
+
labelVerantwortlicher = new JLabel("");
labelVerantwortlicher.setBounds(10, 426, 218, 14);
panel.add(labelVerantwortlicher);
-
+
JLabel lblVerantwortlicher = new JLabel("Verantwortlicher:");
lblVerantwortlicher.setBounds(10, 411, 104, 14);
panel.add(lblVerantwortlicher);
-
+
JLabel lblImageversion = new JLabel("Imageversion:");
lblImageversion.setBounds(10, 381, 104, 14);
panel.add(lblImageversion);
-
+
labelimageversion = new JLabel("");
labelimageversion.setBounds(10, 399, 218, 14);
panel.add(labelimageversion);
-
-
+
labeldesc = new JTextArea();
labeldesc.setFont(new Font("Tahoma", Font.PLAIN, 11));
labeldesc.setEditable(false);
@@ -671,8 +672,8 @@ public class EditLectureSearch_GUI extends JFrame {
JScrollPane scrollPane = new JScrollPane(labeldesc);
scrollPane.setBounds(10, 209, 218, 81);
panel.add(scrollPane);
- //panel.add(labeldesc);
-
+ // panel.add(labeldesc);
+
labelimage = new JTextArea();
labelimage.setLineWrap(true);
labelimage.setFont(new Font("Tahoma", Font.PLAIN, 11));
@@ -682,7 +683,7 @@ public class EditLectureSearch_GUI extends JFrame {
JScrollPane scrollPaneImage = new JScrollPane(labelimage);
scrollPaneImage.setBounds(10, 309, 215, 69);
panel.add(scrollPaneImage);
-
+
labelName = new JTextArea();
labelName.setEditable(false);
labelName.setFont(new Font("Tahoma", Font.PLAIN, 11));
@@ -691,8 +692,8 @@ public class EditLectureSearch_GUI extends JFrame {
JScrollPane scrollPaneName = new JScrollPane(labelName);
scrollPaneName.setBounds(10, 40, 218, 55);
panel.add(scrollPaneName);
- //panel.add(labelName);
- //panel.add(labelimage);
+ // panel.add(labelName);
+ // panel.add(labelimage);
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
@@ -703,15 +704,15 @@ public class EditLectureSearch_GUI extends JFrame {
mntmFaq.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
-
+
OpenLinks open = new OpenLinks();
-
+
URI windows;
try {
windows = new URI(Links.getFAQ());
-
+
open.openWebpage(windows);
-
+
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -719,7 +720,6 @@ public class EditLectureSearch_GUI extends JFrame {
}
});
mnNewMenu_1.add(mntmFaq);
-
JMenuItem mntmOtrs = new JMenuItem("OTRS");
mntmOtrs.addMouseListener(new MouseAdapter() {
@@ -727,22 +727,22 @@ public class EditLectureSearch_GUI extends JFrame {
public void mousePressed(MouseEvent arg0) {
OpenLinks open = new OpenLinks();
-
+
URI windows;
try {
windows = new URI(Links.getOTRS());
-
+
open.openWebpage(windows);
-
+
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
-
+
}
});
mnNewMenu_1.add(mntmOtrs);
-
+
JMenuItem mntmAbout = new JMenuItem("About");
mntmAbout.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@@ -755,30 +755,32 @@ public class EditLectureSearch_GUI extends JFrame {
}
// Initiale Beffuelung eines Table models
- public DefaultTableModel initTableModel(DefaultTableModel model) throws ParseException {
+ 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");
+ 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 = {
lectures.get(x).lecturename,
lectures.get(x).desc,
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).isActive,
+ out.format(in.parse(lectures.get(x).lastused)),
+ lectures.get(x).username, lectures.get(x).imagename,
+ " ", lectures.get(x).id };
// Fuege diese Objekte der Tabelle hinzu
model.addRow(obj);
-
+
x++;
i.next();
@@ -791,21 +793,22 @@ public class EditLectureSearch_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);
+
+ 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));
+ labelimage.setText(res.get("imagepath").substring(
+ res.get("imagepath").indexOf("/") + 1));
labelimageversion.setText(res.get("imageversion"));
-
-}
+ }
}