From 205f059ec5df1a24daa87f8563d2bbb99344ecf9 Mon Sep 17 00:00:00 2001 From: tspitzer Date: Tue, 17 Sep 2013 15:38:08 +0200 Subject: g --- Dozentenmodul/src/GUI/AddOS.java | 145 ++++++++++ Dozentenmodul/src/GUI/AddSoftware.java | 145 ++++++++++ Dozentenmodul/src/GUI/EingabeAllgemein.java | 345 ++++++++++++++++++++++++ Dozentenmodul/src/GUI/EingabeSoftwareDaten.java | 298 ++++++++++++++++++++ Dozentenmodul/src/GUI/EingabeSystemDaten.java | 280 +++++++++++++++++++ Dozentenmodul/src/GUI/FTPDownloader.java | 161 +++++++++++ Dozentenmodul/src/GUI/FTPUploader.java | 180 +++++++++++++ Dozentenmodul/src/GUI/FertigStellen.java | 154 +++++++++++ Dozentenmodul/src/GUI/LoginWindow.java | 3 +- Dozentenmodul/src/GUI/getVMwarePlayer.java | 156 +++++++++++ Dozentenmodul/src/GUI/searchRohling.java | 201 ++++++++++++++ 11 files changed, 2067 insertions(+), 1 deletion(-) create mode 100644 Dozentenmodul/src/GUI/AddOS.java create mode 100644 Dozentenmodul/src/GUI/AddSoftware.java create mode 100644 Dozentenmodul/src/GUI/EingabeAllgemein.java create mode 100644 Dozentenmodul/src/GUI/EingabeSoftwareDaten.java create mode 100644 Dozentenmodul/src/GUI/EingabeSystemDaten.java create mode 100644 Dozentenmodul/src/GUI/FTPDownloader.java create mode 100644 Dozentenmodul/src/GUI/FTPUploader.java create mode 100644 Dozentenmodul/src/GUI/FertigStellen.java create mode 100644 Dozentenmodul/src/GUI/getVMwarePlayer.java create mode 100644 Dozentenmodul/src/GUI/searchRohling.java (limited to 'Dozentenmodul/src/GUI') diff --git a/Dozentenmodul/src/GUI/AddOS.java b/Dozentenmodul/src/GUI/AddOS.java new file mode 100644 index 00000000..5039a4e1 --- /dev/null +++ b/Dozentenmodul/src/GUI/AddOS.java @@ -0,0 +1,145 @@ +package GUI; + +import java.awt.BorderLayout; +import java.awt.FlowLayout; +import sql.sql; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JPanel; +import javax.swing.border.EmptyBorder; +import javax.swing.JLabel; +import java.awt.Font; +import javax.swing.JTextField; +import javax.swing.JComboBox; +import javax.swing.JCheckBox; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import java.sql.Connection; +import javax.swing.DefaultComboBoxModel; + +@SuppressWarnings("serial") +public class AddOS extends JDialog { + + private final JPanel contentPanel = new JPanel(); + private JTextField textField; + private JTextField textField_1; + private JTextField textField_2; + @SuppressWarnings("rawtypes") + JComboBox comboBox; + JCheckBox checkBox; + sql sql=new sql(); + /** + * Launch the application. + */ + public static void main(String[] args) { + try { + AddOS dialog = new AddOS(); + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + dialog.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the dialog. + */ + @SuppressWarnings({ "rawtypes", "unchecked" }) + public AddOS() { + setTitle("Dozentenmodul"); + setBounds(100, 100, 288, 300); + getContentPane().setLayout(new BorderLayout()); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel, BorderLayout.CENTER); + contentPanel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Betriebssystem hinzuf\u00FCgen"); + lblNewLabel.setFont(new Font("Dialog", Font.PLAIN, 14)); + lblNewLabel.setBounds(10, 11, 194, 25); + contentPanel.add(lblNewLabel); + } + { + JLabel lblHersteller = new JLabel("Hersteller:"); + lblHersteller.setBounds(10, 47, 100, 20); + contentPanel.add(lblHersteller); + } + { + textField = new JTextField(); + textField.setBounds(120, 47, 125, 20); + contentPanel.add(textField); + textField.setColumns(10); + } + { + JLabel lblNewLabel_1 = new JLabel("Name:"); + lblNewLabel_1.setBounds(10, 78, 100, 20); + contentPanel.add(lblNewLabel_1); + } + { + textField_1 = new JTextField(); + textField_1.setColumns(10); + textField_1.setBounds(120, 78, 125, 20); + contentPanel.add(textField_1); + } + { + JLabel lblVersion = new JLabel("Version:"); + lblVersion.setBounds(10, 109, 100, 20); + contentPanel.add(lblVersion); + } + { + textField_2 = new JTextField(); + textField_2.setColumns(10); + textField_2.setBounds(120, 109, 125, 20); + contentPanel.add(textField_2); + } + { + JLabel lblArchitektur = new JLabel("Architektur:"); + lblArchitektur.setBounds(10, 140, 100, 20); + contentPanel.add(lblArchitektur); + } + + comboBox = new JComboBox(); + comboBox.setModel(new DefaultComboBoxModel(new String[] {"32-bit", "64-bit"})); + comboBox.setBounds(120, 140, 125, 20); + contentPanel.add(comboBox); + + JLabel lblLizenzpflichtig = new JLabel("Lizenzpflichtig:"); + lblLizenzpflichtig.setBounds(10, 171, 100, 20); + contentPanel.add(lblLizenzpflichtig); + + checkBox = new JCheckBox(""); + checkBox.setBounds(120, 167, 97, 23); + contentPanel.add(checkBox); + { + JPanel buttonPane = new JPanel(); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane, BorderLayout.SOUTH); + { + JButton okButton = new JButton("OK"); + okButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + int Kosten=0; + if(checkBox.isSelected()==true) + { + Kosten=1; + } + Connection con=sql.getConnection(); + sql.AddOS(con, textField_1.getText().toString(), textField_2.getText().toString(), comboBox.getSelectedItem().toString(), Kosten, textField.getText().toString()); + } + }); + okButton.setActionCommand("OK"); + buttonPane.add(okButton); + getRootPane().setDefaultButton(okButton); + } + { + JButton cancelButton = new JButton("Zur\u00FCck"); + cancelButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + dispose(); + } + }); + cancelButton.setActionCommand("Cancel"); + buttonPane.add(cancelButton); + } + } + } +} diff --git a/Dozentenmodul/src/GUI/AddSoftware.java b/Dozentenmodul/src/GUI/AddSoftware.java new file mode 100644 index 00000000..c3a41227 --- /dev/null +++ b/Dozentenmodul/src/GUI/AddSoftware.java @@ -0,0 +1,145 @@ +package GUI; + +import java.awt.BorderLayout; +import java.awt.FlowLayout; +import sql.sql; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JPanel; +import javax.swing.border.EmptyBorder; +import javax.swing.JLabel; +import java.awt.Font; +import javax.swing.JTextField; +import javax.swing.JComboBox; +import javax.swing.JCheckBox; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import java.sql.Connection; +import javax.swing.DefaultComboBoxModel; + +@SuppressWarnings("serial") +public class AddSoftware extends JDialog { + + private final JPanel contentPanel = new JPanel(); + private JTextField textField; + private JTextField textField_1; + private JTextField textField_2; + @SuppressWarnings("rawtypes") + JComboBox comboBox; + JCheckBox checkBox; + sql sql=new sql(); + /** + * Launch the application. + */ + public static void main(String[] args) { + try { + AddSoftware dialog = new AddSoftware(); + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + dialog.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the dialog. + */ + @SuppressWarnings({ "rawtypes", "unchecked" }) + public AddSoftware() { + setTitle("Dozentenmodul"); + setBounds(100, 100, 288, 300); + getContentPane().setLayout(new BorderLayout()); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel, BorderLayout.CENTER); + contentPanel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Software hinzuf\u00FCgen"); + lblNewLabel.setFont(new Font("Dialog", Font.PLAIN, 14)); + lblNewLabel.setBounds(10, 11, 194, 25); + contentPanel.add(lblNewLabel); + } + { + JLabel lblHersteller = new JLabel("Hersteller:"); + lblHersteller.setBounds(10, 47, 100, 20); + contentPanel.add(lblHersteller); + } + { + textField = new JTextField(); + textField.setBounds(120, 47, 125, 20); + contentPanel.add(textField); + textField.setColumns(10); + } + { + JLabel lblNewLabel_1 = new JLabel("Name:"); + lblNewLabel_1.setBounds(10, 78, 100, 20); + contentPanel.add(lblNewLabel_1); + } + { + textField_1 = new JTextField(); + textField_1.setColumns(10); + textField_1.setBounds(120, 78, 125, 20); + contentPanel.add(textField_1); + } + { + JLabel lblVersion = new JLabel("Version:"); + lblVersion.setBounds(10, 109, 100, 20); + contentPanel.add(lblVersion); + } + { + textField_2 = new JTextField(); + textField_2.setColumns(10); + textField_2.setBounds(120, 109, 125, 20); + contentPanel.add(textField_2); + } + { + JLabel lblArchitektur = new JLabel("Architektur:"); + lblArchitektur.setBounds(10, 140, 100, 20); + contentPanel.add(lblArchitektur); + } + + comboBox = new JComboBox(); + comboBox.setModel(new DefaultComboBoxModel(new String[] {"32-bit", "64-bit"})); + comboBox.setBounds(120, 140, 125, 20); + contentPanel.add(comboBox); + + JLabel lblLizenzpflichtig = new JLabel("Lizenzpflichtig:"); + lblLizenzpflichtig.setBounds(10, 171, 100, 20); + contentPanel.add(lblLizenzpflichtig); + + checkBox = new JCheckBox(""); + checkBox.setBounds(120, 167, 97, 23); + contentPanel.add(checkBox); + { + JPanel buttonPane = new JPanel(); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane, BorderLayout.SOUTH); + { + JButton okButton = new JButton("OK"); + okButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + int Kosten=0; + if(checkBox.isSelected()==true) + { + Kosten=1; + } + Connection con=sql.getConnection(); + sql.AddSoftware(con, textField_1.getText().toString(), textField_2.getText().toString(), comboBox.getSelectedItem().toString(), Kosten, textField.getText().toString()); + } + }); + okButton.setActionCommand("OK"); + buttonPane.add(okButton); + getRootPane().setDefaultButton(okButton); + } + { + JButton cancelButton = new JButton("Zur\u00FCck"); + cancelButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + dispose(); + } + }); + cancelButton.setActionCommand("Cancel"); + buttonPane.add(cancelButton); + } + } + } +} diff --git a/Dozentenmodul/src/GUI/EingabeAllgemein.java b/Dozentenmodul/src/GUI/EingabeAllgemein.java new file mode 100644 index 00000000..b28147b7 --- /dev/null +++ b/Dozentenmodul/src/GUI/EingabeAllgemein.java @@ -0,0 +1,345 @@ +package GUI; + + +import java.awt.FlowLayout; +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 javax.swing.JTextField; + +import ftp.ftp; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import javax.swing.JCheckBox; +import javax.swing.JSeparator; +import javax.swing.event.ChangeListener; +import javax.swing.event.ChangeEvent; +import javax.swing.JMenuBar; +import javax.swing.JMenu; +import javax.swing.JMenuItem; + +import Models.person; + +@SuppressWarnings("serial") +public class EingabeAllgemein extends JDialog { + + private final JPanel contentPanel = new JPanel(); + String[] result; + ftp f=new ftp(); + private JTextField Vorname_V; + private JTextField Nachname_V; + private JTextField Hochschule_V; + private JTextField EMail_V; + private JTextField Tel_V; + private JTextField Fak_V; + private JTextField Vorname_E; + private JTextField Nachname_E; + private JTextField Hochschule_E; + private JTextField EMail_E; + private JTextField Tel_E; + private JTextField Fak_E; + JCheckBox chckbxDerVerantwortlicheEntspricht; + /** + * Launch the application. + */ + public static void main(String[] args) { + try { + EingabeAllgemein dialog = new EingabeAllgemein(); + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + dialog.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the dialog. + */ + public EingabeAllgemein() { + + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setTitle("Dozentenmodul"); + setBounds(100, 100, 545, 689); + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBounds(0, 0, 529, 68); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Eingabe der allgemeinen Daten (Schritt 3 von 6)"); + 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("Geben Sie hier bitte die Kontaktdaten des Vernatwortlichen und des Erstellers der VMDK ein"); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 42); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 91, 509, 483); + contentPanel.setBackground(Color.WHITE); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JLabel lblNewLabel_1 = new JLabel("Allgemeine Informationen zum Verantwortlichen"); + lblNewLabel_1.setFont(new Font("Tahoma", Font.PLAIN, 14)); + lblNewLabel_1.setBounds(10, 0, 338, 25); + contentPanel.add(lblNewLabel_1); + + JLabel lblNewLabel_2 = new JLabel("Vorname: *"); + lblNewLabel_2.setBounds(10, 36, 125, 20); + contentPanel.add(lblNewLabel_2); + + Vorname_V = new JTextField(); + Vorname_V.setBounds(145, 36, 125, 20); + Vorname_V.setText(person.verantowrtlicher.getVorname()); + contentPanel.add(Vorname_V); + Vorname_V.setColumns(10); + + JLabel lblNachname = new JLabel("Nachname: *"); + lblNachname.setBounds(10, 67, 125, 20); + contentPanel.add(lblNachname); + + Nachname_V = new JTextField(); + Nachname_V.setBounds(145, 67, 125, 20); + Nachname_V.setText(person.verantowrtlicher.getName()); + contentPanel.add(Nachname_V); + Nachname_V.setColumns(10); + + JLabel lblHochschule = new JLabel("Hochschule: *"); + lblHochschule.setBounds(10, 98, 125, 20); + contentPanel.add(lblHochschule); + + Hochschule_V = new JTextField(); + Hochschule_V.setColumns(10); + Hochschule_V.setBounds(145, 98, 125, 20); + Hochschule_V.setText(person.verantowrtlicher.getHochschule()); + contentPanel.add(Hochschule_V); + + JLabel lblEmail = new JLabel("E-Mail: *"); + lblEmail.setBounds(10, 129, 125, 20); + contentPanel.add(lblEmail); + + EMail_V = new JTextField(); + EMail_V.setColumns(10); + EMail_V.setBounds(145, 129, 125, 20); + EMail_V.setText(person.verantowrtlicher.getEMail()); + contentPanel.add(EMail_V); + + JLabel lblTelnummer = new JLabel("Tel.-Nummer:"); + lblTelnummer.setBounds(10, 160, 125, 20); + contentPanel.add(lblTelnummer); + + Tel_V = new JTextField(); + Tel_V.setColumns(10); + Tel_V.setBounds(145, 160, 125, 20); + Tel_V.setText(person.verantowrtlicher.getTel()); + contentPanel.add(Tel_V); + + JLabel lblFakultt = new JLabel("Fakult\u00E4t:"); + lblFakultt.setBounds(10, 191, 125, 20); + contentPanel.add(lblFakultt); + + Fak_V = new JTextField(); + Fak_V.setColumns(10); + Fak_V.setBounds(145, 191, 125, 20); + Fak_V.setText(person.verantowrtlicher.getFakultät()); + contentPanel.add(Fak_V); + + chckbxDerVerantwortlicheEntspricht = new JCheckBox("Der Verantwortliche entspricht dem Ersteller"); + chckbxDerVerantwortlicheEntspricht.setSelected(person.verantowrtlicher.isIschecked()); + chckbxDerVerantwortlicheEntspricht.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent arg0) { + if(chckbxDerVerantwortlicheEntspricht.isSelected()==true){ + Nachname_E.setText(Nachname_V.getText()); + Vorname_E.setText(Vorname_V.getText()); + Hochschule_E.setText(Hochschule_V.getText()); + EMail_E.setText(EMail_V.getText()); + Tel_E.setText(Tel_V.getText()); + Fak_E.setText(Fak_V.getText()); + }else{ + Nachname_E.setText(""); + Vorname_E.setText(""); + Hochschule_E.setText(""); + EMail_E.setText(""); + Tel_E.setText(""); + Fak_E.setText(""); + } + } + }); + chckbxDerVerantwortlicheEntspricht.setBackground(Color.WHITE); + chckbxDerVerantwortlicheEntspricht.setBounds(6, 228, 264, 23); + contentPanel.add(chckbxDerVerantwortlicheEntspricht); + + JLabel lblAllgemeineInformationenZum = new JLabel("Allgemeine Informationen zum Ersteller"); + lblAllgemeineInformationenZum.setFont(new Font("Tahoma", Font.PLAIN, 14)); + lblAllgemeineInformationenZum.setBounds(10, 258, 338, 25); + contentPanel.add(lblAllgemeineInformationenZum); + + JLabel label_1 = new JLabel("Vorname: *"); + label_1.setBounds(10, 294, 125, 20); + contentPanel.add(label_1); + + Vorname_E = new JTextField(); + Vorname_E.setColumns(10); + Vorname_E.setBounds(145, 294, 125, 20); + Vorname_E.setText(person.ersteller.getVorname()); + contentPanel.add(Vorname_E); + + JLabel label_2 = new JLabel("Nachname: *"); + label_2.setBounds(10, 325, 125, 20); + contentPanel.add(label_2); + + Nachname_E = new JTextField(); + Nachname_E.setColumns(10); + Nachname_E.setBounds(145, 325, 125, 20); + Nachname_E.setText(person.ersteller.getName()); + contentPanel.add(Nachname_E); + + Hochschule_E = new JTextField(); + Hochschule_E.setColumns(10); + Hochschule_E.setBounds(145, 356, 125, 20); + Hochschule_E.setText(person.ersteller.getHochschule()); + contentPanel.add(Hochschule_E); + + JLabel label_3 = new JLabel("Hochschule: *"); + label_3.setBounds(10, 356, 125, 20); + contentPanel.add(label_3); + + JLabel label_4 = new JLabel("E-Mail: *"); + label_4.setBounds(10, 387, 125, 20); + contentPanel.add(label_4); + + EMail_E = new JTextField(); + EMail_E.setColumns(10); + EMail_E.setBounds(145, 387, 125, 20); + EMail_E.setText(person.ersteller.getEMail()); + contentPanel.add(EMail_E); + + Tel_E = new JTextField(); + Tel_E.setColumns(10); + Tel_E.setBounds(145, 418, 125, 20); + Tel_E.setText(person.ersteller.getTel()); + contentPanel.add(Tel_E); + + JLabel label_5 = new JLabel("Tel.-Nummer:"); + label_5.setBounds(10, 418, 125, 20); + contentPanel.add(label_5); + + JLabel label_6 = new JLabel("Fakult\u00E4t:"); + label_6.setBounds(10, 449, 125, 20); + contentPanel.add(label_6); + + Fak_E = new JTextField(); + Fak_E.setColumns(10); + Fak_E.setText(person.ersteller.getFakultät()); + Fak_E.setBounds(145, 449, 125, 20); + contentPanel.add(Fak_E); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 597, 529, 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_V.getText()); + person.verantowrtlicher.setName(Nachname_V.getText()); + person.verantowrtlicher.setEMail(EMail_V.getText()); + person.verantowrtlicher.setFakultät(Fak_V.getText()); + person.verantowrtlicher.setHochschule(Hochschule_V.getText()); + person.verantowrtlicher.setTel(Tel_V.getText()); + person.verantowrtlicher.setIschecked(chckbxDerVerantwortlicheEntspricht.isSelected()); + person.ersteller.setEMail(EMail_E.getText()); + person.ersteller.setFakultät(Fak_E.getText()); + person.ersteller.setHochschule(Hochschule_E.getText()); + person.ersteller.setName(Nachname_E.getText()); + person.ersteller.setVorname(Vorname_V.getText()); + person.ersteller.setTel(Tel_E.getText()); + getVMwarePlayer sr=new getVMwarePlayer(); + 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) { + person.verantowrtlicher.setVorname(Vorname_V.getText()); + person.verantowrtlicher.setName(Nachname_V.getText()); + person.verantowrtlicher.setEMail(EMail_V.getText()); + person.verantowrtlicher.setFakultät(Fak_V.getText()); + person.verantowrtlicher.setHochschule(Hochschule_V.getText()); + person.verantowrtlicher.setTel(Tel_V.getText()); + person.verantowrtlicher.setIschecked(chckbxDerVerantwortlicheEntspricht.isSelected()); + person.ersteller.setEMail(EMail_E.getText()); + person.ersteller.setFakultät(Fak_E.getText()); + person.ersteller.setHochschule(Hochschule_E.getText()); + person.ersteller.setName(Nachname_E.getText()); + person.ersteller.setVorname(Vorname_V.getText()); + person.ersteller.setTel(Tel_E.getText()); + EingabeSystemDaten ea=new EingabeSystemDaten(); + ea.setVisible(true); + dispose(); + } + }); + cancelButton.setActionCommand("Cancel"); + buttonPane.add(cancelButton); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 79, 529, 2); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 585, 529, 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/EingabeSoftwareDaten.java b/Dozentenmodul/src/GUI/EingabeSoftwareDaten.java new file mode 100644 index 00000000..f99fd88e --- /dev/null +++ b/Dozentenmodul/src/GUI/EingabeSoftwareDaten.java @@ -0,0 +1,298 @@ +package GUI; + +import java.awt.FlowLayout; +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 javax.swing.JTextField; +import sql.sql; +import ftp.ftp; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Arrays; +import javax.swing.JSeparator; +import java.awt.List; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import javax.swing.plaf.basic.BasicArrowButton; +import javax.swing.JMenuBar; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import Models.vm; + + +@SuppressWarnings("serial") +public class EingabeSoftwareDaten extends JDialog { + + private final JPanel contentPanel = new JPanel(); + String[] result; + ftp f=new ftp(); + sql sql=new sql(); + private JTextField textField; + List listavailable; + List listchoosed; + + /** + * Launch the application. + */ + public static void main(String[] args) { + try { + EingabeSoftwareDaten dialog = new EingabeSoftwareDaten(); + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + dialog.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the dialog. + */ + @SuppressWarnings({ }) + public EingabeSoftwareDaten() { + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setTitle("Dozentenmodul"); + setBounds(100, 100, 603, 722); + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBounds(0, 0, 529, 71); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Eingabe der installierten Software (Schritt 5 von 6)"); + 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 geben Sie nun die in Ihrem System installierte Software an."); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 42); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 95, 567, 512); + contentPanel.setBackground(Color.WHITE); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JLabel lblSysteminformationen = new JLabel("Verf\u00FCgbare Software"); + lblSysteminformationen.setFont(new Font("Tahoma", Font.PLAIN, 14)); + lblSysteminformationen.setBounds(10, 11, 162, 14); + contentPanel.add(lblSysteminformationen); + + + JLabel lblAusgewhlteSoftware = new JLabel("Ausgew\u00E4hlte Software"); + lblAusgewhlteSoftware.setFont(new Font("Tahoma", Font.PLAIN, 14)); + lblAusgewhlteSoftware.setBounds(306, 11, 162, 14); + contentPanel.add(lblAusgewhlteSoftware); + + + + textField = new JTextField(); + textField.addKeyListener(new KeyAdapter() { + @Override + public void keyReleased(KeyEvent e) { + + + Connection con=sql.getConnection(); + ResultSet rs=sql.getSoftwareByName(con, textField.getText().toString()); + listavailable.removeAll(); + try { + while(rs.next()) + { + listavailable.add(rs.getString("SW")); + } + } catch (SQLException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + } + }); + + textField.setBounds(10, 36, 244, 20); + contentPanel.add(textField); + textField.setColumns(10); + + JButton btnSoftwareHinzufgen = new JButton("Software hinzuf\u00FCgen"); + btnSoftwareHinzufgen.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + AddSoftware as=new AddSoftware(); + as.setVisible(true); + } + }); + btnSoftwareHinzufgen.setBounds(10, 483, 162, 23); + contentPanel.add(btnSoftwareHinzufgen); + + listavailable = new List(); + Connection con=sql.getConnection(); + ResultSet he=sql.getAllHersteller(con); + + try { + while(he.next()) + { + + ResultSet sw=sql.getAllSoftware(con, he.getString("Name")); + + while(sw.next()) + { + + listavailable.add(he.getString("Name")+" "+sw.getString("Produktname")+" "+sw.getString("Version")+" "+sw.getString("Architektur")); + } + } + } catch (SQLException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + listavailable.setMultipleMode(true); + listavailable.setBounds(10, 62, 244, 415); + contentPanel.add(listavailable); + + listchoosed = new List(); + if(vm.vl.getSoftware()!=null) + { + for(int i=0;i