summaryrefslogtreecommitdiffstats
path: root/Dozentenmodul/src/main/java/gui
diff options
context:
space:
mode:
authorSimon Rettberg2014-07-14 20:58:42 +0200
committerSimon Rettberg2014-07-14 20:58:42 +0200
commit67511b8aad6c1162bbd8ba01e1d4cd9a0bb1e107 (patch)
tree82b1d287d0b7304d2c5b8bc4d958694fd8fd2b4d /Dozentenmodul/src/main/java/gui
parentConverted DMS to Maven project (1/2) (diff)
downloadtutor-module-67511b8aad6c1162bbd8ba01e1d4cd9a0bb1e107.tar.gz
tutor-module-67511b8aad6c1162bbd8ba01e1d4cd9a0bb1e107.tar.xz
tutor-module-67511b8aad6c1162bbd8ba01e1d4cd9a0bb1e107.zip
mavenization on its way...
Diffstat (limited to 'Dozentenmodul/src/main/java/gui')
-rw-r--r--Dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java355
-rw-r--r--Dozentenmodul/src/main/java/gui/image/CreateImageFreigabe_GUI.java264
-rw-r--r--Dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java405
-rw-r--r--Dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java633
-rw-r--r--Dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java424
-rw-r--r--Dozentenmodul/src/main/java/gui/image/EditImageFreigabe_GUI.java262
-rw-r--r--Dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java403
-rw-r--r--Dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java547
-rw-r--r--Dozentenmodul/src/main/java/gui/image/FTPDownloader_GUI.java484
-rw-r--r--Dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java538
-rw-r--r--Dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java596
-rw-r--r--Dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java529
-rw-r--r--Dozentenmodul/src/main/java/gui/image/SearchMethodLecture_GUI.java290
-rw-r--r--Dozentenmodul/src/main/java/gui/intro/About_GUI.java95
-rw-r--r--Dozentenmodul/src/main/java/gui/intro/BillOfRights_GUI.java241
-rw-r--r--Dozentenmodul/src/main/java/gui/intro/Login_GUI.java336
-rw-r--r--Dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java462
-rw-r--r--Dozentenmodul/src/main/java/gui/intro/VmWareLink_GUI.java292
-rw-r--r--Dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java545
-rw-r--r--Dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java540
-rw-r--r--Dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java495
-rw-r--r--Dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java454
-rw-r--r--Dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java532
-rw-r--r--Dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java563
-rw-r--r--Dozentenmodul/src/main/java/gui/lecture/ExtendedSearchForImages_GUI.java269
-rw-r--r--Dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java453
26 files changed, 11007 insertions, 0 deletions
diff --git a/Dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java b/Dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java
new file mode 100644
index 00000000..6231c6f2
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/image/CreateImageAllgemein_GUI.java
@@ -0,0 +1,355 @@
+package gui.image;
+
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+
+import models.Image;
+import models.Links;
+import models.person;
+import util.GuiOrganizer;
+import util.OpenLinks;
+
+@SuppressWarnings("serial")
+public class CreateImageAllgemein_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ private JTextField Vorname;
+ private JTextField Nachname;
+ private JTextField Hochschule;
+ private JTextField EMail;
+ private JTextField imagename;
+
+ /**
+ * Create the dialog.
+ */
+ public CreateImageAllgemein_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ //Beendet das Fenster auf X
+ System.exit(0);
+ }
+ @Override
+ public void windowOpened(WindowEvent arg0) {
+ imagename.requestFocusInWindow();
+ }
+ });
+ //Verhindert das Vergroessern des Fensters
+ setResizable(false);
+
+ try {
+ //setzt das Look & Feel
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e.getCause()+"\n"+e.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ //Setzt den Titel
+ setTitle("bwLehrpool Suite *Prototyp* - Image erzeugen");
+ //Zentriert das Fenster
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 577, 57);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Eingabe Ihrer Daten");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie.setText("Geben Sie hier bitte einen sprechenden Imagename sowie Ihre Kontaktdaten an");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 493);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Informationen zum Besitzer", TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 66, 557, 369);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JLabel label = new JLabel("Vorname: *");
+ label.setBackground(SystemColor.menu);
+ label.setBounds(10, 245, 125, 20);
+ panel_1.add(label);
+
+ Vorname = new JTextField();
+ Vorname.setEnabled(false);
+ Vorname.setEditable(false);
+ Vorname.setBackground(Color.WHITE);
+ Vorname.setText(person.verantwortlicher.getVorname());
+ Vorname.setColumns(10);
+ Vorname.setBounds(145, 245, 350, 20);
+ panel_1.add(Vorname);
+
+ JLabel label_7 = new JLabel("Nachname: *");
+ label_7.setBackground(SystemColor.menu);
+ label_7.setBounds(10, 276, 125, 20);
+ panel_1.add(label_7);
+
+ Nachname = new JTextField();
+ Nachname.setEnabled(false);
+ Nachname.setEditable(false);
+ Nachname.setBackground(Color.WHITE);
+ Nachname.setText(person.verantwortlicher.getName());
+ Nachname.setColumns(10);
+ Nachname.setBounds(145, 276, 350, 20);
+ panel_1.add(Nachname);
+
+ JLabel label_8 = new JLabel("Hochschule: *");
+ label_8.setBackground(SystemColor.menu);
+ label_8.setBounds(10, 307, 125, 20);
+ panel_1.add(label_8);
+
+ Hochschule = new JTextField();
+ Hochschule.setEnabled(false);
+ Hochschule.setEditable(false);
+ Hochschule.setBackground(Color.WHITE);
+ Hochschule.setText(person.verantwortlicher.getHochschule());
+ Hochschule.setColumns(10);
+ Hochschule.setBounds(145, 307, 350, 20);
+ panel_1.add(Hochschule);
+
+ JLabel label_9 = new JLabel("E-Mail: *");
+ label_9.setBackground(SystemColor.menu);
+ label_9.setBounds(10, 338, 125, 20);
+ panel_1.add(label_9);
+
+ EMail = new JTextField();
+ EMail.setEnabled(false);
+ EMail.setEditable(false);
+ EMail.setBackground(Color.WHITE);
+ EMail.setText(person.verantwortlicher.getEMail());
+ EMail.setColumns(10);
+ EMail.setBounds(145, 338, 350, 20);
+ panel_1.add(EMail);
+
+ JLabel lblImagename = new JLabel("Imagename: *");
+ lblImagename.setBackground(SystemColor.menu);
+ lblImagename.setBounds(10, 31, 125, 20);
+ panel_1.add(lblImagename);
+
+
+ imagename = new JTextField();
+ imagename.setBackground(Color.WHITE);
+ imagename.setText((String) null);
+ imagename.setColumns(10);
+ imagename.setBounds(145, 31, 350, 20);
+ imagename.setText(Image.image.getImagename()); //null am Anfang, aber speichert die Eingabe, wenn man zurueck kommt zur Seite
+ panel_1.add(imagename);
+
+ JTextArea txtrGebenSieBitte = new JTextArea();
+ txtrGebenSieBitte.setEditable(false);
+ txtrGebenSieBitte.setBackground(SystemColor.menu);
+ txtrGebenSieBitte.setLineWrap(true);
+ txtrGebenSieBitte.setFont(new Font("Tahoma", Font.PLAIN, 12));
+ txtrGebenSieBitte.setText("Geben Sie bitte einen sprechenden Namen f\u00FCr das Image an.\r\nDieser soll jedoch recht allgemein gehalten werden.\r\nBeispiel: \"Programmieren\", nicht \"Programmieren 1\"");
+ txtrGebenSieBitte.setBounds(145, 62, 350, 110);
+ panel_1.add(txtrGebenSieBitte);
+
+ JPanel panel = new JPanel();
+ panel.setBounds(10, 402, 577, 33);
+ contentPanel.add(panel);
+ panel.setLayout(null);
+ panel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ panel.setBackground(SystemColor.menu);
+
+ JLabel lblPflichtfelder = new JLabel("* Pflichtfelder");
+ lblPflichtfelder.setBounds(10, 442, 136, 14);
+ contentPanel.add(lblPflichtfelder);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ //oeffnet das Hauptmenue
+ CreateImageAllgemein_GUI.this.setVisible(false);
+ MainMenue_GUI main=new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("VL-Image");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 45, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(133, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Neu");
+ lblNewLabel_1.setBounds(146, 11, 46, 14);
+ contentPanel.add(lblNewLabel_1);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton backButton = new JButton("Zur\u00FCck");
+ backButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ Image.image.setImagename(imagename.getText());
+ MainMenue_GUI sr=new MainMenue_GUI();
+ sr.setVisible(true);
+ dispose();
+ }
+ });
+ backButton.setActionCommand("Cancel");
+ buttonPane.add(backButton);
+ }
+ {
+ JButton continueButton = new JButton("Weiter");
+ continueButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ //Prueft die Eingabe
+ if(imagename.getText().isEmpty()==false && Vorname.getText().isEmpty()==false && Nachname.getText().isEmpty()==false && Hochschule.getText().isEmpty()==false&&EMail.getText().isEmpty()==false)
+ {
+ //Schreibt die Daten in das Model
+ Image.image.setImagename(imagename.getText());
+ CreateImageTechnisch_GUI ea=new CreateImageTechnisch_GUI();
+ ea.setVisible(true);
+ dispose();
+ }
+ else{
+ JOptionPane.showMessageDialog(null, "Bitte geben Sie alle notwendigen Daten an!",
+ "Daten unvollst\u00e4ndig", JOptionPane.INFORMATION_MESSAGE);
+ }
+ }
+ });
+ continueButton.setActionCommand("OK");
+ buttonPane.add(continueButton);
+ getRootPane().setDefaultButton(continueButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ 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 menuItem = new JMenuItem("About");
+ menuItem.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(menuItem);
+
+ }//end main
+}
diff --git a/Dozentenmodul/src/main/java/gui/image/CreateImageFreigabe_GUI.java b/Dozentenmodul/src/main/java/gui/image/CreateImageFreigabe_GUI.java
new file mode 100644
index 00000000..ec50440f
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/image/CreateImageFreigabe_GUI.java
@@ -0,0 +1,264 @@
+package gui.image;
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.swing.ButtonGroup;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JTextPane;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+
+import models.Image;
+import models.Links;
+import util.GuiOrganizer;
+import util.OpenLinks;
+
+@SuppressWarnings("serial")
+public class CreateImageFreigabe_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ private final ButtonGroup buttonGrouplicense = new ButtonGroup();
+ private final ButtonGroup buttonGroupInternet = new ButtonGroup();
+ JComboBox comboBox;
+
+ /**
+ * Create the dialog.
+ */
+ public CreateImageFreigabe_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ System.exit(0);
+ }
+ });
+ setResizable(false);
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("bwLehrpool Suite *Prototyp* - Image erzeugen");
+
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 577, 57);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Image Freigabe");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie
+ .setText("W\u00E4hlen Sie bitte hier die von Ihnen gew\u00FCnschte Freigabe f\u00FCr Ihr Image aus.");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 493);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Freigabe",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 51, 557, 124);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JLabel lblNewLabel_2 = new JLabel("Freigabemodus:");
+ lblNewLabel_2.setBounds(10, 55, 250, 20);
+ panel_1.add(lblNewLabel_2);
+
+ comboBox = new JComboBox();
+ comboBox.setModel(new DefaultComboBoxModel(new String[] {
+ "Lokal (Eigene Hochschule)",
+ "\u00D6ffentlich (Alle Hochschulen)" }));
+ comboBox.setSelectedIndex(0);
+ comboBox.setBounds(270, 55, 250, 20);
+ panel_1.add(comboBox);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+
+ CreateImageFreigabe_GUI.this.setVisible(false);
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("VL-Image");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 45, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(133, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Neu");
+ lblNewLabel_1.setBounds(146, 11, 46, 14);
+ contentPanel.add(lblNewLabel_1);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton cancelButton = new JButton("Zur\u00FCck");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+ Image.image.setShareMode(comboBox.getSelectedIndex());
+ CreateImageTechnisch_GUI sr = new CreateImageTechnisch_GUI();
+ sr.setVisible(true);
+ dispose();
+ }
+ });
+ cancelButton.setActionCommand("OK");
+ buttonPane.add(cancelButton);
+ // getRootPane().setDefaultButton(cancelButton);
+ }
+ {
+ JButton continueButton = new JButton("Weiter");
+ continueButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ Image.image.setShareMode(comboBox.getSelectedIndex());
+ FTPCreateUploader_GUI ea = new FTPCreateUploader_GUI();
+ ea.setVisible(true);
+ dispose();
+
+ }
+ });
+ continueButton.setActionCommand("Cancel");
+ buttonPane.add(continueButton);
+ getRootPane().setDefaultButton(continueButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu = new JMenu("Suchen");
+ menuBar.add(mnNewMenu);
+
+ JMenuItem mntmVlSuche = new JMenuItem("VL Suche");
+ mnNewMenu.add(mntmVlSuche);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ 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 menuItem = new JMenuItem("About");
+ menuItem.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(menuItem);
+
+ }
+}
diff --git a/Dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java b/Dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java
new file mode 100644
index 00000000..34594f3d
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/image/CreateImageTechnisch_GUI.java
@@ -0,0 +1,405 @@
+package gui.image;
+
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JSeparator;
+import javax.swing.JSpinner;
+import javax.swing.JTextArea;
+import javax.swing.JTextPane;
+import javax.swing.SpinnerNumberModel;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+
+import models.Image;
+import models.Links;
+import util.GuiOrganizer;
+import util.OpenLinks;
+
+@SuppressWarnings("serial")
+public class CreateImageTechnisch_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ JSpinner spinnerCPU;
+ JSpinner spinnerRam;
+ JRadioButton rdbtnlicenseJa;
+ JRadioButton rdbtnlicenseNein;
+ JRadioButton rdbtnInternetJa;
+ JRadioButton rdbtnInternetNein;
+ private final ButtonGroup buttonGrouplicense = new ButtonGroup();
+ private final ButtonGroup buttonGroupInternet = new ButtonGroup();
+
+
+ /**
+ * Create the dialog.
+ */
+ public CreateImageTechnisch_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ System.exit(0);
+ }
+ });
+ setResizable(false);
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("bwLehrpool Suite *Prototyp* - Image erzeugen");
+
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 577, 57);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Eingabe technischer Daten");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie.setText("Geben Sie hier bitte einige technische Daten ein");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 493);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Informationen zum Image", TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 66, 557, 124);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ rdbtnlicenseNein = new JRadioButton("Nein");
+ buttonGrouplicense.add(rdbtnlicenseNein);
+ rdbtnlicenseNein.setBounds(377, 29, 46, 23);
+ panel_1.add(rdbtnlicenseNein);
+
+ rdbtnInternetNein = new JRadioButton("Nein");
+ rdbtnInternetNein.setSelected(true);
+ buttonGroupInternet.add(rdbtnInternetNein);
+ rdbtnInternetNein.setBounds(377, 57, 46, 23);
+ panel_1.add(rdbtnInternetNein);
+
+ JLabel lblInternetIstInnerhalb = new JLabel("Internet ist f\u00FCr dieses Image gesperrt:");
+ lblInternetIstInnerhalb.setBounds(10, 58, 250, 20);
+ panel_1.add(lblInternetIstInnerhalb);
+
+ JButton btnInternetSettings = new JButton("Einstellungen...");
+ btnInternetSettings.setEnabled(false);
+ btnInternetSettings.setBounds(439, 57, 108, 23);
+ panel_1.add(btnInternetSettings);
+
+ rdbtnInternetJa = new JRadioButton("Ja");
+
+ buttonGroupInternet.add(rdbtnInternetJa);
+ rdbtnInternetJa.setBounds(266, 57, 41, 23);
+ panel_1.add(rdbtnInternetJa);
+
+ rdbtnlicenseJa = new JRadioButton("Ja");
+ rdbtnlicenseJa.setSelected(true);
+ buttonGrouplicense.add(rdbtnlicenseJa);
+ rdbtnlicenseJa.setBounds(266, 29, 41, 23);
+ panel_1.add(rdbtnlicenseJa);
+
+ JLabel lblNewLabel_2 = new JLabel("Image enth\u00E4lt lizenzpflichtige Software:");
+ lblNewLabel_2.setBounds(10, 30, 250, 20);
+ panel_1.add(lblNewLabel_2);
+
+ JLabel lblLizenzserverEintragen = new JLabel("Lizenzserver eintragen:");
+ lblLizenzserverEintragen.setBounds(10, 85, 250, 20);
+ panel_1.add(lblLizenzserverEintragen);
+
+ JButton btnLicenseServer = new JButton("Server-Adresse...");
+ btnLicenseServer.setEnabled(false);
+ btnLicenseServer.setBounds(266, 84, 157, 23);
+ panel_1.add(btnLicenseServer);
+
+ JPanel panel_2 = new JPanel();
+ panel_2.setLayout(null);
+ panel_2.setBorder(new TitledBorder(null, "Empfehlung bez\u00fcglich Ressourcen", TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_2.setBackground(SystemColor.menu);
+ panel_2.setBounds(11, 196, 557, 338);
+ contentPanel.add(panel_2);
+
+ JLabel lblGbyte = new JLabel("GByte");
+ lblGbyte.setBounds(424, 91, 46, 20);
+ panel_2.add(lblGbyte);
+
+ spinnerCPU = new JSpinner();
+ spinnerCPU.setModel(new SpinnerNumberModel(1, 1, 4, 1));
+ spinnerCPU.setBounds(385, 188, 29, 20);
+ panel_2.add(spinnerCPU);
+
+ JTextArea txtrBeispielWindows = new JTextArea();
+ txtrBeispielWindows.setText("Beispiel:\r\nWindows 7 32/64 Bit: 2 GByte\r\nLinux/Unix 32/64 Bit: 1 GByte");
+ txtrBeispielWindows.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ txtrBeispielWindows.setBackground(SystemColor.menu);
+ txtrBeispielWindows.setBounds(10, 122, 280, 55);
+ panel_2.add(txtrBeispielWindows);
+
+
+
+ JLabel lblKerne = new JLabel("Kerne");
+ lblKerne.setBounds(424, 191, 46, 20);
+ panel_2.add(lblKerne);
+
+ JLabel lblWieVieleCpus = new JLabel("Wie viele CPUs empfehlen Sie f\u00FCr das Image:");
+ lblWieVieleCpus.setBounds(10, 191, 280, 20);
+ panel_2.add(lblWieVieleCpus);
+
+ spinnerRam = new JSpinner();
+ spinnerRam.setModel(new SpinnerNumberModel(1, 1, 8, 1));
+ spinnerRam.setBounds(385, 88, 29, 20);
+ panel_2.add(spinnerRam);
+
+ JLabel label_3 = new JLabel("mindestens");
+ label_3.setBounds(315, 191, 60, 20);
+ panel_2.add(label_3);
+
+ JLabel lblMindestens = new JLabel("mindestens");
+ lblMindestens.setBounds(315, 91, 60, 20);
+ panel_2.add(lblMindestens);
+
+ JTextArea txtrBeispielWindows_1 = new JTextArea();
+ txtrBeispielWindows_1.setText("Beispiel:\r\nWindows 7 32/64 Bit: 1 Kern\r\nLinux/Unix 32/64 Bit: 1 Kern");
+ txtrBeispielWindows_1.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ txtrBeispielWindows_1.setBackground(SystemColor.menu);
+ txtrBeispielWindows_1.setBounds(10, 222, 280, 55);
+ panel_2.add(txtrBeispielWindows_1);
+
+ JLabel lblNewLabel_3 = new JLabel("Wie viel Arbeitsspeicher empfehlen Sie f\u00FCr das Image:");
+ lblNewLabel_3.setBounds(10, 91, 280, 20);
+ panel_2.add(lblNewLabel_3);
+
+ JTextArea txtrHinweisSolltenSie = new JTextArea();
+ txtrHinweisSolltenSie.setBackground(SystemColor.menu);
+ txtrHinweisSolltenSie.setFont(new Font("Tahoma", Font.PLAIN, 13));
+ txtrHinweisSolltenSie.setText("Hinweis: Sollten Sie keine Software einsetzen, die viele Ressourcen ben\u00F6tigt,\r\nk\u00F6nnen Sie sich an den Beispielwerten orientieren.");
+ txtrHinweisSolltenSie.setBounds(10, 25, 537, 55);
+ panel_2.add(txtrHinweisSolltenSie);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+
+ CreateImageTechnisch_GUI.this.setVisible(false);
+ MainMenue_GUI main=new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("VL-Image");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 45, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(133, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Neu");
+ lblNewLabel_1.setBounds(146, 11, 46, 14);
+ contentPanel.add(lblNewLabel_1);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton cancelButton = new JButton("Zur\u00FCck");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+ if(rdbtnInternetJa.isSelected()==true)
+ {
+ Image.image.setInternet(true);
+ }
+ else
+ {
+ Image.image.setInternet(false);
+ }
+
+ if(rdbtnlicenseJa.isSelected()==true)
+ {
+ Image.image.setLicensed(true);
+ }
+ else
+ {
+ Image.image.setLicensed(false);
+ }
+ Image.image.setCpu(Integer.valueOf(spinnerCPU.getValue().toString()).intValue());
+ Image.image.setRam(Integer.valueOf(spinnerRam.getValue().toString()).intValue());
+
+ CreateImageAllgemein_GUI sr=new CreateImageAllgemein_GUI();
+ sr.setVisible(true);
+ dispose();
+ }
+ });
+ cancelButton.setActionCommand("OK");
+ buttonPane.add(cancelButton);
+ //getRootPane().setDefaultButton(cancelButton);
+ }
+ {
+ JButton continueButton = new JButton("Weiter");
+ continueButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ if(rdbtnInternetJa.isSelected()==true)
+ {
+ Image.image.setInternet(true);
+ }
+ else
+ {
+ Image.image.setInternet(false);
+ }
+
+ if(rdbtnlicenseJa.isSelected()==true)
+ {
+ Image.image.setLicensed(true);
+ }
+ else
+ {
+ Image.image.setLicensed(false);
+ }
+ Image.image.setCpu(Integer.valueOf(spinnerCPU.getValue().toString()).intValue());
+ Image.image.setRam(Integer.valueOf(spinnerRam.getValue().toString()).intValue());
+ CreateImageFreigabe_GUI ea=new CreateImageFreigabe_GUI();
+ ea.setVisible(true);
+ dispose();
+
+ }
+ });
+ continueButton.setActionCommand("Cancel");
+ buttonPane.add(continueButton);
+ getRootPane().setDefaultButton(continueButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu = new JMenu("Suchen");
+ menuBar.add(mnNewMenu);
+
+ JMenuItem mntmVlSuche = new JMenuItem("VL Suche");
+ mnNewMenu.add(mntmVlSuche);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ 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 menuItem = new JMenuItem("About");
+ menuItem.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(menuItem);
+
+ }
+}
diff --git a/Dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java b/Dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java
new file mode 100644
index 00000000..67084a75
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/image/DeleteImage_GUI.java
@@ -0,0 +1,633 @@
+package gui.image;
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.HeadlessException;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JScrollPane;
+import javax.swing.JSeparator;
+import javax.swing.JTabbedPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.ListSelectionModel;
+import javax.swing.RowFilter;
+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.table.DefaultTableModel;
+import javax.swing.table.TableModel;
+import javax.swing.table.TableRowSorter;
+
+import models.Links;
+import models.person;
+
+import org.apache.thrift.TException;
+
+import server.Server.Client;
+import thrift.ThriftConnection;
+import util.GuiOrganizer;
+import util.OpenLinks;
+
+@SuppressWarnings("serial")
+public class DeleteImage_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ JRadioButton rdbtnInternetJa;
+ JRadioButton rdbtnInternetNein;
+ JComboBox<String> comboBox;
+ JTable tableAllImages;
+ JTable tablemyImages;
+ private JTextField textFieldName;
+ JTabbedPane tabbedPane;
+ String[] titles = { "Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung",
+ "Verantwortlicher", "Letztes Update", "Schlagwort", "ID", "Version" };
+ 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 modelMyImages = new DefaultTableModel(titles,0){
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
+ };
+ final TableRowSorter<TableModel> rowSorterAll = new TableRowSorter<TableModel>(
+ modelAll);
+ final TableRowSorter<TableModel> rowSorterMyImages = new TableRowSorter<TableModel>(
+ modelMyImages);
+
+ /**
+ * Create the dialog.
+ */
+ public DeleteImage_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ // Beendet die Anwendung nach klick auf X
+ con.closeThriftConnection();
+ System.exit(0);
+ }
+ });
+ // Verhindert das Vergroessern Des Fensters
+ setResizable(false);
+
+ try {
+ // Setzt das Look & Feel auf System
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ // Setzt den Fenstertitel
+ setTitle("bwLehrpool Suite *Prototyp* - Image l\u00F6schen");
+ // Zentriert das Fenster in die Bildmitte
+ setBounds(0, 0, 603, 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);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel(
+ "Zu l\u00F6schendes Image w\u00E4hlen");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie
+ .setText("W\u00E4hlen Sie bitte aus der unten stehenden Liste das zu l\u00F6schende Image aus.");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 531);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Filterfunktionen",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 49, 557, 131);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JLabel lblNewLabel_2 = new JLabel("Anzeigename:");
+ lblNewLabel_2.setBounds(10, 30, 250, 20);
+ panel_1.add(lblNewLabel_2);
+
+ JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:");
+ lblInternetIstInnerhalb.setBounds(10, 58, 250, 20);
+ panel_1.add(lblInternetIstInnerhalb);
+
+ textFieldName = new JTextField();
+ // Key Listener der Tastatureingabe registriert
+ textFieldName.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+ // Textfield eingabe auslesen
+ String stext = textFieldName.getText();
+
+ // Wenn Textfield nicht leer
+ if (stext != "") {
+ // Filtere nach der Eingabe
+ rowSorterAll.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+
+
+ }
+ }
+ });
+
+ textFieldName.setBounds(270, 30, 250, 20);
+ panel_1.add(textFieldName);
+ textFieldName.setColumns(10);
+
+ JLabel lblErweiterteSuche = new JLabel(
+ "<html><u>Erweiterte Suche*Folgt noch...*</u></html>");
+ lblErweiterteSuche.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+
+ // oeffnet das Fenster Extended GUI
+ con.closeThriftConnection();
+
+ // oeffnet das Fenster Extended GUI
+
+ //ExtendedSearchForImages_GUI es = new ExtendedSearchForImages_GUI();
+ //es.setVisible(true);
+ }
+ });
+ lblErweiterteSuche.setForeground(Color.BLUE);
+
+ lblErweiterteSuche.setBounds(332, 106, 188, 14);
+ panel_1.add(lblErweiterteSuche);
+
+ comboBox = new JComboBox<String>();
+ try {
+ // Holt sich eine Liste aller verf\u00FCgbaren Betriebssysteme vom Server
+ List<String> list = client.getAllOS();
+ // Leeres Item hinzufuegen
+ comboBox.addItem("");
+ for (int i = 0; i < list.size(); i++) {
+ // Hinzufuegen der verfuegbaren Betriebssysteme
+ comboBox.addItem(list.get(i));
+ }
+ } catch (TException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e2.getCause()+"\n"+e2.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ // Registriert Auswahlaenderungen der Box
+ comboBox.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ // Prueft das die Auswahl nicht leer ist
+ if (comboBox.getSelectedItem().toString() != "") {
+ // Filtert nach dem ausgewaehlten Betriebssystem
+ rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox
+ .getSelectedItem().toString(), 2));
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ comboBox.getSelectedItem().toString(), 2));
+ }
+ }
+
+ });
+ comboBox.setBounds(270, 58, 250, 20);
+ panel_1.add(comboBox);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+
+ // oeffnet das Hauuetmenue
+ con.closeThriftConnection();
+
+ // oeffnet das Hauuetmenue
+
+ DeleteImage_GUI.this.setVisible(false);
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("VL-Image");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 45, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(133, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Imageauswahl");
+ lblNewLabel_1.setBounds(146, 11, 85, 14);
+ contentPanel.add(lblNewLabel_1);
+
+ tabbedPane = new JTabbedPane(JTabbedPane.TOP);
+ tabbedPane.addChangeListener(new ChangeListener() {
+ public void stateChanged(ChangeEvent arg0) {
+ System.out.println(tabbedPane.getSelectedIndex());
+ if (tabbedPane.getSelectedIndex() == 0) {
+
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ // String username="Spitzer Tobias";
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ username, 4));
+ } else if (tabbedPane.getSelectedIndex() == 1) {
+
+ }
+
+ }
+ });
+
+ tabbedPane.setBounds(10, 197, 557, 300);
+ contentPanel.add(tabbedPane);
+ initTableModel(modelMyImages);
+
+ JScrollPane scrollPaneAllImages = new JScrollPane();
+ tableAllImages = new JTable();
+ tableAllImages.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ tableAllImages.setModel(modelAll);
+ tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit();
+ initTableModel(modelAll);
+
+ JScrollPane scrollPaneMyImage = new JScrollPane();
+ tablemyImages = new JTable();
+ tablemyImages.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ tablemyImages.setEnabled(true);
+
+ tablemyImages.setModel(modelMyImages);
+
+ tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit();
+ tablemyImages.setRowSorter(rowSorterMyImages);
+
+ scrollPaneMyImage.setViewportView(tablemyImages);
+ tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null);
+ tableAllImages.setRowSorter(rowSorterAll);
+
+ scrollPaneAllImages.setViewportView(tableAllImages);
+ tabbedPane.addTab("Alle", null, scrollPaneAllImages, null);
+
+ JScrollPane scrollPaneCoopImages = new JScrollPane();
+ JTable tableCoopImages = new JTable();
+ tableCoopImages.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ 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 Images", null, scrollPaneCoopImages,
+ null);
+ tabbedPane.setEnabledAt(2, false);
+
+ JScrollPane scrollPanePublicImages = new JScrollPane();
+ JTable tablePublicImages = new JTable();
+ tablePublicImages.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ 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 Images", null,
+ scrollPanePublicImages, null);
+ tabbedPane.setEnabledAt(3, false);
+
+ JScrollPane scrollPanePublicVorlagen = new JScrollPane();
+ JTable tablePublicVorlagen = new JTable();
+ tablePublicVorlagen
+ .setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ tablePublicVorlagen.setModel(model);
+ tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit();
+
+ scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen);
+ tabbedPane.addTab("\u00D6ffentliche Vorlagen", null,
+ scrollPanePublicVorlagen, null);
+ tabbedPane.setEnabledAt(4, false);
+
+ JButton btnDelete = new JButton("L\u00F6schen");
+ btnDelete.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+
+ String imageid="";
+ String imageversion="";
+ int eingabe;
+
+ if (tablemyImages.getSelectedRowCount() != 0) {
+
+ // frage, soll das selektierte Daten geloescht werden?
+ eingabe = JOptionPane.showConfirmDialog(null,
+ "Wollen Sie diese Daten l\u00f6schen?", "L\u00f6schen?",
+ JOptionPane.YES_NO_OPTION);
+
+ if (eingabe == JOptionPane.YES_OPTION) {
+
+ imageid = modelMyImages.getValueAt(
+ tablemyImages
+ .convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 7)
+ .toString();
+
+ imageversion = modelMyImages.getValueAt(
+ tablemyImages
+ .convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 8)
+ .toString();
+
+ // TODO
+ // Image darf nur geloescht werden, wenn keine
+ // Veranstaltung mehr auf das Image verweist.
+ // Unbdingt abfragen!
+
+ try {
+ if (!client.connectedToLecture(imageid,
+ imageversion)) {
+ System.out.println(imageid);
+ System.out.println(imageversion);
+ try {
+ client.deleteImageServer(imageid, imageversion);
+ if (client.deleteImageData(imageid,
+ imageversion)) {
+ // if (client.deleteImageServer(imageid
+ // ,imageversion)) {
+
+
+
+
+ DeleteImage_GUI di = new DeleteImage_GUI();
+ di.setVisible(true);
+ dispose();
+
+
+ /*
+ * } else {
+ *
+ * JOptionPane.showConfirmDialog(null,
+ * "Loeschen vom Server hat leider nicht geklappt!!"
+ * , imageversion,
+ * JOptionPane.OK_CANCEL_OPTION); }
+ */
+
+ } else {
+
+ JOptionPane
+ .showConfirmDialog(
+ null,
+ "L\u00f6schen von der DB hat leider nicht geklappt!!",
+ "Fehler",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+ } catch (HeadlessException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e.getCause()+"\n"+e.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ } catch (TException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e.getCause()+"\n"+e.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+
+ } else {
+
+ JOptionPane.showMessageDialog(null,
+ "Image kann nicht gel\u00f6scht werden, da mindestens eine Veranstaltung mit diesem Image verlinkt ist.",
+ "Verlinkung vorhanden", JOptionPane.INFORMATION_MESSAGE);
+ }
+ } catch (TException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e.getCause()+"\n"+e.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ }
+
+ } else {
+
+ JOptionPane.showMessageDialog(null,
+ "Bitte w\u00e4hlen Sie ein eigenes Image aus",
+ "Message", JOptionPane.INFORMATION_MESSAGE);
+ }
+
+ }
+ });
+ btnDelete.setBounds(449, 508, 118, 23);
+ contentPanel.add(btnDelete);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton okButton = new JButton("Zur\u00FCck");
+ okButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+ // oeffnet das Hauptmen\u00FC
+ con.closeThriftConnection();
+
+ // oeffnet das Hauptmenue
+
+
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ dispose();
+ }
+ });
+ okButton.setActionCommand("OK");
+ buttonPane.add(okButton);
+ getRootPane().setDefaultButton(okButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ 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 menuItem = new JMenuItem("About");
+ menuItem.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(menuItem);
+
+ }
+
+ // Initiale Beff\u00FClung eines Table models
+ public DefaultTableModel initTableModel(DefaultTableModel model) {
+ List<server.Image> images;
+ try {
+ // Hole eine Liste der Images
+ images = client.getImageList();
+
+ Iterator<server.Image> i = images.iterator();
+
+ int x = 0;
+
+ while (i.hasNext()) {
+ // erzeuge Objekte f\u00FCr die Tabelle
+ Object[] obj = { images.get(x).getImageName(),
+ images.get(x).getLicenseRestriction(),
+ images.get(x).getOsName(),
+ images.get(x).getLectureName(),
+ images.get(x).getUserData(),
+ images.get(x).getUpdateTime(), "", images.get(x).id,
+ images.get(x).getVersion() };
+ // System.out.println("id:"+images.get(x).getId());
+ // F\u00FCge diese Objekte der Tabelle hinzu
+
+ model.addRow(obj);
+ x++;
+ i.next();
+
+ }
+
+ return model;
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e1.getCause()+"\n"+e1.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ return model;
+ }
+
+}
diff --git a/Dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java b/Dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java
new file mode 100644
index 00000000..47837c22
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/image/EditImageAllgemein_GUI.java
@@ -0,0 +1,424 @@
+package gui.image;
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Map;
+
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+
+import models.Image;
+import models.Links;
+import models.person;
+
+import org.apache.thrift.TException;
+
+import server.Server.Client;
+import thrift.ThriftConnection;
+import util.GuiOrganizer;
+import util.OpenLinks;
+
+@SuppressWarnings("serial")
+public class EditImageAllgemein_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ private JTextField Vorname;
+ private JTextField Nachname;
+ private JTextField Hochschule;
+ private JTextField EMail;
+ private JTextField imagename;
+ ThriftConnection con = new ThriftConnection();
+ Client client = models.Client.clientcon.getClient();
+ private JPanel panel_2;
+ private JLabel lblNewLabel;
+ private JTextPane txtpnBitteWhlenSie;
+ private JPanel buttonPane;
+ private JButton backButton;
+ private JButton okButton;
+
+ /**
+ * Create the dialog.
+ */
+ public EditImageAllgemein_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ // Beendet die Anwendung bei einem Klick auf das X
+ con.closeThriftConnection();
+ System.exit(0);
+ }
+ });
+ // Verhindert das vergroessern des Fensters
+ setResizable(false);
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ // Setzt den Fenstertitel
+ setTitle("bwLehrpool Suite *Prototyp* - Image bearbeiten");
+
+ // Zentriert das Fenster in der Bildmitte
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+ initData();
+ getContentPane().setLayout(null);
+ {
+ panel_2 = new JPanel();
+ panel_2.setBackground(SystemColor.menu);
+ panel_2.setBounds(10, 11, 577, 57);
+ getContentPane().add(panel_2);
+ panel_2.setLayout(null);
+ {
+ lblNewLabel = new JLabel("Bearbeiten Ihrer Daten");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel_2.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie
+ .setText("Geben Sie hier bitte einen sprechenden Imagename sowie Ihre Kontaktdaten an");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel_2.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 493);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Informationen zum Besitzer",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 66, 557, 369);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JLabel label = new JLabel("Vorname: *");
+ label.setBackground(SystemColor.menu);
+ label.setBounds(10, 245, 125, 20);
+ panel_1.add(label);
+
+ Vorname = new JTextField();
+ Vorname.setEditable(false);
+ Vorname.setEnabled(false);
+ Vorname.setBackground(Color.WHITE);
+ Vorname.setText(person.verantwortlicher.getVorname());
+ Vorname.setColumns(10);
+ Vorname.setBounds(145, 245, 350, 20);
+ panel_1.add(Vorname);
+
+ JLabel label_7 = new JLabel("Nachname: *");
+ label_7.setBackground(SystemColor.menu);
+ label_7.setBounds(10, 276, 125, 20);
+ panel_1.add(label_7);
+
+ Nachname = new JTextField();
+ Nachname.setEnabled(false);
+ Nachname.setEditable(false);
+ Nachname.setBackground(Color.WHITE);
+ Nachname.setText(person.verantwortlicher.getName());
+ Nachname.setColumns(10);
+ Nachname.setBounds(145, 276, 350, 20);
+ panel_1.add(Nachname);
+
+ JLabel label_8 = new JLabel("Hochschule: *");
+ label_8.setBackground(SystemColor.menu);
+ label_8.setBounds(10, 307, 125, 20);
+ panel_1.add(label_8);
+
+ Hochschule = new JTextField();
+ Hochschule.setEnabled(false);
+ Hochschule.setEditable(false);
+ Hochschule.setBackground(Color.WHITE);
+ Hochschule.setText(person.verantwortlicher.getHochschule());
+ Hochschule.setColumns(10);
+ Hochschule.setBounds(145, 307, 350, 20);
+ panel_1.add(Hochschule);
+
+ JLabel label_9 = new JLabel("E-Mail: *");
+ label_9.setBackground(SystemColor.menu);
+ label_9.setBounds(10, 338, 125, 20);
+ panel_1.add(label_9);
+
+ EMail = new JTextField();
+ EMail.setEnabled(false);
+ EMail.setEditable(false);
+ EMail.setBackground(Color.WHITE);
+ EMail.setText(person.verantwortlicher.getEMail());
+ EMail.setColumns(10);
+ EMail.setBounds(145, 338, 350, 20);
+ panel_1.add(EMail);
+
+ JLabel lblImagename = new JLabel("Imagename: *");
+ lblImagename.setBackground(SystemColor.menu);
+ lblImagename.setBounds(10, 31, 125, 20);
+ panel_1.add(lblImagename);
+
+ imagename = new JTextField();
+ imagename
+ .setToolTipText("Bitte geben Sie hier den Namen des Image ein, z.B. \"Programmieren\".");
+ imagename.setBackground(Color.WHITE);
+ imagename.setText(Image.image.getImagename());
+ imagename.setColumns(10);
+ imagename.setBounds(145, 31, 350, 20);
+ panel_1.add(imagename);
+
+ JTextArea txtrGebenSieBitte = new JTextArea();
+ txtrGebenSieBitte.setBackground(SystemColor.menu);
+ txtrGebenSieBitte.setLineWrap(true);
+ txtrGebenSieBitte.setFont(new Font("Tahoma", Font.PLAIN, 12));
+ txtrGebenSieBitte
+ .setText("Geben Sie bitte einen sprechenden Namen f\u00FCr das Image an.\r\nDieser soll jedoch recht allgemein gehalten werden.\r\nBeispiel: \"Programmieren\", nicht \"Programmieren 1\"");
+ txtrGebenSieBitte.setBounds(145, 62, 350, 110);
+ panel_1.add(txtrGebenSieBitte);
+
+ JPanel panel = new JPanel();
+ panel.setBounds(10, 402, 577, 33);
+ contentPanel.add(panel);
+ panel.setLayout(null);
+ panel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ panel.setBackground(SystemColor.menu);
+
+ JLabel lblPflichtfelder = new JLabel("* Pflichtfelder");
+ lblPflichtfelder.setBounds(10, 442, 136, 14);
+ contentPanel.add(lblPflichtfelder);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ // Durch den Klick auf Button Hauptmenpue wird dieses Fenster
+ // unsichtbar und das Hauptmenue sichtbar
+
+ EditImageAllgemein_GUI.this.setVisible(false);
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("VL-Image");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 45, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(133, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Bearbeiten");
+ lblNewLabel_1.setBounds(146, 11, 71, 14);
+ contentPanel.add(lblNewLabel_1);
+ {
+ buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ backButton = new JButton("Zur\u00FCck");
+ backButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+ // Setzen der Eingabe im Model, dadurch bleiben die
+ // Daten bei einem erneuten Aufruf verfuegbar
+ // Image.image.setImagename(imagename.getText());
+
+ SearchEditImage_GUI se = new SearchEditImage_GUI();
+ se.setVisible(true);
+ dispose();
+ }
+ });
+ backButton.setActionCommand("CANCEL");
+ buttonPane.add(backButton);
+
+ }
+ {
+ okButton = new JButton("Weiter");
+ okButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ // check is textfield is empty
+ if (imagename.getText().length() <= 0) {
+ JOptionPane.showMessageDialog(null,
+ "Bitte geben Sie einen Labornamen ein.",
+ "Daten nicht vollst\u00e4ndig",
+ JOptionPane.INFORMATION_MESSAGE);
+
+ } else {
+
+ // setze Namen, egal ob alt oder nicht
+ Image.image.setImagename(imagename.getText());
+ System.out.println("Changing name to:" + imagename.getText()+ "\nNewName is: "+Image.image.getNewName());
+
+
+ EditImageTechnisch_GUI ea = new EditImageTechnisch_GUI();
+ ea.setVisible(true);
+ dispose();
+ }// end else
+ }
+ });
+
+ okButton.setActionCommand("OK");
+ buttonPane.add(okButton);
+ getRootPane().setDefaultButton(okButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ 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 menuItem = new JMenuItem("About");
+ menuItem.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(menuItem);
+ // setFocusTraversalPolicy(new FocusTraversalOnArray(new
+ // Component[]{getContentPane(), panel_2, lblNewLabel,
+ // txtpnBitteWhlenSie, contentPanel, panel_1, label, Vorname, label_7,
+ // Nachname, label_8, Hochschule, label_9, EMail, lblImagename,
+ // imagename, txtrGebenSieBitte, panel, lblPflichtfelder, lblHauptmen,
+ // label_1, lblVlimage, label_2, lblNewLabel_1, buttonPane, backButton,
+ // okButton, separator, separator_1, menuBar, mnNewMenu_1, mntmFaq,
+ // mntmOtrs}));
+
+ }
+
+ public void initData() {
+ try {
+
+ Map<String, String> map = client.getImageData(
+ Image.image.getImageId(), Image.image.getVersion());
+ if (map.get("internet").equals("0")) {
+ Image.image.setInternet(false);
+ } else {
+ Image.image.setInternet(true);
+ }
+ if (map.get("license").equals("0")) {
+ Image.image.setLicensed(false);
+ } else {
+ Image.image.setLicensed(true);
+ }
+ Image.image.setImagename(map.get("name"));
+ Image.image.setRam(Integer.parseInt(map.get("ram")));
+ Image.image.setCpu(Integer.parseInt(map.get("cpu")));
+ Image.image.setImagepath(map.get("path"));
+ Image.image.setFilesize(Long.parseLong(map.get("filesize")));
+ int mode=0;
+ if(map.get("shareMode").equals("only_local")){
+ mode=0;
+ }
+ else
+ {
+ mode=1;
+ }
+ Image.image.setShareMode(mode);
+ } catch (TException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e.getCause() + "\n" + e.getMessage(), "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
+ }
+ }
+
+}
diff --git a/Dozentenmodul/src/main/java/gui/image/EditImageFreigabe_GUI.java b/Dozentenmodul/src/main/java/gui/image/EditImageFreigabe_GUI.java
new file mode 100644
index 00000000..e28b774b
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/image/EditImageFreigabe_GUI.java
@@ -0,0 +1,262 @@
+package gui.image;
+
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.swing.ButtonGroup;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JTextPane;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+
+import models.Image;
+import models.Links;
+import util.GuiOrganizer;
+import util.OpenLinks;
+
+@SuppressWarnings("serial")
+public class EditImageFreigabe_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ private final ButtonGroup buttonGrouplicense = new ButtonGroup();
+ private final ButtonGroup buttonGroupInternet = new ButtonGroup();
+ JComboBox comboBox;
+
+ /**
+ * Create the dialog.
+ */
+ public EditImageFreigabe_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ System.exit(0);
+ }
+ });
+ setResizable(false);
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("bwLehrpool Suite *Prototyp* - Image erzeugen");
+
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 577, 57);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Image Freigabe");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie.setText("W\u00E4hlen Sie bitte hier die von Ihnen gew\u00FCnschte Freigabe f\u00FCr Ihr Image aus.");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 493);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Freigabe", TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 51, 557, 124);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JLabel lblNewLabel_2 = new JLabel("Freigabemodus:");
+ lblNewLabel_2.setBounds(10, 55, 250, 20);
+ panel_1.add(lblNewLabel_2);
+
+ comboBox = new JComboBox();
+ comboBox.setModel(new DefaultComboBoxModel(new String[] {"Lokal (Eigene Hochschule)", "\u00D6ffentlich (Alle Hochschulen)"}));
+ comboBox.setSelectedIndex(Image.image.getShareMode());
+ comboBox.setBounds(270, 55, 250, 20);
+ panel_1.add(comboBox);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+
+ EditImageFreigabe_GUI.this.setVisible(false);
+ MainMenue_GUI main=new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("VL-Image");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 45, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(133, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Neu");
+ lblNewLabel_1.setBounds(146, 11, 46, 14);
+ contentPanel.add(lblNewLabel_1);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton cancelButton = new JButton("Zur\u00FCck");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+ Image.image.setShareMode(comboBox.getSelectedIndex());
+ EditImageTechnisch_GUI sr=new EditImageTechnisch_GUI();
+ sr.setVisible(true);
+ dispose();
+ }
+ });
+ cancelButton.setActionCommand("OK");
+ buttonPane.add(cancelButton);
+ //getRootPane().setDefaultButton(cancelButton);
+ }
+ {
+ JButton continueButton = new JButton("Weiter");
+ continueButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ Image.image.setShareMode(comboBox.getSelectedIndex());
+ FTPEditUploader_GUI ea=new FTPEditUploader_GUI();
+ ea.setVisible(true);
+ dispose();
+
+ }
+ });
+ continueButton.setActionCommand("Cancel");
+ buttonPane.add(continueButton);
+ getRootPane().setDefaultButton(continueButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu = new JMenu("Suchen");
+ menuBar.add(mnNewMenu);
+
+ JMenuItem mntmVlSuche = new JMenuItem("VL Suche");
+ mnNewMenu.add(mntmVlSuche);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ 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) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(mntmAbout);
+
+ }
+}
diff --git a/Dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java b/Dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java
new file mode 100644
index 00000000..825292c2
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/image/EditImageTechnisch_GUI.java
@@ -0,0 +1,403 @@
+package gui.image;
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+
+import javax.swing.ButtonGroup;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JSeparator;
+import javax.swing.JSpinner;
+import javax.swing.JTextArea;
+import javax.swing.JTextPane;
+import javax.swing.SpinnerNumberModel;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+
+import util.GuiOrganizer;
+import util.OpenLinks;
+import models.Image;
+import models.Links;
+
+@SuppressWarnings("serial")
+public class EditImageTechnisch_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ JSpinner spinnerCPU;
+ JSpinner spinnerRam;
+ JRadioButton rdbtnlicenseJa;
+ JRadioButton rdbtnlicenseNein;
+ JRadioButton rdbtnInternetJa;
+ JRadioButton rdbtnInternetNein;
+ private final ButtonGroup buttonGrouplicense = new ButtonGroup();
+ private final ButtonGroup buttonGroupInternet = new ButtonGroup();
+
+ /**
+ * Create the dialog.
+ */
+ public EditImageTechnisch_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ // Beendet die Anwendung bei Klick auf das X
+
+ System.exit(0);
+ }
+
+ });
+ // Verhindert das Vergroe�ern des Fensters
+ setResizable(false);
+
+ try {
+ // setzt das Look & Feel
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ // Setzt den Titel des Fensters
+ setTitle("bwLehrpool Suite *Prototyp* - Image bearbeiten");
+ // Zentriert das Fenster
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 577, 57);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Eingabe technischer Daten");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie
+ .setText("Geben Sie hier bitte einige technische Daten ein.");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 493);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Informationen zum Image",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 66, 557, 95);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JLabel lblNewLabel_2 = new JLabel(
+ "Image enth\u00E4lt lizenzpflichtige Software:");
+ lblNewLabel_2.setBounds(10, 30, 250, 20);
+ panel_1.add(lblNewLabel_2);
+
+ rdbtnlicenseJa = new JRadioButton("Ja");
+ rdbtnlicenseJa.setSelected(true);
+ buttonGrouplicense.add(rdbtnlicenseJa);
+ rdbtnlicenseJa.setBounds(266, 29, 109, 23);
+ panel_1.add(rdbtnlicenseJa);
+
+ rdbtnlicenseNein = new JRadioButton("Nein");
+ buttonGrouplicense.add(rdbtnlicenseNein);
+ rdbtnlicenseNein.setBounds(377, 29, 109, 23);
+ panel_1.add(rdbtnlicenseNein);
+ if (Image.image.isLicensed() == true) {
+ rdbtnlicenseJa.setSelected(true);
+ } else {
+ rdbtnlicenseNein.setSelected(true);
+ }
+
+ JLabel lblInternetIstInnerhalb = new JLabel(
+ "Internet ist innerhalb des Image gesperrt:");
+ lblInternetIstInnerhalb.setBounds(10, 58, 250, 20);
+ panel_1.add(lblInternetIstInnerhalb);
+
+ rdbtnInternetJa = new JRadioButton("Ja");
+ buttonGroupInternet.add(rdbtnInternetJa);
+ rdbtnInternetJa.setBounds(266, 57, 109, 23);
+ panel_1.add(rdbtnInternetJa);
+
+ rdbtnInternetNein = new JRadioButton("Nein");
+ rdbtnInternetNein.setSelected(true);
+ buttonGroupInternet.add(rdbtnInternetNein);
+ rdbtnInternetNein.setBounds(377, 57, 109, 23);
+ panel_1.add(rdbtnInternetNein);
+ if (Image.image.isInternet() == true) {
+ rdbtnInternetJa.setSelected(true);
+ } else {
+ rdbtnInternetNein.setSelected(true);
+ }
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ // Macht dieses Fenster unsichtbar und das vorhergehende Fenster
+ // sichtbar
+ EditImageTechnisch_GUI.this.setVisible(false);
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("VL-Image");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 45, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(133, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Neu");
+ lblNewLabel_1.setBounds(146, 11, 46, 14);
+ contentPanel.add(lblNewLabel_1);
+
+ JPanel panel_2 = new JPanel();
+ panel_2.setLayout(null);
+ panel_2.setBorder(new TitledBorder(null,
+ "Empfehlung bez\u00fcglich Ressourcen", TitledBorder.LEADING,
+ TitledBorder.TOP, null, null));
+ panel_2.setBackground(SystemColor.menu);
+ panel_2.setBounds(10, 172, 557, 338);
+ contentPanel.add(panel_2);
+
+ JTextArea txtrHinweisSolltenSie = new JTextArea();
+ txtrHinweisSolltenSie.setBackground(SystemColor.menu);
+ txtrHinweisSolltenSie.setFont(new Font("Tahoma", Font.PLAIN, 13));
+ txtrHinweisSolltenSie
+ .setText("Hinweis: Sollten Sie keine Software einsetzen, die viele Ressourcen ben\u00F6tigt,\r\nk\u00F6nnen Sie sich an den Beispielwerten orientieren.");
+ txtrHinweisSolltenSie.setBounds(10, 25, 537, 55);
+ panel_2.add(txtrHinweisSolltenSie);
+
+ JLabel lblNewLabel_3 = new JLabel(
+ "Wie viel Arbeitsspeicher empfehlen Sie f\u00FCr das Image:");
+ lblNewLabel_3.setBounds(10, 91, 280, 20);
+ panel_2.add(lblNewLabel_3);
+
+ JLabel lblMindestens = new JLabel("mindestens");
+ lblMindestens.setBounds(315, 91, 60, 20);
+ panel_2.add(lblMindestens);
+
+ spinnerRam = new JSpinner();
+ spinnerRam.setModel(new SpinnerNumberModel(1, 1, 8, 1));
+ spinnerRam.setBounds(385, 88, 29, 20);
+ spinnerRam.setValue(Image.image.getRam());
+ panel_2.add(spinnerRam);
+
+ JLabel lblGbyte = new JLabel("GByte");
+ lblGbyte.setBounds(424, 91, 46, 20);
+ panel_2.add(lblGbyte);
+
+ JTextArea txtrBeispielWindows = new JTextArea();
+ txtrBeispielWindows
+ .setText("Beispiel:\r\nWindows 7 32/64 Bit: 2 GByte\r\nLinux/Unix 32/64 Bit: 1 GByte");
+ txtrBeispielWindows.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ txtrBeispielWindows.setBackground(SystemColor.menu);
+ txtrBeispielWindows.setBounds(20, 111, 280, 55);
+ panel_2.add(txtrBeispielWindows);
+
+ JTextArea txtrBeispielWindows_1 = new JTextArea();
+ txtrBeispielWindows_1
+ .setText("Beispiel:\r\nWindows 7 32/64 Bit: 1 Kern\r\nLinux/Unix 32/64 Bit: 1 Kern");
+ txtrBeispielWindows_1.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ txtrBeispielWindows_1.setBackground(SystemColor.menu);
+ txtrBeispielWindows_1.setBounds(20, 226, 280, 55);
+ panel_2.add(txtrBeispielWindows_1);
+
+ JLabel lblWieVieleCpus = new JLabel(
+ "Wie viele CPUs empfehlen Sie f\u00FCr das Image:");
+ lblWieVieleCpus.setBounds(10, 201, 280, 20);
+ panel_2.add(lblWieVieleCpus);
+
+ JLabel label_3 = new JLabel("mindestens");
+ label_3.setBounds(315, 201, 60, 20);
+ panel_2.add(label_3);
+
+ spinnerCPU = new JSpinner();
+ spinnerCPU.setModel(new SpinnerNumberModel(1, 1, 4, 1));
+ spinnerCPU.setBounds(385, 198, 29, 20);
+ spinnerCPU.setValue(Image.image.getCpu());
+ panel_2.add(spinnerCPU);
+
+ JLabel lblKerne = new JLabel("Kerne");
+ lblKerne.setBounds(424, 201, 46, 20);
+ panel_2.add(lblKerne);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton okButton = new JButton("Zur\u00FCck");
+ okButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ // Setzt die Imagewerte in das Model
+ Image.image.setCpu(Integer.valueOf(
+ spinnerCPU.getValue().toString()).intValue());
+ Image.image.setRam(Integer.valueOf(
+ spinnerRam.getValue().toString()).intValue());
+ if (rdbtnInternetJa.isSelected() == true) {
+ Image.image.setInternet(true);
+ } else {
+ Image.image.setInternet(false);
+ }
+
+ if (rdbtnlicenseJa.isSelected() == true) {
+ Image.image.setLicensed(true);
+ } else {
+ Image.image.setLicensed(false);
+ }
+ // oeffnet das vorherige Fenster
+ EditImageAllgemein_GUI ei = new EditImageAllgemein_GUI();
+ ei.setVisible(true);
+ dispose();
+ }
+ });
+ okButton.setActionCommand("OK");
+ buttonPane.add(okButton);
+ getRootPane().setDefaultButton(okButton);
+ }
+ {
+ JButton cancelButton = new JButton("Weiter");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ Image.image.setCpu(Integer.valueOf(
+ spinnerCPU.getValue().toString()).intValue());
+ Image.image.setRam(Integer.valueOf(
+ spinnerRam.getValue().toString()).intValue());
+ if (rdbtnInternetJa.isSelected() == true) {
+ Image.image.setInternet(true);
+ } else {
+ Image.image.setInternet(false);
+ }
+
+ if (rdbtnlicenseJa.isSelected() == true) {
+ Image.image.setLicensed(true);
+ } else {
+ Image.image.setLicensed(false);
+ }
+ // oeffnet das naechste Fenster
+ EditImageFreigabe_GUI ea=new EditImageFreigabe_GUI();
+ ea.setVisible(true);
+ dispose();
+
+ }
+ });
+ cancelButton.setActionCommand("Cancel");
+ buttonPane.add(cancelButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ 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) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(mntmAbout);
+
+ }
+}
diff --git a/Dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java b/Dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java
new file mode 100644
index 00000000..b850ccb2
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/image/FTPCreateUploader_GUI.java
@@ -0,0 +1,547 @@
+package gui.image;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.swing.JButton;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JProgressBar;
+import javax.swing.JSeparator;
+import javax.swing.JTextPane;
+import javax.swing.SwingConstants;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+
+import models.Image;
+import models.Links;
+import models.SessionData;
+import models.person;
+
+import org.apache.thrift.TException;
+
+import server.Server.Client;
+import thrift.ThriftConnection;
+import util.GuiOrganizer;
+import util.OpenLinks;
+import ftp.UploadTask;
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+@SuppressWarnings("serial")
+public class FTPCreateUploader_GUI extends JFrame implements
+ PropertyChangeListener {
+
+ @SuppressWarnings("unused")
+ private JPanel contentPane;
+ private final JPanel contentPanel = new JPanel();
+ JLabel lblPath;
+ JProgressBar progressBar;
+ String host = SessionData.session.getServerAdress();
+ int port = 21;
+ server.User user;
+ String filename = "";
+ File uploadFile;
+ static String arg = "";
+ UploadTask task;
+ JLabel UpSpeed;
+ JLabel labelfertig;
+ JLabel labelfilesize;
+ JLabel labelZeit;
+ JLabel labelverbleibend;
+ long filesize;
+ double speed;
+ long bytesread;
+ boolean taskrun = false;
+ ThriftConnection con = new ThriftConnection();
+ Client client = models.Client.clientcon.getClient();
+ JButton finishButton = new JButton("Fertigstellen");
+ JButton btnUploadStarten = new JButton("Upload auf Server starten");
+ JButton btnZurck = new JButton("Zur\u00FCck");
+ int progress = 0; // progress of upload
+
+
+ /**
+ * Create the frame.
+ */
+ public FTPCreateUploader_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ if (taskrun == true) {
+ try {
+ client.DeleteFtpUser(user.userName);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e1.getCause()+"\n"+e1.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ task.cancel(true);
+ }
+ con.closeThriftConnection();
+ System.exit(0);
+ }// end window closing
+ });
+ setResizable(false);
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e.getCause()+"\n"+e.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+
+ // filename=name;
+ setBackground(Color.WHITE);
+ setTitle("Dozentenmodul *Prototyp* - Image erzeugen");
+
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ getContentPane().setLayout(new BorderLayout());
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel, BorderLayout.CENTER);
+ contentPanel.setLayout(null);
+ {
+ JButton btnSpeicherortAuswhlen = new JButton("Image ausw\u00E4hlen");
+ btnSpeicherortAuswhlen.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ JFileChooser fc = new JFileChooser();
+ fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
+
+ fc.showOpenDialog(getParent());
+ File file = fc.getSelectedFile();
+ // check if a file is selected and exists
+ if (file != null) {
+ // file selected
+ uploadFile = file;
+ filename = uploadFile.getName();
+ lblPath.setText(file.getAbsolutePath());
+ } else {
+ // no file selected
+ lblPath.setText("");
+ }// end if
+ }
+ });
+
+ btnSpeicherortAuswhlen.setBounds(102, 124, 173, 23);
+ btnSpeicherortAuswhlen.setVerticalAlignment(SwingConstants.TOP);
+ contentPanel.add(btnSpeicherortAuswhlen);
+ }
+
+ lblPath = new JLabel("");
+ lblPath.addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent arg0) {
+ if (lblPath.getText().isEmpty()) {
+ // wenn leer, dann upload button nicht freigeben
+ btnUploadStarten.setEnabled(false);
+ btnUploadStarten.setText("Bitte warten");
+ } else {
+ // wenn leer, dann upload button nicht freigeben
+ btnUploadStarten.setEnabled(true);
+ btnUploadStarten.setText("Upload auf Server starten");
+ }
+ }
+ });
+ lblPath.setHorizontalAlignment(SwingConstants.LEFT);
+ lblPath.setBounds(102, 158, 485, 23);
+ contentPanel.add(lblPath);
+
+ btnUploadStarten.setEnabled(false);
+ btnUploadStarten.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ buttonUploadActionPerformed(arg0);
+
+ }
+ });
+
+ btnUploadStarten.setBounds(102, 200, 173, 23);
+ contentPanel.add(btnUploadStarten);
+
+ progressBar = new JProgressBar(0, 100);
+ progressBar.setStringPainted(true);
+
+ progressBar.setBounds(102, 234, 485, 30);
+ contentPanel.add(progressBar);
+
+ JLabel lblUploadgeschwindigkeit = new JLabel("Uploadgeschwindigkeit:");
+ lblUploadgeschwindigkeit.setBounds(102, 275, 141, 14);
+ contentPanel.add(lblUploadgeschwindigkeit);
+
+ JLabel label_1 = new JLabel("Fertig:");
+ label_1.setBounds(102, 325, 46, 14);
+ contentPanel.add(label_1);
+
+ labelfertig = new JLabel("0");
+ labelfertig.setHorizontalAlignment(SwingConstants.LEFT);
+ labelfertig.setBounds(183, 325, 108, 14);
+ contentPanel.add(labelfertig);
+
+ UpSpeed = new JLabel("0");
+ UpSpeed.setHorizontalAlignment(SwingConstants.LEFT);
+ UpSpeed.setBounds(374, 275, 117, 14);
+ contentPanel.add(UpSpeed);
+
+ JLabel label_4 = new JLabel("von:");
+ label_4.setBounds(318, 325, 46, 14);
+ contentPanel.add(label_4);
+
+ labelfilesize = new JLabel("0");
+ labelfilesize.setHorizontalAlignment(SwingConstants.LEFT);
+ labelfilesize.setBounds(374, 325, 117, 14);
+ contentPanel.add(labelfilesize);
+
+ JLabel label_6 = new JLabel("Verbleibend:");
+ label_6.setBounds(102, 350, 71, 14);
+ contentPanel.add(label_6);
+
+ JLabel label_7 = new JLabel("Gesch\u00E4tzte Verbleibende Zeit:");
+ label_7.setBounds(102, 300, 150, 14);
+ contentPanel.add(label_7);
+
+ labelZeit = new JLabel("0");
+ labelZeit.setHorizontalAlignment(SwingConstants.LEFT);
+ labelZeit.setBounds(374, 300, 117, 14);
+ contentPanel.add(labelZeit);
+
+ labelverbleibend = new JLabel("0");
+ labelverbleibend.setHorizontalAlignment(SwingConstants.LEFT);
+ labelverbleibend.setBounds(183, 350, 108, 14);
+ contentPanel.add(labelverbleibend);
+
+ JPanel panel = new JPanel();
+ panel.setLayout(null);
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 577, 57);
+ contentPanel.add(panel);
+
+ JLabel lblUploadIhresImage = new JLabel("Upload Ihres Image");
+ lblUploadIhresImage.setFont(new Font("Tahoma", Font.BOLD, 18));
+ lblUploadIhresImage.setBounds(10, 11, 509, 22);
+ panel.add(lblUploadIhresImage);
+
+ JTextPane txtpnFhreSieBitte = new JTextPane();
+ txtpnFhreSieBitte
+ .setText("F\u00FChre Sie bitte die folgenden 3 Schritte aus um Ihr Image auf unseren Server zu laden.");
+ txtpnFhreSieBitte.setEditable(false);
+ txtpnFhreSieBitte.setBackground(SystemColor.menu);
+ txtpnFhreSieBitte.setBounds(10, 36, 509, 32);
+ panel.add(txtpnFhreSieBitte);
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 79, 597, 2);
+ contentPanel.add(separator);
+
+ JLabel lblNewLabel_1 = new JLabel("Hauptmen\u00FC");
+ lblNewLabel_1.setForeground(Color.BLUE);
+ lblNewLabel_1.setBounds(20, 88, 61, 20);
+ contentPanel.add(lblNewLabel_1);
+
+ JLabel label_3 = new JLabel(">");
+ label_3.setBounds(80, 91, 14, 14);
+ contentPanel.add(label_3);
+
+ JLabel lblVlimage = new JLabel("VL-Image");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(91, 88, 46, 20);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_5 = new JLabel(">");
+ label_5.setBounds(139, 91, 14, 14);
+ contentPanel.add(label_5);
+
+ JLabel lblNeubearbeiten = new JLabel("Neu");
+ lblNeubearbeiten.setBounds(149, 91, 108, 14);
+ contentPanel.add(lblNeubearbeiten);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ contentPanel.add(separator_1);
+
+ JLabel lblSchritt_1 = new JLabel("Schritt 1:");
+ lblSchritt_1.setBounds(24, 128, 57, 14);
+ contentPanel.add(lblSchritt_1);
+
+ JLabel lblSchritt_2 = new JLabel("Schritt 2:");
+ lblSchritt_2.setBounds(24, 204, 57, 14);
+ contentPanel.add(lblSchritt_2);
+
+ JLabel lblSchritt_3 = new JLabel("Schritt 3:");
+ lblSchritt_3.setBounds(20, 423, 57, 14);
+ contentPanel.add(lblSchritt_3);
+
+ JLabel lblKlickenSieAuf = new JLabel(
+ "Klicken Sie auf \"Fertigstellen\".");
+ lblKlickenSieAuf.setBounds(98, 423, 241, 14);
+ contentPanel.add(lblKlickenSieAuf);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBackground(UIManager.getColor("Button.background"));
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane, BorderLayout.SOUTH);
+ {
+ finishButton.setEnabled(false);
+ finishButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ writeData();
+ dispose();
+ MainMenue_GUI m = new MainMenue_GUI();
+ m.setVisible(true);
+ if (taskrun == true) {
+ try {
+ client.DeleteFtpUser(user.userName);
+
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e1.getCause()+"\n"+e1.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ task.cancel(true);
+ }
+
+ }
+ });
+
+ btnZurck.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ dispose();
+
+ CreateImageTechnisch_GUI m = new CreateImageTechnisch_GUI();
+ m.setVisible(true);
+ }
+ });
+ btnZurck.setActionCommand("Cancel");
+ buttonPane.add(btnZurck);
+ finishButton.setActionCommand("Cancel");
+ buttonPane.add(finishButton);
+ }
+ }
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu menu = new JMenu("Hilfe");
+ menuBar.add(menu);
+
+ JMenuItem menuItem = new JMenuItem("FAQ");
+ menuItem.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();
+ }
+
+ }
+ });
+
+ menu.add(menuItem);
+
+ JMenuItem menuItem_1 = new JMenuItem("OTRS");
+ menuItem_1.addMouseListener(new MouseAdapter() {
+ @Override
+ 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();
+ }
+
+ }
+ });
+ menu.add(menuItem_1);
+
+ JMenuItem mntmAbout = new JMenuItem("About");
+ mntmAbout.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ menu.add(mntmAbout);
+ setVisible(true);
+
+ }
+
+ private void buttonUploadActionPerformed(ActionEvent event) {
+
+ progressBar.setValue(0);
+ btnUploadStarten.setEnabled(false); // verhindert einen weiteren klick
+ btnUploadStarten.setText("Bitte warten");
+
+ try {
+ System.out.println("Test");
+ user = client.getFtpUser();
+ System.out.println("FTP name" + user.userName);
+ System.out.println("FTP path" + user.path);
+ System.out.println("FTP pass" + user.password);
+ } catch (TException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e.getCause()+"\n"+e.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ DateFormat formatter = new SimpleDateFormat("yyyMMddhhmmss");
+
+ System.out.println(formatter.format(new Date()) + "_"
+ + person.verantwortlicher.getHochschule() + "_"
+ + person.verantwortlicher.getUsername() + "_"
+ + Image.image.getImagename() + ".vmdk");
+ Image.image.setNewName(formatter.format(new Date()) + "_"
+ + person.verantwortlicher.getHochschule() + "_"
+ + person.verantwortlicher.getUsername() + "_"
+ + Image.image.getImagename() + ".vmdk");
+ System.out.println("Uploading to host: "+host);
+
+ task = new UploadTask(host, port, user.userName, user.password,
+ user.path+"temp/", uploadFile);
+
+ task.addPropertyChangeListener(this);
+ task.execute();
+ taskrun = true;
+
+ }
+
+ public void propertyChange(PropertyChangeEvent arg0) {
+ progress = 0;
+ if ("progress" == arg0.getPropertyName()) {
+ progress = (Integer) arg0.getNewValue();
+ progressBar.setValue(progress);
+
+ // Button zum Fertigstellen freischalten, wenn 100% erreicht sind
+ if (progress == 0 || progress == 100) {
+ // not uploading currently
+ btnZurck.setEnabled(true);
+ } else {
+ // currently uploading, don't let user interact
+ btnZurck.setEnabled(false);
+ }
+
+ // Fertigstellen erlauben wenn upload abgeschlossen
+ if (progress == 100) {
+ finishButton.setEnabled(true);
+
+ } else {
+ finishButton.setEnabled(false);
+
+ }
+
+ }
+
+
+
+ if ("speed" == arg0.getPropertyName()) {
+ speed = (double) arg0.getNewValue();
+ // if(speed<=1){
+
+ UpSpeed.setText(String.valueOf(speed).substring(0,
+ String.valueOf(speed).lastIndexOf(".") + 3)
+ + " MB/s");
+
+ }
+ if ("bytesread" == arg0.getPropertyName()) {
+ bytesread = (long) arg0.getNewValue();
+ labelfertig.setText((bytesread / 1024 / 1024) + " MB");
+ labelverbleibend
+ .setText(((filesize / 1024 / 1024) - (bytesread / 1024 / 1024))
+ + " MB");
+
+ labelZeit
+ .setText(String
+ .valueOf(
+ ((((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60) + 1)
+ .substring(
+ 0,
+ String.valueOf(
+ (((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60)
+ .lastIndexOf("."))
+ + " Minuten");
+
+ }
+ if ("filesize" == arg0.getPropertyName()) {
+ filesize = (long) arg0.getNewValue();
+ labelfilesize.setText((filesize / 1024 / 1024) + " MB");
+
+ }
+
+ }
+
+ public boolean writeData() {
+
+ try {
+
+ client.writeVLdata(Image.image.getImagename(),
+ person.verantwortlicher.getUsername(),
+ person.verantwortlicher.getVorname(),
+ person.verantwortlicher.getName(),
+ person.verantwortlicher.getHochschule(),
+ person.verantwortlicher.getEMail(),
+ person.verantwortlicher.getTel(),
+ person.verantwortlicher.getFakultaet(),
+ Image.image.isLicensed(), Image.image.isInternet(),
+ Image.image.getRam(), Image.image.getCpu(),
+ "temp/" + Image.image.getNewName(),false,Image.image.getFilesize(),Image.image.getShareMode());
+ client.startFileCopy(Image.image.getNewName());
+ } catch (TException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e.getCause()+"\n"+e.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ return false;
+ }
+ return true;
+
+ }
+} \ No newline at end of file
diff --git a/Dozentenmodul/src/main/java/gui/image/FTPDownloader_GUI.java b/Dozentenmodul/src/main/java/gui/image/FTPDownloader_GUI.java
new file mode 100644
index 00000000..d21da67e
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/image/FTPDownloader_GUI.java
@@ -0,0 +1,484 @@
+package gui.image;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.swing.JButton;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JProgressBar;
+import javax.swing.JSeparator;
+import javax.swing.JTextPane;
+import javax.swing.SwingConstants;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+
+import models.Image;
+import models.Links;
+import models.SessionData;
+
+import org.apache.thrift.TException;
+
+import server.Server.Client;
+import server.User;
+import thrift.ThriftConnection;
+import util.GuiOrganizer;
+import util.OpenLinks;
+import ftp.DownloadTask;
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+@SuppressWarnings("serial")
+public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener {
+
+ @SuppressWarnings("unused")
+ private JPanel contentPane;
+ private final JPanel contentPanel = new JPanel();
+ JLabel lblPath;
+ JLabel downspeed;
+ User user;
+ JProgressBar progressBar;
+ String host = SessionData.session.getServerAdress();
+ int port = 21;
+ String downloadFile = "";
+ static String arg = "";
+ DownloadTask task;
+ JLabel lblBytesread;
+ JLabel lblNewLabel_3;
+ JLabel labelVerbleibend;
+ long filesize;
+ double speed;
+ int progress = 0; // progress of download
+ long bytesread;
+ JLabel labelZeit;
+ boolean taskrun = false;
+ ThriftConnection con = new ThriftConnection();
+ Client client = models.Client.clientcon.getClient();
+ JButton btnZurck = new JButton("Zur\u00FCck");
+ JButton btnDownloadStarten = new JButton("Download starten");
+ JButton btnMainMenu = new JButton("Hauptmen\u00FC");
+
+
+ /**
+ * Create the frame.
+ */
+ public FTPDownloader_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent e) {
+ if (taskrun == true) {
+ try {
+ client.DeleteFtpUser(user.userName);
+ con.closeThriftConnection();
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e1.getCause()+"\n"+e1.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ task.cancel(true);
+ }
+ //dispose();
+ System.exit(0);
+ }//end window closing
+ });
+ setResizable(false);
+ // setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ setBackground(Color.WHITE);
+ setTitle("Dozentenmodul *Prototyp* - Image herunterladen");
+
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ getContentPane().setLayout(new BorderLayout());
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel, BorderLayout.CENTER);
+ contentPanel.setLayout(null);
+ {
+ JButton btnSpeicherortAuswhlen = new JButton(
+ "Speicherort ausw\u00E4hlen");
+ btnSpeicherortAuswhlen.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ JFileChooser fc = new JFileChooser();
+ fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+
+ fc.showOpenDialog(getParent());
+ File dir = fc.getSelectedFile();
+ // check if directory is selected
+ if (dir != null) {
+ // is selected
+ lblPath.setText(dir.getAbsolutePath());
+ } else {
+ // no directory selected
+ lblPath.setText("");
+ }// end if
+ }
+ });
+
+ btnSpeicherortAuswhlen.setBounds(102, 124, 173, 23);
+ btnSpeicherortAuswhlen.setVerticalAlignment(SwingConstants.TOP);
+ contentPanel.add(btnSpeicherortAuswhlen);
+ }
+
+ lblPath = new JLabel("");
+ lblPath.addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent arg0) {
+ if (lblPath.getText().isEmpty()) {
+ // wenn leer, dann upload button nicht freigeben
+ btnDownloadStarten.setEnabled(false);
+ btnDownloadStarten.setText("Bitte warten");
+ } else {
+ // wenn leer, dann upload button nicht freigeben
+ btnDownloadStarten.setEnabled(true);
+ btnDownloadStarten.setText("Download starten");
+ }
+ }
+ });
+ lblPath.setBounds(102, 158, 485, 23);
+ contentPanel.add(lblPath);
+
+ btnDownloadStarten.setEnabled(false);
+ btnDownloadStarten.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ buttonDownloadActionPerformed(arg0);
+ }
+ });
+
+ btnDownloadStarten.setBounds(102, 200, 173, 23);
+ contentPanel.add(btnDownloadStarten);
+
+ progressBar = new JProgressBar(0, 100);
+ progressBar.setStringPainted(true);
+
+ progressBar.setBounds(102, 234, 485, 30);
+ contentPanel.add(progressBar);
+
+ JLabel lblDownloadgeschwindigkeit = new JLabel(
+ "Downloadgeschwindigkeit:");
+ lblDownloadgeschwindigkeit.setBounds(102, 275, 141, 14);
+ contentPanel.add(lblDownloadgeschwindigkeit);
+
+ downspeed = new JLabel("0");
+ downspeed.setBounds(374, 275, 117, 14);
+ contentPanel.add(downspeed);
+
+ JLabel lblFertig = new JLabel("Fertig:");
+ lblFertig.setBounds(102, 325, 46, 14);
+ contentPanel.add(lblFertig);
+
+ lblBytesread = new JLabel("0");
+ lblBytesread.setBounds(183, 325, 108, 14);
+ contentPanel.add(lblBytesread);
+
+ JLabel lblVon = new JLabel("von:");
+ lblVon.setBounds(318, 325, 46, 14);
+ contentPanel.add(lblVon);
+
+ lblNewLabel_3 = new JLabel("0");
+ lblNewLabel_3.setBounds(374, 325, 117, 14);
+ contentPanel.add(lblNewLabel_3);
+
+ JLabel lblMbVerbleibend = new JLabel("Verbleibend:");
+ lblMbVerbleibend.setBounds(102, 350, 71, 14);
+ contentPanel.add(lblMbVerbleibend);
+
+ labelVerbleibend = new JLabel("0");
+ labelVerbleibend.setBounds(183, 350, 108, 14);
+ contentPanel.add(labelVerbleibend);
+
+ JLabel lblGeschtzteVerbleibendeZeit = new JLabel(
+ "Gesch\u00E4tzte Verbleibende Zeit:");
+ lblGeschtzteVerbleibendeZeit.setBounds(102, 300, 150, 14);
+ contentPanel.add(lblGeschtzteVerbleibendeZeit);
+
+ labelZeit = new JLabel("0");
+ labelZeit.setBounds(374, 300, 117, 14);
+ contentPanel.add(labelZeit);
+
+ JPanel panel = new JPanel();
+ panel.setLayout(null);
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 24, 577, 57);
+ contentPanel.add(panel);
+
+ JLabel lblImageDownloader = new JLabel("Image Downloader");
+ lblImageDownloader.setFont(new Font("Tahoma", Font.BOLD, 18));
+ lblImageDownloader.setBounds(10, 11, 509, 22);
+ panel.add(lblImageDownloader);
+
+ JTextPane txtpnWhlenSieEinen = new JTextPane();
+ txtpnWhlenSieEinen.setText("W\u00E4hlen Sie einen Ort aus, um das von Ihnen gw\u00E4hlte Image erunter zu laden.");
+ txtpnWhlenSieEinen.setEditable(false);
+ txtpnWhlenSieEinen.setBackground(SystemColor.menu);
+ txtpnWhlenSieEinen.setBounds(10, 36, 509, 32);
+ panel.add(txtpnWhlenSieEinen);
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 88, 597, 2);
+ contentPanel.add(separator);
+
+ JLabel label_1 = new JLabel("Hauptmen\u00FC");
+ label_1.setForeground(Color.BLUE);
+ label_1.setBounds(20, 92, 61, 20);
+ contentPanel.add(label_1);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(80, 95, 14, 14);
+ contentPanel.add(label_2);
+
+ JLabel label_3 = new JLabel("VL-Image");
+ label_3.setForeground(Color.BLUE);
+ label_3.setBounds(91, 92, 46, 20);
+ contentPanel.add(label_3);
+
+ JLabel label_4 = new JLabel(">");
+ label_4.setBounds(139, 95, 14, 14);
+ contentPanel.add(label_4);
+
+ JLabel label_5 = new JLabel("Neu/Bearbeiten");
+ label_5.setBounds(149, 95, 108, 14);
+ contentPanel.add(label_5);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(-10, 648, 597, 2);
+ contentPanel.add(separator_1);
+
+ JLabel lblSchritt = new JLabel("Schritt 1:");
+ lblSchritt.setBounds(24, 128, 57, 14);
+ contentPanel.add(lblSchritt);
+
+ JLabel lblSchritt_1 = new JLabel("Schritt 2:");
+ lblSchritt_1.setBounds(24, 204, 57, 14);
+ contentPanel.add(lblSchritt_1);
+
+ JLabel lblSchritt_3 = new JLabel("Schritt 3:");
+ lblSchritt_3.setBounds(20, 423, 57, 14);
+ contentPanel.add(lblSchritt_3);
+
+ JLabel lblKlickenSieAuf = new JLabel(
+ "Klicken Sie auf \"Fertigstellen\".");
+ lblKlickenSieAuf.setBounds(98, 423, 241, 14);
+ contentPanel.add(lblKlickenSieAuf);
+
+ JMenuBar menuBar = new JMenuBar();
+ menuBar.setBounds(0, 0, 597, 21);
+ contentPanel.add(menuBar);
+
+ JMenu menu = new JMenu("Hilfe");
+ menuBar.add(menu);
+
+ JMenuItem menuItem = new JMenuItem("FAQ");
+ menuItem.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();
+ }
+
+ }
+ });
+
+ menu.add(menuItem);
+
+ JMenuItem menuItem_1 = new JMenuItem("OTRS");
+ menuItem_1.addMouseListener(new MouseAdapter() {
+ @Override
+ 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();
+ }
+
+ }
+ });
+
+ menu.add(menuItem_1);
+
+ JMenuItem mntmAbout = new JMenuItem("About");
+ mntmAbout.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ menu.add(mntmAbout);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBackground(UIManager.getColor("Button.background"));
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane, BorderLayout.SOUTH);
+ {
+ btnZurck.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ if (taskrun == true) {
+ task.cancel(true);
+ try {
+ client.DeleteFtpUser(user.userName);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e1.getCause()+"\n"+e1.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ }
+
+ SearchEditImage_GUI se = new SearchEditImage_GUI();
+ se.setVisible(true);
+ dispose();
+ }
+ });
+ btnZurck.setActionCommand("Cancel");
+ buttonPane.add(btnZurck);
+ }
+
+
+ btnMainMenu.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+
+ MainMenue_GUI mm = new MainMenue_GUI();
+ mm.setVisible(true);
+ dispose();
+ }
+ });
+ btnMainMenu.setActionCommand("Cancel");
+ buttonPane.add(btnMainMenu);
+ }
+ setVisible(true);
+
+ }
+
+ private void buttonDownloadActionPerformed(ActionEvent event) {
+
+ progressBar.setValue(0);
+ btnDownloadStarten.setEnabled(false); // verhindert schnellen zweiten
+ // Klick
+ btnDownloadStarten.setText("Bitte warten");
+ try {
+ user = client.getFtpUser();
+
+ downloadFile = user.path+"/"+client.getPathOfImage(Image.image.getImageId(),
+ Image.image.getVersion());
+
+ } catch (TException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e.getCause()+"\n"+e.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+
+ task = new DownloadTask(host, port, user.userName, user.password,
+ downloadFile, lblPath.getText(), this);
+ task.addPropertyChangeListener(this);
+ task.execute();
+ taskrun = true;
+
+ }
+
+ public void propertyChange(PropertyChangeEvent arg0) {
+
+ progress = 0;
+ if ("progress" == arg0.getPropertyName()) {
+ progress = (Integer) arg0.getNewValue();
+ progressBar.setValue(progress);
+
+ // Button zum Fertigstellen freischalten, wenn 100% erreicht sind
+ if (progress == 0 || progress == 100) {
+ // not uploading currently
+ btnZurck.setEnabled(true);
+ btnMainMenu.setEnabled(true);
+ } else {
+ // currently uploading, don't let user interact
+ btnZurck.setEnabled(false);
+ btnMainMenu.setEnabled(false);
+ }
+ }
+
+ if ("speed" == arg0.getPropertyName()) {
+ speed = (double) arg0.getNewValue();
+ // if(speed<=1){
+
+ downspeed.setText(String.valueOf(speed).substring(0,
+ String.valueOf(speed).lastIndexOf(".") + 3)
+ + " MB/s");
+
+ }
+ if ("bytesread" == arg0.getPropertyName()) {
+ bytesread = (long) arg0.getNewValue();
+ lblBytesread.setText((bytesread / 1024 / 1024) + " MB");
+ labelVerbleibend
+ .setText(((filesize / 1024 / 1024) - (bytesread / 1024 / 1024))
+ + " MB");
+
+ labelZeit
+ .setText(String
+ .valueOf(
+ ((((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60) + 1)
+ .substring(
+ 0,
+ String.valueOf(
+ (((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60)
+ .lastIndexOf("."))
+ + " Minuten");
+
+ }
+ if ("filesize" == arg0.getPropertyName()) {
+ filesize = (long) arg0.getNewValue();
+ lblNewLabel_3.setText((filesize / 1024 / 1024) + " MB");
+
+ }
+
+ }
+} \ No newline at end of file
diff --git a/Dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java b/Dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java
new file mode 100644
index 00000000..a2123712
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/image/FTPEditUploader_GUI.java
@@ -0,0 +1,538 @@
+package gui.image;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.swing.JButton;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JProgressBar;
+import javax.swing.JSeparator;
+import javax.swing.JTextPane;
+import javax.swing.SwingConstants;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+
+import models.Image;
+import models.Links;
+import models.SessionData;
+import models.person;
+
+import org.apache.thrift.TException;
+
+import server.Server.Client;
+import thrift.ThriftConnection;
+import util.GuiOrganizer;
+import util.OpenLinks;
+import ftp.UploadTask;
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+@SuppressWarnings("serial")
+public class FTPEditUploader_GUI extends JFrame implements
+ PropertyChangeListener {
+
+ @SuppressWarnings("unused")
+ private JPanel contentPane;
+ private final JPanel contentPanel = new JPanel();
+ JLabel lblPath;
+ JProgressBar progressBar;
+ String host = SessionData.session.getServerAdress();
+ int port = 21;
+ server.User user;
+ String filename = "";
+ File uploadFile;
+ static String arg = "";
+ UploadTask task;
+ JLabel UpSpeed;
+ JLabel labelfertig;
+ JLabel labelfilesize;
+ JLabel labelZeit;
+ JLabel labelverbleibend;
+ long filesize;
+ double speed;
+ long bytesread;
+ boolean taskrun = false;
+ int progress = 0;
+ ThriftConnection con = new ThriftConnection();
+ Client client = models.Client.clientcon.getClient();
+ JButton btnUploadStarten = new JButton("Upload auf Server starten");
+ JButton btnSpeicherortAuswhlen = new JButton("Image ausw\u00E4hlen");
+ JButton finishButton = new JButton("Fertigstellen");
+ JButton btnZurck = new JButton("Zur\u00FCck");
+
+
+ /**
+ * Create the frame.
+ */
+ public FTPEditUploader_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ if (taskrun == true) {
+ try {
+
+ client.DeleteFtpUser(user.userName);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ task.cancel(true);
+ }
+ con.closeThriftConnection();
+ System.exit(0);
+ }// end window closing
+ });
+ setResizable(false);
+ // setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ // filename=name;
+ setBackground(Color.WHITE);
+ setTitle("Dozentenmodul *Prototyp* - Image bearbeiten");
+
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ getContentPane().setLayout(new BorderLayout());
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel, BorderLayout.CENTER);
+ contentPanel.setLayout(null);
+ {
+
+ btnSpeicherortAuswhlen.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ JFileChooser fc = new JFileChooser();
+ fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
+
+ fc.showOpenDialog(getParent());
+ File file = fc.getSelectedFile();
+ // check if a file is selected and exists
+ if (file != null) {
+ // file exists
+ uploadFile = file;
+ filename = uploadFile.getName();
+ lblPath.setText(file.getAbsolutePath());
+ } else {
+ // no file selected
+ lblPath.setText("");
+ }// end if
+ }
+ });
+
+ btnSpeicherortAuswhlen.setBounds(102, 124, 173, 23);
+ btnSpeicherortAuswhlen.setVerticalAlignment(SwingConstants.TOP);
+ contentPanel.add(btnSpeicherortAuswhlen);
+ }
+
+ lblPath = new JLabel("");
+ lblPath.addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent arg0) {
+ if (lblPath.getText().isEmpty()) {
+ // wenn leer, dann upload button nicht freigeben
+ btnUploadStarten.setEnabled(false);
+ btnUploadStarten.setText("Bitte warten");
+ } else {
+ // wenn leer, dann upload button nicht freigeben
+ btnUploadStarten.setEnabled(true);
+ btnUploadStarten.setText("Upload auf Server starten");
+ }
+ }
+ });
+ lblPath.setBounds(102, 158, 485, 23);
+ contentPanel.add(lblPath);
+
+ btnUploadStarten.setEnabled(false);
+ btnUploadStarten.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ buttonUploadActionPerformed(arg0);
+
+ }
+ });
+
+ btnUploadStarten.setBounds(102, 200, 173, 23);
+ contentPanel.add(btnUploadStarten);
+
+ progressBar = new JProgressBar(0, 100);
+ progressBar.setStringPainted(true);
+
+ progressBar.setBounds(102, 234, 485, 30);
+ contentPanel.add(progressBar);
+
+ JLabel lblUploadgeschwindigkeit = new JLabel("Uploadgeschwindigkeit:");
+ lblUploadgeschwindigkeit.setBounds(102, 275, 141, 14);
+ contentPanel.add(lblUploadgeschwindigkeit);
+
+ JLabel label_1 = new JLabel("Fertig:");
+ label_1.setBounds(102, 325, 46, 14);
+ contentPanel.add(label_1);
+
+ labelfertig = new JLabel("0");
+ labelfertig.setBounds(183, 325, 108, 14);
+ contentPanel.add(labelfertig);
+
+ UpSpeed = new JLabel("0");
+ UpSpeed.setBounds(374, 275, 117, 14);
+ contentPanel.add(UpSpeed);
+
+ JLabel label_4 = new JLabel("von:");
+ label_4.setBounds(318, 325, 46, 14);
+ contentPanel.add(label_4);
+
+ labelfilesize = new JLabel("0");
+ labelfilesize.setBounds(374, 325, 117, 14);
+ contentPanel.add(labelfilesize);
+
+ JLabel label_6 = new JLabel("Verbleibend:");
+ label_6.setBounds(102, 350, 71, 14);
+ contentPanel.add(label_6);
+
+ JLabel label_7 = new JLabel("Gesch\u00E4tzte Verbleibende Zeit:");
+ label_7.setBounds(102, 300, 150, 14);
+ contentPanel.add(label_7);
+
+ labelZeit = new JLabel("0");
+ labelZeit.setBounds(374, 300, 117, 14);
+ contentPanel.add(labelZeit);
+
+ labelverbleibend = new JLabel("0");
+ labelverbleibend.setBounds(183, 350, 108, 14);
+ contentPanel.add(labelverbleibend);
+
+ JPanel panel = new JPanel();
+ panel.setLayout(null);
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 577, 57);
+ contentPanel.add(panel);
+
+ JLabel lblUploadIhresImage = new JLabel("Upload Ihres Image");
+ lblUploadIhresImage.setFont(new Font("Tahoma", Font.BOLD, 18));
+ lblUploadIhresImage.setBounds(10, 11, 509, 22);
+ panel.add(lblUploadIhresImage);
+
+ JTextPane txtpnFhreSieBitte = new JTextPane();
+ txtpnFhreSieBitte
+ .setText("F\u00FChre Sie bitte die folgenden 3 Schritte aus um Ihr Image auf unseren Server zu laden.");
+ txtpnFhreSieBitte.setEditable(false);
+ txtpnFhreSieBitte.setBackground(SystemColor.menu);
+ txtpnFhreSieBitte.setBounds(10, 36, 509, 32);
+ panel.add(txtpnFhreSieBitte);
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 79, 597, 2);
+ contentPanel.add(separator);
+
+ JLabel lblNewLabel_1 = new JLabel("Hauptmen\u00FC");
+ lblNewLabel_1.setForeground(Color.BLUE);
+ lblNewLabel_1.setBounds(20, 88, 61, 20);
+ contentPanel.add(lblNewLabel_1);
+
+ JLabel label_3 = new JLabel(">");
+ label_3.setBounds(80, 91, 14, 14);
+ contentPanel.add(label_3);
+
+ JLabel lblVlimage = new JLabel("VL-Image");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(91, 88, 46, 20);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_5 = new JLabel(">");
+ label_5.setBounds(139, 91, 14, 14);
+ contentPanel.add(label_5);
+
+ JLabel lblNeubearbeiten = new JLabel("Bearbeiten");
+ lblNeubearbeiten.setBounds(149, 91, 108, 14);
+ contentPanel.add(lblNeubearbeiten);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ contentPanel.add(separator_1);
+
+ JLabel lblSchritt_1 = new JLabel("Schritt 1:");
+ lblSchritt_1.setBounds(24, 128, 57, 14);
+ contentPanel.add(lblSchritt_1);
+
+ JLabel lblSchritt_2 = new JLabel("Schritt 2:");
+ lblSchritt_2.setBounds(24, 204, 57, 14);
+ contentPanel.add(lblSchritt_2);
+
+ JLabel label = new JLabel("Schritt 3:");
+ label.setBounds(20, 423, 57, 14);
+ contentPanel.add(label);
+
+ JLabel label_2 = new JLabel("Klicken Sie auf \"Fertigstellen\".");
+ label_2.setBounds(98, 423, 241, 14);
+ contentPanel.add(label_2);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBackground(UIManager.getColor("Button.background"));
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane, BorderLayout.SOUTH);
+ {
+
+ //finishButton.setEnabled(false);
+ finishButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+ updateData();
+ dispose();
+ MainMenue_GUI m = new MainMenue_GUI();
+ m.setVisible(true);
+
+ if (taskrun == true) {
+ try {
+ client.DeleteFtpUser(user.userName);
+
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e1.getCause()+"\n"+e1.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ task.cancel(true);
+ }
+
+ }
+ });
+ btnZurck.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ dispose();
+ EditImageTechnisch_GUI ei = new EditImageTechnisch_GUI();
+ ei.setVisible(true);
+ }
+ });
+
+ btnZurck.setActionCommand("Cancel");
+ buttonPane.add(btnZurck);
+ finishButton.setActionCommand("Cancel");
+ buttonPane.add(finishButton);
+ }
+ }
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu menu = new JMenu("Hilfe");
+ menuBar.add(menu);
+
+ JMenuItem menuItem = new JMenuItem("FAQ");
+ menuItem.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();
+ }
+
+
+ }
+ });
+
+ menu.add(menuItem);
+
+ JMenuItem menuItem_1 = new JMenuItem("OTRS");
+ menuItem_1.addMouseListener(new MouseAdapter() {
+ @Override
+ 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();
+ }
+
+
+ }
+ });
+
+ menu.add(menuItem_1);
+
+ JMenuItem mntmAbout = new JMenuItem("About");
+ mntmAbout.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ menu.add(mntmAbout);
+ setVisible(true);
+
+ }
+
+ private void buttonUploadActionPerformed(ActionEvent event) {
+
+ progressBar.setValue(0);
+ btnUploadStarten.setEnabled(false); // verhindert einen weiteren klick
+ btnUploadStarten.setText("Bitte warten");
+
+ try {
+ user = client.getFtpUser();
+ System.out.println("FTP name" + user.userName);
+ System.out.println("FTP path" + user.path);
+ System.out.println("FTP pass" + user.password);
+ } catch (TException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e.getCause()+"\n"+e.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ DateFormat formatter = new SimpleDateFormat("yyyMMddhhmmss");
+
+ Image.image.setNewName(formatter.format(new Date()) + "_"
+ + person.verantwortlicher.getHochschule() + "_"
+ + person.verantwortlicher.getUsername() + "_"
+ + Image.image.getImagename()+ ".vmdk");
+ task = new UploadTask(host, port, user.userName, user.password,
+ user.path+"temp/", uploadFile);
+
+ task.addPropertyChangeListener(this);
+ task.execute();
+ taskrun = true;
+
+ }
+
+ public void propertyChange(PropertyChangeEvent arg0) {
+ if ("progress" == arg0.getPropertyName()) {
+ progress = (Integer) arg0.getNewValue();
+ progressBar.setValue(progress);
+
+ // Button zum Fertigstellen freischalten, wenn 100% erreicht sind
+ if (progress == 100) {
+ // not uploading currently
+ btnZurck.setEnabled(true);
+ } else {
+ // currently uploading, don't let user interact
+ btnZurck.setEnabled(false);
+ }
+
+ // Fertigstellen erlauben wenn upload abgeschlossen
+ if (progress == 100) {
+ finishButton.setEnabled(true);
+ } else {
+ finishButton.setEnabled(false);
+ }
+ }
+
+
+
+ if ("speed" == arg0.getPropertyName()) {
+ speed = (double) arg0.getNewValue();
+ // if(speed<=1){
+
+ UpSpeed.setText(String.valueOf(speed).substring(0,
+ String.valueOf(speed).lastIndexOf(".") + 3)
+ + " MB/s");
+
+ }
+ if ("bytesread" == arg0.getPropertyName()) {
+ bytesread = (long) arg0.getNewValue();
+ labelfertig.setText((bytesread / 1024 / 1024) + " MB");
+ labelverbleibend
+ .setText(((filesize / 1024 / 1024) - (bytesread / 1024 / 1024))
+ + " MB");
+
+ labelZeit
+ .setText(String
+ .valueOf(
+ ((((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60) + 1)
+ .substring(
+ 0,
+ String.valueOf(
+ (((filesize / 1024 / 1024) - (bytesread / 1024 / 1024)) / speed) / 60)
+ .lastIndexOf("."))
+ + " Minuten");
+
+ }
+ if ("filesize" == arg0.getPropertyName()) {
+ filesize = (long) arg0.getNewValue();
+ labelfilesize.setText((filesize / 1024 / 1024) + " MB");
+
+ }
+
+ }
+
+ public boolean updateData() {
+
+ try {
+ System.out.println("NewName="+Image.image.getNewName());
+ System.out.println("OldName="+Image.image.getImagename());
+ if(Image.image.getNewName().isEmpty()){
+ client.updateImageData(Image.image.getImagename(),
+ Image.image.getImagename(),Image.image.getImagepath(), Image.image.isLicensed(),
+ Image.image.isInternet(), Image.image.getRam(),
+ Image.image.getCpu(), Image.image.getImageId(),
+ Image.image.getVersion(), false,Image.image.getFilesize(),Image.image.getShareMode());
+ client.startFileCopy(Image.image.getNewName());
+ }
+ else{
+
+
+ client.updateImageData(Image.image.getImagename(),
+ Image.image.getImagename(),"temp/" + Image.image.getNewName(), Image.image.isLicensed(),
+ Image.image.isInternet(), Image.image.getRam(),
+ Image.image.getCpu(), Image.image.getImageId(),
+ Image.image.getVersion(), false,Image.image.getFilesize(),Image.image.getShareMode());
+ client.startFileCopy(Image.image.getNewName());
+ }
+ } catch (TException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e.getCause()+"\n"+e.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ return false;
+ }
+ return true;
+
+ }
+} \ No newline at end of file
diff --git a/Dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java b/Dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java
new file mode 100644
index 00000000..58fba9e7
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/image/SearchEditImage_GUI.java
@@ -0,0 +1,596 @@
+package gui.image;
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JScrollPane;
+import javax.swing.JSeparator;
+import javax.swing.JTabbedPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.RowFilter;
+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.table.DefaultTableModel;
+import javax.swing.table.TableModel;
+import javax.swing.table.TableRowSorter;
+
+import models.Image;
+import models.Links;
+import models.person;
+
+import org.apache.thrift.TException;
+
+import server.Server.Client;
+import thrift.ThriftConnection;
+import util.GuiOrganizer;
+//import models.person;
+import util.OpenLinks;
+
+@SuppressWarnings("serial")
+public class SearchEditImage_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ JRadioButton rdbtnInternetJa;
+ JRadioButton rdbtnInternetNein;
+ JComboBox<String> comboBox;
+ JTable tableAllImages;
+ JTable tablemyImages;
+ boolean activeSearch=false;
+ private JTextField textFieldName;
+ JTabbedPane tabbedPane;
+ String[] titles = { "Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung",
+ "Verantwortlicher", "Letztes Update", "Schlagwort", "ID", "Version" };
+ 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 modelMyImages = new DefaultTableModel(titles, 0){
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
+ };
+ final TableRowSorter<TableModel> rowSorterAll = new TableRowSorter<TableModel>(
+ modelAll);
+ final TableRowSorter<TableModel> rowSorterMyImages = new TableRowSorter<TableModel>(
+ modelMyImages);
+
+
+ /**
+ * Create the dialog.
+ */
+ public SearchEditImage_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ // Beendet die Anwendung nach klick auf X
+ con.closeThriftConnection();
+ System.exit(0);
+ }
+
+ @Override
+ public void windowOpened(WindowEvent arg0) {
+ initTableModel(modelMyImages);
+ initTableModel(modelAll);
+ textFieldName.requestFocusInWindow();
+ }
+ });
+ // Verhindert das Vergroessern Des Fensters
+ setResizable(false);
+
+ try {
+ // Setzt das Look & Feel auf System
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ // Setzt den Fenstertitel
+ setTitle("bwLehrpool Suite *Prototyp* - Image bearbeiten");
+ // Zentriert das Fenster in die Bildmitte
+ setBounds(0, 0, 603, 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);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Suche nach VL-Image");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie
+ .setText("Hier k\u00F6nnen Sie nach Ihrem gew\u00FCnschten VL-Image suchen und dieses f\u00FCr weitere Schritte ausw\u00E4hlen");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 531);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Filterfunktionen",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 49, 557, 131);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JLabel lblNewLabel_2 = new JLabel("Anzeigename:");
+ lblNewLabel_2.setBounds(10, 30, 250, 20);
+ panel_1.add(lblNewLabel_2);
+
+ JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:");
+ lblInternetIstInnerhalb.setBounds(10, 58, 250, 20);
+ panel_1.add(lblInternetIstInnerhalb);
+
+ textFieldName = new JTextField();
+ // Key Listener der Tastatureingabe registriert
+ textFieldName.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+ // Textfield eingabe auslesen
+ String stext = textFieldName.getText();
+
+ // Wenn Textfield nicht leer
+ if (stext.isEmpty()==false) {
+ activeSearch=true;
+ // Filtere nach der Eingabe
+ rowSorterAll.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+ }
+ else{
+ activeSearch=false;
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ username, 4));
+ rowSorterAll.setRowFilter(null);
+ }
+ }
+ });
+
+ textFieldName.setBounds(270, 30, 250, 20);
+ panel_1.add(textFieldName);
+ textFieldName.setColumns(10);
+
+ JLabel lblErweiterteSuche = new JLabel(
+ "<html><u>Erweiterte Suche *Folgt noch*</u></html>");
+ lblErweiterteSuche.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ // oeffnet das Fenster Extended GUI
+
+ //ExtendedSearchForImages_GUI es = new ExtendedSearchForImages_GUI();
+ //es.setVisible(true);
+ }
+ });
+ lblErweiterteSuche.setForeground(Color.BLUE);
+
+ lblErweiterteSuche.setBounds(365, 106, 155, 14);
+ panel_1.add(lblErweiterteSuche);
+
+ comboBox = new JComboBox<String>();
+ try {
+ // Holt sich eine Liste aller verfuegbaren Betriebssysteme vom Server
+ List<String> list = client.getAllOS();
+ // Leeres Item hinzufuegen
+ comboBox.addItem("");
+ for (int i = 0; i < list.size(); i++) {
+ // Hinzufuegen der verfuegbaren Betriebssysteme
+ comboBox.addItem(list.get(i));
+ }
+ } catch (TException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e2.getCause()+"\n"+e2.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ // Registriert Auswahlaenderungen der Box
+ comboBox.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ // Prueft das die Auswahl nicht leer ist
+ if (comboBox.getSelectedItem().toString().isEmpty()==false) {
+ // Filtert nach dem ausgewaehlten Betriebssystem
+ activeSearch=true;
+ rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox
+ .getSelectedItem().toString(), 2));
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ comboBox.getSelectedItem().toString(), 2));
+ }
+ else{
+ activeSearch=false;
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ username, 4));
+
+ rowSorterAll.setRowFilter(null);
+ }
+ }
+
+ });
+ comboBox.setBounds(270, 58, 250, 20);
+ panel_1.add(comboBox);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ // oeffnet das Hauuetmenue
+
+ SearchEditImage_GUI.this.setVisible(false);
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("VL-Image");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 45, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(133, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Imageauswahl");
+ lblNewLabel_1.setBounds(146, 11, 85, 14);
+ contentPanel.add(lblNewLabel_1);
+
+ tabbedPane = new JTabbedPane(JTabbedPane.TOP);
+ tabbedPane.addChangeListener(new ChangeListener() {
+ public void stateChanged(ChangeEvent arg0) {
+ if (tabbedPane.getSelectedIndex() == 0 && activeSearch==false) {
+
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ // String username="Spitzer Tobias";
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ username, 4));
+ } else if(tabbedPane.getSelectedIndex()==1 && activeSearch==false){
+ rowSorterAll.setRowFilter(null);
+ }
+
+ }
+ });
+
+ tabbedPane.setBounds(10, 197, 557, 300);
+ contentPanel.add(tabbedPane);
+
+
+ JScrollPane scrollPaneAllImages = new JScrollPane();
+ tableAllImages = new JTable();
+ tableAllImages.setModel(modelAll);
+ tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit();
+
+
+ JScrollPane scrollPaneMyImage = new JScrollPane();
+ tablemyImages = new JTable();
+ tablemyImages.setModel(modelMyImages);
+ tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit();
+ tablemyImages.setRowSorter(rowSorterMyImages);
+
+ scrollPaneMyImage.setViewportView(tablemyImages);
+ tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null);
+ tableAllImages.setRowSorter(rowSorterAll);
+
+ scrollPaneAllImages.setViewportView(tableAllImages);
+ tabbedPane.addTab("Alle", null, scrollPaneAllImages, null);
+
+ JScrollPane scrollPaneCoopImages = new JScrollPane();
+ JTable 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 Images", null, scrollPaneCoopImages,
+ null);
+ tabbedPane.setEnabledAt(2, false);
+
+ JScrollPane scrollPanePublicImages = new JScrollPane();
+ JTable 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 Images", null,
+ scrollPanePublicImages, null);
+ tabbedPane.setEnabledAt(3, false);
+
+ JScrollPane scrollPanePublicVorlagen = new JScrollPane();
+ JTable tablePublicVorlagen = new JTable();
+ tablePublicVorlagen.setModel(model);
+ tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit();
+
+ 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) {
+ // oeffnet den Downloader
+
+ if (tablemyImages.getSelectedRow() != -1) {
+ String imageid = modelMyImages.getValueAt(
+ tablemyImages.convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 7).toString();
+
+ Image.image.setImageId(imageid);
+ String imageversion = modelMyImages.getValueAt(
+ tablemyImages.convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 8).toString();
+
+ Image.image.setVersion(imageversion);
+ SearchEditImage_GUI.this.setVisible(false);
+ FTPDownloader_GUI down = new FTPDownloader_GUI();
+ down.setVisible(true);
+
+
+ } else {
+ JOptionPane.showMessageDialog(null,
+ "Bitte w\u00e4hlen Sie ein Image f\u00fcr 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);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton okButton = new JButton("Zur\u00FCck");
+ okButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ // oeffnet das Hauptmenue
+
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ dispose();
+ }
+ });
+ okButton.setActionCommand("OK");
+ buttonPane.add(okButton);
+ getRootPane().setDefaultButton(okButton);
+ }
+ {
+ JButton cancelButton = new JButton("Weiter");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+
+ // check if user is in correct tab
+ if (tabbedPane.getSelectedIndex() == 0) {
+ //check if a row is selected
+ if (tablemyImages.getSelectedRow() != -1) {
+ String imageid = modelMyImages
+ .getValueAt(
+ tablemyImages
+ .convertRowIndexToModel(tablemyImages
+ .getSelectedRow()),
+ 7).toString();
+
+ Image.image.setImageId(imageid);
+ String imageversion = modelMyImages
+ .getValueAt(
+ tablemyImages
+ .convertRowIndexToModel(tablemyImages
+ .getSelectedRow()),
+ 8).toString();
+
+ Image.image.setVersion(imageversion);
+
+ EditImageAllgemein_GUI ea = new EditImageAllgemein_GUI();
+ ea.setVisible(true);
+ dispose();
+ } else {
+ JOptionPane.showMessageDialog(null,
+ "Bitte w\u00e4hlen Sie ein Image aus.",
+ "Image Auswahl", JOptionPane.INFORMATION_MESSAGE);
+ }// end check if row is selected
+ } else {
+ JOptionPane.showMessageDialog(null,
+ "Bitte w\u00e4hlen Sie ein eigenes Image aus.",
+ "Image Auswahl", JOptionPane.INFORMATION_MESSAGE);
+ }//end check if correct tab is selected
+ }
+ });
+ cancelButton.setActionCommand("Cancel");
+ buttonPane.add(cancelButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ 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) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(mntmAbout);
+
+ }
+
+ // Initiale Beffuelung eines Table models
+ public DefaultTableModel initTableModel(DefaultTableModel model) {
+ List<server.Image> images;
+ try {
+ // Hole eine Liste der Images
+ images = client.getImageList();
+
+ Iterator<server.Image> i = images.iterator();
+
+ 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(),
+ images.get(x).getUpdateTime(), "", images.get(x).id,
+ images.get(x).getVersion() };
+ // Fuege diese Objekte der Tabelle hinzu
+ model.addRow(obj);
+ x++;
+ i.next();
+
+ }
+
+ return model;
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e1.getCause()+"\n"+e1.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ return model;
+ }
+
+}
diff --git a/Dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java b/Dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java
new file mode 100644
index 00000000..ef8b75bb
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/image/SearchImage_GUI.java
@@ -0,0 +1,529 @@
+package gui.image;
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JScrollPane;
+import javax.swing.JSeparator;
+import javax.swing.JTabbedPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.RowFilter;
+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.table.DefaultTableModel;
+import javax.swing.table.TableModel;
+import javax.swing.table.TableRowSorter;
+
+import models.Image;
+import models.Links;
+import models.person;
+
+import org.apache.thrift.TException;
+
+import server.Server.Client;
+import thrift.ThriftConnection;
+import util.GuiOrganizer;
+import util.OpenLinks;
+
+@SuppressWarnings("serial")
+public class SearchImage_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ JRadioButton rdbtnInternetJa;
+ JRadioButton rdbtnInternetNein;
+ JComboBox<String> comboBox;
+ JTable tableAllImages;
+ JTable tablemyImages;
+ private JTextField textFieldName;
+ JTabbedPane tabbedPane;
+ String[] titles = { "Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung",
+ "Verantwortlicher", "Letztes Update", "Schlagwort", "ID", "Version" };
+ 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 modelMyImages = new DefaultTableModel(titles, 0){
+ public boolean isCellEditable(int rowIndex, int mColIndex) {
+ return false;
+ }
+ };
+ final TableRowSorter<TableModel> rowSorterAll = new TableRowSorter<TableModel>(
+ modelAll);
+ final TableRowSorter<TableModel> rowSorterMyImages = new TableRowSorter<TableModel>(
+ modelMyImages);
+
+
+ /**
+ * Create the dialog.
+ */
+ public SearchImage_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ // Beendet die Anwendung nach klick auf X
+ con.closeThriftConnection();
+ System.exit(0);
+ }
+
+ @Override
+ public void windowOpened(WindowEvent arg0) {
+ textFieldName.requestFocusInWindow();
+ }
+ });
+ // Verhindert das Vergroessern Des Fensters
+ setResizable(false);
+
+ try {
+ // Setzt das Look & Feel auf System
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ // Setzt den Fenstertitel
+ setTitle("bwLehrpool Suite *Prototyp* - Suche VL-Image");
+ // Zentriert das Fenster in die Bildmitte
+ setBounds(0, 0, 603, 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);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Suche nach VL-Image");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie
+ .setText("Hier k\u00F6nnen Sie nach Ihrem gew\u00FCnschten VL-Image suchen und dieses f\u00FCr weitere Schritte ausw\u00E4hlen");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 531);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Filterfunktionen",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 49, 557, 131);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JLabel lblNewLabel_2 = new JLabel("Anzeigename:");
+ lblNewLabel_2.setBounds(10, 30, 250, 20);
+ panel_1.add(lblNewLabel_2);
+
+ JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:");
+ lblInternetIstInnerhalb.setBounds(10, 58, 250, 20);
+ panel_1.add(lblInternetIstInnerhalb);
+
+ textFieldName = new JTextField();
+ // Key Listener der Tastatureingabe registriert
+ textFieldName.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+ // Textfield eingabe auslesen
+ String stext = textFieldName.getText();
+
+ // Wenn Textfield nicht leer
+ if (stext != "") {
+ // Filtere nach der Eingabe
+ rowSorterAll.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+
+ }
+ }
+ });
+
+ textFieldName.setBounds(270, 30, 250, 20);
+ panel_1.add(textFieldName);
+ textFieldName.setColumns(10);
+
+ JLabel lblErweiterteSuche = new JLabel(
+ "<html><u>Erweiterte Suche *Folgt noch*</u></html>");
+ lblErweiterteSuche.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ // oeffnet das Fenster Extended GUI
+
+ //ExtendedSearchForImages_GUI es = new ExtendedSearchForImages_GUI();
+ //es.setVisible(true);
+ }
+ });
+ lblErweiterteSuche.setForeground(Color.BLUE);
+
+ lblErweiterteSuche.setBounds(360, 106, 160, 14);
+ panel_1.add(lblErweiterteSuche);
+
+ comboBox = new JComboBox<String>();
+ try {
+ // Holt sich eine Liste aller verfuegbaren Betriebssysteme vom Server
+ List<String> list = client.getAllOS();
+ // Leeres Item hinzufuegen
+ comboBox.addItem("");
+ for (int i = 0; i < list.size(); i++) {
+ // Hinzufuegen der verfuegbaren Betriebssysteme
+ comboBox.addItem(list.get(i));
+ }
+ } catch (TException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e2.getCause()+"\n"+e2.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ // Registriert Auswahlaenderungen der Box
+ comboBox.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ // Prueft das die Auswahl nicht leer ist
+ if (comboBox.getSelectedItem().toString() != "") {
+ // Filtert nach dem ausgewaehlten Betriebssystem
+ rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox
+ .getSelectedItem().toString(), 2));
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ comboBox.getSelectedItem().toString(), 2));
+ }
+ }
+
+ });
+ comboBox.setBounds(270, 58, 250, 20);
+ panel_1.add(comboBox);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ // oeffnet das Hauuetmenue
+
+ SearchImage_GUI.this.setVisible(false);
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("VL-Image");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 45, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(133, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Imageauswahl");
+ lblNewLabel_1.setBounds(146, 11, 85, 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();
+ // String username="Spitzer Tobias";
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ username, 4));
+ } else if (tabbedPane.getSelectedIndex() == 1) {
+
+ }
+
+ }
+ });
+
+ tabbedPane.setBounds(10, 197, 557, 300);
+ contentPanel.add(tabbedPane);
+ initTableModel(modelMyImages);
+
+ JScrollPane scrollPaneAllImages = new JScrollPane();
+ tableAllImages = new JTable();
+ tableAllImages.setModel(modelAll);
+ tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit();
+ initTableModel(modelAll);
+
+ JScrollPane scrollPaneMyImage = new JScrollPane();
+ tablemyImages = new JTable();
+ tablemyImages.setModel(modelMyImages);
+ tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit();
+ tablemyImages.setRowSorter(rowSorterMyImages);
+
+ scrollPaneMyImage.setViewportView(tablemyImages);
+ tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null);
+ tableAllImages.setRowSorter(rowSorterAll);
+
+ scrollPaneAllImages.setViewportView(tableAllImages);
+ tabbedPane.addTab("Alle", null, scrollPaneAllImages, null);
+
+ JScrollPane scrollPaneCoopImages = new JScrollPane();
+ JTable 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 Images", null, scrollPaneCoopImages,
+ null);
+ tabbedPane.setEnabledAt(2, false);
+
+ JScrollPane scrollPanePublicImages = new JScrollPane();
+ JTable 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 Images", null,
+ scrollPanePublicImages, null);
+ tabbedPane.setEnabledAt(3, false);
+
+ JScrollPane scrollPanePublicVorlagen = new JScrollPane();
+ JTable tablePublicVorlagen = new JTable();
+ tablePublicVorlagen.setModel(model);
+ tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit();
+
+ 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) {
+ // oeffnet den Downloader
+
+ if (tablemyImages.getSelectedRow() != -1) {
+ String imageid = modelMyImages.getValueAt(
+ tablemyImages.convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 7).toString();
+
+ Image.image.setImageId(imageid);
+ String imageversion = modelMyImages.getValueAt(
+ tablemyImages.convertRowIndexToModel(tablemyImages
+ .getSelectedRow()), 8).toString();
+
+ Image.image.setVersion(imageversion);
+ SearchImage_GUI.this.setVisible(false);
+ FTPDownloader_GUI down = new FTPDownloader_GUI();
+ down.setVisible(true);
+
+
+ } else {
+ JOptionPane.showMessageDialog(null,
+ "Bitte w\u00e4hlen Sie ein Image f\u00fcr 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);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton okButton = new JButton("Zur\u00FCck");
+ okButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ // oeffnet das Hauptmenue
+
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ dispose();
+ }
+ });
+ okButton.setActionCommand("OK");
+ buttonPane.add(okButton);
+ getRootPane().setDefaultButton(okButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ 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) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(mntmAbout);
+
+ }
+
+ // Initiale Beffuelung eines Table models
+ public DefaultTableModel initTableModel(DefaultTableModel model) {
+ List<server.Image> images;
+ try {
+ // Hole eine Liste der Images
+ images = client.getImageList();
+
+ Iterator<server.Image> i = images.iterator();
+
+ 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(),
+ images.get(x).getUpdateTime(), "", images.get(x).id,
+ images.get(x).getVersion() };
+ // Fuege diese Objekte der Tabelle hinzu
+ model.addRow(obj);
+ x++;
+ i.next();
+
+ }
+
+ return model;
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e1.getCause()+"\n"+e1.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ return model;
+ }
+
+}
diff --git a/Dozentenmodul/src/main/java/gui/image/SearchMethodLecture_GUI.java b/Dozentenmodul/src/main/java/gui/image/SearchMethodLecture_GUI.java
new file mode 100644
index 00000000..4eda36f0
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/image/SearchMethodLecture_GUI.java
@@ -0,0 +1,290 @@
+package gui.image;
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JSeparator;
+import javax.swing.JTextArea;
+import javax.swing.JTextPane;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+
+import models.Links;
+import util.GuiOrganizer;
+import util.OpenLinks;
+
+@SuppressWarnings("serial")
+public class SearchMethodLecture_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ JRadioButton rdbtnSearchByImage;
+ JRadioButton rdbtnSearchByLecture;
+ private final ButtonGroup buttonGroup = new ButtonGroup();
+
+
+
+ /**
+ * Create the dialog.
+ */
+ public SearchMethodLecture_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ System.exit(0);
+ }
+ });
+ setResizable(false);
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("bwLehrpool Suite *Prototyp* - Suchmethode w\u00E4hlen");
+
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 577, 57);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Suchmethode ausw\u00E4hlen");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie
+ .setText("Geben Sie bitte an, nach welchem Kriterium Sie suchen m\u00F6chten.");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 493);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null,
+ "W\u00e4hlen Sie bitte die Suchmethode Ihrer Suche",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 36, 557, 369);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ rdbtnSearchByImage = new JRadioButton(
+ "Nach einem VL-Image oder Vorlagen suchen");
+ buttonGroup.add(rdbtnSearchByImage);
+ rdbtnSearchByImage.setBounds(6, 38, 545, 23);
+ panel_1.add(rdbtnSearchByImage);
+
+ JTextArea txtrHierKlickenWenn = new JTextArea();
+ txtrHierKlickenWenn.setBackground(SystemColor.menu);
+ txtrHierKlickenWenn.setLineWrap(true);
+ txtrHierKlickenWenn.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ txtrHierKlickenWenn
+ .setText("Hier klicken, wenn Sie nach einem konkreten Image suchen, von dem Sie exakte Daten kennen. Hierzu geh\u00F6ren z.B. das Betriebssystem oder die installierte Software.\r\nEs werden zudem alle Vorlagen aufgelistet.");
+ txtrHierKlickenWenn.setBounds(25, 68, 518, 80);
+ panel_1.add(txtrHierKlickenWenn);
+
+ JTextArea txtrHierKlickenWenn_1 = new JTextArea();
+ txtrHierKlickenWenn_1
+ .setText("Hier klicken, wenn Sie nur wissen f\u00FCr welche Veranstaltung das gesuchte Image verwendet wird. Hierzu geh\u00F6ren z.B. der Name des Dozenten oder der Name der Veranstaltung.");
+ txtrHierKlickenWenn_1.setLineWrap(true);
+ txtrHierKlickenWenn_1.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ txtrHierKlickenWenn_1.setBackground(SystemColor.menu);
+ txtrHierKlickenWenn_1.setBounds(25, 210, 518, 80);
+ panel_1.add(txtrHierKlickenWenn_1);
+
+ rdbtnSearchByLecture = new JRadioButton(
+ "Nach einer Veranstaltung suchen");
+ buttonGroup.add(rdbtnSearchByLecture);
+ rdbtnSearchByLecture.setBounds(6, 180, 545, 23);
+ panel_1.add(rdbtnSearchByLecture);
+
+ JPanel panel = new JPanel();
+ panel.setBounds(10, 402, 577, 33);
+ contentPanel.add(panel);
+ panel.setLayout(null);
+ panel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ panel.setBackground(SystemColor.menu);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+
+ SearchMethodLecture_GUI.this.setVisible(false);
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("VL-Image");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 45, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(133, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Suchmethode");
+ lblNewLabel_1.setBounds(146, 11, 82, 14);
+ contentPanel.add(lblNewLabel_1);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton backButton = new JButton("Zur\u00FCck");
+ backButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ MainMenue_GUI sr = new MainMenue_GUI();
+ sr.setVisible(true);
+ dispose();
+ }
+ });
+ backButton.setActionCommand("CANCEL");
+ buttonPane.add(backButton);
+ getRootPane().setDefaultButton(backButton);
+ }
+ {
+ JButton continueButton = new JButton("Weiter");
+ continueButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+ if (rdbtnSearchByImage.isSelected() == true) {
+ SearchImage_GUI si = new SearchImage_GUI();
+ si.setVisible(true);
+ dispose();
+ }
+ }
+
+ });
+ continueButton.setActionCommand("OK");
+ buttonPane.add(continueButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu = new JMenu("Suchen");
+ menuBar.add(mnNewMenu);
+
+ JMenuItem mntmVlSuche = new JMenuItem("VL Suche");
+ mnNewMenu.add(mntmVlSuche);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ 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) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(mntmAbout);
+
+ }
+}
diff --git a/Dozentenmodul/src/main/java/gui/intro/About_GUI.java b/Dozentenmodul/src/main/java/gui/intro/About_GUI.java
new file mode 100644
index 00000000..447f18ee
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/intro/About_GUI.java
@@ -0,0 +1,95 @@
+package gui.intro;
+
+import java.awt.Image;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JTextPane;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+
+import util.GuiOrganizer;
+
+@SuppressWarnings("serial")
+public class About_GUI extends JFrame {
+
+ private JPanel contentPane;
+ private JTextPane txtpnVersionVBuilddate;
+
+ /**
+ * Create the frame.
+ */
+ public About_GUI() {
+ // Fenster darf nicht vergroessert werden
+ setResizable(false);
+
+ try {
+ // Setzt das Look and Feel auf System
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e.getCause() + "\n" + e.getMessage(), "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
+ }
+ // Titel des Fensters setzen
+ setTitle("Dozentenmodul *Prototyp* - About");
+ // Aktion die beim Schliessen durchgefuehrt werden soll
+ setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+ // Groesse des Fensters definieren
+ setBounds(0, 0, 355, 309);
+ GuiOrganizer.centerGUI(this);
+ // Erzeugen eines Panels
+ contentPane = new JPanel();
+ // Hintergrund Farbe des Panels setzen
+ contentPane.setBackground(SystemColor.menu);
+ // Rahmen des Fensters setzen
+ contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
+ setContentPane(contentPane);
+ // Layout setzen
+ contentPane.setLayout(null);
+ // Label fuer das Logo erzeugen
+ JLabel imgLabel = new JLabel();
+ // Groesse und Position des Logos festelegen
+ imgLabel.setBounds(30, 18, 294, 80);
+ // Pfadangabe des Logos
+
+ ImageIcon icon = new ImageIcon(getClass().getResource(
+ "/Logo_bwLehrpool.png"), "Logo");
+ // Skalierung des Logos
+ Image scaled = icon.getImage().getScaledInstance(270, 64, 0);
+ imgLabel.setIcon(new ImageIcon(scaled));
+ // Hinzufuegen des Logos in das Fenster
+ contentPane.add(imgLabel);
+
+ // Erzeugen, Hinzufuegen und definierung der Aktion des Buttons
+ JButton BtnClose = new JButton("Close");
+ BtnClose.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ dispose();
+
+ }// end actionPerformed
+ });
+
+ BtnClose.setBounds(62, 226, 237, 23);
+ contentPane.add(BtnClose);
+
+ txtpnVersionVBuilddate = new JTextPane();
+ txtpnVersionVBuilddate
+ .setText("Version: v0.1\r\nBuild-Date: 03.06.2014\r\n\r\nContact: michael.wilson@hs-offenburg.de\r\nWebsite: http://bwlehrpool.hs-offenburg.de/");
+ txtpnVersionVBuilddate.setEditable(false);
+ txtpnVersionVBuilddate.setBackground(SystemColor.menu);
+ txtpnVersionVBuilddate.setBounds(62, 95, 224, 90);
+ contentPane.add(txtpnVersionVBuilddate);
+ }// end LoginGUI()
+}// end class
diff --git a/Dozentenmodul/src/main/java/gui/intro/BillOfRights_GUI.java b/Dozentenmodul/src/main/java/gui/intro/BillOfRights_GUI.java
new file mode 100644
index 00000000..21d15d40
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/intro/BillOfRights_GUI.java
@@ -0,0 +1,241 @@
+package gui.intro;
+
+
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSeparator;
+import javax.swing.JTextArea;
+import javax.swing.JTextPane;
+import javax.swing.SwingConstants;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+import models.Links;
+
+import org.ini4j.InvalidFileFormatException;
+import org.ini4j.Wini;
+
+import util.GuiOrganizer;
+import util.OpenLinks;
+
+
+
+@SuppressWarnings("serial")
+public class BillOfRights_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ JButton fwdButton;
+ JCheckBox chckbxAkzeptieren;
+
+ /**
+ * Create the dialog.
+ */
+ public BillOfRights_GUI() {
+ setResizable(false);
+
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ //Beendet das Programm beim Klick auf das X
+ System.exit(0);
+ }
+ });
+ try {
+ //Setzt das Look & Feel auf das System
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ //Setzt den Fenstertitel
+ setTitle("bwLehrpool Suite *Prototyp*");
+
+ //Zentiert das Fenster in der Bildschirmmitte
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 567, 60);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Hinweis");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie.setText("Bitte lesen und best\u00E4tigen Sie folgende rechtliche Hinweise");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 22);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 95, 567, 485);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JTextArea txtrLoremIpsumDolor = new JTextArea();
+ txtrLoremIpsumDolor.setWrapStyleWord(true);
+ txtrLoremIpsumDolor.setLineWrap(true);
+ txtrLoremIpsumDolor.setEditable(false);
+ JScrollPane scr=new JScrollPane(txtrLoremIpsumDolor);
+ scr.setBounds(0, 0, 567, 477);
+ txtrLoremIpsumDolor.setBounds(0, 0, 567, 477);
+ txtrLoremIpsumDolor.setText("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. \r\n\r\nDuis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. \r\n\r\nUt wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. \r\n\r\nNam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. \r\n\r\nDuis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis. \r\n\r\nAt vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat. \r\n\r\nConsetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus. \r\n\r\nLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. \r\n\r\nDuis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. \r\n\r\nUt wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. \r\n\r\nNam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo");
+
+ contentPanel.add(scr);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 630, 587, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ fwdButton = new JButton("Weiter");
+ fwdButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ try {
+ Wini ini=new Wini(new File("C:\\Users\\"+System.getProperty("user.name")+"\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ ini.put("main", "BillOfRights",true);
+ ini.store();
+ } catch (InvalidFileFormatException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e1.getCause()+"\n"+e1.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e1.getCause()+"\n"+e1.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ VmWareLink_GUI ac=new VmWareLink_GUI();
+ ac.setVisible(true);
+ dispose();
+ }
+ });
+ fwdButton.setEnabled(false);
+
+ buttonPane.add(fwdButton);
+ }
+ }
+ {
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 617, 587, 2);
+ getContentPane().add(separator);
+ }
+ {
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 82, 587, 2);
+ getContentPane().add(separator);
+ }
+
+ chckbxAkzeptieren = new JCheckBox("Ja, ich akzeptiere die Vereinbarung. Benachrichtigung nicht mehr anzeigen.");
+ chckbxAkzeptieren.addChangeListener(new ChangeListener() {
+ public void stateChanged(ChangeEvent arg0) {
+ //Beim Akzeptieren der Bestaetigung wird der Weiter-Button verfuegbar gemacht
+ if(chckbxAkzeptieren.isSelected()==true)
+ {
+
+ fwdButton.setEnabled(true);
+
+ }
+ else
+ {
+
+ }
+ }
+ });
+ chckbxAkzeptieren.setBackground(SystemColor.menu);
+ chckbxAkzeptieren.setBounds(10, 587, 567, 23);
+ getContentPane().add(chckbxAkzeptieren);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ mnNewMenu_1.setHorizontalAlignment(SwingConstants.CENTER);
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ 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);
+
+ }
+}
diff --git a/Dozentenmodul/src/main/java/gui/intro/Login_GUI.java b/Dozentenmodul/src/main/java/gui/intro/Login_GUI.java
new file mode 100644
index 00000000..06a87307
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/intro/Login_GUI.java
@@ -0,0 +1,336 @@
+package gui.intro;
+
+import java.awt.Color;
+import java.awt.EventQueue;
+import java.awt.Image;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.File;
+import java.io.IOException;
+
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JPasswordField;
+import javax.swing.JTextField;
+import javax.swing.SwingConstants;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+
+import models.SessionData;
+import models.person;
+
+import org.apache.thrift.TException;
+import org.ini4j.Wini;
+
+import thrift.ImageServer.Client;
+import thrift.MasterThriftConnection;
+import thrift.ThriftConnection;
+import thrift.UserInfo;
+import util.GuiOrganizer;
+import config.config_file;
+
+@SuppressWarnings("serial")
+public class Login_GUI extends JFrame {
+
+ private JPanel contentPane;
+ private JTextField lblusername;
+ private JPasswordField lblpass;
+ JLabel lblConnectionInfo = new JLabel("");
+ boolean isClientReturnedCorrectly = false;
+ boolean login;
+ String masterServerIP = MasterThriftConnection.MASTERSERVERIP;
+ MasterThriftConnection thrift;
+ Client client;
+ String token;
+
+ /**
+ * Launch the application.
+ */
+ public static void main(String[] args) {
+ EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ try {
+ // Pruefe und Erzeuge gegebenfalls Config
+ config_file cf = new config_file();
+ boolean conf = cf.createConfig();
+ if (conf == true) {
+ // Aufruf und Anzeige des Login Fensters
+ Login_GUI frame = new Login_GUI();
+ frame.setVisible(true);
+ } else {
+ JOptionPane.showMessageDialog(null,
+ "Fehler beim erzeugen der Konfigurationsfile",
+ "Message", JOptionPane.ERROR_MESSAGE);
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null, e.getStackTrace(),
+ "Message", JOptionPane.ERROR_MESSAGE);
+ }
+ }
+ });
+ }
+
+ /**
+ * Create the frame.
+ */
+ public Login_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent e) {
+ System.exit(0);
+ }
+ });
+
+ // Fenster darf nicht vergroessert werden
+ setResizable(false);
+
+ try {
+ // Setzt das Look and Feel auf System
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e.getCause() + "\n" + e.getMessage(), "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
+ }
+ // Titel des Fensters setzen
+ setTitle("Dozentenmodul *Prototyp*");
+ // Aktion die beim Schliessen durchgefuehrt werden soll
+ setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+
+ //Größe setzen und mittig ausrichten
+ setBounds(0, 0, 603, 400);
+ GuiOrganizer.centerGUI(this);
+
+ // Erzeugen eines Panels
+ contentPane = new JPanel();
+ // Hintergrund Farbe des Panels setzen
+ contentPane.setBackground(SystemColor.menu);
+ // Rahmen des Fensters setzen
+ contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
+ setContentPane(contentPane);
+ // Layout setzen
+ contentPane.setLayout(null);
+ // Label fuer das Logo erzeugen
+ JLabel imgLabel = new JLabel();
+ // Groesse und Position des Logos festelegen
+ imgLabel.setBounds(150, 11, 350, 142);
+ // Pfadangabe des Logos
+
+ ImageIcon icon = new ImageIcon(getClass().getResource(
+ "/Logo_bwLehrpool.png"), "Logo");
+ // Skalierung des Logos
+ Image scaled = icon.getImage().getScaledInstance(270, 64, 0);
+ imgLabel.setIcon(new ImageIcon(scaled));
+ // Hinzufuegen des Logos in das Fenster
+ contentPane.add(imgLabel);
+
+ // Erzeugen und Hinzufuegen des Labels
+ JLabel LabelUser = new JLabel("bwIDM-Benutzername:");
+ LabelUser.setBounds(111, 164, 134, 20);
+ contentPane.add(LabelUser);
+
+ // Erzeugen und Hinzufuegen des Textfeldes
+ lblusername = new JTextField();
+ lblusername
+ .setToolTipText("Bitte geben Sie Ihren bwIDM-Benutzernamen ein.");
+ lblusername.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ performLogin();
+ }
+ });
+ lblusername.setBounds(292, 164, 237, 20);
+ contentPane.add(lblusername);
+ lblusername.setColumns(10);
+
+ // Erzeugen und Hinzufuegen des Labels
+ JLabel LabelPass = new JLabel("bwIDM-Passwort:");
+ LabelPass.setBounds(111, 195, 134, 20);
+ contentPane.add(LabelPass);
+
+ // Erzeugen, Hinzufuegen und definierung der Aktion des Buttons
+ JButton BtnLogin = new JButton("Login");
+ BtnLogin.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ performLogin();
+ }// end actionPerformed
+ });
+
+ BtnLogin.setBounds(292, 244, 237, 23);
+ contentPane.add(BtnLogin);
+
+ // Erzeugen und Hinzufuegen des Passwortfeldes
+ lblpass = new JPasswordField();
+ lblpass.setToolTipText("Bitte geben Sie Ihr bwIDM-Passwort ein.");
+ lblpass.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ performLogin();
+ }
+ });
+ lblpass.setBounds(292, 195, 237, 20);
+ contentPane.add(lblpass);
+
+ lblConnectionInfo.setHorizontalAlignment(SwingConstants.LEFT);
+ lblConnectionInfo.setBounds(292, 290, 237, 20);
+ contentPane.add(lblConnectionInfo);
+ //GuiOrganizer.centerGUI(this);
+ }// end LoginGUI()
+
+ // Versuche den Benutzer einzuloggen
+ public void performLogin() {
+
+ login = false;
+ thrift = new MasterThriftConnection();
+ client = thrift.getMasterThriftConnection();
+ token = null;
+ thrift.SessionData result = null;
+
+ try {
+ login = true;
+ String passText = new String(lblpass.getPassword());
+ // check if client has received a connection with information or a
+ // null package
+ if (checkClientPackage() == true) {
+ // package has information
+ result = client.authenticate(lblusername.getText(), passText);
+ SessionData.session.setAuthToken(result.authToken);
+ SessionData.session.setSessionID(result.sessionId);
+ SessionData.session.setServerAdress(result.serverAddress);
+
+ // set connection to bwLehrpoolSuiteServer
+ ThriftConnection bwthrift = new ThriftConnection();
+ server.Server.Client bwClient = bwthrift.getThriftConnection();
+ models.Client.clientcon.setClient(bwClient);
+
+ System.out.println("Session-ID: " + result.sessionId
+ + "\nToken: " + result.authToken);
+
+ if (login == true) {
+ //Daten speichern
+ if (SessionData.session.getAuthToken() == null) {
+ System.out.println("Token ist null");
+ JOptionPane.showMessageDialog(null,
+ "Error: Token ist null", "Token defekt",
+ JOptionPane.ERROR_MESSAGE);
+ }
+ System.out.println("Hole jetzt Infos aus SessionData...");
+ UserInfo user = client.getUserFromToken(SessionData.session
+ .getAuthToken());
+
+ String hochschule = user.eMail.substring(user.eMail
+ .indexOf("@") + 1);
+
+ person.verantwortlicher.setUsername(lblusername.getText()
+ .substring(0, lblusername.getText().indexOf("@")));
+ person.verantwortlicher.setName(user.lastName);
+ person.verantwortlicher.setVorname(user.firstName);
+ person.verantwortlicher.setEMail(user.eMail);
+ person.verantwortlicher.setHochschule(hochschule);
+
+ try {
+ // Lege config File an und entscheide welches Fenster
+ // als naechstes geoeffnet wird
+ Wini ini = new Wini(
+ new File(
+ "C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ // Pruefe ob Bills Of Rights schon akzeptiert wurden,
+ // wenn
+ // nicht zeige diese an
+ if (ini.get("main", "BillOfRights", boolean.class) == false) {
+ // Erstellen einer Instanz der Aktionsauswahl
+ BillOfRights_GUI re = new BillOfRights_GUI();
+ re.setVisible(true);
+ // Schliessen des Fensters nach erfolgreichen Login
+ setVisible(false);
+ } else {
+ // Pruefe ob die Links zu vmware angezeigt werden
+ // sollen
+ if (ini.get("main", "vmware", boolean.class) == false) {
+ VmWareLink_GUI vm = new VmWareLink_GUI();
+ vm.setVisible(true);
+ setVisible(false);
+ } else {
+
+ // oeffne das Hauptmenue
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ setVisible(false);
+ }
+ }
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null, e.getCause() + "\n"
+ + e.getMessage(), "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
+ }
+
+ } else {
+ JOptionPane.showMessageDialog(null, "Login denied!",
+ "Message", JOptionPane.INFORMATION_MESSAGE);
+ }
+
+ } else {
+ // package from server is null
+ login = false;
+ lblConnectionInfo.setForeground(Color.red);
+ lblConnectionInfo
+ .setText("Fehler: Client nicht mit Server verbunden.");
+
+ }
+
+ } catch (thrift.AuthenticationException e) {
+ System.out
+ .println("Authentifizierung fehlgeschlagen: " + e.message);
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Benutzeranmeldung fehlgeschlagen: Bitte Benutzername und Passwort \u00fcberpr\u00fcfen.",
+ "Anmeldung fehlgeschlagen",
+ JOptionPane.ERROR_MESSAGE);
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e.getCause() + "\n" + e.getMessage(), "Message",
+ JOptionPane.ERROR_MESSAGE);
+ return;
+ } catch (TException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e.getCause() + "\n" + e.getMessage(), "Debug-Message",
+ JOptionPane.ERROR_MESSAGE);
+ return;
+ }
+ }// end performLogin
+
+ public boolean checkClientPackage() {
+ // check if client is null or has been returned with information
+ if (client != null) {
+ // client contains information
+ isClientReturnedCorrectly = true;
+ System.out.println("Verbindungsinformationen erhalten");
+ } else {
+ // client has returned with error
+ isClientReturnedCorrectly = false;
+ System.out
+ .println("Fehler: Keine korrekten Verbindungsdaten erhalten.");
+ }
+
+ return isClientReturnedCorrectly;
+ }// end checkServerConnection()
+
+}// end class
diff --git a/Dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java b/Dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java
new file mode 100644
index 00000000..2954ca3b
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java
@@ -0,0 +1,462 @@
+package gui.intro;
+
+import gui.image.CreateImageAllgemein_GUI;
+import gui.image.DeleteImage_GUI;
+import gui.image.SearchEditImage_GUI;
+import gui.image.SearchImage_GUI;
+import gui.lecture.CreateLectureAllgemein_GUI;
+import gui.lecture.DeleteLecture_GUI;
+import gui.lecture.EditLectureSearch_GUI;
+import gui.lecture.SearchLecture_GUI;
+
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.ScrollPane;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.swing.ButtonGroup;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JSeparator;
+import javax.swing.JTextArea;
+import javax.swing.JTextPane;
+import javax.swing.SwingConstants;
+import javax.swing.ToolTipManager;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+
+import models.Links;
+import models.SessionData;
+import util.GuiOrganizer;
+import util.OpenLinks;
+
+@SuppressWarnings("serial")
+public class MainMenue_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ String descNewImage, descEditImage, descDeleteImage, descSearchImage,
+ descNewLecture, descEditLecture, descDeleteLecture,
+ descSearchLecture = "";
+ JRadioButton rdbtnImageNew;
+ JRadioButton rdbtnImageEdit;
+ JRadioButton rdbtnImageSearchDownload;
+ JRadioButton rdbtnLectureNew;
+ JRadioButton rdbtnImageDelete;
+ JRadioButton rdbtnLectureEdit;
+ JRadioButton rdbtnLectureDelete;
+ JRadioButton rdbtnLectureSearch;
+ private final ButtonGroup buttonGroup = new ButtonGroup();
+ private JMenuItem mntmAbout;
+
+
+ /**
+ * Create the dialog.
+ */
+ public MainMenue_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ System.exit(0);
+ }
+ });
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("bwLehrpool Suite *Prototyp* - Connected Server: "+SessionData.session.getServerAdress());
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 567, 69);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Hauptmen\u00FC");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie
+ .setText("Bitte w\u00E4hlen Sie ihre gew\u00FCnschte Aktion.");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 22);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 104, 567, 502);
+ contentPanel.setBackground(SystemColor.menu);
+
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panelImage = new JPanel();
+ panelImage.setBackground(SystemColor.menu);
+ panelImage.setBorder(new TitledBorder(null, "VL-Image",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panelImage.setBounds(10, 146, 270, 170);
+ contentPanel.add(panelImage);
+ panelImage.setLayout(null);
+
+ rdbtnImageNew = new JRadioButton("Neu");
+ rdbtnImageNew
+ .setToolTipText("Hier k\u00F6nnen Sie eine standard Laborvorlage downloaden");
+ rdbtnImageNew.setBounds(6, 22, 159, 23);
+ panelImage.add(rdbtnImageNew);
+ rdbtnImageNew.setSelected(true);
+ buttonGroup.add(rdbtnImageNew);
+ rdbtnImageNew.setBackground(SystemColor.menu);
+
+ rdbtnImageEdit = new JRadioButton("Bearbeiten");
+ rdbtnImageEdit
+ .setToolTipText("Hier k\u00F6nnen Sie ein bestehendes Labor zum ver\u00E4ndern downloaden");
+ rdbtnImageEdit.setBounds(6, 48, 185, 23);
+ panelImage.add(rdbtnImageEdit);
+ buttonGroup.add(rdbtnImageEdit);
+ rdbtnImageEdit.setHorizontalAlignment(SwingConstants.LEFT);
+ rdbtnImageEdit.setBackground(SystemColor.menu);
+
+ rdbtnImageDelete = new JRadioButton("L\u00F6schen");
+ rdbtnImageDelete.setEnabled(true);
+ buttonGroup.add(rdbtnImageDelete);
+ rdbtnImageDelete
+ .setToolTipText("Hier k\u00F6nnen Sie ein bestehendes Labor zum ver\u00E4ndern downloaden");
+ rdbtnImageDelete.setHorizontalAlignment(SwingConstants.LEFT);
+ rdbtnImageDelete.setBackground(SystemColor.menu);
+ rdbtnImageDelete.setBounds(6, 74, 185, 23);
+ panelImage.add(rdbtnImageDelete);
+
+ rdbtnImageSearchDownload = new JRadioButton("Suche und Download");
+ buttonGroup.add(rdbtnImageSearchDownload);
+ rdbtnImageSearchDownload
+ .setToolTipText("Hier k\u00F6nnen Sie ein bestehendes Labor zum ver\u00E4ndern downloaden");
+ rdbtnImageSearchDownload.setHorizontalAlignment(SwingConstants.LEFT);
+ rdbtnImageSearchDownload.setBackground(SystemColor.menu);
+ rdbtnImageSearchDownload.setBounds(6, 100, 185, 23);
+ panelImage.add(rdbtnImageSearchDownload);
+
+ JPanel panelDesc = new JPanel();
+ panelDesc.setLayout(null);
+ panelDesc.setBorder(new TitledBorder(UIManager
+ .getBorder("TitledBorder.border"), "Erkl\u00e4rung",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panelDesc.setBackground(SystemColor.menu);
+ panelDesc.setBounds(290, 146, 270, 170);
+ contentPanel.add(panelDesc);
+
+ ScrollPane scrollPaneDesc = new ScrollPane();
+ scrollPaneDesc.setBounds(10, 15, 250, 145);
+ final JTextArea txtDesc = new JTextArea();
+ txtDesc.setLineWrap(true);
+ txtDesc.setWrapStyleWord(true);
+ txtDesc.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ txtDesc.setBackground(SystemColor.menu);
+ scrollPaneDesc.add(txtDesc);
+ // Pro AUswahl
+ txtDesc.setText("Legen Sie ein neues Image an und laden Sie anschlie\u00dfend die passende .vmdk-Datei hoch. Ein Image (wenn auch von einem anderen Dozenten) ist die Voraussetzung f\u00fcr eine Veranstaltung.");
+ panelDesc.add(scrollPaneDesc);
+
+ JPanel panelVeranstaltung = new JPanel();
+ panelVeranstaltung.setLayout(null);
+ panelVeranstaltung.setBorder(new TitledBorder(UIManager
+ .getBorder("TitledBorder.border"), "Veranstaltung (VMChooser)",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panelVeranstaltung.setBackground(SystemColor.menu);
+ panelVeranstaltung.setBounds(10, 327, 270, 170);
+ contentPanel.add(panelVeranstaltung);
+
+ rdbtnLectureNew = new JRadioButton("Neu");
+ buttonGroup.add(rdbtnLectureNew);
+ rdbtnLectureNew
+ .setToolTipText("Hier k\u00F6nnen Sie Ihre Labordaten eingeben");
+ rdbtnLectureNew.setBounds(6, 24, 185, 23);
+ panelVeranstaltung.add(rdbtnLectureNew);
+ rdbtnLectureNew.setBackground(SystemColor.menu);
+
+ rdbtnLectureEdit = new JRadioButton("Bearbeiten");
+ rdbtnLectureEdit
+ .setToolTipText("Hier k\u00F6nnen Sie einen Link auf ein bestehendes Labor erzeugen");
+ rdbtnLectureEdit.setBounds(6, 50, 230, 23);
+ panelVeranstaltung.add(rdbtnLectureEdit);
+ buttonGroup.add(rdbtnLectureEdit);
+ rdbtnLectureEdit.setBackground(SystemColor.menu);
+
+ rdbtnLectureDelete = new JRadioButton("L\u00F6schen");
+ rdbtnLectureDelete
+ .setToolTipText("Hier k\u00F6nnen Sie ein Labor l\u00F6schen");
+ rdbtnLectureDelete.setBounds(6, 76, 175, 23);
+ panelVeranstaltung.add(rdbtnLectureDelete);
+ buttonGroup.add(rdbtnLectureDelete);
+ rdbtnLectureDelete.setBackground(SystemColor.menu);
+
+ rdbtnLectureSearch = new JRadioButton("Suche");
+ buttonGroup.add(rdbtnLectureSearch);
+ rdbtnLectureSearch
+ .setToolTipText("Hier k\u00F6nnen Sie ein Labor l\u00F6schen");
+ rdbtnLectureSearch.setBackground(SystemColor.menu);
+ rdbtnLectureSearch.setBounds(6, 102, 175, 23);
+ panelVeranstaltung.add(rdbtnLectureSearch);
+
+ JPanel panelNews = new JPanel();
+ panelNews.setLayout(null);
+ panelNews.setBorder(new TitledBorder(UIManager
+ .getBorder("TitledBorder.border"), "News",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panelNews.setBackground(SystemColor.menu);
+ panelNews.setBounds(290, 327, 270, 170);
+ contentPanel.add(panelNews);
+
+ ScrollPane scrollPaneNews = new ScrollPane();
+ // scrollPaneDesc.setBounds(10, 15, 250, 145);
+ scrollPaneNews.setBounds(10, 15, 250, 145);
+ JTextArea txtNews = new JTextArea();
+ txtNews.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ txtNews.setBackground(SystemColor.menu);
+ txtNews.setWrapStyleWord(true);
+ txtNews.setLineWrap(true);
+ txtNews.setText("Hier werden mal die Neuigkeiten stehen. Diese kommen direkt vom Satelliten, sind als HS-spezifisch :)");
+ scrollPaneNews.add(txtNews);
+ panelNews.add(scrollPaneNews);
+
+ /*
+ * Funktion Texte f\u00fcr das Klicken der RadioButtons
+ */
+ rdbtnImageNew.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ descNewImage = "Legen Sie ein neues Image an und laden Sie anschlie\u00dfend die passende .vmdk-Datei hoch. Ein Image (wenn auch von einem anderen Dozenten) ist die Voraussetzung f\u00fcr eine Veranstaltung.";
+ txtDesc.setText(descNewImage);
+ }
+ });
+ rdbtnImageEdit.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ descEditImage = "Bearbeiten Sie die hinterlegten Informationen zu einem Image oder laden Sie eine neue .vmdk-Datei hoch.";
+ txtDesc.setText(descEditImage);
+ }
+ });
+ rdbtnImageDelete.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ descDeleteImage = "Suchen Sie alte und nicht mehr ben\u00f6tigte Images und l\u00f6schen Sie diese.";
+ txtDesc.setText(descDeleteImage);
+ }
+ });
+ rdbtnImageSearchDownload.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ descSearchImage = "Suchen Sie nach bestimmten Images oder verschaffen Sie sich einen \u00fcberblick \u00fcber alle verf\u00fcgbaren Images. Sie k\u00f6nnen gew\u00fcnschte Images umgehend herunterladen.";
+ txtDesc.setText(descSearchImage);
+ }
+ });
+ rdbtnLectureNew.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ descNewLecture = "Legen Sie eine neue Veranstaltung an und verkn\u00fcpfen Sie diese mit einem bereits vorhandenem Image. Ihre neue Veranstaltung kann auch auf dem Image eines anderen Dozenten beruhen.";
+ txtDesc.setText(descNewLecture);
+ }
+ });
+ rdbtnLectureEdit.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ descEditLecture = "Bearbeiten Sie die hinterlegten Informationen zu einer Veranstaltung.";
+ txtDesc.setText(descEditLecture);
+ }
+ });
+ rdbtnLectureDelete.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ descDeleteLecture = "Suchen und l\u00f6schen Sie eine Veranstaltung. Das hiermit verbundene Image bleibt erhalten.";
+ txtDesc.setText(descDeleteLecture);
+ }
+ });
+ rdbtnLectureSearch.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ descSearchLecture = "Suchen Sie nach bestimmten Veranstaltungen oder verschaffen Sie sich einen \u00fcberblick \u00fcber alle verf\u00fcgbaren Veranstaltungen. Eventuell gibt es bereits etwas passendes f\u00fcr Ihre Vorlesung.";
+ txtDesc.setText(descSearchLecture);
+ }
+ });
+ /*
+ * Ende der Radiobuttons
+ */
+
+ JLabel lblGrafik = new JLabel("");
+ // ToolTipp fuer Grafik
+ lblGrafik
+ .setToolTipText("<html>"
+ + "Ein virtuelles Labor besteht immer aus den beiden Komponenten <br>"
+ + "Image und Veranstaltung. Ein Image ist dabei die Grundlage f\u00FCr <br>"
+ + "mehrere Veranstaltungen. Somit kann eine neue Veranstaltung <br>"
+ + "erstellt werden, ohne ein neues Image hochladen zu m\u00FCssen. <br> <br> <br>"
+ + "<b>Image:</b> Das Image enth\u00E4lt die ben\u00F6tigte Software, die im <br>"
+ + "virtuellen Labor ben\u00F6tigt wird. Es wird von genau einem Dozenten <br>"
+ + "angelegt und besitzt einen allgemeinen Namen, z.B. \"Programmieren\". <br>"
+ + "Bei einem Image handelt es sich um eine Datei vom Typ VMDK. <br> <br> <br>"
+ + "<b>Veranstaltung:</b> Es k\u00F6nnen nun, basierend auf einem Image,<br>"
+ + " beliebig viele Veranstaltungen von unterschiedlichen Dozenten erstellt <br>"
+ + "werden. Diese k\u00F6nnten z.B. konkret \"Web-Entwicklung\" oder \"K\u00FCnstliche <br>"
+ + "Intelligenz\" lauten und referenzieren dabei auf das allgemeine Image <br>"
+ + "\"Programmieren\".</html>");
+ lblGrafik.setIcon(new ImageIcon(MainMenue_GUI.class
+ .getResource("/Image_zu_Veranstaltung_HDD.png")));
+ // ToolTipp lange anzeigen - 60sec
+ ToolTipManager.sharedInstance().setDismissDelay(60000);
+ ToolTipManager.sharedInstance().registerComponent(lblGrafik);
+ lblGrafik.setBounds(82, 3, 391, 110);
+ contentPanel.add(lblGrafik);
+
+ JTextPane txtpnUmDetaillierteInformationen = new JTextPane();
+ txtpnUmDetaillierteInformationen
+ .setText("Um detaillierte Informationen zu erhalten, fahren Sie bitte mit der Maus \u00FCber die Grafik.");
+ txtpnUmDetaillierteInformationen.setEditable(false);
+ txtpnUmDetaillierteInformationen.setBackground(SystemColor.menu);
+ txtpnUmDetaillierteInformationen.setBounds(10, 113, 509, 22);
+ contentPanel.add(txtpnUmDetaillierteInformationen);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 630, 587, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton continueButton = new JButton("Weiter");
+
+ continueButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+ // Images
+ if (rdbtnImageNew.isSelected() == true) {
+ CreateImageAllgemein_GUI sr = new CreateImageAllgemein_GUI();
+ sr.setVisible(true);
+ dispose();
+ } else if (rdbtnImageEdit.isSelected() == true) {
+ SearchEditImage_GUI si = new SearchEditImage_GUI();
+ si.setVisible(true);
+ dispose();
+ } else if (rdbtnImageDelete.isSelected() == true) {
+ DeleteImage_GUI di = new DeleteImage_GUI();
+ di.setVisible(true);
+ dispose();
+ } else if (rdbtnImageSearchDownload.isSelected() == true) {
+ // SearchMethodLecture_GUI sm = new
+ // SearchMethodLecture_GUI();
+ SearchImage_GUI si = new SearchImage_GUI();
+ si.setVisible(true);
+ dispose();
+ // Lectures
+ } else if (rdbtnLectureNew.isSelected() == true) {
+ CreateLectureAllgemein_GUI av = new CreateLectureAllgemein_GUI();
+ av.setVisible(true);
+ dispose();
+ } else if (rdbtnLectureEdit.isSelected() == true) {
+ EditLectureSearch_GUI el = new EditLectureSearch_GUI();
+ el.setVisible(true);
+ dispose();
+ } else if (rdbtnLectureDelete.isSelected() == true) {
+ DeleteLecture_GUI dl = new DeleteLecture_GUI();
+ dl.setVisible(true);
+ dispose();
+ } else if (rdbtnLectureSearch.isSelected() == true) {
+ SearchLecture_GUI sl = new SearchLecture_GUI();
+ sl.setVisible(true);
+ dispose();
+ }
+ }
+ });
+ continueButton.setActionCommand("OK");
+ buttonPane.add(continueButton);
+ getRootPane().setDefaultButton(continueButton);
+ }
+ }
+ {
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 617, 587, 2);
+ getContentPane().add(separator);
+ }
+ {
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 91, 587, 2);
+ getContentPane().add(separator);
+ }
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ 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);
+
+ mntmAbout = new JMenuItem("About");
+ mntmAbout.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(mntmAbout);
+
+ }// end main
+}// end class
diff --git a/Dozentenmodul/src/main/java/gui/intro/VmWareLink_GUI.java b/Dozentenmodul/src/main/java/gui/intro/VmWareLink_GUI.java
new file mode 100644
index 00000000..87c6b2a2
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/intro/VmWareLink_GUI.java
@@ -0,0 +1,292 @@
+package gui.intro;
+
+
+import java.awt.Desktop;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JTextPane;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+import models.Links;
+
+import org.ini4j.InvalidFileFormatException;
+import org.ini4j.Wini;
+
+import util.GuiOrganizer;
+import util.OpenLinks;
+
+
+@SuppressWarnings("serial")
+public class VmWareLink_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ JCheckBox chckbxNewCheckBox;
+ private JButton btnWindows;
+
+
+ /**
+ * Create the dialog.
+ */
+ public VmWareLink_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent e) {
+ System.exit(0);
+ }
+ });
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("Dozentenmodul *Prototyp*");
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBounds(0, 0, 577, 80);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Hinweis VMWare Player");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 42);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 104, 567, 502);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JTextPane txtpnUmIhreVmdk = new JTextPane();
+ txtpnUmIhreVmdk.setBackground(SystemColor.menu);
+ txtpnUmIhreVmdk.setEditable(false);
+ txtpnUmIhreVmdk.setText("F\u00FCr die Arbeit mit der bwLehrpool Suite wird zwingend ein VMWare Player ben\u00F6tigt. Diesen k\u00F6nnen Sie sich unter folgendem Link kostenfrei downloaden.");
+ txtpnUmIhreVmdk.setBounds(10, 16, 499, 66);
+ contentPanel.add(txtpnUmIhreVmdk);
+
+ JLabel lblNewLabel_1 = new JLabel("<html><b>Windows: </b></html>");
+ lblNewLabel_1.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseReleased(MouseEvent arg0) {
+ URI url;
+ try {
+ url = new URI("https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/6_0");
+ Desktop.getDesktop().browse(url);
+ } catch (URISyntaxException | IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e.getCause()+"\n"+e.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+
+ }
+ });
+
+ lblNewLabel_1.setBounds(10, 93, 499, 14);
+ contentPanel.add(lblNewLabel_1);
+
+ chckbxNewCheckBox = new JCheckBox("Diese Benachrichtigung nicht mehr anzeigen.");
+ chckbxNewCheckBox.addChangeListener(new ChangeListener() {
+ public void stateChanged(ChangeEvent arg0) {
+ if(chckbxNewCheckBox.isSelected()==true)
+ {
+ try {
+ Wini ini=new Wini(new File("C:\\Users\\"+System.getProperty("user.name")+"\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ ini.put("main", "vmware",true);
+ ini.store();
+ } catch (InvalidFileFormatException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e1.getCause()+"\n"+e1.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e1.getCause()+"\n"+e1.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ }
+ }
+ });
+ chckbxNewCheckBox.setBounds(6, 472, 555, 23);
+ contentPanel.add(chckbxNewCheckBox);
+
+ JLabel lbllinuxvmwarePlayer = new JLabel("<html><b>Linux: </b></html>");
+ lbllinuxvmwarePlayer.setBounds(10, 178, 499, 14);
+ contentPanel.add(lbllinuxvmwarePlayer);
+
+ btnWindows = new JButton("VMware Player herunterladen");
+ btnWindows.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ try {
+
+ OpenLinks open = new OpenLinks();
+
+ URI windows= new URI(Links.getUriWindows());
+
+ open.openWebpage(windows);
+
+ } catch (URISyntaxException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+ });
+ btnWindows.setBounds(10, 119, 186, 23);
+ contentPanel.add(btnWindows);
+
+ JButton btnLinux = new JButton("VMware Player herunterladen");
+ btnLinux.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ try {
+ OpenLinks open = new OpenLinks();
+
+ URI linux= new URI(Links.getUriLinux());
+
+ open.openWebpage(linux);
+
+ } catch (URISyntaxException f) {
+ // TODO Auto-generated catch block
+ f.printStackTrace();
+ }
+ }
+ });
+ btnLinux.setBounds(10, 203, 186, 23);
+ contentPanel.add(btnLinux);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 630, 587, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton cancelButton = new JButton("Weiter");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ MainMenue_GUI ea=new MainMenue_GUI();
+ ea.setVisible(true);
+ dispose();
+ }
+ });
+ cancelButton.setActionCommand("Cancel");
+ buttonPane.add(cancelButton);
+ }
+ }
+ {
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 617, 587, 2);
+ getContentPane().add(separator);
+ }
+ {
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 91, 587, 2);
+ getContentPane().add(separator);
+ }
+ {
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+ {
+ JMenu mnHilfe = new JMenu("Hilfe");
+ menuBar.add(mnHilfe);
+ {
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+
+ }
+ });
+
+ mnHilfe.add(mntmFaq);
+ }
+ {
+ JMenuItem mntmOTRS = new JMenuItem("OTRS");
+ mntmOTRS.addMouseListener(new MouseAdapter() {
+ @Override
+ 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();
+ }
+
+ }
+ });
+
+ mnHilfe.add(mntmOTRS);
+ }
+ }
+ }
+
+
+
+ }//end constructor
+
+
+
+}// end class
diff --git a/Dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java b/Dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java
new file mode 100644
index 00000000..44e8bd50
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java
@@ -0,0 +1,545 @@
+package gui.lecture;
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.ScrollPane;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Calendar;
+import java.util.Date;
+
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JSeparator;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+
+import models.Image;
+import models.Lecture;
+import models.Links;
+import models.person;
+import util.GuiOrganizer;
+import util.OpenLinks;
+
+import com.toedter.calendar.JDateChooser;
+
+@SuppressWarnings("serial")
+public class CreateLectureAllgemein_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ private JTextField Vorname;
+ private JTextField Nachname;
+ private JTextField Hochschule;
+ private JTextField EMail;
+ private JTextField txtFldVeranstaltungsname;
+ JTextArea description;
+ JRadioButton radioButtonyes;
+ JRadioButton radioButtonno;
+ JDateChooser dateChooserend;
+ JDateChooser dateChooserstart;
+ Date startDate = new Date();
+ Date endDate;
+ int maxLifeTime = 180; // Anzahl Tage, die eine Veranstaltung in der Zukunft
+ // aktiv sein darf
+ boolean isDateOrderCorrect, isDateMaxLifeTimeCorrect,
+ isAllInformationReady = false;
+
+
+ /**
+ * Create the dialog.
+ */
+ public CreateLectureAllgemein_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ System.exit(0);
+ }
+
+ @Override
+ public void windowOpened(WindowEvent arg0) {
+ txtFldVeranstaltungsname.requestFocusInWindow();
+ }
+ });
+ setResizable(false);
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung erzeugen");
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 577, 57);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Eingabe Ihrer Daten");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie
+ .setText("Geben Sie hier bitte einen sprechenden Imagename sowie Ihre Kontaktdaten an");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 21);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 493);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Informationen zum Besitzer",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 331, 557, 162);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JLabel label = new JLabel("Vorname: *");
+ label.setBackground(SystemColor.menu);
+ label.setBounds(10, 33, 125, 20);
+ panel_1.add(label);
+
+ Vorname = new JTextField();
+ Vorname.setEditable(false);
+ Vorname.setEnabled(false);
+ Vorname.setText(person.verantwortlicher.getVorname());
+ Vorname.setBackground(Color.WHITE);
+ Vorname.setColumns(10);
+ Vorname.setBounds(145, 33, 350, 20);
+ panel_1.add(Vorname);
+
+ JLabel label_7 = new JLabel("Nachname: *");
+ label_7.setBackground(SystemColor.menu);
+ label_7.setBounds(10, 64, 125, 20);
+ panel_1.add(label_7);
+
+ Nachname = new JTextField();
+ Nachname.setEnabled(false);
+ Nachname.setEditable(false);
+ Nachname.setText(person.verantwortlicher.getName());
+ Nachname.setBackground(Color.WHITE);
+ Nachname.setColumns(10);
+ Nachname.setBounds(145, 64, 350, 20);
+ panel_1.add(Nachname);
+
+ JLabel label_8 = new JLabel("Hochschule: *");
+ label_8.setBackground(SystemColor.menu);
+ label_8.setBounds(10, 95, 125, 20);
+ panel_1.add(label_8);
+
+ Hochschule = new JTextField();
+ Hochschule.setEnabled(false);
+ Hochschule.setEditable(false);
+ Hochschule.setText(person.verantwortlicher.getHochschule());
+ Hochschule.setBackground(Color.WHITE);
+ Hochschule.setColumns(10);
+ Hochschule.setBounds(145, 95, 350, 20);
+ panel_1.add(Hochschule);
+
+ JLabel label_9 = new JLabel("E-Mail: *");
+ label_9.setBackground(SystemColor.menu);
+ label_9.setBounds(10, 126, 125, 20);
+ panel_1.add(label_9);
+
+ EMail = new JTextField();
+ EMail.setEnabled(false);
+ EMail.setEditable(false);
+ EMail.setText(person.verantwortlicher.getEMail());
+ EMail.setBackground(Color.WHITE);
+ EMail.setColumns(10);
+ EMail.setBounds(145, 126, 350, 20);
+ panel_1.add(EMail);
+
+ JPanel panel = new JPanel();
+ panel.setBounds(10, 402, 577, 33);
+ contentPanel.add(panel);
+ panel.setLayout(null);
+ panel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ panel.setBackground(SystemColor.menu);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+
+ CreateLectureAllgemein_GUI.this.setVisible(false);
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("VL-Image");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 45, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(133, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Neu");
+ lblNewLabel_1.setBounds(146, 11, 46, 14);
+ contentPanel.add(lblNewLabel_1);
+
+ JPanel panel_2 = new JPanel();
+ panel_2.setLayout(null);
+ panel_2.setBorder(new TitledBorder(null, "Veranstaltungsdaten",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_2.setBackground(SystemColor.menu);
+ panel_2.setBounds(10, 36, 557, 284);
+ contentPanel.add(panel_2);
+
+ JLabel label_3 = new JLabel("Laborname (Anzeigename): *");
+ label_3.setBounds(10, 25, 180, 14);
+ panel_2.add(label_3);
+
+ txtFldVeranstaltungsname = new JTextField();
+ txtFldVeranstaltungsname.setColumns(10);
+ txtFldVeranstaltungsname.setBounds(200, 22, 347, 20);
+ txtFldVeranstaltungsname.setText(Lecture.lecture.getName());
+ panel_2.add(txtFldVeranstaltungsname);
+
+ JTextArea textArea = new JTextArea();
+ textArea.setEditable(false);
+ textArea.setWrapStyleWord(true);
+ textArea.setText("Geben Sie bitte einen sprechenden Namen f\u00FCr das Image an. Dieser soll jedoch recht allgemein gehalten werden.\r\nBeispiel: \"Programmieren\", nicht \"Programmieren 1\"");
+ textArea.setLineWrap(true);
+ textArea.setFont(new Font("Tahoma", Font.PLAIN, 12));
+ textArea.setBackground(SystemColor.menu);
+ textArea.setBounds(10, 49, 537, 49);
+ panel_2.add(textArea);
+
+ JLabel lblDesc = new JLabel("Beschreibung: *");
+ lblDesc.setBounds(10, 111, 180, 14);
+ panel_2.add(lblDesc);
+
+ ScrollPane scrollPane = new ScrollPane();
+ scrollPane.setBounds(200, 104, 347, 78);
+ panel_2.add(scrollPane);
+ description = new JTextArea();
+ description.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ description.setLineWrap(true);
+ description.setText(Lecture.lecture.getDesc());
+ scrollPane.add(description);
+ description.setBounds(0, 0, 4, 22);
+ scrollPane.add(description);
+
+ dateChooserend = new JDateChooser();
+ endDate = addDays(new Date(), maxLifeTime); // Datum darf weiter als 6
+ // Monate in der Zukunft
+ // liegen
+ dateChooserend.setDate(endDate);
+ if (Lecture.lecture.getEnddate() == null) {
+ // is not defined yet
+ dateChooserend.setDate(endDate);
+ } else {
+ // already defined from last visit on this page
+ dateChooserend.setDate(Lecture.lecture.getEnddate());
+ }
+ dateChooserend.setDateFormatString("yyyy-MM-dd hh:mm:ss");
+ dateChooserend.setBounds(404, 188, 143, 20);
+ panel_2.add(dateChooserend);
+
+ JLabel lblBis = new JLabel("bis:");
+ lblBis.setBounds(378, 188, 21, 20);
+ panel_2.add(lblBis);
+
+ dateChooserstart = new JDateChooser();
+ if (Lecture.lecture.getStartdate() == null) {
+ // is not defined yet
+ dateChooserstart.setDate(startDate);
+ } else {
+ // already defined from last visit on this page
+ dateChooserstart.setDate(Lecture.lecture.getStartdate());
+ }
+ dateChooserstart.setDateFormatString("yyyy-MM-dd hh:mm:ss");
+ dateChooserstart.setBounds(226, 188, 143, 20);
+ panel_2.add(dateChooserstart);
+
+ JLabel label_6 = new JLabel("von:");
+ label_6.setBounds(200, 188, 30, 20);
+ panel_2.add(label_6);
+
+ JLabel label_10 = new JLabel("G\u00FCltigkeitsdatum: *");
+ label_10.setBounds(10, 194, 127, 14);
+ panel_2.add(label_10);
+
+ JLabel label_11 = new JLabel("Aktiv:");
+ label_11.setBounds(10, 229, 127, 14);
+ panel_2.add(label_11);
+
+ radioButtonyes = new JRadioButton("Ja");
+ radioButtonyes.setSelected(true);
+ radioButtonyes.setBounds(200, 225, 73, 23);
+ panel_2.add(radioButtonyes);
+
+ radioButtonno = new JRadioButton("Nein");
+ radioButtonyes.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ radioButtonyes.setSelected(true);
+ radioButtonno.setSelected(false);
+ }
+ });
+ radioButtonno.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ radioButtonno.setSelected(true);
+ radioButtonyes.setSelected(false);
+ }
+ });
+ radioButtonno.setBounds(296, 225, 73, 23);
+ panel_2.add(radioButtonno);
+
+ JLabel lblimVmchooserSichtbar = new JLabel("(im VMChooser sichtbar)");
+ lblimVmchooserSichtbar.setBounds(10, 245, 127, 14);
+ panel_2.add(lblimVmchooserSichtbar);
+
+ JLabel lblmaxMonate = new JLabel("(max. 6 Monate)");
+ lblmaxMonate.setBounds(10, 208, 127, 14);
+ panel_2.add(lblmaxMonate);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton backButton = new JButton("Zur\u00FCck");
+ backButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ if (radioButtonyes.isSelected() == true) {
+ Lecture.lecture.setActive(true);
+ } else {
+ Lecture.lecture.setActive(false);
+ }
+
+ Lecture.lecture.setName(txtFldVeranstaltungsname
+ .getText());
+ Lecture.lecture.setDesc(description.getText());
+ Lecture.lecture.setEnddate(dateChooserend.getDate());
+ Lecture.lecture.setStartdate(dateChooserstart.getDate());
+ Image.image.setImagename(txtFldVeranstaltungsname
+ .getText());
+
+ MainMenue_GUI sr = new MainMenue_GUI();
+ sr.setVisible(true);
+ dispose();
+ }
+ });
+ backButton.setActionCommand("Cancel");
+ buttonPane.add(backButton);
+ getRootPane().setDefaultButton(backButton);
+ }
+ {
+ JButton continueButton = new JButton("Weiter");
+ continueButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ // liegt das End-Datum vor dem Start-Datum?
+ if (dateChooserend.getDate().before(
+ dateChooserstart.getDate())) {
+ // datum ist falsch rum
+ isDateOrderCorrect = false;
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Das End-Datum liegt vor dem Start-Datum. Bitte \u00e4ndern.",
+ "Datum fehlerhaft",
+ JOptionPane.INFORMATION_MESSAGE);
+ } else {
+ // bereit
+ isDateOrderCorrect = true;
+ }
+ // liegt das eingegebene Datum nach dem erlaubten
+ // End-Datum?
+ if (dateChooserend.getDate().after(endDate)) {
+ // Datum zu weit weg
+ isDateMaxLifeTimeCorrect = false;
+ JOptionPane.showMessageDialog(null,
+ "Das End-Datum liegt zu weit in der Zukunft. Erlaubt ist maximal:\n"
+ + endDate, "Datum fehlerhaft",
+ JOptionPane.INFORMATION_MESSAGE);
+ dateChooserend.setDate(endDate); //setze Datum auf maximum
+ } else {
+ // bereit
+ isDateMaxLifeTimeCorrect = true;
+ }
+ // Pruefen ob alles eingegeben wurde
+ if (txtFldVeranstaltungsname.getText().isEmpty() == true
+ || description.getText().isEmpty() == true) {
+ // mind 1 Textfeld ist leer
+ isAllInformationReady = false;
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Bitte geben Sie einen Veranstaltungsnamen und eine Beschreibung ein.",
+ "Datum fehlerhaft",
+ JOptionPane.INFORMATION_MESSAGE);
+ } else {
+ // Textfelder bereit
+ isAllInformationReady = true;
+ }
+
+ // welcher Radiobutton ist geklickt?
+ if (radioButtonyes.isSelected() == true) {
+ Lecture.lecture.setActive(true);
+ } else {
+ Lecture.lecture.setActive(false);
+ }
+ // Pruefe ob alle Eingaben korrekt sind, dann mache
+ // weiter
+ if (isAllInformationReady == true
+ && isDateMaxLifeTimeCorrect == true
+ && isDateOrderCorrect == true) {
+ // everything is ok, proceed
+ Lecture.lecture.setName(txtFldVeranstaltungsname
+ .getText());
+ Lecture.lecture.setDesc(description.getText());
+ Lecture.lecture.setEnddate(dateChooserend.getDate());
+ Lecture.lecture.setStartdate(dateChooserstart
+ .getDate());
+ Image.image.setImagename(txtFldVeranstaltungsname
+ .getText());
+
+ CreateLectureLink_GUI ev = new CreateLectureLink_GUI();
+ ev.setVisible(true);
+ dispose();
+ }
+
+ }
+ });
+ continueButton.setActionCommand("OK");
+ buttonPane.add(continueButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JLabel lblPflichtfelder = new JLabel("* Pflichtfelder");
+ lblPflichtfelder.setBounds(32, 602, 136, 14);
+ getContentPane().add(lblPflichtfelder);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu = new JMenu("Suchen");
+ menuBar.add(mnNewMenu);
+
+ JMenuItem mntmVlSuche = new JMenuItem("VL Suche");
+ mnNewMenu.add(mntmVlSuche);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ 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 mnmtAbout = new JMenuItem("About");
+ mnmtAbout.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(mnmtAbout);
+
+ }
+
+ public Date addDays(Date date, int days) {
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(date);
+ cal.add(Calendar.DATE, days); // minus number would decrement the days
+ return cal.getTime();
+ }
+}
diff --git a/Dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java b/Dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java
new file mode 100644
index 00000000..0a00e781
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java
@@ -0,0 +1,540 @@
+package gui.lecture;
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JScrollPane;
+import javax.swing.JSeparator;
+import javax.swing.JTabbedPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+import javax.swing.table.DefaultTableModel;
+
+import models.Lecture;
+import models.Links;
+import models.person;
+
+import org.apache.thrift.TException;
+
+import server.Server.Client;
+import thrift.ThriftConnection;
+import util.GuiOrganizer;
+import util.OpenLinks;
+
+@SuppressWarnings("serial")
+public class CreateLectureLink_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ JRadioButton rdbtnInternetJa;
+ JRadioButton rdbtnInternetNein;
+ JComboBox<String> comboBox;
+ JTable tableAllImages = new JTable();
+ JTable tablemyImages = new JTable();
+ JTable tableCoopImages = new JTable();
+ JTable tablePublicImages = new JTable();
+ JTable tablePublicVorlagen = new JTable();
+ private JTextField textFieldName;
+ String[] titles = { "Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung",
+ "Verantwortlicher", "Letztes Update", "Schlagwort" };
+ ThriftConnection con = new ThriftConnection();
+ Client client = models.Client.clientcon.getClient();
+
+
+ /**
+ * Create the dialog.
+ */
+ public CreateLectureLink_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ con.closeThriftConnection();
+ System.exit(0);
+ }
+
+ @Override
+ public void windowOpened(WindowEvent arg0) {
+ textFieldName.requestFocusInWindow();
+ }
+ });
+ setResizable(false);
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung erzeugen");
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ final DefaultTableModel modelAll = new DefaultTableModel(titles, 0);
+ final DefaultTableModel model = new DefaultTableModel(titles, 0);
+
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 577, 57);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Image verlinken");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie
+ .setText("W\u00E4hlen Sie bitte ein Image aus, auf dem Ihre Versanstaltung basiert.");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 531);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Filterfunktionen",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 49, 557, 131);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JLabel lblNewLabel_2 = new JLabel("Anzeigename:");
+ lblNewLabel_2.setBounds(10, 30, 250, 20);
+ panel_1.add(lblNewLabel_2);
+
+ JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:");
+ lblInternetIstInnerhalb.setBounds(10, 58, 250, 20);
+ panel_1.add(lblInternetIstInnerhalb);
+
+ textFieldName = new JTextField();
+ textFieldName.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+ String stext = textFieldName.getText();
+ modelAll.setRowCount(0);
+ initTableModel(modelAll);
+
+ if (stext != "")
+ for (int i = 0; i < modelAll.getRowCount(); i++) {
+
+ if (modelAll.getValueAt(i, 0).toString()
+ .startsWith(stext)) {
+
+ } else {
+ modelAll.removeRow(i);
+ }
+ }
+
+ }
+
+ });
+
+ textFieldName.setBounds(270, 30, 250, 20);
+ panel_1.add(textFieldName);
+ textFieldName.setColumns(10);
+
+ JLabel lblErweiterteSuche = new JLabel(
+ "<html><u>Erweiterte Suche</u></html>");
+ lblErweiterteSuche.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ ExtendedSearchForImages_GUI es = new ExtendedSearchForImages_GUI();
+ es.setVisible(true);
+ }
+ });
+ lblErweiterteSuche.setForeground(Color.BLUE);
+
+ lblErweiterteSuche.setBounds(431, 106, 89, 14);
+ panel_1.add(lblErweiterteSuche);
+
+ comboBox = new JComboBox<String>();
+ try {
+ List<String> list = client.getAllOS();
+ comboBox.addItem("");
+ for (int i = 0; i < list.size(); i++) {
+ comboBox.addItem(list.get(i));
+ }
+ } catch (TException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e.getCause()+"\n"+e.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+ comboBox.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ modelAll.setRowCount(0);
+ initTableModel(modelAll);
+ String selItem = comboBox.getSelectedItem().toString();
+ if (selItem != "") {
+ for (int i = 0; i < modelAll.getRowCount(); i++) {
+
+ if (modelAll.getValueAt(i, 2).equals(selItem)) {
+
+ } else {
+ modelAll.removeRow(i);
+ }
+ }
+
+ }
+ }
+ });
+ comboBox.setBounds(270, 58, 250, 20);
+ panel_1.add(comboBox);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+
+ CreateLectureLink_GUI.this.setVisible(false);
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("Veranstaltung");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 76, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(151, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Imageauswahl");
+ lblNewLabel_1.setBounds(164, 11, 85, 14);
+ contentPanel.add(lblNewLabel_1);
+
+ JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
+
+ tabbedPane.setBounds(10, 197, 557, 300);
+ contentPanel.add(tabbedPane);
+
+ JScrollPane scrollPaneMyImage = new JScrollPane();
+
+ tablemyImages.setModel(model);
+ tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit();
+
+ JScrollPane scrollPaneAllImages = new JScrollPane();
+ tableAllImages = new JTable();
+ tableAllImages.setModel(modelAll);
+ tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit();
+
+ scrollPaneAllImages.setViewportView(tableAllImages);
+ tabbedPane.addTab("Alle", null, scrollPaneAllImages, null);
+
+ scrollPaneMyImage.setViewportView(tablemyImages);
+ tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null);
+
+ JScrollPane scrollPaneCoopImages = new JScrollPane();
+
+ 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 Images", null, scrollPaneCoopImages,
+ null);
+ tabbedPane.setEnabledAt(2, false);
+
+ JScrollPane scrollPanePublicImages = new JScrollPane();
+
+ 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 Images", null,
+ scrollPanePublicImages, null);
+ tabbedPane.setEnabledAt(3, false);
+
+ JScrollPane scrollPanePublicVorlagen = new JScrollPane();
+
+ tablePublicVorlagen.setModel(model);
+ tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit();
+
+ scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen);
+ tabbedPane.addTab("\u00D6ffentliche Vorlagen", null,
+ scrollPanePublicVorlagen, null);
+ tabbedPane.setEnabledAt(4, false);
+
+ initTableModel(modelAll);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton cancelButton = new JButton("Zur\u00FCck");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+ CreateLectureAllgemein_GUI eVAG = new CreateLectureAllgemein_GUI();
+ eVAG.setVisible(true);
+ dispose();
+ }
+ });
+ cancelButton.setActionCommand("CANCEL");
+ buttonPane.add(cancelButton);
+ getRootPane().setDefaultButton(cancelButton);
+ }
+ {
+ JButton doLinkButton = new JButton(
+ "Veranstaltung erzeugen und abschlie\u00DFen");
+ doLinkButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+ // check if a row is selected
+ if ((tableAllImages.getSelectedRow() != -1)
+ || (tablemyImages.getSelectedRow() != -1)
+ || (tableCoopImages.getSelectedRow() != -1)
+ || (tablePublicImages.getSelectedRow() != -1)
+ || (tablePublicVorlagen.getSelectedRow() != -1)) {
+
+ // a row is selected, do operations
+ String imagename = tableAllImages.getValueAt(
+ tableAllImages.getSelectedRow(), 0)
+ .toString();
+ try {
+ DateFormat formatter = new SimpleDateFormat(
+ "yyyy-MM-dd hh:mm:ss");
+ client.writeLecturedata(
+ Lecture.lecture.getName(),
+ Lecture.lecture.getShortDesc(),
+ Lecture.lecture.getDesc(),
+ formatter.format(
+ Lecture.lecture.getStartdate())
+ .toString(),
+ formatter.format(
+ Lecture.lecture.getEnddate())
+ .toString(),
+ Lecture.lecture.isActive(),
+ imagename,
+ person.verantwortlicher.getUsername(),
+ person.verantwortlicher.getVorname(),
+ person.verantwortlicher.getName(),
+ person.verantwortlicher.getHochschule(),
+ person.verantwortlicher.getEMail(),
+ person.verantwortlicher.getTel(),
+ person.verantwortlicher.getFakultaet());
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Ihre Veranstaltung wurde erfolgreich angelegt. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.",
+ "Veranstaltung angelegt",
+ JOptionPane.INFORMATION_MESSAGE);
+ // zurueck zum Menue
+ MainMenue_GUI m = new MainMenue_GUI();
+ m.setVisible(true);
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Beim Anlegen Ihrer Veranstaltung ist ein Fehler aufgetreten.",
+ "Error",
+ JOptionPane.ERROR_MESSAGE);
+ JOptionPane.showMessageDialog(null,
+ e1.getCause()+"\n"+e1.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ }
+
+ dispose();
+
+ } else {
+ // nothing selected
+ JOptionPane.showMessageDialog(null,
+ "Bitte w\u00e4hlen Sie ein Image aus.",
+ "Image Auswahl",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+
+ }
+ });
+ doLinkButton.setActionCommand("OK");
+ buttonPane.add(doLinkButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu = new JMenu("Suchen");
+ menuBar.add(mnNewMenu);
+
+ JMenuItem mntmVlSuche = new JMenuItem("VL Suche");
+ mnNewMenu.add(mntmVlSuche);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ 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) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(mntmAbout);
+
+ }
+
+ public DefaultTableModel initTableModel(DefaultTableModel model) {
+ List<server.Image> images;
+ try {
+ images = client.getImageList();
+ Iterator<server.Image> i = images.iterator();
+ List<Object[]> ListObj = new ArrayList<Object[]>();
+ int x = 0;
+
+ while (i.hasNext()) {
+
+ i.next();
+ Object[] obj = { images.get(x).getImageName(),
+ images.get(x).getLicenseRestriction(),
+ images.get(x).getOsName(),
+ images.get(x).getLectureName(),
+ images.get(x).getUserData(),
+ images.get(x).getUpdateTime()
+ };
+ ListObj.add(obj);
+ model.addRow(ListObj.get(x));
+ x++;
+
+ }
+
+ return model;
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ return model;
+ }
+
+}
diff --git a/Dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java b/Dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java
new file mode 100644
index 00000000..c638e440
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/lecture/DeleteLecture_GUI.java
@@ -0,0 +1,495 @@
+package gui.lecture;
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JScrollPane;
+import javax.swing.JSeparator;
+import javax.swing.JTabbedPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.RowFilter;
+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.table.DefaultTableModel;
+import javax.swing.table.TableModel;
+import javax.swing.table.TableRowSorter;
+
+import models.Links;
+import models.person;
+
+import org.apache.thrift.TException;
+
+import server.Server.Client;
+import thrift.ThriftConnection;
+import util.GuiOrganizer;
+import util.OpenLinks;
+
+@SuppressWarnings("serial")
+public class DeleteLecture_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ JRadioButton rdbtnInternetJa;
+ JRadioButton rdbtnInternetNein;
+ JTable tableAllLectures;
+ JTable tablemyLectures;
+ JTable tableCoopImages;
+ JTable tablePublicVorlagen;
+ JTable tablePublicImages;
+ private JTextField textFieldName;
+ JTabbedPane tabbedPane;
+ 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);
+ final DefaultTableModel modelMyLectures = new DefaultTableModel(titles, 0);
+ final TableRowSorter<TableModel> rowSorterAll = new TableRowSorter<TableModel>(
+ modelAll);
+ final TableRowSorter<TableModel> rowSorterMyLectures = new TableRowSorter<TableModel>(
+ modelMyLectures);
+ private JButton button;
+
+
+ /**
+ * Create the dialog.
+ */
+ public DeleteLecture_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ // Beendet die Anwendung nach klick auf X
+ con.closeThriftConnection();
+ System.exit(0);
+ }
+ });
+ // Verhindert das Vergroessern Des Fensters
+ setResizable(false);
+
+ try {
+ // Setzt das Look & Feel auf System
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ // Setzt den Fenstertitel
+ setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung l\u00F6schen");
+ // Zentriert das Fenster in die Bildmitte
+ setBounds(0, 0, 603, 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);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel(
+ "Zu l\u00F6schende Veranstaltung w\u00E4hlen");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie
+ .setText("W\u00E4hlen Sie bitte aus der unten stehenden Liste die zu l\u00F6schende Veranstaltung aus.");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 531);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Filterfunktionen",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 49, 557, 131);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JLabel lblNewLabel_2 = new JLabel("Anzeigename:");
+ lblNewLabel_2.setBounds(10, 30, 250, 20);
+ panel_1.add(lblNewLabel_2);
+
+ textFieldName = new JTextField();
+ // Key Listener der Tastatureingabe registriert
+ textFieldName.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+ // Textfield eingabe auslesen
+ String stext = textFieldName.getText();
+
+ // Wenn Textfield nicht leer
+ if (stext != "") {
+ // Filtere nach der Eingabe
+ rowSorterAll.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+ rowSorterMyLectures.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+
+ }
+ }
+ });
+
+ textFieldName.setBounds(270, 30, 250, 20);
+ panel_1.add(textFieldName);
+ textFieldName.setColumns(10);
+
+ JLabel lblErweiterteSuche = new JLabel(
+ "<html><u>Erweiterte Suche*Folgt noch*</u></html>");
+ lblErweiterteSuche.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ // oeffnet das Fenster Extended GUI
+
+ //ExtendedSearchForImages_GUI es = new ExtendedSearchForImages_GUI();
+ //es.setVisible(true);
+ }
+ });
+ lblErweiterteSuche.setForeground(Color.BLUE);
+
+ lblErweiterteSuche.setBounds(336, 106, 184, 14);
+ panel_1.add(lblErweiterteSuche);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ // oeffnet das Hauptmenue
+
+ DeleteLecture_GUI.this.setVisible(false);
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("Veranstaltung");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 75, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(152, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Veranstaltungsauswahl");
+ 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) {
+
+ }
+
+ }
+ });
+
+ tabbedPane.setBounds(10, 197, 557, 300);
+ contentPanel.add(tabbedPane);
+ initTableModel(modelMyLectures);
+
+ JScrollPane scrollPaneAllImages = new JScrollPane();
+ tableAllLectures = new JTable();
+ 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();
+ initTableModel(modelAll);
+
+ JScrollPane scrollPaneMyImage = new JScrollPane();
+ tablemyLectures = new JTable();
+ 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);
+ tableAllLectures.setRowSorter(rowSorterAll);
+
+ 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 Images", null,
+ scrollPanePublicImages, null);
+ tabbedPane.setEnabledAt(3, false);
+
+ JScrollPane scrollPanePublicVorlagen = new JScrollPane();
+ tablePublicVorlagen = new JTable();
+ tablePublicVorlagen.setModel(model);
+ tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit();
+
+ scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen);
+ tabbedPane.addTab("\u00D6ffentliche Vorlagen", null,
+ scrollPanePublicVorlagen, null);
+ tabbedPane.setEnabledAt(4, false);
+
+ button = new JButton("L\u00F6schen");
+ button.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ String lectureID="";
+ int eingabe;
+
+ //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
+
+ }
+ });
+ button.setBounds(459, 508, 118, 23);
+ contentPanel.add(button);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton btnBack = new JButton("Zur\u00FCck");
+ btnBack.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ // oeffnet das Hauptmenue
+
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ dispose();
+ }
+ });
+ btnBack.setActionCommand("OK");
+ buttonPane.add(btnBack);
+ getRootPane().setDefaultButton(btnBack);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ 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) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(mntmAbout);
+
+ }
+
+ // Initiale Beffuelung eines Table models
+ public DefaultTableModel initTableModel(DefaultTableModel model) {
+ List<server.Lecture> lectures;
+ try {
+ // Hole eine Liste der Images
+ lectures = client.getLectureList();
+ Iterator<server.Lecture> i = lectures.iterator();
+
+ int x = 0;
+
+ while (i.hasNext()) {
+ // erzeuge Objekte fuer die Tabelle
+ 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 };
+ // Fuege diese Objekte der Tabelle hinzu
+ model.addRow(obj);
+ x++;
+ i.next();
+
+ }
+
+ return model;
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ return model;
+ }
+}
diff --git a/Dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java b/Dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java
new file mode 100644
index 00000000..b72efce9
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/lecture/EditLectureAllgemein_GUI.java
@@ -0,0 +1,454 @@
+package gui.lecture;
+
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.ScrollPane;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JSeparator;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+
+import models.Image;
+import models.Lecture;
+import models.Links;
+import models.person;
+import util.GuiOrganizer;
+import util.OpenLinks;
+
+import com.toedter.calendar.JDateChooser;
+
+
+@SuppressWarnings("serial")
+public class EditLectureAllgemein_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ private JTextField Vorname;
+ private JTextField Nachname;
+ private JTextField Hochschule;
+ private JTextField EMail;
+ private JTextField textFieldLaborname;
+ JTextArea description;
+ JRadioButton radioButtonyes;
+ JDateChooser dateChooserend;
+ JDateChooser dateChooserstart;
+ JRadioButton radioButtonno;
+ private final ButtonGroup buttonGroup = new ButtonGroup();
+
+
+ /**
+ * Create the dialog.
+ */
+ public EditLectureAllgemein_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ System.exit(0);
+ }
+ });
+ setResizable(false);
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung bearbeiten");;
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 577, 57);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Eingabe Ihrer Daten");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie.setText("Geben Sie hier bitte einen sprechenden Imagename sowie Ihre Kontaktdaten an");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 21);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 493);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Informationen zum Besitzer", TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 331, 557, 162);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JLabel label = new JLabel("Vorname: *");
+ label.setBackground(SystemColor.menu);
+ label.setBounds(10, 33, 125, 20);
+ panel_1.add(label);
+
+ Vorname = new JTextField();
+ Vorname.setEditable(false);
+ Vorname.setEnabled(false);
+ Vorname.setText(person.verantwortlicher.getVorname());
+ Vorname.setBackground(Color.WHITE);
+ Vorname.setColumns(10);
+ Vorname.setBounds(145, 33, 350, 20);
+ panel_1.add(Vorname);
+
+ JLabel label_7 = new JLabel("Nachname: *");
+ label_7.setBackground(SystemColor.menu);
+ label_7.setBounds(10, 64, 125, 20);
+ panel_1.add(label_7);
+
+ Nachname = new JTextField();
+ Nachname.setEnabled(false);
+ Nachname.setEditable(false);
+ Nachname.setText(person.verantwortlicher.getName());
+ Nachname.setBackground(Color.WHITE);
+ Nachname.setColumns(10);
+ Nachname.setBounds(145, 64, 350, 20);
+ panel_1.add(Nachname);
+
+ JLabel label_8 = new JLabel("Hochschule: *");
+ label_8.setBackground(SystemColor.menu);
+ label_8.setBounds(10, 95, 125, 20);
+ panel_1.add(label_8);
+
+ Hochschule = new JTextField();
+ Hochschule.setEnabled(false);
+ Hochschule.setEditable(false);
+ Hochschule.setText(person.verantwortlicher.getHochschule());
+ Hochschule.setBackground(Color.WHITE);
+ Hochschule.setColumns(10);
+ Hochschule.setBounds(145, 95, 350, 20);
+ panel_1.add(Hochschule);
+
+ JLabel label_9 = new JLabel("E-Mail: *");
+ label_9.setBackground(SystemColor.menu);
+ label_9.setBounds(10, 126, 125, 20);
+ panel_1.add(label_9);
+
+ EMail = new JTextField();
+ EMail.setEnabled(false);
+ EMail.setEditable(false);
+ EMail.setText(person.verantwortlicher.getEMail());
+ EMail.setBackground(Color.WHITE);
+ EMail.setColumns(10);
+ EMail.setBounds(145, 126, 350, 20);
+ panel_1.add(EMail);
+
+ JPanel panel = new JPanel();
+ panel.setBounds(10, 402, 577, 33);
+ contentPanel.add(panel);
+ panel.setLayout(null);
+ panel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ panel.setBackground(SystemColor.menu);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+
+ EditLectureAllgemein_GUI.this.setVisible(false);
+ MainMenue_GUI main=new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("VL-Image");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 45, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(133, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Neu");
+ lblNewLabel_1.setBounds(146, 11, 46, 14);
+ contentPanel.add(lblNewLabel_1);
+
+ JPanel panel_2 = new JPanel();
+ panel_2.setLayout(null);
+ panel_2.setBorder(new TitledBorder(null, "Veranstaltungsdaten", TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_2.setBackground(SystemColor.menu);
+ panel_2.setBounds(10, 36, 557, 284);
+ contentPanel.add(panel_2);
+
+ JLabel label_3 = new JLabel("Laborname (Anzeigename): *");
+ label_3.setBounds(10, 25, 180, 14);
+ panel_2.add(label_3);
+
+ textFieldLaborname = new JTextField();
+ textFieldLaborname.setText(Lecture.lecture.getName());
+ textFieldLaborname.setColumns(10);
+ textFieldLaborname.setBounds(200, 22, 347, 20);
+ panel_2.add(textFieldLaborname);
+
+ JTextArea textArea = new JTextArea();
+ textArea.setEditable(false);
+ textArea.setWrapStyleWord(true);
+ textArea.setText("Geben Sie bitte einen sprechenden Namen f\u00FCr das Image an. Dieser soll jedoch recht allgemein gehalten werden.\r\nBeispiel: \"Programmieren\", nicht \"Programmieren 1\"");
+ textArea.setLineWrap(true);
+ textArea.setFont(new Font("Tahoma", Font.PLAIN, 12));
+ textArea.setBackground(SystemColor.menu);
+ textArea.setBounds(10, 49, 537, 49);
+ panel_2.add(textArea);
+
+ JLabel label_4 = new JLabel("Beschreibung: *");
+ label_4.setBounds(10, 111, 180, 14);
+ panel_2.add(label_4);
+
+ ScrollPane scrollPane = new ScrollPane();
+ scrollPane.setBounds(200, 104, 347, 78);
+ panel_2.add(scrollPane);
+ description = new JTextArea();
+ description.setFont(new Font("Tahoma", Font.PLAIN, 11));
+ description.setText(Lecture.lecture.getDesc());
+ description.setLineWrap(true);
+ scrollPane.add(description);
+ description.setBounds(0, 0, 4, 22);
+ scrollPane.add(description);
+
+ dateChooserend = new JDateChooser();
+ dateChooserend.setDateFormatString("dd-MM-yyyy hh:mm:ss");
+ dateChooserend.setDate(Lecture.lecture.getEnddate());
+ dateChooserend.setBounds(385, 188, 100, 20);
+ panel_2.add(dateChooserend);
+
+ JLabel label_5 = new JLabel("bis");
+ label_5.setBounds(351, 188, 24, 20);
+ panel_2.add(label_5);
+
+ dateChooserstart = new JDateChooser();
+ dateChooserstart.setDateFormatString("yyyy-MM-dd hh:mm:ss");
+ dateChooserstart.setDate(Lecture.lecture.getStartdate());
+ dateChooserstart.setBounds(240, 188, 101, 20);
+ panel_2.add(dateChooserstart);
+
+ JLabel label_6 = new JLabel("von:");
+ label_6.setBounds(200, 188, 30, 20);
+ panel_2.add(label_6);
+
+ JLabel label_10 = new JLabel("G\u00FCltigkeitsdatum: *");
+ label_10.setBounds(10, 188, 250, 14);
+ panel_2.add(label_10);
+
+ JLabel label_11 = new JLabel("Aktiv:");
+ label_11.setBounds(10, 229, 250, 14);
+ panel_2.add(label_11);
+
+ radioButtonyes = new JRadioButton("Ja");
+ buttonGroup.add(radioButtonyes);
+ if(Lecture.lecture.isActive()==true)
+ {
+ radioButtonyes.setSelected(true);
+ }else
+ {
+ radioButtonno.setSelected(true);
+ }
+
+ radioButtonyes.setBounds(240, 225, 109, 23);
+ panel_2.add(radioButtonyes);
+
+ radioButtonno = new JRadioButton("Nein");
+ buttonGroup.add(radioButtonno);
+ radioButtonno.setBounds(385, 225, 109, 23);
+ panel_2.add(radioButtonno);
+
+ JLabel label_12 = new JLabel("(Im VMChooser sichtbar)");
+ label_12.setBounds(10, 254, 250, 14);
+ panel_2.add(label_12);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton okButton = new JButton("Zur\u00FCck");
+ okButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ if(radioButtonyes.isSelected()==true)
+ {
+ Lecture.lecture.setActive(true);
+ }
+ else
+ {
+ Lecture.lecture.setActive(false);
+ }
+
+ Lecture.lecture.setName(textFieldLaborname.getText());
+ Lecture.lecture.setDesc(description.getText());
+ Lecture.lecture.setEnddate(dateChooserend.getDate());
+ Lecture.lecture.setStartdate(dateChooserstart.getDate());
+ Image.image.setImagename(textFieldLaborname.getText());
+
+ MainMenue_GUI sr=new MainMenue_GUI();
+ sr.setVisible(true);
+ dispose();
+ }
+ });
+ okButton.setActionCommand("OK");
+ buttonPane.add(okButton);
+ getRootPane().setDefaultButton(okButton);
+ }
+ {
+ JButton cancelButton = new JButton("Weiter");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ if(radioButtonyes.isSelected()==true)
+ {
+ Lecture.lecture.setActive(true);
+ }
+ else
+ {
+ Lecture.lecture.setActive(false);
+ }
+
+ Lecture.lecture.setName(textFieldLaborname.getText());
+ Lecture.lecture.setNewName(textFieldLaborname.getText());
+ Lecture.lecture.setDesc(description.getText());
+ Lecture.lecture.setEnddate(dateChooserend.getDate());
+ Lecture.lecture.setStartdate(dateChooserstart.getDate());
+ Image.image.setImagename(textFieldLaborname.getText());
+
+
+ EditLectureLink_GUI ev=new EditLectureLink_GUI();
+ ev.setVisible(true);
+ dispose();
+ }
+ });
+ cancelButton.setActionCommand("Cancel");
+ buttonPane.add(cancelButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JLabel lblPflichtfelder = new JLabel("* Pflichtfelder");
+ lblPflichtfelder.setBounds(32, 602, 136, 14);
+ getContentPane().add(lblPflichtfelder);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu = new JMenu("Suchen");
+ menuBar.add(mnNewMenu);
+
+ JMenuItem mntmVlSuche = new JMenuItem("VL Suche");
+ mnNewMenu.add(mntmVlSuche);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ 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) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(mntmAbout);
+
+ }
+
+
+} \ No newline at end of file
diff --git a/Dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java b/Dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java
new file mode 100644
index 00000000..f7b38b06
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/lecture/EditLectureLink_GUI.java
@@ -0,0 +1,532 @@
+package gui.lecture;
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JScrollPane;
+import javax.swing.JSeparator;
+import javax.swing.JTabbedPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+import javax.swing.table.DefaultTableModel;
+
+import models.Lecture;
+import models.Links;
+import models.person;
+
+import org.apache.thrift.TException;
+
+import server.Server.Client;
+import thrift.ThriftConnection;
+import util.GuiOrganizer;
+import util.OpenLinks;
+
+@SuppressWarnings("serial")
+public class EditLectureLink_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ JRadioButton rdbtnInternetJa;
+ JRadioButton rdbtnInternetNein;
+ JComboBox<String> comboBox;
+ JTable tableAllImages = new JTable();
+ JTable tablemyImages = new JTable();
+ JTable tableCoopImages = new JTable();
+ JTable tablePublicImages = new JTable();
+ JTable tablePublicVorlagen = new JTable();
+ private JTextField textFieldName;
+ String[] titles = { "Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung",
+ "Verantwortlicher", "Letztes Update", "Schlagwort", "ID", "Version" };
+ ThriftConnection con = new ThriftConnection();
+ Client client = models.Client.clientcon.getClient();
+
+ /**
+ * Create the dialog.
+ */
+ public EditLectureLink_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ con.closeThriftConnection();
+ System.exit(0);
+ }
+ });
+ setResizable(false);
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung bearbeiten");
+
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ final DefaultTableModel modelAll = new DefaultTableModel(titles, 0);
+ final DefaultTableModel model = new DefaultTableModel(titles, 0);
+
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 577, 57);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Image verlinken");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie
+ .setText("W\u00E4hlen Sie bitte ein Image aus, auf dem Ihre Versanstaltung basiert.");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 531);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Filterfunktionen",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 49, 557, 131);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JLabel lblNewLabel_2 = new JLabel("Anzeigename:");
+ lblNewLabel_2.setBounds(10, 30, 250, 20);
+ panel_1.add(lblNewLabel_2);
+
+ JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:");
+ lblInternetIstInnerhalb.setBounds(10, 58, 250, 20);
+ panel_1.add(lblInternetIstInnerhalb);
+
+ textFieldName = new JTextField();
+ textFieldName.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+ String stext = textFieldName.getText();
+ modelAll.setRowCount(0);
+ initTableModel(modelAll);
+
+ if (stext != "")
+ for (int i = 0; i < modelAll.getRowCount(); i++) {
+
+ if (modelAll.getValueAt(i, 0).toString()
+ .startsWith(stext)) {
+
+ } else {
+ modelAll.removeRow(i);
+ }
+ }
+
+ }
+
+ });
+
+ textFieldName.setBounds(270, 30, 250, 20);
+ panel_1.add(textFieldName);
+ textFieldName.setColumns(10);
+
+ JLabel lblErweiterteSuche = new JLabel(
+ "<html><u>Erweiterte Suche *Folgt noch*</u></html>");
+ lblErweiterteSuche.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ // ExtendedSearchForImages_GUI es = new
+ // ExtendedSearchForImages_GUI();
+ // es.setVisible(true);
+ }
+ });
+ lblErweiterteSuche.setForeground(Color.BLUE);
+
+ lblErweiterteSuche.setBounds(317, 106, 203, 14);
+ panel_1.add(lblErweiterteSuche);
+
+ comboBox = new JComboBox<String>();
+ try {
+ List<String> list = client.getAllOS();
+ comboBox.addItem("");
+ for (int i = 0; i < list.size(); i++) {
+ comboBox.addItem(list.get(i));
+ }
+ } catch (TException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
+ comboBox.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ modelAll.setRowCount(0);
+ initTableModel(modelAll);
+ String selItem = comboBox.getSelectedItem().toString();
+ if (selItem != "") {
+ for (int i = 0; i < modelAll.getRowCount(); i++) {
+
+ if (modelAll.getValueAt(i, 2).equals(selItem)) {
+
+ } else {
+ modelAll.removeRow(i);
+ }
+ }
+
+ }
+ }
+ });
+ comboBox.setBounds(270, 58, 250, 20);
+ panel_1.add(comboBox);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+
+ EditLectureLink_GUI.this.setVisible(false);
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("Veranstaltung");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 76, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(151, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Veranstaltung verlinken");
+ lblNewLabel_1.setBounds(164, 11, 113, 14);
+ contentPanel.add(lblNewLabel_1);
+
+ JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
+
+ tabbedPane.setBounds(10, 197, 557, 300);
+ contentPanel.add(tabbedPane);
+
+ JScrollPane scrollPaneMyImage = new JScrollPane();
+
+ tablemyImages.setModel(model);
+ tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit();
+ tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit();
+
+ JScrollPane scrollPaneAllImages = new JScrollPane();
+ tableAllImages.setModel(modelAll);
+ tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit();
+ tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit();
+
+ scrollPaneAllImages.setViewportView(tableAllImages);
+ tabbedPane.addTab("Alle", null, scrollPaneAllImages, null);
+
+ scrollPaneMyImage.setViewportView(tablemyImages);
+ tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null);
+
+ JScrollPane scrollPaneCoopImages = new JScrollPane();
+
+ 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 Images", null, scrollPaneCoopImages,
+ null);
+ tabbedPane.setEnabledAt(2, false);
+
+ JScrollPane scrollPanePublicImages = new JScrollPane();
+
+ 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 Images", null,
+ scrollPanePublicImages, null);
+ tabbedPane.setEnabledAt(3, false);
+
+ JScrollPane scrollPanePublicVorlagen = new JScrollPane();
+
+ tablePublicVorlagen.setModel(model);
+ tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit();
+
+ scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen);
+ tabbedPane.addTab("\u00D6ffentliche Vorlagen", null,
+ scrollPanePublicVorlagen, null);
+ tabbedPane.setEnabledAt(4, false);
+
+ JButton btnLinkLschen = new JButton("Link l\u00F6schen");
+ btnLinkLschen.setEnabled(false);
+ btnLinkLschen.setBounds(478, 508, 89, 23);
+ contentPanel.add(btnLinkLschen);
+
+ initTableModel(modelAll);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton okButton = new JButton("Zur\u00FCck");
+ okButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+ EditLectureAllgemein_GUI el = new EditLectureAllgemein_GUI();
+ el.setVisible(true);
+ dispose();
+ }
+ });
+ okButton.setActionCommand("OK");
+ buttonPane.add(okButton);
+ getRootPane().setDefaultButton(okButton);
+ }
+ {
+ JButton cancelButton = new JButton(
+ "Veranstaltung \u00e4ndern und abschlie\u00DFen");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+ // check if a row is selected
+ if ((tableAllImages.getSelectedRow() != -1)
+ || (tablemyImages.getSelectedRow() != -1)
+ || (tableCoopImages.getSelectedRow() != -1)
+ || (tablePublicImages.getSelectedRow() != -1)
+ || (tablePublicVorlagen.getSelectedRow() != -1)) {
+
+ // a row is selected, do operations
+ String imagename = tableAllImages.getValueAt(
+ tableAllImages.getSelectedRow(), 0)
+ .toString();
+
+ try {
+
+ DateFormat formatter = new SimpleDateFormat(
+ "yyyy-MM-dd hh:mm:ss");
+ client.updateLecturedata(
+ Lecture.lecture.getName(),
+ Lecture.lecture.getNewName(),
+ Lecture.lecture.getShortDesc(),
+ Lecture.lecture.getDesc(),
+ formatter.format(
+ Lecture.lecture.getStartdate())
+ .toString(),
+ formatter.format(
+ Lecture.lecture.getEnddate())
+ .toString(),
+ Lecture.lecture.isActive(),
+ imagename,
+ person.verantwortlicher.getVorname(),
+ person.verantwortlicher.getName(),
+ person.verantwortlicher.getHochschule(),
+ person.verantwortlicher.getEMail(),
+ person.verantwortlicher.getTel(),
+ person.verantwortlicher.getFakultaet(),
+ Lecture.lecture.getid());
+
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Ihre Veranstaltung wurde erfolgreich angelegt. Sie kehren nun zum Hauptmen\u00fc zur\u00fcck.",
+ "Veranstaltung angelegt",
+ JOptionPane.INFORMATION_MESSAGE);
+
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+
+ } else {
+ // nothing selected
+ JOptionPane.showMessageDialog(null,
+ "Bitte w\u00e4hlen Sie ein Image aus.",
+ "Image Auswahl",
+ JOptionPane.INFORMATION_MESSAGE);
+
+ }
+
+ MainMenue_GUI m = new MainMenue_GUI();
+ m.setVisible(true);
+ dispose();
+
+ }
+ });
+ cancelButton.setActionCommand("Cancel");
+ buttonPane.add(cancelButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu = new JMenu("Suchen");
+ menuBar.add(mnNewMenu);
+
+ JMenuItem mntmVlSuche = new JMenuItem("VL Suche");
+ mnNewMenu.add(mntmVlSuche);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ 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) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(mntmAbout);
+
+ }
+
+ public DefaultTableModel initTableModel(DefaultTableModel model) {
+ List<server.Image> images;
+ try {
+ images = client.getImageList();
+ Iterator<server.Image> i = images.iterator();
+ List<Object[]> ListObj = new ArrayList<Object[]>();
+ int x = 0;
+
+ while (i.hasNext()) {
+
+ i.next();
+ Object[] obj = { images.get(x).getImageName(),
+ images.get(x).getLicenseRestriction(),
+ images.get(x).getOsName(),
+ images.get(x).getLectureName(),
+ images.get(x).getUserData(),
+ images.get(x).getUpdateTime(), "", images.get(x).id,
+ images.get(x).getVersion() };
+ ListObj.add(obj);
+ model.addRow(ListObj.get(x));
+ x++;
+
+ }
+
+ return model;
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ return model;
+ }
+}
diff --git a/Dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java b/Dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java
new file mode 100644
index 00000000..58329ae2
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/lecture/EditLectureSearch_GUI.java
@@ -0,0 +1,563 @@
+package gui.lecture;
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+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.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JScrollPane;
+import javax.swing.JSeparator;
+import javax.swing.JTabbedPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.RowFilter;
+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.table.DefaultTableModel;
+import javax.swing.table.TableModel;
+import javax.swing.table.TableRowSorter;
+
+import models.Lecture;
+import models.Links;
+import models.person;
+
+import org.apache.thrift.TException;
+
+import server.Server.Client;
+import thrift.ThriftConnection;
+import util.GuiOrganizer;
+import util.OpenLinks;
+
+@SuppressWarnings("serial")
+public class EditLectureSearch_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ JRadioButton rdbtnInternetJa;
+ JRadioButton rdbtnInternetNein;
+ JTable tableAllLectures;
+ JTable tablemyLectures;
+ JTable tableCoopImages;
+ JTable tablePublicVorlagen;
+ JTable tablePublicImages;
+ private JTextField textFieldName;
+ JTabbedPane tabbedPane;
+ 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 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.
+ */
+ public EditLectureSearch_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ // Beendet die Anwendung nach klick auf X
+ con.closeThriftConnection();
+ System.exit(0);
+ }
+ });
+ // Verhindert das Vergroessern Des Fensters
+ setResizable(false);
+
+ try {
+ // Setzt das Look & Feel auf System
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ // Setzt den Fenstertitel
+ setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung bearbeiten");
+ // Zentriert das Fenster in die Bildmitte
+ setBounds(0, 0, 603, 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);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Suche nach Veranstaltung");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie
+ .setText("Hier k\u00F6nnen Sie nach Ihrem gew\u00FCnschten VL-Image suchen und dieses f\u00FCr weitere Schritte ausw\u00E4hlen");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 531);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Filterfunktionen",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 49, 557, 131);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JLabel lblNewLabel_2 = new JLabel("Anzeigename:");
+ lblNewLabel_2.setBounds(10, 30, 250, 20);
+ panel_1.add(lblNewLabel_2);
+
+ textFieldName = new JTextField();
+ // Key Listener der Tastatureingabe registriert
+ textFieldName.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+ // Textfield eingabe auslesen
+ String stext = textFieldName.getText();
+
+ // Wenn Textfield nicht leer
+ if (stext != "") {
+ // Filtere nach der Eingabe
+ rowSorterAll.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+ rowSorterMyLectures.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+
+ }
+ }
+ });
+
+ textFieldName.setBounds(270, 30, 250, 20);
+ panel_1.add(textFieldName);
+ textFieldName.setColumns(10);
+
+ JLabel lblErweiterteSuche = new JLabel(
+ "<html><u>Erweiterte Suche *Folgt noch*</u></html>");
+ lblErweiterteSuche.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ // oeffnet das Fenster Extended GUI
+
+ //ExtendedSearchForImages_GUI es = new ExtendedSearchForImages_GUI();
+ //es.setVisible(true);
+ }
+ });
+ lblErweiterteSuche.setForeground(Color.BLUE);
+
+ lblErweiterteSuche.setBounds(326, 106, 194, 14);
+ panel_1.add(lblErweiterteSuche);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ // oeffnet das Hauptmenue
+
+ EditLectureSearch_GUI.this.setVisible(false);
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("Veranstaltung");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 75, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(152, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Veranstaltungsauswahl");
+ 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) {
+
+ }
+
+ }
+ });
+
+ tabbedPane.setBounds(10, 197, 557, 323);
+ contentPanel.add(tabbedPane);
+ initTableModel(modelMyLectures);
+
+ JScrollPane scrollPaneAllImages = new JScrollPane();
+ tableAllLectures = new JTable();
+ 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();
+ initTableModel(modelAll);
+
+ JScrollPane scrollPaneMyImage = new JScrollPane();
+ tablemyLectures = new JTable();
+ 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);
+ tableAllLectures.setRowSorter(rowSorterAll);
+
+ 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 Images", null,
+ scrollPanePublicImages, null);
+ tabbedPane.setEnabledAt(3, false);
+
+ JScrollPane scrollPanePublicVorlagen = new JScrollPane();
+ tablePublicVorlagen = new JTable();
+ tablePublicVorlagen.setModel(model);
+ tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit();
+
+ scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen);
+ tabbedPane.addTab("\u00D6ffentliche Vorlagen", null,
+ scrollPanePublicVorlagen, null);
+ tabbedPane.setEnabledAt(4, false);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton btnBack = new JButton("Zur\u00FCck");
+ btnBack.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ // oeffnet das Hauptmenue
+
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ dispose();
+ }
+ });
+ btnBack.setActionCommand("OK");
+ buttonPane.add(btnBack);
+ getRootPane().setDefaultButton(btnBack);
+ }
+ {
+ JButton btnContinue = new JButton("Weiter");
+ btnContinue.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ // check if a row is selected
+ if ((tableAllLectures.getSelectedRow() != -1)
+ || (tablemyLectures.getSelectedRow() != -1)
+ || (tableCoopImages.getSelectedRow() != -1)
+ || (tablePublicImages.getSelectedRow() != -1)
+ || (tablePublicVorlagen.getSelectedRow() != -1)) {
+
+ // a row is selected, do operations
+
+ if (tabbedPane.getSelectedIndex() == 0) {
+
+ 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);
+ 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 {
+ JOptionPane
+ .showMessageDialog(
+ null,
+ "Bitte w\u00f4hlen Sie ein eigenes Image aus",
+ "Message",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+ } else {
+ // nothing selected
+ JOptionPane.showMessageDialog(null,
+ "Bitte w\u00f4hlen Sie ein Image aus.",
+ "Image Auswahl",
+ JOptionPane.INFORMATION_MESSAGE);
+ }// end check if a row is selected
+
+ }
+ });
+ btnContinue.setActionCommand("Cancel");
+ buttonPane.add(btnContinue);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ 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) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(mntmAbout);
+
+ }
+
+ // Initiale Beffuelung eines Table models
+ public DefaultTableModel initTableModel(DefaultTableModel model) {
+ List<server.Lecture> lectures;
+ try {
+ // Hole eine Liste der Images
+ lectures = client.getLectureList();
+ Iterator<server.Lecture> i = lectures.iterator();
+
+ int x = 0;
+
+ while (i.hasNext()) {
+ // erzeuge Objekte fuer die Tabelle
+ 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 };
+ // Fuege diese Objekte der Tabelle hinzu
+ model.addRow(obj);
+ x++;
+ i.next();
+
+ }
+
+ return model;
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ return model;
+ }
+
+}
diff --git a/Dozentenmodul/src/main/java/gui/lecture/ExtendedSearchForImages_GUI.java b/Dozentenmodul/src/main/java/gui/lecture/ExtendedSearchForImages_GUI.java
new file mode 100644
index 00000000..579ea3bd
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/lecture/ExtendedSearchForImages_GUI.java
@@ -0,0 +1,269 @@
+package gui.lecture;
+
+
+import gui.image.CreateImageAllgemein_GUI;
+import gui.image.FTPCreateUploader_GUI;
+import gui.intro.About_GUI;
+
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+
+import models.Links;
+import util.GuiOrganizer;
+import util.OpenLinks;
+
+@SuppressWarnings("serial")
+public class ExtendedSearchForImages_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ private JTextField textField;
+ private JTextField textField_1;
+
+
+ /**
+ * Create the dialog.
+ */
+ public ExtendedSearchForImages_GUI() {
+
+ setResizable(false);
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("bwLehrpool Suite *Prototyp* - Erweiterte Suche");
+ setBounds(0, 0, 603, 722);
+ GuiOrganizer.centerGUI(this);
+
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 577, 57);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Weitere Suchoptionen");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie.setText("beschreibung");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 493);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Image-Typ", TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 11, 557, 95);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JLabel lblNewLabel_2 = new JLabel("Image-Typ");
+ lblNewLabel_2.setBounds(10, 39, 176, 20);
+ panel_1.add(lblNewLabel_2);
+
+ JCheckBox chckbxBestehendesImage = new JCheckBox("Bestehendes Image");
+ chckbxBestehendesImage.setSelected(true);
+ chckbxBestehendesImage.setBounds(192, 38, 138, 23);
+ panel_1.add(chckbxBestehendesImage);
+
+ JCheckBox chckbxRohling = new JCheckBox("Rohling");
+ chckbxRohling.setSelected(true);
+ chckbxRohling.setBounds(332, 38, 97, 23);
+ panel_1.add(chckbxRohling);
+
+ JPanel panel = new JPanel();
+ panel.setLayout(null);
+ panel.setBorder(new TitledBorder(null, "Image-Inhalt", TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 117, 557, 95);
+ contentPanel.add(panel);
+
+ JLabel lblEnthalteneSoftware = new JLabel("Enthaltene Software");
+ lblEnthalteneSoftware.setBounds(10, 39, 176, 20);
+ panel.add(lblEnthalteneSoftware);
+
+ textField = new JTextField();
+ textField.setBounds(196, 39, 351, 20);
+ panel.add(textField);
+ textField.setColumns(10);
+
+ JLabel lblNewLabel_1 = new JLabel("Bitte mit ; getrennt angeben");
+ lblNewLabel_1.setBounds(196, 70, 351, 14);
+ panel.add(lblNewLabel_1);
+
+ JPanel panel_2 = new JPanel();
+ panel_2.setLayout(null);
+ panel_2.setBorder(new TitledBorder(null, "Informationen zum Ersteller", TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_2.setBackground(SystemColor.menu);
+ panel_2.setBounds(10, 223, 557, 123);
+ contentPanel.add(panel_2);
+
+ JLabel lblNachnameDesErstellers = new JLabel("Nachname des Erstellers");
+ lblNachnameDesErstellers.setBounds(10, 39, 176, 20);
+ panel_2.add(lblNachnameDesErstellers);
+
+ textField_1 = new JTextField();
+ textField_1.setColumns(10);
+ textField_1.setBounds(196, 39, 351, 20);
+ panel_2.add(textField_1);
+
+ JLabel lblHochschuleuniversitt = new JLabel("Hochschule/Universit\u00E4t");
+ lblHochschuleuniversitt.setBounds(10, 70, 176, 20);
+ panel_2.add(lblHochschuleuniversitt);
+
+ JComboBox<String> comboBox = new JComboBox<String>();
+ comboBox.setBounds(196, 70, 351, 20);
+ panel_2.add(comboBox);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton okButton = new JButton("Zur\u00FCck");
+ okButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+
+ CreateImageAllgemein_GUI sr=new CreateImageAllgemein_GUI();
+ sr.setVisible(true);
+ dispose();
+ }
+ });
+ okButton.setActionCommand("OK");
+ buttonPane.add(okButton);
+ getRootPane().setDefaultButton(okButton);
+ }
+ {
+ JButton cancelButton = new JButton("\u00DCbernehmen");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+
+ FTPCreateUploader_GUI ea=new FTPCreateUploader_GUI();
+ ea.setVisible(true);
+ dispose();
+
+ }
+ });
+ cancelButton.setActionCommand("Cancel");
+ buttonPane.add(cancelButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu = new JMenu("Suchen");
+ menuBar.add(mnNewMenu);
+
+ JMenuItem mntmVlSuche = new JMenuItem("VL Suche");
+ mnNewMenu.add(mntmVlSuche);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ 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) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(mntmAbout);
+
+ }
+}
diff --git a/Dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java b/Dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java
new file mode 100644
index 00000000..6035ebf5
--- /dev/null
+++ b/Dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java
@@ -0,0 +1,453 @@
+package gui.lecture;
+
+import gui.intro.About_GUI;
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JScrollPane;
+import javax.swing.JSeparator;
+import javax.swing.JTabbedPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.JTextPane;
+import javax.swing.RowFilter;
+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.table.DefaultTableModel;
+import javax.swing.table.TableModel;
+import javax.swing.table.TableRowSorter;
+
+import models.Links;
+import models.person;
+
+import org.apache.thrift.TException;
+
+import server.Server.Client;
+import thrift.ThriftConnection;
+import util.GuiOrganizer;
+import util.OpenLinks;
+
+@SuppressWarnings("serial")
+public class SearchLecture_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ JRadioButton rdbtnInternetJa;
+ JRadioButton rdbtnInternetNein;
+ JTable tableAllLectures;
+ JTable tablemyLectures;
+ JTable tableCoopImages;
+ JTable tablePublicVorlagen;
+ JTable tablePublicImages;
+ private JTextField textFieldName;
+ JTabbedPane tabbedPane;
+ 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 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.
+ */
+ public SearchLecture_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ // Beendet die Anwendung nach klick auf X
+ con.closeThriftConnection();
+ System.exit(0);
+ }
+ });
+ // Verhindert das Vergroessern Des Fensters
+ setResizable(false);
+
+ try {
+ // Setzt das Look & Feel auf System
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ // Setzt den Fenstertitel
+ setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung suchen");
+ // Zentriert das Fenster in die Bildmitte 2;
+ setBounds(0, 0, 603, 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);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Suche nach Veranstaltung");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie
+ .setText("Hier k\u00F6nnen Sie nach Ihrem gew\u00FCnschten VL-Image suchen und dieses f\u00FCr weitere Schritte ausw\u00E4hlen");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 531);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Filterfunktionen",
+ TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 49, 557, 131);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JLabel lblNewLabel_2 = new JLabel("Anzeigename:");
+ lblNewLabel_2.setBounds(10, 30, 250, 20);
+ panel_1.add(lblNewLabel_2);
+
+ textFieldName = new JTextField();
+ // Key Listener der Tastatureingabe registriert
+ textFieldName.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+ // Textfield eingabe auslesen
+ String stext = textFieldName.getText();
+
+ // Wenn Textfield nicht leer
+ if (stext != "") {
+ // Filtere nach der Eingabe
+ rowSorterAll.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+ rowSorterMyLectures.setRowFilter(RowFilter.regexFilter(
+ textFieldName.getText(), 0));
+
+ }
+ }
+ });
+
+ textFieldName.setBounds(270, 30, 250, 20);
+ panel_1.add(textFieldName);
+ textFieldName.setColumns(10);
+
+ JLabel lblErweiterteSuche = new JLabel(
+ "<html><u>Erweiterte Suche *Folgt noch*</u></html>");
+ lblErweiterteSuche.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ // oeffnet das Fenster Extended GUI
+
+ //ExtendedSearchForImages_GUI es = new ExtendedSearchForImages_GUI();
+ //es.setVisible(true);
+ }
+ });
+ lblErweiterteSuche.setForeground(Color.BLUE);
+
+ lblErweiterteSuche.setBounds(315, 106, 205, 14);
+ panel_1.add(lblErweiterteSuche);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ // oeffnet das Hauptmenue
+
+ SearchLecture_GUI.this.setVisible(false);
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("Veranstaltung");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 75, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(152, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Veranstaltungsauswahl");
+ 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) {
+
+ }
+
+ }
+ });
+
+ tabbedPane.setBounds(10, 197, 557, 323);
+ contentPanel.add(tabbedPane);
+ initTableModel(modelMyLectures);
+
+ JScrollPane scrollPaneAllImages = new JScrollPane();
+ tableAllLectures = new JTable();
+ 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();
+ initTableModel(modelAll);
+
+ JScrollPane scrollPaneMyImage = new JScrollPane();
+ tablemyLectures = new JTable();
+ 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);
+ tableAllLectures.setRowSorter(rowSorterAll);
+
+ 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 Images", null,
+ scrollPanePublicImages, null);
+ tabbedPane.setEnabledAt(3, false);
+
+ JScrollPane scrollPanePublicVorlagen = new JScrollPane();
+ tablePublicVorlagen = new JTable();
+ tablePublicVorlagen.setModel(model);
+ tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit();
+ tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit();
+
+ scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen);
+ tabbedPane.addTab("\u00D6ffentliche Vorlagen", null,
+ scrollPanePublicVorlagen, null);
+ tabbedPane.setEnabledAt(4, false);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton btnBack = new JButton("Zur\u00FCck");
+ btnBack.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ // oeffnet das Hauptmenue
+
+ MainMenue_GUI main = new MainMenue_GUI();
+ main.setVisible(true);
+ dispose();
+ }
+ });
+ btnBack.setActionCommand("OK");
+ buttonPane.add(btnBack);
+ getRootPane().setDefaultButton(btnBack);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ 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();
+ }
+ }
+ });
+ mnNewMenu_1.add(mntmFaq);
+
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ 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) {
+ About_GUI ab = new About_GUI();
+ ab.setVisible(true);
+ }
+ });
+ mnNewMenu_1.add(mntmAbout);
+
+ }
+
+ // Initiale Beffuelung eines Table models
+ public DefaultTableModel initTableModel(DefaultTableModel model) {
+ List<server.Lecture> lectures;
+ try {
+ // Hole eine Liste der Images
+ lectures = client.getLectureList();
+ Iterator<server.Lecture> i = lectures.iterator();
+
+ int x = 0;
+
+ while (i.hasNext()) {
+ // erzeuge Objekte fuer die Tabelle
+ 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 };
+ // Fuege diese Objekte der Tabelle hinzu
+ model.addRow(obj);
+ x++;
+ i.next();
+
+ }
+
+ return model;
+ } catch (TException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ return model;
+ }
+
+}