diff options
| author | unknown | 2014-02-25 11:04:51 +0100 |
|---|---|---|
| committer | unknown | 2014-02-25 11:04:51 +0100 |
| commit | 2a3ec0fbda66ed07adcdc968a9365096ecd54f40 (patch) | |
| tree | 187af202e5a404a15c31f0915e73cb23bf5b7900 /Dozentenmodul/src/gui | |
| parent | Problem der herumspringenden Fenster entfernt (diff) | |
| download | tutor-module-2a3ec0fbda66ed07adcdc968a9365096ecd54f40.tar.gz tutor-module-2a3ec0fbda66ed07adcdc968a9365096ecd54f40.tar.xz tutor-module-2a3ec0fbda66ed07adcdc968a9365096ecd54f40.zip | |
Kommunikation von BwLehrpool Suite zu BwLehrpool Suite Server läuft nun über Thrift
Diffstat (limited to 'Dozentenmodul/src/gui')
| -rw-r--r-- | Dozentenmodul/src/gui/BillOfRights_GUI.java | 181 | ||||
| -rw-r--r-- | Dozentenmodul/src/gui/EditImageAllgemein_GUI.java | 336 | ||||
| -rw-r--r-- | Dozentenmodul/src/gui/EditImageTechnisch_GUI.java | 311 | ||||
| -rw-r--r-- | Dozentenmodul/src/gui/EingabeImageAllgemein_GUI.java | 337 | ||||
| -rw-r--r-- | Dozentenmodul/src/gui/EingabeImageTechnisch_GUI.java | 346 | ||||
| -rw-r--r-- | Dozentenmodul/src/gui/EingabeVeranstaltungAllgemein_GUI.java | 338 | ||||
| -rw-r--r-- | Dozentenmodul/src/gui/EingabeVeranstatlungTechnisch_GUI.java | 317 | ||||
| -rw-r--r-- | Dozentenmodul/src/gui/ExtendedSearch_GUI.java | 233 | ||||
| -rw-r--r-- | Dozentenmodul/src/gui/FTPDownloader_GUI.java | 348 | ||||
| -rw-r--r-- | Dozentenmodul/src/gui/FTPUploader_GUI.java | 401 | ||||
| -rw-r--r-- | Dozentenmodul/src/gui/LinkImage_GUI.java | 433 | ||||
| -rw-r--r-- | Dozentenmodul/src/gui/Login_GUI.java | 152 | ||||
| -rw-r--r-- | Dozentenmodul/src/gui/MainMenue_GUI.java | 325 | ||||
| -rw-r--r-- | Dozentenmodul/src/gui/SearchImage_GUI.java | 420 | ||||
| -rw-r--r-- | Dozentenmodul/src/gui/SearchMethod_GUI.java | 243 | ||||
| -rw-r--r-- | Dozentenmodul/src/gui/VmWareLink_GUI.java | 190 |
16 files changed, 4911 insertions, 0 deletions
diff --git a/Dozentenmodul/src/gui/BillOfRights_GUI.java b/Dozentenmodul/src/gui/BillOfRights_GUI.java new file mode 100644 index 00000000..6f66d479 --- /dev/null +++ b/Dozentenmodul/src/gui/BillOfRights_GUI.java @@ -0,0 +1,181 @@ +package gui; + +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Toolkit; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.JLabel; +import java.awt.Font; +import javax.swing.JTextPane; +import java.awt.SystemColor; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import javax.swing.JFrame; +import javax.swing.JSeparator; +import javax.swing.JMenuBar; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import javax.swing.JCheckBox; +import javax.swing.SwingConstants; +import javax.swing.event.ChangeListener; +import javax.swing.event.ChangeEvent; +import javax.swing.JTextArea; + + + +@SuppressWarnings("serial") +public class BillOfRights_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + JButton fwdButton; + JCheckBox chckbxAkzeptieren; + /** + * Launch the application. + */ + public static void main(String[] args) { + try { + BillOfRights_GUI dialog = new BillOfRights_GUI(); + dialog.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); + dialog.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the dialog. + */ + public BillOfRights_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("Dozentenmodul *Prototyp*"); + + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + int top=(screenSize.height - 722) / 2; + int left=(screenSize.width - 603) / 2; + setBounds(left, top, 603, 722); + //setBounds(100, 100, 545, 366); + 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) { + 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) { + 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"); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mnNewMenu_1.add(mntmOtrs); + + + + } +} diff --git a/Dozentenmodul/src/gui/EditImageAllgemein_GUI.java b/Dozentenmodul/src/gui/EditImageAllgemein_GUI.java new file mode 100644 index 00000000..784c66a7 --- /dev/null +++ b/Dozentenmodul/src/gui/EditImageAllgemein_GUI.java @@ -0,0 +1,336 @@ +package gui; + +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Toolkit; +import javax.swing.JFrame; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import java.awt.Color; +import javax.swing.JLabel; +import java.awt.Font; +import javax.swing.JTextPane; +import java.awt.SystemColor; +import javax.swing.JTextField; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import javax.swing.JSeparator; +import javax.swing.JMenuBar; +import javax.swing.JMenu; +import javax.swing.JMenuItem; + +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import javax.swing.border.TitledBorder; +import javax.swing.JTextArea; + +import models.Image; +import models.person; + +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +@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 Tel; + private JTextField Fak; + private JTextField imagename; + /** + * Launch the application. + */ + public static void main(String[] args) { + try { + EditImageAllgemein_GUI dialog = new EditImageAllgemein_GUI(); + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + dialog.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the dialog. + */ + public EditImageAllgemein_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*"); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + int top=(screenSize.height - 722) / 2; + int left=(screenSize.width - 603) / 2; + setBounds(left, top, 603, 722); + //setBounds(100, 100, 603, 722); + 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("Bearbeiten 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, 183, 125, 20); + panel_1.add(label); + + Vorname = new JTextField(); + Vorname.setBackground(Color.WHITE); + Vorname.setText(person.verantowrtlicher.getVorname()); + Vorname.setColumns(10); + Vorname.setBounds(145, 183, 350, 20); + panel_1.add(Vorname); + + JLabel label_7 = new JLabel("Nachname: *"); + label_7.setBackground(SystemColor.menu); + label_7.setBounds(10, 214, 125, 20); + panel_1.add(label_7); + + Nachname = new JTextField(); + Nachname.setBackground(Color.WHITE); + Nachname.setText(person.verantowrtlicher.getName()); + Nachname.setColumns(10); + Nachname.setBounds(145, 214, 350, 20); + panel_1.add(Nachname); + + JLabel label_8 = new JLabel("Hochschule: *"); + label_8.setBackground(SystemColor.menu); + label_8.setBounds(10, 245, 125, 20); + panel_1.add(label_8); + + Hochschule = new JTextField(); + Hochschule.setBackground(Color.WHITE); + Hochschule.setText(person.verantowrtlicher.getHochschule()); + Hochschule.setColumns(10); + Hochschule.setBounds(145, 245, 350, 20); + panel_1.add(Hochschule); + + JLabel label_9 = new JLabel("E-Mail: *"); + label_9.setBackground(SystemColor.menu); + label_9.setBounds(10, 276, 125, 20); + panel_1.add(label_9); + + EMail = new JTextField(); + EMail.setBackground(Color.WHITE); + EMail.setText(person.verantowrtlicher.getEMail()); + EMail.setColumns(10); + EMail.setBounds(145, 276, 350, 20); + panel_1.add(EMail); + + JLabel label_10 = new JLabel("Tel.-Nummer:"); + label_10.setBackground(SystemColor.menu); + label_10.setBounds(10, 307, 125, 20); + panel_1.add(label_10); + + Tel = new JTextField(); + Tel.setBackground(Color.WHITE); + Tel.setText(person.verantowrtlicher.getTel()); + Tel.setColumns(10); + Tel.setBounds(145, 307, 350, 20); + panel_1.add(Tel); + + JLabel lblFakulttinstitution = new JLabel("Fakult\u00E4t/Institution:"); + lblFakulttinstitution.setBackground(SystemColor.menu); + lblFakulttinstitution.setBounds(10, 338, 125, 20); + panel_1.add(lblFakulttinstitution); + + Fak = new JTextField(); + Fak.setBackground(Color.WHITE); + Fak.setText(person.verantowrtlicher.getFakultät()); + Fak.setColumns(10); + Fak.setBounds(145, 338, 350, 20); + panel_1.add(Fak); + + 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(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) { + + 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); + { + 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) { + person.verantowrtlicher.setVorname(Vorname.getText()); + person.verantowrtlicher.setName(Nachname.getText()); + person.verantowrtlicher.setEMail(EMail.getText()); + person.verantowrtlicher.setFakultät(Fak.getText()); + person.verantowrtlicher.setHochschule(Hochschule.getText()); + person.verantowrtlicher.setTel(Tel.getText()); + Image.image.setImagename(imagename.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(Vorname.getText().isEmpty()==false && Nachname.getText().isEmpty()==false && Hochschule.getText().isEmpty()==false&&EMail.getText().isEmpty()==false) + { + person.verantowrtlicher.setVorname(Vorname.getText()); + person.verantowrtlicher.setName(Nachname.getText()); + person.verantowrtlicher.setEMail(EMail.getText()); + person.verantowrtlicher.setFakultät(Fak.getText()); + person.verantowrtlicher.setHochschule(Hochschule.getText()); + person.verantowrtlicher.setTel(Tel.getText()); + Image.image.setImagename(imagename.getText()); + EditImageTechnisch_GUI ea=new EditImageTechnisch_GUI(); + ea.setVisible(true); + dispose(); + } + else{ + JOptionPane.showMessageDialog(null, "Bitte geben Sie alle notwendigen Daten an!", + "Error", JOptionPane.ERROR_MESSAGE); + } + } + }); + 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"); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mnNewMenu_1.add(mntmOtrs); + + } +} diff --git a/Dozentenmodul/src/gui/EditImageTechnisch_GUI.java b/Dozentenmodul/src/gui/EditImageTechnisch_GUI.java new file mode 100644 index 00000000..a3fdcf20 --- /dev/null +++ b/Dozentenmodul/src/gui/EditImageTechnisch_GUI.java @@ -0,0 +1,311 @@ +package gui; + + +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Toolkit; +import javax.swing.JFrame; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JPanel; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import java.awt.Color; +import javax.swing.JLabel; +import java.awt.Font; +import javax.swing.JTextPane; +import java.awt.SystemColor; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import javax.swing.JSeparator; +import javax.swing.JMenuBar; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import javax.swing.border.TitledBorder; +import javax.swing.JTextArea; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.JRadioButton; +import javax.swing.ButtonGroup; +import javax.swing.JSpinner; +import javax.swing.SpinnerNumberModel; + +import models.Image; + +@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(); + /** + * Launch the application. + */ + public static void main(String[] args) { + try { + EditImageTechnisch_GUI dialog = new EditImageTechnisch_GUI(); + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + dialog.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the dialog. + */ + public EditImageTechnisch_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*"); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + int top=(screenSize.height - 722) / 2; + int left=(screenSize.width - 603) / 2; + setBounds(left, top, 603, 722); + //setBounds(100, 100, 603, 722); + 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 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); + + JLabel lblInternetIstInnerhalb = new JLabel("Internet ist innerhalb des Image gesperrt:"); + lblInternetIstInnerhalb.setBounds(10, 58, 250, 20); + panel_1.add(lblInternetIstInnerhalb); + + JRadioButton rdbtnInternetJa = new JRadioButton("Ja"); + buttonGroupInternet.add(rdbtnInternetJa); + rdbtnInternetJa.setBounds(266, 57, 109, 23); + panel_1.add(rdbtnInternetJa); + + JRadioButton rdbtnInternetNein = new JRadioButton("Nein"); + rdbtnInternetNein.setSelected(true); + buttonGroupInternet.add(rdbtnInternetNein); + rdbtnInternetNein.setBounds(377, 57, 109, 23); + panel_1.add(rdbtnInternetNein); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + + 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üglich 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); + 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(10, 122, 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(10, 222, 280, 55); + panel_2.add(txtrBeispielWindows_1); + + JLabel lblWieVieleCpus = new JLabel("Wie viele CPUs empfehlen Sie f\u00FCr das Image:"); + lblWieVieleCpus.setBounds(10, 191, 280, 20); + panel_2.add(lblWieVieleCpus); + + JLabel label_3 = new JLabel("mindestens"); + label_3.setBounds(315, 191, 60, 20); + panel_2.add(label_3); + + spinnerCPU = new JSpinner(); + spinnerCPU.setModel(new SpinnerNumberModel(1, 1, 4, 1)); + spinnerCPU.setBounds(385, 188, 29, 20); + panel_2.add(spinnerCPU); + + JLabel lblKerne = new JLabel("Kerne"); + lblKerne.setBounds(424, 191, 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) { + Image.image.setCpu(Integer.valueOf(spinnerCPU.getValue().toString()).intValue()); + Image.image.setRam(Integer.valueOf(spinnerRam.getValue().toString()).intValue()); + + EingabeImageAllgemein_GUI sr=new EingabeImageAllgemein_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) { + + + FTPUploader_GUI ea=new FTPUploader_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"); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mnNewMenu_1.add(mntmOtrs); + + } +} diff --git a/Dozentenmodul/src/gui/EingabeImageAllgemein_GUI.java b/Dozentenmodul/src/gui/EingabeImageAllgemein_GUI.java new file mode 100644 index 00000000..4eb5c609 --- /dev/null +++ b/Dozentenmodul/src/gui/EingabeImageAllgemein_GUI.java @@ -0,0 +1,337 @@ +package gui; + + +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Toolkit; +import javax.swing.JFrame; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import java.awt.Color; +import javax.swing.JLabel; +import java.awt.Font; +import javax.swing.JTextPane; +import java.awt.SystemColor; +import javax.swing.JTextField; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import javax.swing.JSeparator; +import javax.swing.JMenuBar; +import javax.swing.JMenu; +import javax.swing.JMenuItem; + +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import javax.swing.border.TitledBorder; +import javax.swing.JTextArea; + +import models.Image; +import models.person; + +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +@SuppressWarnings("serial") +public class EingabeImageAllgemein_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 Tel; + private JTextField Fak; + private JTextField imagename; + /** + * Launch the application. + */ + public static void main(String[] args) { + try { + EingabeImageAllgemein_GUI dialog = new EingabeImageAllgemein_GUI(); + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + dialog.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the dialog. + */ + public EingabeImageAllgemein_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*"); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + int top=(screenSize.height - 722) / 2; + int left=(screenSize.width - 603) / 2; + setBounds(left, top, 603, 722); + //setBounds(100, 100, 603, 722); + 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, 183, 125, 20); + panel_1.add(label); + + Vorname = new JTextField(); + Vorname.setBackground(Color.WHITE); + Vorname.setText((String) null); + Vorname.setColumns(10); + Vorname.setBounds(145, 183, 350, 20); + panel_1.add(Vorname); + + JLabel label_7 = new JLabel("Nachname: *"); + label_7.setBackground(SystemColor.menu); + label_7.setBounds(10, 214, 125, 20); + panel_1.add(label_7); + + Nachname = new JTextField(); + Nachname.setBackground(Color.WHITE); + Nachname.setText((String) null); + Nachname.setColumns(10); + Nachname.setBounds(145, 214, 350, 20); + panel_1.add(Nachname); + + JLabel label_8 = new JLabel("Hochschule: *"); + label_8.setBackground(SystemColor.menu); + label_8.setBounds(10, 245, 125, 20); + panel_1.add(label_8); + + Hochschule = new JTextField(); + Hochschule.setBackground(Color.WHITE); + Hochschule.setText((String) null); + Hochschule.setColumns(10); + Hochschule.setBounds(145, 245, 350, 20); + panel_1.add(Hochschule); + + JLabel label_9 = new JLabel("E-Mail: *"); + label_9.setBackground(SystemColor.menu); + label_9.setBounds(10, 276, 125, 20); + panel_1.add(label_9); + + EMail = new JTextField(); + EMail.setBackground(Color.WHITE); + EMail.setText((String) null); + EMail.setColumns(10); + EMail.setBounds(145, 276, 350, 20); + panel_1.add(EMail); + + JLabel label_10 = new JLabel("Tel.-Nummer:"); + label_10.setBackground(SystemColor.menu); + label_10.setBounds(10, 307, 125, 20); + panel_1.add(label_10); + + Tel = new JTextField(); + Tel.setBackground(Color.WHITE); + Tel.setText((String) null); + Tel.setColumns(10); + Tel.setBounds(145, 307, 350, 20); + panel_1.add(Tel); + + JLabel lblFakulttinstitution = new JLabel("Fakult\u00E4t/Institution:"); + lblFakulttinstitution.setBackground(SystemColor.menu); + lblFakulttinstitution.setBounds(10, 338, 125, 20); + panel_1.add(lblFakulttinstitution); + + Fak = new JTextField(); + Fak.setBackground(Color.WHITE); + Fak.setText((String) null); + Fak.setColumns(10); + Fak.setBounds(145, 338, 350, 20); + panel_1.add(Fak); + + 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); + 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) { + + EingabeImageAllgemein_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 okButton = new JButton("Zur\u00FCck"); + okButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + person.verantowrtlicher.setVorname(Vorname.getText()); + person.verantowrtlicher.setName(Nachname.getText()); + person.verantowrtlicher.setEMail(EMail.getText()); + person.verantowrtlicher.setFakultät(Fak.getText()); + person.verantowrtlicher.setHochschule(Hochschule.getText()); + person.verantowrtlicher.setTel(Tel.getText()); + Image.image.setImagename(imagename.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(Vorname.getText().isEmpty()==false && Nachname.getText().isEmpty()==false && Hochschule.getText().isEmpty()==false&&EMail.getText().isEmpty()==false) + { + person.verantowrtlicher.setVorname(Vorname.getText()); + person.verantowrtlicher.setName(Nachname.getText()); + person.verantowrtlicher.setEMail(EMail.getText()); + person.verantowrtlicher.setFakultät(Fak.getText()); + person.verantowrtlicher.setHochschule(Hochschule.getText()); + person.verantowrtlicher.setTel(Tel.getText()); + Image.image.setImagename(imagename.getText()); + EingabeImageTechnisch_GUI ea=new EingabeImageTechnisch_GUI(); + ea.setVisible(true); + dispose(); + } + else{ + JOptionPane.showMessageDialog(null, "Bitte geben Sie alle notwendigen Daten an!", + "Error", JOptionPane.ERROR_MESSAGE); + } + } + }); + 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"); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mnNewMenu_1.add(mntmOtrs); + + } +} diff --git a/Dozentenmodul/src/gui/EingabeImageTechnisch_GUI.java b/Dozentenmodul/src/gui/EingabeImageTechnisch_GUI.java new file mode 100644 index 00000000..62cfd19a --- /dev/null +++ b/Dozentenmodul/src/gui/EingabeImageTechnisch_GUI.java @@ -0,0 +1,346 @@ +package gui; + + +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Toolkit; +import javax.swing.JFrame; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JPanel; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import java.awt.Color; +import javax.swing.JLabel; +import java.awt.Font; +import javax.swing.JTextPane; +import java.awt.SystemColor; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import javax.swing.JSeparator; +import javax.swing.JMenuBar; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import javax.swing.border.TitledBorder; +import javax.swing.JTextArea; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.JRadioButton; +import javax.swing.ButtonGroup; +import javax.swing.JSpinner; +import javax.swing.SpinnerNumberModel; + +import models.Image; + +@SuppressWarnings("serial") +public class EingabeImageTechnisch_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(); + /** + * Launch the application. + */ + public static void main(String[] args) { + try { + EingabeImageTechnisch_GUI dialog = new EingabeImageTechnisch_GUI(); + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + dialog.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the dialog. + */ + public EingabeImageTechnisch_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*"); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + int top=(screenSize.height - 722) / 2; + int left=(screenSize.width - 603) / 2; + setBounds(left, top, 603, 722); + //setBounds(100, 100, 603, 722); + 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 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); + + 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); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + + EingabeImageTechnisch_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üglich 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); + 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(10, 122, 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(10, 222, 280, 55); + panel_2.add(txtrBeispielWindows_1); + + JLabel lblWieVieleCpus = new JLabel("Wie viele CPUs empfehlen Sie f\u00FCr das Image:"); + lblWieVieleCpus.setBounds(10, 191, 280, 20); + panel_2.add(lblWieVieleCpus); + + JLabel label_3 = new JLabel("mindestens"); + label_3.setBounds(315, 191, 60, 20); + panel_2.add(label_3); + + spinnerCPU = new JSpinner(); + spinnerCPU.setModel(new SpinnerNumberModel(1, 1, 4, 1)); + spinnerCPU.setBounds(385, 188, 29, 20); + panel_2.add(spinnerCPU); + + JLabel lblKerne = new JLabel("Kerne"); + lblKerne.setBounds(424, 191, 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) { + + 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()); + + EingabeImageAllgemein_GUI sr=new EingabeImageAllgemein_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(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()); + FTPUploader_GUI ea=new FTPUploader_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"); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mnNewMenu_1.add(mntmOtrs); + + } +} diff --git a/Dozentenmodul/src/gui/EingabeVeranstaltungAllgemein_GUI.java b/Dozentenmodul/src/gui/EingabeVeranstaltungAllgemein_GUI.java new file mode 100644 index 00000000..045f8a84 --- /dev/null +++ b/Dozentenmodul/src/gui/EingabeVeranstaltungAllgemein_GUI.java @@ -0,0 +1,338 @@ +package gui; + + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.Toolkit; +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 javax.swing.JButton; +import javax.swing.JDialog; +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.Lecture; +import models.person; + + +@SuppressWarnings("serial") +public class EingabeVeranstaltungAllgemein_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 Tel; + private JTextField Fak; + private JTextField imagename; + /** + * Launch the application. + */ + public static void main(String[] args) { + try { + EingabeVeranstaltungAllgemein_GUI dialog = new EingabeVeranstaltungAllgemein_GUI(); + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + dialog.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the dialog. + */ + public EingabeVeranstaltungAllgemein_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*"); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + int top=(screenSize.height - 722) / 2; + int left=(screenSize.width - 603) / 2; + setBounds(left, top, 603, 722); + //setBounds(100, 100, 603, 722); + 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, 183, 125, 20); + panel_1.add(label); + + Vorname = new JTextField(); + Vorname.setBackground(Color.WHITE); + Vorname.setText((String) null); + Vorname.setColumns(10); + Vorname.setBounds(145, 183, 350, 20); + panel_1.add(Vorname); + + JLabel label_7 = new JLabel("Nachname: *"); + label_7.setBackground(SystemColor.menu); + label_7.setBounds(10, 214, 125, 20); + panel_1.add(label_7); + + Nachname = new JTextField(); + Nachname.setBackground(Color.WHITE); + Nachname.setText((String) null); + Nachname.setColumns(10); + Nachname.setBounds(145, 214, 350, 20); + panel_1.add(Nachname); + + JLabel label_8 = new JLabel("Hochschule: *"); + label_8.setBackground(SystemColor.menu); + label_8.setBounds(10, 245, 125, 20); + panel_1.add(label_8); + + Hochschule = new JTextField(); + Hochschule.setBackground(Color.WHITE); + Hochschule.setText((String) null); + Hochschule.setColumns(10); + Hochschule.setBounds(145, 245, 350, 20); + panel_1.add(Hochschule); + + JLabel label_9 = new JLabel("E-Mail: *"); + label_9.setBackground(SystemColor.menu); + label_9.setBounds(10, 276, 125, 20); + panel_1.add(label_9); + + EMail = new JTextField(); + EMail.setBackground(Color.WHITE); + EMail.setText((String) null); + EMail.setColumns(10); + EMail.setBounds(145, 276, 350, 20); + panel_1.add(EMail); + + JLabel label_10 = new JLabel("Tel.-Nummer:"); + label_10.setBackground(SystemColor.menu); + label_10.setBounds(10, 307, 125, 20); + panel_1.add(label_10); + + Tel = new JTextField(); + Tel.setBackground(Color.WHITE); + Tel.setText((String) null); + Tel.setColumns(10); + Tel.setBounds(145, 307, 350, 20); + panel_1.add(Tel); + + JLabel lblFakulttinstitution = new JLabel("Fakult\u00E4t/Institution:"); + lblFakulttinstitution.setBackground(SystemColor.menu); + lblFakulttinstitution.setBounds(10, 338, 125, 20); + panel_1.add(lblFakulttinstitution); + + Fak = new JTextField(); + Fak.setBackground(Color.WHITE); + Fak.setText((String) null); + Fak.setColumns(10); + Fak.setBounds(145, 338, 350, 20); + panel_1.add(Fak); + + JLabel lblImagename = new JLabel("Veranstaltungsname: *"); + 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); + 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) { + + EingabeVeranstaltungAllgemein_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 okButton = new JButton("Zur\u00FCck"); + okButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + person.verantowrtlicher.setVorname(Vorname.getText()); + person.verantowrtlicher.setName(Nachname.getText()); + person.verantowrtlicher.setEMail(EMail.getText()); + person.verantowrtlicher.setFakultät(Fak.getText()); + person.verantowrtlicher.setHochschule(Hochschule.getText()); + person.verantowrtlicher.setTel(Tel.getText()); + Lecture.lecture.setName(imagename.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(Vorname.getText().isEmpty()==false && Nachname.getText().isEmpty()==false && Hochschule.getText().isEmpty()==false&&EMail.getText().isEmpty()==false) + { + person.verantowrtlicher.setVorname(Vorname.getText()); + person.verantowrtlicher.setName(Nachname.getText()); + person.verantowrtlicher.setEMail(EMail.getText()); + person.verantowrtlicher.setFakultät(Fak.getText()); + person.verantowrtlicher.setHochschule(Hochschule.getText()); + person.verantowrtlicher.setTel(Tel.getText()); + Lecture.lecture.setName(imagename.getText()); + EingabeVeranstatlungTechnisch_GUI ea=new EingabeVeranstatlungTechnisch_GUI(); + ea.setVisible(true); + dispose(); + } + else{ + JOptionPane.showMessageDialog(null, "Bitte geben Sie alle notwendigen Daten an!", + "Error", JOptionPane.ERROR_MESSAGE); + } + } + }); + 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"); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mnNewMenu_1.add(mntmOtrs); + + } +} diff --git a/Dozentenmodul/src/gui/EingabeVeranstatlungTechnisch_GUI.java b/Dozentenmodul/src/gui/EingabeVeranstatlungTechnisch_GUI.java new file mode 100644 index 00000000..3733b200 --- /dev/null +++ b/Dozentenmodul/src/gui/EingabeVeranstatlungTechnisch_GUI.java @@ -0,0 +1,317 @@ +package gui; + + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.ScrollPane; +import java.awt.SystemColor; +import java.awt.Toolkit; +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 javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JDialog; +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 models.Lecture; + + +import com.toedter.calendar.JDateChooser; + +@SuppressWarnings("serial") +public class EingabeVeranstatlungTechnisch_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + private JTextField textFieldLaborname; + JRadioButton rdbtnJa; + JDateChooser dateChooserend; + JDateChooser dateChooserstart; + JTextArea textAreashort; + JTextArea textArealong; + private final ButtonGroup buttonGroup = new ButtonGroup(); + /** + * Launch the application. + */ + public static void main(String[] args) { + try { + EingabeVeranstatlungTechnisch_GUI dialog = new EingabeVeranstatlungTechnisch_GUI(); + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + dialog.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the dialog. + */ + public EingabeVeranstatlungTechnisch_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*"); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + int top=(screenSize.height - 722) / 2; + int left=(screenSize.width - 603) / 2; + setBounds(left, top, 603, 722); + //setBounds(100, 100, 603, 722); + 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("Dateneingabe f\u00FCr 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("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, 531); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + + EingabeVeranstatlungTechnisch_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, 74, 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("Neu"); + lblNewLabel_1.setBounds(165, 11, 46, 14); + contentPanel.add(lblNewLabel_1); + + JLabel lblLabornameanzeigename = new JLabel("Laborname (Anzeigename): *"); + lblLabornameanzeigename.setBounds(10, 57, 250, 14); + contentPanel.add(lblLabornameanzeigename); + + textFieldLaborname = new JTextField(); + textFieldLaborname.setBounds(270, 54, 307, 20); + contentPanel.add(textFieldLaborname); + textFieldLaborname.setColumns(10); + + JLabel lblKurzbeschreibung = new JLabel("Kurzbeschreibung: *"); + lblKurzbeschreibung.setBounds(10, 109, 250, 14); + contentPanel.add(lblKurzbeschreibung); + + ScrollPane scrollPane = new ScrollPane(); + scrollPane.setBounds(270, 109, 307, 137); + contentPanel.add(scrollPane); + + textAreashort = new JTextArea(); + textAreashort.setLineWrap(true); + scrollPane.add(textAreashort); + textAreashort.setBounds(0, 0, 4, 22); + + ScrollPane scrollPane_1 = new ScrollPane(); + scrollPane_1.setBounds(270, 249, 307, 137); + contentPanel.add(scrollPane_1); + + textArealong = new JTextArea(); + textArealong.setLineWrap(true); + textArealong.setBounds(0, 0, 4, 22); + scrollPane_1.add(textArealong); + + JLabel label = new JLabel("Kurzbeschreibung: *"); + label.setBounds(0, 252, 250, 14); + contentPanel.add(label); + + JLabel lblGltigkeitsdatum = new JLabel("G\u00FCltigkeitsdatum: *"); + lblGltigkeitsdatum.setBounds(0, 397, 250, 14); + contentPanel.add(lblGltigkeitsdatum); + + JLabel lblVon = new JLabel("von:"); + lblVon.setBounds(270, 394, 30, 20); + contentPanel.add(lblVon); + + dateChooserstart = new JDateChooser(); + dateChooserstart.setDateFormatString("yyyy-MM-dd hh:mm:ss"); + dateChooserstart.setBounds(332, 391, 101, 20); + contentPanel.add(dateChooserstart); + + JLabel lblBis = new JLabel("bis"); + lblBis.setBounds(443, 394, 24, 20); + contentPanel.add(lblBis); + + dateChooserend = new JDateChooser(); + dateChooserend.setDateFormatString("dd.MM.yyyy hh:mm:ss"); + dateChooserend.setBounds(477, 392, 100, 20); + contentPanel.add(dateChooserend); + + JLabel lblAktiv = new JLabel("Aktiv:"); + lblAktiv.setBounds(0, 450, 250, 14); + contentPanel.add(lblAktiv); + + JLabel lblimVmchooserSichtbar = new JLabel("(Im VMChooser sichtbar)"); + lblimVmchooserSichtbar.setBounds(0, 475, 250, 14); + contentPanel.add(lblimVmchooserSichtbar); + + rdbtnJa = new JRadioButton("Ja"); + rdbtnJa.setSelected(true); + buttonGroup.add(rdbtnJa); + rdbtnJa.setBounds(270, 446, 109, 23); + contentPanel.add(rdbtnJa); + + JRadioButton rdbtnNein = new JRadioButton("Nein"); + buttonGroup.add(rdbtnNein); + rdbtnNein.setBounds(381, 446, 109, 23); + contentPanel.add(rdbtnNein); + //contentPanel.add(textArea); + { + 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(rdbtnJa.isSelected()==true) + { + Lecture.lecture.setActive(true); + } + else + { + Lecture.lecture.setActive(false); + } + + Lecture.lecture.setName(textFieldLaborname.getText()); + Lecture.lecture.setDesc(textArealong.getText()); + Lecture.lecture.setEnddate(dateChooserend.getDate()); + Lecture.lecture.setShortDesc(textAreashort.getText()); + Lecture.lecture.setStartdate(dateChooserstart.getDate()); + + + EingabeVeranstaltungAllgemein_GUI sr=new EingabeVeranstaltungAllgemein_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(rdbtnJa.isSelected()==true) + { + Lecture.lecture.setActive(true); + } + else + { + Lecture.lecture.setActive(false); + } + + Lecture.lecture.setName(textFieldLaborname.getText()); + Lecture.lecture.setDesc(textArealong.getText()); + Lecture.lecture.setEnddate(dateChooserend.getDate()); + Lecture.lecture.setShortDesc(textAreashort.getText()); + Lecture.lecture.setStartdate(dateChooserstart.getDate()); + LinkImage_GUI ea=new LinkImage_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"); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mnNewMenu_1.add(mntmOtrs); + + } +} diff --git a/Dozentenmodul/src/gui/ExtendedSearch_GUI.java b/Dozentenmodul/src/gui/ExtendedSearch_GUI.java new file mode 100644 index 00000000..20041516 --- /dev/null +++ b/Dozentenmodul/src/gui/ExtendedSearch_GUI.java @@ -0,0 +1,233 @@ +package gui; + + +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JDialog; +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; + +@SuppressWarnings("serial") +public class ExtendedSearch_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + private JTextField textField; + private JTextField textField_1; + /** + * Launch the application. + */ + public static void main(String[] args) { + try { + ExtendedSearch_GUI dialog = new ExtendedSearch_GUI(); + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + dialog.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the dialog. + */ + public ExtendedSearch_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*"); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + int top=(screenSize.height - 603) / 2; + int left=(screenSize.width - 722) / 2; + setBounds(left, top, 603, 722); + //setBounds(100, 100, 603, 722); + 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) { + + + EingabeImageAllgemein_GUI sr=new EingabeImageAllgemein_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) { + + + FTPUploader_GUI ea=new FTPUploader_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"); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mnNewMenu_1.add(mntmOtrs); + + } +} diff --git a/Dozentenmodul/src/gui/FTPDownloader_GUI.java b/Dozentenmodul/src/gui/FTPDownloader_GUI.java new file mode 100644 index 00000000..94e1e05d --- /dev/null +++ b/Dozentenmodul/src/gui/FTPDownloader_GUI.java @@ -0,0 +1,348 @@ +package gui; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Toolkit; +import java.io.File; + +import javax.swing.JButton; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.SwingConstants; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; + +import ftp.DownloadTask; + +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.SystemColor; +import java.awt.Font; +import javax.swing.JTextPane; +import javax.swing.JSeparator; + +import org.apache.thrift.TException; + +import server.Server.Client; +import server.User; +import thrift.ThriftConnection; + +@SuppressWarnings("serial") +public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener { + + @SuppressWarnings("unused") + private JPanel contentPane; + private final JPanel contentPanel = new JPanel(); + JLabel lblNewLabel; + JLabel downspeed; + User user; + JProgressBar progressBar; + String host="141.79.128.121"; + int port=21; + String username="openslx"; + String password="openslx-ng"; + String downloadPath=""; + String filename=""; + static String arg=""; + DownloadTask task; + JLabel bytesreadlbl; + JLabel lblNewLabel_3; + JLabel labelVerbleibend; + long filesize; + double speed; + long bytesread; + JLabel labelZeit; + boolean taskrun=false; + ThriftConnection thrift=new ThriftConnection(); + Client client=thrift.getThriftConnection(); + /** + * Launch the application. + */ + /*public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + FTPDownloader frame = new FTPDownloader(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + }*/ + + /** + * Create the frame. + */ + public FTPDownloader_GUI(String name) { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + if(taskrun==true) + { + try { + client.DeleteFtpUser(user.userName); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + task.cancel(true); + } + dispose(); + } + }); + setResizable(false); + //setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + + filename=name; + + 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*"); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + int top=(screenSize.height - 722) / 2; + int left=(screenSize.width - 603) / 2; + setBounds(left, top, 603, 722); + 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(); + lblNewLabel.setText(dir.getAbsolutePath()); + } + }); + + btnSpeicherortAuswhlen.setBounds(10, 124, 141, 23); + btnSpeicherortAuswhlen.setVerticalAlignment(SwingConstants.TOP); + btnSpeicherortAuswhlen.setHorizontalAlignment(SwingConstants.LEFT); + contentPanel.add(btnSpeicherortAuswhlen); + } + + lblNewLabel = new JLabel("C:\\"); + lblNewLabel.setBounds(169, 124, 255, 23); + contentPanel.add(lblNewLabel); + + JButton btnDownloadStarten = new JButton("Download starten"); + btnDownloadStarten.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + buttonDownloadActionPerformed(arg0); + } + }); + + btnDownloadStarten.setBounds(10, 294, 141, 23); + contentPanel.add(btnDownloadStarten); + + progressBar = new JProgressBar(0,100); + progressBar.setStringPainted(true); + + + progressBar.setBounds(10, 158, 577, 30); + contentPanel.add(progressBar); + + JLabel lblDownloadgeschwindigkeit = new JLabel("Downloadgeschwindigkeit:"); + lblDownloadgeschwindigkeit.setBounds(10, 194, 141, 14); + contentPanel.add(lblDownloadgeschwindigkeit); + + downspeed = new JLabel("0"); + downspeed.setBounds(261, 194, 95, 14); + contentPanel.add(downspeed); + + JLabel lblNewLabel_1 = new JLabel("Fertig:"); + lblNewLabel_1.setBounds(10, 244, 46, 14); + contentPanel.add(lblNewLabel_1); + + bytesreadlbl = new JLabel(""); + bytesreadlbl.setBounds(66, 244, 108, 14); + contentPanel.add(bytesreadlbl); + + JLabel lblNewLabel_2 = new JLabel("von:"); + lblNewLabel_2.setBounds(179, 244, 46, 14); + contentPanel.add(lblNewLabel_2); + + lblNewLabel_3 = new JLabel(""); + lblNewLabel_3.setBounds(235, 244, 108, 14); + contentPanel.add(lblNewLabel_3); + + JLabel lblMbVerbleibend = new JLabel("Verbleibend:"); + lblMbVerbleibend.setBounds(10, 269, 71, 14); + contentPanel.add(lblMbVerbleibend); + + labelVerbleibend = new JLabel(""); + labelVerbleibend.setBounds(91, 269, 108, 14); + contentPanel.add(labelVerbleibend); + + JLabel lblGeschtzteVerbleibendeZeit = new JLabel("Gesch\u00E4tzte Verbleibende Zeit:"); + lblGeschtzteVerbleibendeZeit.setBounds(10, 219, 150, 14); + contentPanel.add(lblGeschtzteVerbleibendeZeit); + + labelZeit = new JLabel(""); + labelZeit.setBounds(261, 219, 117, 14); + contentPanel.add(labelZeit); + + JPanel panel = new JPanel(); + panel.setLayout(null); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 577, 57); + contentPanel.add(panel); + + JLabel label = new JLabel("Eingabe Ihrer Daten"); + label.setFont(new Font("Tahoma", Font.BOLD, 18)); + label.setBounds(10, 11, 509, 22); + panel.add(label); + + JTextPane textPane = new JTextPane(); + textPane.setText("Geben Sie hier bitte einen sprechenden Imagename sowie Ihre Kontaktdaten an"); + textPane.setEditable(false); + textPane.setBackground(SystemColor.menu); + textPane.setBounds(10, 36, 509, 32); + panel.add(textPane); + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 79, 597, 2); + contentPanel.add(separator); + + JLabel label_1 = new JLabel("Hauptmen\u00FC"); + label_1.setForeground(Color.BLUE); + label_1.setBounds(20, 88, 61, 20); + contentPanel.add(label_1); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(80, 91, 14, 14); + contentPanel.add(label_2); + + JLabel label_3 = new JLabel("VL-Image"); + label_3.setForeground(Color.BLUE); + label_3.setBounds(91, 88, 46, 20); + contentPanel.add(label_3); + + JLabel label_4 = new JLabel(">"); + label_4.setBounds(139, 91, 14, 14); + contentPanel.add(label_4); + + JLabel label_5 = new JLabel("Neu/Bearbeiten"); + label_5.setBounds(149, 91, 108, 14); + contentPanel.add(label_5); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(-10, 648, 597, 2); + contentPanel.add(separator_1); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBackground(UIManager.getColor("Button.background")); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane, BorderLayout.SOUTH); + { + JButton cancelButton = new JButton("Weiter"); + cancelButton.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(); + } + } + dispose(); + } + }); + + JButton btnZurck = new JButton("Zur\u00FCck"); + btnZurck.setActionCommand("Cancel"); + buttonPane.add(btnZurck); + cancelButton.setActionCommand("Cancel"); + buttonPane.add(cancelButton); + } + } + setVisible(true); + + } + + private void buttonDownloadActionPerformed(ActionEvent event) { + + progressBar.setValue(0); + + try { + user=client.getFtpUser(); + //downloadPath=client.getPathOfImage(filename); + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + task = new DownloadTask(host, port, user.userName, user.password,user.path+filename+".vmdk", lblNewLabel.getText(), this); + task.addPropertyChangeListener(this); + task.execute(); + taskrun=true; + + } + + public void propertyChange(PropertyChangeEvent arg0) { + + + if ("progress" == arg0.getPropertyName()) { + int progress = (Integer) arg0.getNewValue(); + progressBar.setValue(progress); + } + 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"); + + // }else + //{ + //double MBSpeed=speed/1024; + //downspeed.setText(String.valueOf((MBSpeed)).substring(0, String.valueOf(MBSpeed).indexOf("."))); + //} + + } + if("bytesread"==arg0.getPropertyName()) + { + bytesread=(long)arg0.getNewValue(); + bytesreadlbl.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/gui/FTPUploader_GUI.java b/Dozentenmodul/src/gui/FTPUploader_GUI.java new file mode 100644 index 00000000..980f3481 --- /dev/null +++ b/Dozentenmodul/src/gui/FTPUploader_GUI.java @@ -0,0 +1,401 @@ +package gui; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.io.File; + +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.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.person; + +import org.apache.thrift.TException; + +import server.Server.Client; +import thrift.ThriftConnection; +import ftp.UploadTask; + + +@SuppressWarnings("serial") +public class FTPUploader_GUI extends JFrame implements PropertyChangeListener { + + @SuppressWarnings("unused") + private JPanel contentPane; + private final JPanel contentPanel = new JPanel(); + JLabel lblNewLabel; + JProgressBar progressBar; + String host="141.79.128.121"; + 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 thrift=new ThriftConnection(); + Client client=thrift.getThriftConnection(); + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + FTPUploader_GUI frame = new FTPUploader_GUI(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + public FTPUploader_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); + } + } + }); + 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*"); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + int top=(screenSize.height - 722) / 2; + int left=(screenSize.width - 603) / 2; + setBounds(left, top, 603, 722); + //setBounds(100, 100, 603, 250); + 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("VMDK ausw\u00E4hlen"); + btnSpeicherortAuswhlen.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + JFileChooser fc=new JFileChooser(); + fc.setFileSelectionMode(JFileChooser.FILES_ONLY); + + fc.showOpenDialog(getParent()); + File dir=fc.getSelectedFile(); + uploadFile=dir; + filename=uploadFile.getName(); + lblNewLabel.setText(dir.getAbsolutePath()); + } + }); + + btnSpeicherortAuswhlen.setBounds(10, 124, 141, 23); + btnSpeicherortAuswhlen.setVerticalAlignment(SwingConstants.TOP); + btnSpeicherortAuswhlen.setHorizontalAlignment(SwingConstants.LEFT); + contentPanel.add(btnSpeicherortAuswhlen); + } + + lblNewLabel = new JLabel(""); + lblNewLabel.setBounds(184, 124, 255, 23); + contentPanel.add(lblNewLabel); + + JButton btnDownloadStarten = new JButton("Upload starten"); + btnDownloadStarten.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + buttonUploadActionPerformed(arg0); + + } + }); + + btnDownloadStarten.setBounds(10, 330, 141, 23); + contentPanel.add(btnDownloadStarten); + + progressBar = new JProgressBar(0,100); + progressBar.setStringPainted(true); + + + progressBar.setBounds(10, 158, 577, 30); + contentPanel.add(progressBar); + + JLabel label = new JLabel("Downloadgeschwindigkeit:"); + label.setBounds(10, 199, 141, 14); + contentPanel.add(label); + + JLabel label_1 = new JLabel("Fertig:"); + label_1.setBounds(10, 249, 46, 14); + contentPanel.add(label_1); + + labelfertig = new JLabel("0"); + labelfertig.setBounds(66, 249, 108, 14); + contentPanel.add(labelfertig); + + UpSpeed = new JLabel("0"); + UpSpeed.setBounds(329, 199, 95, 14); + contentPanel.add(UpSpeed); + + JLabel label_4 = new JLabel("von:"); + label_4.setBounds(184, 249, 46, 14); + contentPanel.add(label_4); + + labelfilesize = new JLabel("0"); + labelfilesize.setBounds(240, 249, 108, 14); + contentPanel.add(labelfilesize); + + JLabel label_6 = new JLabel("Verbleibend:"); + label_6.setBounds(10, 274, 71, 14); + contentPanel.add(label_6); + + JLabel label_7 = new JLabel("Gesch\u00E4tzte Verbleibende Zeit:"); + label_7.setBounds(10, 224, 150, 14); + contentPanel.add(label_7); + + labelZeit = new JLabel("0"); + labelZeit.setBounds(329, 224, 117, 14); + contentPanel.add(labelZeit); + + labelverbleibend = new JLabel("0"); + labelverbleibend.setBounds(91, 274, 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 label_2 = new JLabel("Eingabe Ihrer Daten"); + label_2.setFont(new Font("Tahoma", Font.BOLD, 18)); + label_2.setBounds(10, 11, 509, 22); + panel.add(label_2); + + JTextPane textPane = new JTextPane(); + textPane.setText("Geben Sie hier bitte einen sprechenden Imagename sowie Ihre Kontaktdaten an"); + textPane.setEditable(false); + textPane.setBackground(SystemColor.menu); + textPane.setBounds(10, 36, 509, 32); + panel.add(textPane); + + 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/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); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBackground(UIManager.getColor("Button.background")); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane, BorderLayout.SOUTH); + { + JButton ButtonReady = new JButton("Abschlie\u00DFen"); + ButtonReady.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(); + } + task.cancel(true); + } + + } + }); + + JButton buttonCancel = new JButton("Schlie\u00DFen"); + buttonCancel.setActionCommand("Cancel"); + buttonPane.add(buttonCancel); + ButtonReady.setActionCommand("Cancel"); + buttonPane.add(ButtonReady); + } + } + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnHillfe = new JMenu("Hillfe"); + menuBar.add(mnHillfe); + setVisible(true); + + } + + private void buttonUploadActionPerformed(ActionEvent event) { + // File (or directory) with old name + // File file = new File(lblNewLabel.getText()); + + // File (or directory) with new name + //System.out.println(file.getAbsolutePath().substring(0,file.getAbsolutePath().lastIndexOf("\\"))+"\\"+vm.vl.getLaborname()+".vmdk"); + //File file2 = new File(file.getAbsoluteFile()+"\\"+vm.vl.getLaborname()+".vmdk"); + + + // Rename file (or directory) + //boolean success = file.renameTo(file2); + //if (!success) { + // File was not successfully renamed + //System.out.println("Not OK"); + //} + //else + //{ + //System.out.println("OK"); + //} + progressBar.setValue(0); + + try { + user=client.getFtpUser(); + System.out.println("name"+user.userName); + System.out.println("path"+user.path); + System.out.println("pass"+user.password); + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + task=new UploadTask(host,port,user.userName,user.password,user.path, uploadFile); + + task.addPropertyChangeListener(this); + task.execute(); + taskrun=true; + + //createXML(); + //TransferToSatellit(); + + + } + + public void propertyChange(PropertyChangeEvent arg0) { + if ("progress" == arg0.getPropertyName()) { + int progress = (Integer) arg0.getNewValue(); + progressBar.setValue(progress); + } + 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"); + + // }else + //{ + //double MBSpeed=speed/1024; + //downspeed.setText(String.valueOf((MBSpeed)).substring(0, String.valueOf(MBSpeed).indexOf("."))); + //} + + } + 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.verantowrtlicher.getVorname(), person.verantowrtlicher.getName(), person.verantowrtlicher.getHochschule(), person.verantowrtlicher.getEMail(), person.verantowrtlicher.getTel(), person.verantowrtlicher.getFakultät(), Image.image.isLicensed(), Image.image.isInternet(), Image.image.getRam(), Image.image.getCpu()); + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return false; + } + return true; + + + } +}
\ No newline at end of file diff --git a/Dozentenmodul/src/gui/LinkImage_GUI.java b/Dozentenmodul/src/gui/LinkImage_GUI.java new file mode 100644 index 00000000..38b3d5e3 --- /dev/null +++ b/Dozentenmodul/src/gui/LinkImage_GUI.java @@ -0,0 +1,433 @@ +package gui; + + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.Toolkit; +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.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.JDialog; +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.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.person; + +import org.apache.thrift.TException; + +import server.Server.Client; +import thrift.ThriftConnection; + +@SuppressWarnings("serial") +public class LinkImage_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + JRadioButton rdbtnInternetJa; + JRadioButton rdbtnInternetNein; + JComboBox<String> comboBox; + JTable tableAllImages; + private JTextField textFieldName; + String[] titles= {"Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung", "Verantwortlicher", "Letztes Update", "Schlagwort"}; + ThriftConnection thrift=new ThriftConnection(); + Client client=thrift.getThriftConnection(); + + + /** + * Launch the application. + */ + public static void main(String[] args) { + try { + LinkImage_GUI dialog = new LinkImage_GUI(); + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + dialog.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the dialog. + */ + public LinkImage_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*"); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + int top=(screenSize.height - 603) / 2; + int left=(screenSize.width - 722) / 2; + setBounds(left, top, 603, 722); + + + 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("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(); + 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) { + ExtendedSearch_GUI es=new ExtendedSearch_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 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) { + + LinkImage_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); + + JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP); + + tabbedPane.setBounds(10, 197, 557, 300); + contentPanel.add(tabbedPane); + + JScrollPane scrollPaneMyImage = new JScrollPane(); + JTable tablemyImages=new JTable(); + 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(); + 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); + + 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); + + 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); + + 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) { + + MainMenue_GUI main=new MainMenue_GUI(); + main.setVisible(true); + dispose(); + } + }); + okButton.setActionCommand("OK"); + buttonPane.add(okButton); + getRootPane().setDefaultButton(okButton); + } + { + JButton cancelButton = new JButton("Veranstaltung erzeugen und abschlie\u00DFen"); + cancelButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + String imagename=tableAllImages.getValueAt(tableAllImages.getSelectedRow(), 0).toString(); + try { + DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + System.out.println(formatter.format(Lecture.lecture.getStartdate()).toString()); + 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.verantowrtlicher.getVorname(), person.verantowrtlicher.getName(), person.verantowrtlicher.getHochschule(), person.verantowrtlicher.getEMail(), person.verantowrtlicher.getTel(), person.verantowrtlicher.getFakultät()); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + 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"); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mnNewMenu_1.add(mntmOtrs); + + } + + 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).getUpdateTime(),images.get(x).getUserData()}; + 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/gui/Login_GUI.java b/Dozentenmodul/src/gui/Login_GUI.java new file mode 100644 index 00000000..c982fa7b --- /dev/null +++ b/Dozentenmodul/src/gui/Login_GUI.java @@ -0,0 +1,152 @@ +package gui; + + +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.Image; +import java.awt.Toolkit; +import javax.swing.ImageIcon; +import javax.swing.JFrame; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.JLabel; +import javax.swing.JTextField; +import javax.swing.JButton; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import javax.swing.JPasswordField; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.SystemColor; + + +@SuppressWarnings("serial") +public class Login_GUI extends JFrame { + + private JPanel contentPane; + private JTextField username; + private JPasswordField pass; + + /** + * Launch the application. + */ + public static void main(String[] args) { + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + //Aufruf und Anzeige des Login Fensters + Login_GUI frame = new Login_GUI(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + public Login_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + System.exit(0); + } + }); + + //Fenster darf nicht vergrößert 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(); + } + //Titel des Fensters setzen + setTitle("Dozentenmodul *Prototyp*"); + //Aktion die beim Schließen durchgeführt werden soll + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + //Größe des Fensters definieren + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + int top=(screenSize.height - 400) / 2; + int left=(screenSize.width - 603) / 2; + setBounds(left, top, 603, 400); + //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 für das Logo erzeugen + JLabel imgLabel = new JLabel(); + //Größe 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)); + //Hinzufügen des Logos in das Fenster + contentPane.add(imgLabel); + + //Erzeugen und Hinzufügen des Labels + JLabel LabelUser = new JLabel("bwIDM-Benutzername:"); + LabelUser.setBounds(150, 164, 134, 20); + contentPane.add(LabelUser); + + //Erzeugen und Hinzufügen des Textfeldes + username = new JTextField(); + username.setBounds(343, 164, 125, 20); + contentPane.add(username); + username.setColumns(10); + + //Erzeugen und Hinzufügen des Labels + JLabel LabelPass = new JLabel("bwIDM-Passwort:"); + LabelPass.setBounds(150, 195, 134, 20); + contentPane.add(LabelPass); + + //Erzeugen, Hinzufügen und definierung der Aktion des Buttons + JButton BtnLogin = new JButton("Login"); + BtnLogin.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + //Aufruf der Ldap Klasse, welche die Ldap überprüfung vornimmt + //Ldap check=new Ldap(); + boolean login=true; + //boolean login=check.LdapAuth(username.getText(), new String(pass.getPassword())); + if(login==true) + { + + + //Erstellen einer Instanz der Aktionsauswahl + BillOfRights_GUI re=new BillOfRights_GUI(); + re.setVisible(true); + //Schließen des Fensters nach erfolgreichen Login + setVisible(false); + } + else + { + JOptionPane.showMessageDialog(null, + "Login denied!", "Message", + JOptionPane.INFORMATION_MESSAGE); + } + } + }); + BtnLogin.setBounds(343, 244, 125, 23); + contentPane.add(BtnLogin); + + //Erzeugen und Hinzufügen des Passwortfeldes + pass = new JPasswordField(); + pass.setBounds(343, 195, 125, 20); + contentPane.add(pass); + } +} diff --git a/Dozentenmodul/src/gui/MainMenue_GUI.java b/Dozentenmodul/src/gui/MainMenue_GUI.java new file mode 100644 index 00000000..e44e5c90 --- /dev/null +++ b/Dozentenmodul/src/gui/MainMenue_GUI.java @@ -0,0 +1,325 @@ +package gui; + +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Toolkit; +import javax.swing.JFrame; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JPanel; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import java.awt.Color; +import javax.swing.JLabel; +import java.awt.Font; +import javax.swing.JTextPane; +import java.awt.SystemColor; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import javax.swing.JSeparator; +import javax.swing.JRadioButton; +import javax.swing.SwingConstants; +import javax.swing.ButtonGroup; +import javax.swing.JMenuBar; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import javax.swing.border.TitledBorder; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.ScrollPane; +import javax.swing.JTextArea; + +@SuppressWarnings("serial") +public class MainMenue_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + JRadioButton rdbtnImageNew; + JRadioButton rdbtnImageEdit; + JRadioButton rdbtnImageSearchDownload; + JRadioButton rdbtnVeranstaltungNew; + private final ButtonGroup buttonGroup = new ButtonGroup(); + /** + * Launch the application. + */ + public static void main(String[] args) { + try { + MainMenue_GUI dialog = new MainMenue_GUI(); + dialog.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); + dialog.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 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*"); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + int top=(screenSize.height - 722) / 2; + int left=(screenSize.width - 603) / 2; + setBounds(left, top, 603, 722); + //setBounds(100, 100, 545, 366); + 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, 86, 270, 200); + 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); + + JRadioButton rdbtnImageDelete = new JRadioButton("L\u00F6schen"); + 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ärung", TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panelDesc.setBackground(SystemColor.menu); + panelDesc.setBounds(290, 86, 270, 200); + contentPanel.add(panelDesc); + + ScrollPane scrollPaneDesc = new ScrollPane(); + scrollPaneDesc.setBounds(5, 15, 260, 180); + JTextArea txtDesc=new JTextArea(); + txtDesc.setBackground(SystemColor.menu); + txtDesc.setWrapStyleWord(true); + txtDesc.setLineWrap(true); + scrollPaneDesc.add(txtDesc); + //Pro AUswahl + txtDesc.setText("Hier steht irgendwann die Beschreibung der einzelnen Punkte\r\n"); + 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, 297, 270, 200); + contentPanel.add(panelVeranstaltung); + + rdbtnVeranstaltungNew = new JRadioButton("Neu"); + buttonGroup.add(rdbtnVeranstaltungNew); + rdbtnVeranstaltungNew.setToolTipText("Hier k\u00F6nnen Sie Ihre Labordaten eingeben"); + rdbtnVeranstaltungNew.setBounds(6, 24, 185, 23); + panelVeranstaltung.add(rdbtnVeranstaltungNew); + rdbtnVeranstaltungNew.setBackground(SystemColor.menu); + + JRadioButton rdbtnVeranstaltungEdit = new JRadioButton("Bearbeiten"); + rdbtnVeranstaltungEdit.setToolTipText("Hier k\u00F6nnen Sie einen Link auf ein bestehendes Labor erzeugen"); + rdbtnVeranstaltungEdit.setBounds(6, 50, 230, 23); + panelVeranstaltung.add(rdbtnVeranstaltungEdit); + buttonGroup.add(rdbtnVeranstaltungEdit); + rdbtnVeranstaltungEdit.setBackground(SystemColor.menu); + + JRadioButton rdbtnVeranstaltungDelete = new JRadioButton("L\u00F6schen"); + rdbtnVeranstaltungDelete.setToolTipText("Hier k\u00F6nnen Sie ein Labor l\u00F6schen"); + rdbtnVeranstaltungDelete.setBounds(6, 76, 175, 23); + panelVeranstaltung.add(rdbtnVeranstaltungDelete); + buttonGroup.add(rdbtnVeranstaltungDelete); + rdbtnVeranstaltungDelete.setBackground(SystemColor.menu); + + JRadioButton rdbtnVeranstaltungSearch = new JRadioButton("Suche"); + buttonGroup.add(rdbtnVeranstaltungSearch); + rdbtnVeranstaltungSearch.setToolTipText("Hier k\u00F6nnen Sie ein Labor l\u00F6schen"); + rdbtnVeranstaltungSearch.setBackground(SystemColor.menu); + rdbtnVeranstaltungSearch.setBounds(6, 102, 175, 23); + panelVeranstaltung.add(rdbtnVeranstaltungSearch); + + JLabel lblCrumbStart = new JLabel("Startseite"); + lblCrumbStart.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + Login_GUI lw=new Login_GUI(); + lw.setVisible(true); + MainMenue_GUI.this.setVisible(false); + } + }); + lblCrumbStart.setForeground(Color.BLUE); + lblCrumbStart.setBounds(10, 0, 52, 14); + contentPanel.add(lblCrumbStart); + + JLabel label = new JLabel(">"); + label.setBounds(60, 0, 13, 14); + contentPanel.add(label); + + JLabel lblRechtshinweis = new JLabel("Rechtshinweis"); + lblRechtshinweis.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + BillOfRights_GUI rb=new BillOfRights_GUI(); + rb.setVisible(true); + MainMenue_GUI.this.setVisible(false); + } + }); + lblRechtshinweis.setForeground(Color.BLUE); + lblRechtshinweis.setBounds(72, 0, 68, 14); + contentPanel.add(lblRechtshinweis); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(142, 0, 13, 14); + contentPanel.add(label_1); + + JLabel lblNewLabel_1 = new JLabel("Hauptmen\u00FC"); + lblNewLabel_1.setBounds(150, 0, 74, 14); + contentPanel.add(lblNewLabel_1); + + JLabel lblNewLabel_2 = new JLabel("*Platzhalter Bild*"); + lblNewLabel_2.setBounds(10, 25, 557, 59); + contentPanel.add(lblNewLabel_2); + + 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, 297, 270, 200); + contentPanel.add(panelNews); + + ScrollPane scrollPaneNews = new ScrollPane(); + scrollPaneNews.setBounds(5, 15, 260, 180); + JTextArea txtNews=new JTextArea(); + txtNews.setBackground(SystemColor.menu); + txtNews.setWrapStyleWord(true); + txtNews.setLineWrap(true); + txtNews.setText("Hier werden mal die Neuigkeiten stehen"); + scrollPaneNews.add(txtNews); + panelNews.add(scrollPaneNews); + { + 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) { + + if(rdbtnImageNew.isSelected()==true) + { + EingabeImageAllgemein_GUI sr=new EingabeImageAllgemein_GUI(); + sr.setVisible(true); + dispose(); + } else if(rdbtnImageEdit.isSelected()==true) + { + SearchImage_GUI si=new SearchImage_GUI(); + si.setVisible(true); + dispose(); + }else if(rdbtnImageSearchDownload.isSelected()==true) + { + SearchMethod_GUI sm=new SearchMethod_GUI(); + sm.setVisible(true); + dispose(); + }else if(rdbtnVeranstaltungNew.isSelected()==true) + { + EingabeVeranstaltungAllgemein_GUI av=new EingabeVeranstaltungAllgemein_GUI(); + av.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 mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mnNewMenu_1.add(mntmOtrs); + + + + } +} diff --git a/Dozentenmodul/src/gui/SearchImage_GUI.java b/Dozentenmodul/src/gui/SearchImage_GUI.java new file mode 100644 index 00000000..44b83087 --- /dev/null +++ b/Dozentenmodul/src/gui/SearchImage_GUI.java @@ -0,0 +1,420 @@ +package gui; + + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.Toolkit; +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.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JDialog; +import javax.swing.JFrame; +import javax.swing.JLabel; +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.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; +import javax.swing.table.DefaultTableModel; + +import org.apache.thrift.TException; + +import server.Server.Client; +import thrift.ThriftConnection; + +@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; + private JTextField textFieldName; + String[] titles= {"Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung", "Verantwortlicher", "Letztes Update", "Schlagwort"}; + ThriftConnection con=new ThriftConnection(); + Client client=con.getThriftConnection(); + + /** + * Launch the application. + */ + public static void main(String[] args) { + try { + SearchImage_GUI dialog = new SearchImage_GUI(); + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + dialog.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the dialog. + */ + public SearchImage_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*"); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + int top=(screenSize.height - 603) / 2; + int left=(screenSize.width - 722) / 2; + setBounds(left, top, 603, 722); + + + 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("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(); + 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) { + ExtendedSearch_GUI es=new ExtendedSearch_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 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) { + + 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); + + JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP); + + tabbedPane.setBounds(10, 197, 557, 300); + contentPanel.add(tabbedPane); + + JScrollPane scrollPaneMyImage = new JScrollPane(); + JTable tablemyImages=new JTable(); + 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(); + 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); + + 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); + + 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); + + initTableModel(modelAll); + + JButton btnDownload = new JButton("Download"); + btnDownload.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + FTPDownloader_GUI down=new FTPDownloader_GUI("Test"); + down.setVisible(true); + SearchImage_GUI.this.setVisible(false); + } + }); + 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) { + 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) { + EditImageAllgemein_GUI ea=new EditImageAllgemein_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"); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mnNewMenu_1.add(mntmOtrs); + + } + + 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).getUpdateTime(),images.get(x).getUserData()}; + 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/gui/SearchMethod_GUI.java b/Dozentenmodul/src/gui/SearchMethod_GUI.java new file mode 100644 index 00000000..24a12959 --- /dev/null +++ b/Dozentenmodul/src/gui/SearchMethod_GUI.java @@ -0,0 +1,243 @@ +package gui; + + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.Toolkit; +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 javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JDialog; +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; + +@SuppressWarnings("serial") +public class SearchMethod_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + JRadioButton rdbtnNachEinemVlimage; + JRadioButton rdbtnNachEinerVeranstaltung; + private final ButtonGroup buttonGroup = new ButtonGroup(); + /** + * Launch the application. + */ + public static void main(String[] args) { + try { + SearchMethod_GUI dialog = new SearchMethod_GUI(); + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + dialog.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the dialog. + */ + public SearchMethod_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*"); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + int top=(screenSize.height - 603) / 2; + int left=(screenSize.width - 722) / 2; + setBounds(left, top, 603, 722); + //setBounds(100, 100, 603, 722); + 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, "Wählen 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); + + rdbtnNachEinemVlimage = new JRadioButton("Nach einem VL-Image oder Vorlagen suchen"); + buttonGroup.add(rdbtnNachEinemVlimage); + rdbtnNachEinemVlimage.setBounds(6, 38, 545, 23); + panel_1.add(rdbtnNachEinemVlimage); + + 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); + + rdbtnNachEinerVeranstaltung = new JRadioButton("Nach einer Veranstaltung suchen"); + buttonGroup.add(rdbtnNachEinerVeranstaltung); + rdbtnNachEinerVeranstaltung.setBounds(6, 180, 545, 23); + panel_1.add(rdbtnNachEinerVeranstaltung); + + 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) { + + SearchMethod_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 okButton = new JButton("Zur\u00FCck"); + okButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + 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(rdbtnNachEinemVlimage.isSelected()==true) + { + SearchImage_GUI ea=new SearchImage_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"); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mnNewMenu_1.add(mntmOtrs); + + } +} diff --git a/Dozentenmodul/src/gui/VmWareLink_GUI.java b/Dozentenmodul/src/gui/VmWareLink_GUI.java new file mode 100644 index 00000000..b803ee44 --- /dev/null +++ b/Dozentenmodul/src/gui/VmWareLink_GUI.java @@ -0,0 +1,190 @@ +package gui; + +import java.awt.Desktop; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Toolkit; +import javax.swing.JFrame; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JPanel; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.JLabel; +import java.awt.Font; +import javax.swing.JTextPane; +import java.awt.SystemColor; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import javax.swing.JSeparator; +import javax.swing.JMenuBar; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import javax.swing.JCheckBox; + + +@SuppressWarnings("serial") +public class VmWareLink_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + /** + * Launch the application. + */ + public static void main(String[] args) { + try { + VmWareLink_GUI dialog = new VmWareLink_GUI(); + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + dialog.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 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*"); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + int top=(screenSize.height - 722) / 2; + int left=(screenSize.width - 603) / 2; + setBounds(left, top, 603, 722); + //setBounds(100, 100, 603, 722); + 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(); + } + + } + }); + + lblNewLabel_1.setBounds(10, 93, 499, 14); + contentPanel.add(lblNewLabel_1); + + JCheckBox chckbxNewCheckBox = new JCheckBox("Diese Benachrichtigung nicht mehr anzeigen."); + 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); + + JLabel lblvmwarePlayerDownload = new JLabel("<html><a href=\"https:////my.vmware.com//web//vmware//free#desktop_end_user_computing//vmware_player//6_0\" >vmWare Player Download</a></html>"); + lblvmwarePlayerDownload.setBounds(10, 118, 499, 14); + contentPanel.add(lblvmwarePlayerDownload); + + JLabel lblvmwarePlayerDownload_1 = new JLabel("<html><a href=\"https:////my.vmware.com//web//vmware//free#desktop_end_user_computing//vmware_player//6_0\" >vmWare Player Download</a></html>"); + lblvmwarePlayerDownload_1.setBounds(10, 203, 499, 14); + contentPanel.add(lblvmwarePlayerDownload_1); + { + 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"); + mnHilfe.add(mntmFaq); + } + { + JMenuItem mntmHilfe = new JMenuItem("Hilfe"); + mnHilfe.add(mntmHilfe); + } + } + } + + + + } +} |
