diff options
Diffstat (limited to 'Dozentenmodul/src/GUI/EingabeSystemDaten.java')
| -rw-r--r-- | Dozentenmodul/src/GUI/EingabeSystemDaten.java | 280 |
1 files changed, 280 insertions, 0 deletions
diff --git a/Dozentenmodul/src/GUI/EingabeSystemDaten.java b/Dozentenmodul/src/GUI/EingabeSystemDaten.java new file mode 100644 index 00000000..bbbfa98a --- /dev/null +++ b/Dozentenmodul/src/GUI/EingabeSystemDaten.java @@ -0,0 +1,280 @@ +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 javax.swing.JSeparator;
+import javax.swing.JTextArea;
+import java.awt.Choice;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+import Models.vm;
+
+import com.toedter.calendar.JDateChooser;
+import javax.swing.JMenuBar;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+
+@SuppressWarnings("serial")
+public class EingabeSystemDaten extends JDialog {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ ftp f=new ftp();
+ sql sql=new sql();
+ private JTextField Laborname;
+ JDateChooser dateChooser;
+ JTextArea textArea_2;
+ JDateChooser dateChooser_1;
+ JTextArea textArea_1;
+ Choice choiceOS;
+ JTextArea textArea;
+ /**
+ * Launch the application.
+ */
+ public static void main(String[] args) {
+ try {
+ EingabeSystemDaten dialog = new EingabeSystemDaten();
+ dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+ dialog.setVisible(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Create the dialog.
+ */
+ public EingabeSystemDaten() {
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("Dozentenmodul");
+ setBounds(100, 100, 583, 648);
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBounds(0, 0, 567, 71);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Eingabe der systembezogenen Daten (Schritt 4 von 5)");
+ 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 notwendigen Daten Ihres Systems ein.");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 42);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 95, 547, 441);
+ contentPanel.setBackground(Color.WHITE);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JLabel lblSysteminformationen = new JLabel("Systeminformationen");
+ lblSysteminformationen.setFont(new Font("Tahoma", Font.PLAIN, 14));
+ lblSysteminformationen.setBounds(10, 11, 162, 14);
+ contentPanel.add(lblSysteminformationen);
+
+ JLabel lblLabornameanzeigename = new JLabel("Laborname (Anzeigename): *");
+ lblLabornameanzeigename.setBounds(10, 36, 150, 20);
+ contentPanel.add(lblLabornameanzeigename);
+
+ Laborname = new JTextField();
+ Laborname.setText(vm.vl.getLaborname());
+ Laborname.setBounds(170, 36, 150, 20);
+ contentPanel.add(Laborname);
+ Laborname.setColumns(10);
+
+ JLabel lblKurzbeschreibung = new JLabel("Kurzbeschreibung: *");
+ lblKurzbeschreibung.setBounds(10, 67, 150, 20);
+ contentPanel.add(lblKurzbeschreibung);
+
+ textArea = new JTextArea();
+ textArea.setBorder(UIManager.getBorder("TextField.border"));
+ textArea.setText(vm.vl.getShortDesc());
+ textArea.setBounds(170, 67, 274, 63);
+ contentPanel.add(textArea);
+
+ JLabel lblLangbeschreibung = new JLabel("Langbeschreibung: *");
+ lblLangbeschreibung.setBounds(10, 139, 150, 20);
+ contentPanel.add(lblLangbeschreibung);
+
+ textArea_1 = new JTextArea();
+ textArea_1.setBorder(UIManager.getBorder("TextField.border"));
+ textArea_1.setText(vm.vl.getLongDesc());
+ textArea_1.setBounds(170, 141, 274, 152);
+ contentPanel.add(textArea_1);
+
+ JLabel lblKommentar = new JLabel("Kommentar:");
+ lblKommentar.setBounds(10, 308, 150, 20);
+ contentPanel.add(lblKommentar);
+
+ textArea_2 = new JTextArea();
+ textArea_2.setBorder(UIManager.getBorder("TextField.border"));
+ textArea_2.setText(vm.vl.getComment());
+ textArea_2.setBounds(170, 304, 274, 63);
+ contentPanel.add(textArea_2);
+
+ JLabel lblBetriebssystem = new JLabel("Betriebssystem: *");
+ lblBetriebssystem.setBounds(10, 373, 150, 20);
+ contentPanel.add(lblBetriebssystem);
+
+ choiceOS = new Choice();
+
+ choiceOS.setBounds(170, 373, 150, 20);
+
+ Connection con=sql.getConnection();
+ ResultSet rs=sql.getAllOS(con);
+
+ try {
+ while(rs.next())
+ {
+ choiceOS.addItem(rs.getString("Produktname")+" "+rs.getString("Version")+" "+rs.getString("Architektur"));
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ choiceOS.select(vm.vl.getOS());
+
+ contentPanel.add(choiceOS);
+
+ JLabel lblGltigkeitsdatumVon = new JLabel("G\u00FCltigkeitsdatum: *");
+ lblGltigkeitsdatumVon.setBounds(10, 404, 150, 20);
+ contentPanel.add(lblGltigkeitsdatumVon);
+
+ JLabel lblVon = new JLabel("von");
+ lblVon.setBounds(170, 407, 24, 14);
+ contentPanel.add(lblVon);
+
+ dateChooser = new JDateChooser();
+ dateChooser.setDateFormatString("dd.MM.yyyy hh:mm:ss");
+ dateChooser.setDate(vm.vl.getBegin());
+ dateChooser.setBounds(204, 404, 140, 20);
+ contentPanel.add(dateChooser);
+
+ JLabel lblNewLabel_1 = new JLabel("bis");
+ lblNewLabel_1.setBounds(354, 407, 24, 14);
+ contentPanel.add(lblNewLabel_1);
+
+ dateChooser_1 = new JDateChooser();
+ dateChooser_1.setDateFormatString("dd.MM.yyyy hh:mm:ss");
+ dateChooser_1.setDate(vm.vl.getEnd());
+ dateChooser_1.setBounds(388, 404, 140, 20);
+ contentPanel.add(dateChooser_1);
+
+ JButton btnHinzufgen = new JButton("Hinzuf\u00FCgen");
+ btnHinzufgen.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ AddOS os=new AddOS();
+ os.setVisible(true);
+ }
+ });
+ btnHinzufgen.setBounds(326, 372, 118, 23);
+ contentPanel.add(btnHinzufgen);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 554, 567, 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 arg0) {
+ vm.vl.setBegin(dateChooser.getDate());
+ vm.vl.setComment(textArea_2.getText());
+ vm.vl.setEnd(dateChooser_1.getDate());
+ vm.vl.setLaborname(Laborname.getText());
+ vm.vl.setLongDesc(textArea_1.getText());
+ vm.vl.setOS(choiceOS.getSelectedItem());
+ vm.vl.setShortDesc(textArea.getText());
+ EingabeAllgemein ea= new EingabeAllgemein();
+ ea.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 arg0) {
+ vm.vl.setBegin(dateChooser.getDate());
+ vm.vl.setComment(textArea_2.getText());
+ vm.vl.setEnd(dateChooser_1.getDate());
+ vm.vl.setLaborname(Laborname.getText());
+ vm.vl.setLongDesc(textArea_1.getText());
+ vm.vl.setOS(choiceOS.getSelectedItem());
+ vm.vl.setShortDesc(textArea.getText());
+
+ EingabeSoftwareDaten ea=new EingabeSoftwareDaten();
+ ea.setVisible(true);
+ dispose();
+ }
+ });
+ cancelButton.setActionCommand("Cancel");
+ buttonPane.add(cancelButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 547, 567, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 82, 529, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnSuchen = new JMenu("Suchen");
+ menuBar.add(mnSuchen);
+
+ JMenuItem mntmVlSuche = new JMenuItem("VL Suche");
+ mnSuchen.add(mntmVlSuche);
+
+ JMenu mnHilfe = new JMenu("Hilfe");
+ menuBar.add(mnHilfe);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ mnHilfe.add(mntmFaq);
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mnHilfe.add(mntmOtrs);
+
+
+
+
+ }
+}
|
