diff options
Diffstat (limited to 'Dozentenmodul/src/GUI/EingabeSystemDaten.java')
| -rw-r--r-- | Dozentenmodul/src/GUI/EingabeSystemDaten.java | 311 |
1 files changed, 0 insertions, 311 deletions
diff --git a/Dozentenmodul/src/GUI/EingabeSystemDaten.java b/Dozentenmodul/src/GUI/EingabeSystemDaten.java deleted file mode 100644 index 2722fa51..00000000 --- a/Dozentenmodul/src/GUI/EingabeSystemDaten.java +++ /dev/null @@ -1,311 +0,0 @@ -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 sql.sql;
-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;
-import javax.swing.JScrollPane;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-
-
-@SuppressWarnings("serial")
-public class EingabeSystemDaten extends JFrame {
-
- private final JPanel contentPanel = new JPanel();
- String[] result;
- sql sql=new sql();
- private JTextField Laborname;
- JDateChooser dateChooser;
- JDateChooser dateChooser_1;
- Choice choiceOS;
- JTextArea shortDesc;
- JTextArea longDesc;
- JTextArea comment;
- /**
- * 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() {
- 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 - 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.setBounds(0, 0, 587, 71);
- getContentPane().add(panel);
- panel.setLayout(null);
- {
- JLabel lblNewLabel = new JLabel("Eingabe der systembezogenen Daten (Schritt 4 von 7)");
- 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, 567, 506);
- 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, 350, 20);
- contentPanel.add(Laborname);
- Laborname.setColumns(10);
-
- JLabel lblKurzbeschreibung = new JLabel("Kurzbeschreibung: *");
- lblKurzbeschreibung.setBounds(10, 67, 150, 20);
- contentPanel.add(lblKurzbeschreibung);
-
- JLabel lblLangbeschreibung = new JLabel("Langbeschreibung: *");
- lblLangbeschreibung.setBounds(10, 139, 150, 20);
- contentPanel.add(lblLangbeschreibung);
-
- JLabel lblKommentar = new JLabel("Kommentar:");
- lblKommentar.setBounds(10, 308, 150, 20);
- contentPanel.add(lblKommentar);
-
- JLabel lblBetriebssystem = new JLabel("Betriebssystem: *");
- lblBetriebssystem.setBounds(10, 373, 150, 20);
- contentPanel.add(lblBetriebssystem);
-
- choiceOS = new Choice();
- choiceOS.setFont(new Font("Tahoma", Font.PLAIN, 11));
-
-
-
-
-
- choiceOS.setBounds(170, 373, 226, 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, 132, 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, 132, 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(402, 372, 118, 23);
- contentPanel.add(btnHinzufgen);
- shortDesc=new JTextArea();
- shortDesc.setBorder(UIManager.getBorder("ComboBox.border"));
- shortDesc.setFont(new Font("Tahoma", Font.PLAIN, 11));
- shortDesc.setText(vm.vl.getShortDesc());
- JScrollPane scrollPane = new JScrollPane(shortDesc);
- scrollPane.setBorder(null);
- scrollPane.setBounds(170, 67, 350, 63);
- contentPanel.add(scrollPane);
- longDesc=new JTextArea();
- longDesc.setBorder(UIManager.getBorder("TextField.border"));
- longDesc.setFont(new Font("Tahoma", Font.PLAIN, 11));
- longDesc.setText(vm.vl.getLongDesc());
- JScrollPane scrollPane_1 = new JScrollPane(longDesc);
- scrollPane_1.setBorder(null);
- scrollPane_1.setBounds(170, 139, 350, 158);
- contentPanel.add(scrollPane_1);
- JScrollPane scrollPane_2 = new JScrollPane();
- scrollPane_2.setBorder(UIManager.getBorder("TextArea.border"));
- scrollPane_2.setBounds(170, 308, 350, 59);
- contentPanel.add(scrollPane_2);
-
- comment = new JTextArea();
- comment.setFont(new Font("Tahoma", Font.PLAIN, 11));
- comment.setBorder(UIManager.getBorder("TextField.border"));
- scrollPane_2.setViewportView(comment);
- {
- JPanel buttonPane = new JPanel();
- buttonPane.setBounds(0, 630, 587, 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(comment.getText());
- vm.vl.setEnd(dateChooser_1.getDate());
- vm.vl.setLaborname(Laborname.getText());
- vm.vl.setLongDesc(longDesc.getText());
- vm.vl.setOS(choiceOS.getSelectedItem());
- vm.vl.setShortDesc(shortDesc.getText());
- EingabeImageAllgemein_GUI ea= new EingabeImageAllgemein_GUI();
- 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(comment.getText());
- vm.vl.setEnd(dateChooser_1.getDate());
- vm.vl.setLaborname(Laborname.getText());
- vm.vl.setLongDesc(longDesc.getText());
- vm.vl.setOS(choiceOS.getSelectedItem());
- vm.vl.setShortDesc(shortDesc.getText());
- if(Laborname.getText().isEmpty()==false&&shortDesc.getText().isEmpty()==false&&longDesc.getText().isEmpty()==false&&dateChooser.getDate()!=null&&dateChooser_1.getDate()!=null)
- {
- EingabeSoftwareDaten ea=new EingabeSoftwareDaten();
- 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, 617, 587, 2);
- getContentPane().add(separator);
-
- JSeparator separator_1 = new JSeparator();
- separator_1.setBounds(0, 82, 587, 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);
-
- }
-}
|
