summaryrefslogtreecommitdiffstats
path: root/Dozentenmodul/src/GUI
diff options
context:
space:
mode:
authortspitzer2013-09-30 09:17:29 +0200
committertspitzer2013-09-30 09:17:29 +0200
commit1d1153c6262f0ec69a7f29c92ba2c389f37e7c83 (patch)
tree1d0a745266b8769db1e70ee17caa0c338c3effbc /Dozentenmodul/src/GUI
parentErste Version fast fertig (diff)
downloadtutor-module-1d1153c6262f0ec69a7f29c92ba2c389f37e7c83.tar.gz
tutor-module-1d1153c6262f0ec69a7f29c92ba2c389f37e7c83.tar.xz
tutor-module-1d1153c6262f0ec69a7f29c92ba2c389f37e7c83.zip
actual
Diffstat (limited to 'Dozentenmodul/src/GUI')
-rw-r--r--Dozentenmodul/src/GUI/ActionChooser.java6
-rw-r--r--Dozentenmodul/src/GUI/EingabeAllgemein.java5
-rw-r--r--Dozentenmodul/src/GUI/EingabeSoftwareDaten.java2
-rw-r--r--Dozentenmodul/src/GUI/EingabeSystemDaten.java2
-rw-r--r--Dozentenmodul/src/GUI/FTPDownloader.java48
-rw-r--r--Dozentenmodul/src/GUI/FTPUploader.java78
-rw-r--r--Dozentenmodul/src/GUI/FertigStellen.java9
-rw-r--r--Dozentenmodul/src/GUI/Summary.java3
-rw-r--r--Dozentenmodul/src/GUI/getVMwarePlayer.java10
-rw-r--r--Dozentenmodul/src/GUI/searchRohling.java17
10 files changed, 126 insertions, 54 deletions
diff --git a/Dozentenmodul/src/GUI/ActionChooser.java b/Dozentenmodul/src/GUI/ActionChooser.java
index 60e3cf6a..71f1be92 100644
--- a/Dozentenmodul/src/GUI/ActionChooser.java
+++ b/Dozentenmodul/src/GUI/ActionChooser.java
@@ -12,7 +12,6 @@ import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextPane;
import java.awt.SystemColor;
-import ftp.ftp;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JSeparator;
@@ -28,7 +27,6 @@ public class ActionChooser extends JDialog {
private final JPanel contentPanel = new JPanel();
String[] result;
- ftp f=new ftp();
JRadioButton radioButton_1;
JRadioButton radioButton;
private final ButtonGroup buttonGroup = new ButtonGroup();
@@ -57,7 +55,7 @@ public class ActionChooser extends JDialog {
e.printStackTrace();
}
setTitle("Dozentenmodul");
- setBounds(100, 100, 545, 360);
+ setBounds(100, 100, 545, 366);
getContentPane().setLayout(null);
{
JPanel panel = new JPanel();
@@ -78,7 +76,7 @@ public class ActionChooser extends JDialog {
txtpnBitteWhlenSie.setBounds(10, 36, 509, 42);
panel.add(txtpnBitteWhlenSie);
}
- contentPanel.setBounds(10, 113, 509, 135);
+ contentPanel.setBounds(10, 104, 509, 144);
contentPanel.setBackground(Color.WHITE);
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel);
diff --git a/Dozentenmodul/src/GUI/EingabeAllgemein.java b/Dozentenmodul/src/GUI/EingabeAllgemein.java
index 86488036..4643332e 100644
--- a/Dozentenmodul/src/GUI/EingabeAllgemein.java
+++ b/Dozentenmodul/src/GUI/EingabeAllgemein.java
@@ -15,8 +15,6 @@ 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;
@@ -34,7 +32,6 @@ 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;
@@ -348,7 +345,5 @@ public class EingabeAllgemein extends JDialog {
JMenuItem mntmOtrs = new JMenuItem("OTRS");
mnNewMenu_1.add(mntmOtrs);
-
-
}
}
diff --git a/Dozentenmodul/src/GUI/EingabeSoftwareDaten.java b/Dozentenmodul/src/GUI/EingabeSoftwareDaten.java
index bf88f665..90b6fb6f 100644
--- a/Dozentenmodul/src/GUI/EingabeSoftwareDaten.java
+++ b/Dozentenmodul/src/GUI/EingabeSoftwareDaten.java
@@ -14,7 +14,6 @@ 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;
@@ -37,7 +36,6 @@ 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;
diff --git a/Dozentenmodul/src/GUI/EingabeSystemDaten.java b/Dozentenmodul/src/GUI/EingabeSystemDaten.java
index f94efbef..9e370328 100644
--- a/Dozentenmodul/src/GUI/EingabeSystemDaten.java
+++ b/Dozentenmodul/src/GUI/EingabeSystemDaten.java
@@ -15,7 +15,6 @@ 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;
@@ -38,7 +37,6 @@ 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;
diff --git a/Dozentenmodul/src/GUI/FTPDownloader.java b/Dozentenmodul/src/GUI/FTPDownloader.java
index b936a966..5f062ff0 100644
--- a/Dozentenmodul/src/GUI/FTPDownloader.java
+++ b/Dozentenmodul/src/GUI/FTPDownloader.java
@@ -3,7 +3,13 @@ package GUI;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
+import java.io.BufferedReader;
import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Properties;
+
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
@@ -15,9 +21,15 @@ import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.EmptyBorder;
-import downloader.DownloadTask;
+import Models.person;
+import Models.vm;
+
+import com.jcraft.jsch.ChannelExec;
+import com.jcraft.jsch.JSch;
+import com.jcraft.jsch.JSchException;
+import com.jcraft.jsch.Session;
-import ftp.ftp;
+import downloader.DownloadTask;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.beans.PropertyChangeEvent;
@@ -30,13 +42,13 @@ public class FTPDownloader extends JFrame implements PropertyChangeListener {
private JPanel contentPane;
private final JPanel contentPanel = new JPanel();
JLabel lblNewLabel;
+ JLabel downspeed;
JProgressBar progressBar;
- ftp f=new ftp();
- String host="openslx-nfs.rz.hs-offenburg.de";
+ String host="132.230.4.16";
int port=21;
- String username="tspitzer";
- String password="21071989";
- String downloadPath="_vorlagen/";
+ String username="openslx";
+ String password="openslx-ng";
+ String downloadPath="";
String filename="";
static String arg="";
/**
@@ -119,6 +131,14 @@ public class FTPDownloader extends JFrame implements PropertyChangeListener {
progressBar.setBounds(10, 45, 414, 30);
contentPanel.add(progressBar);
+
+ JLabel lblDownloadgeschwindigkeit = new JLabel("Downloadgeschwindigkeit:");
+ lblDownloadgeschwindigkeit.setBounds(10, 81, 141, 14);
+ contentPanel.add(lblDownloadgeschwindigkeit);
+
+ downspeed = new JLabel("0");
+ downspeed.setBounds(169, 81, 46, 14);
+ contentPanel.add(downspeed);
{
JPanel buttonPane = new JPanel();
buttonPane.setBackground(Color.WHITE);
@@ -146,6 +166,7 @@ public class FTPDownloader extends JFrame implements PropertyChangeListener {
DownloadTask task = new DownloadTask(host, port, username, password,downloadPath+filename, lblNewLabel.getText(), this);
task.addPropertyChangeListener(this);
task.execute();
+
}
public void propertyChange(PropertyChangeEvent arg0) {
@@ -153,9 +174,20 @@ public class FTPDownloader extends JFrame implements PropertyChangeListener {
int progress = (Integer) arg0.getNewValue();
progressBar.setValue(progress);
}
+ if("speed"==arg0.getPropertyName()){
+ double speed=(double)arg0.getNewValue();
+ //if(speed<=1){
+ downspeed.setText(String.valueOf(speed));
+ // }else
+ //{
+ //double MBSpeed=speed/1024;
+ //downspeed.setText(String.valueOf((MBSpeed)).substring(0, String.valueOf(MBSpeed).indexOf(".")));
+ //}
+
+ }
}
-
+
} \ No newline at end of file
diff --git a/Dozentenmodul/src/GUI/FTPUploader.java b/Dozentenmodul/src/GUI/FTPUploader.java
index 88526d04..34e14022 100644
--- a/Dozentenmodul/src/GUI/FTPUploader.java
+++ b/Dozentenmodul/src/GUI/FTPUploader.java
@@ -4,7 +4,12 @@ import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.EventQueue;
import java.awt.FlowLayout;
+import java.io.BufferedReader;
import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Properties;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
@@ -15,8 +20,13 @@ import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.EmptyBorder;
+import com.jcraft.jsch.ChannelExec;
+import com.jcraft.jsch.JSch;
+import com.jcraft.jsch.JSchException;
+import com.jcraft.jsch.Session;
+import Models.person;
+import Models.vm;
import downloader.UploadTask;
-import ftp.ftp;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.beans.PropertyChangeEvent;
@@ -31,11 +41,10 @@ public class FTPUploader extends JFrame implements PropertyChangeListener {
JLabel lblNewLabel;
JLabel UpSpeed;
JProgressBar progressBar;
- ftp f=new ftp();
- String host="141.79.128.103";
+ String host="bwlp-masterserver.ruf.uni-freiburg.de";
int port=21;
- String username="sysadmin4openslx";
- String password="!N4ye,04u.";
+ String username="openslx";
+ String password="openslx-ng";
String uploadPath="/";
String filename="";
File uploadFile;
@@ -91,6 +100,7 @@ public class FTPUploader extends JFrame implements PropertyChangeListener {
fc.showOpenDialog(getParent());
File dir=fc.getSelectedFile();
uploadFile=dir;
+ filename=uploadFile.getName();
lblNewLabel.setText(dir.getAbsolutePath());
}
});
@@ -109,6 +119,7 @@ public class FTPUploader extends JFrame implements PropertyChangeListener {
btnDownloadStarten.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
buttonUploadActionPerformed(arg0);
+
}
});
@@ -152,11 +163,20 @@ public class FTPUploader extends JFrame implements PropertyChangeListener {
}
private void buttonUploadActionPerformed(ActionEvent event) {
-
+ //File f=new File(lblNewLabel.getText());
+ //boolean nextStep=f.renameTo(new File(f.getAbsolutePath().substring(0,f.getAbsolutePath().lastIndexOf(File.separator))+"//"+vm.vl.getLaborname()+".vmdk"));
+ //if(nextStep==true)
+ //{
progressBar.setValue(0);
UploadTask task=new UploadTask(host,port,username,password,uploadPath, uploadFile);
task.addPropertyChangeListener(this);
task.execute();
+
+
+ createXML();
+
+
+ //}
}
public void propertyChange(PropertyChangeEvent arg0) {
@@ -166,15 +186,49 @@ public class FTPUploader extends JFrame implements PropertyChangeListener {
}
if("speed"==arg0.getPropertyName()){
double speed=(double)arg0.getNewValue();
- if(speed<=1){
+ //if(speed<=1){
UpSpeed.setText(String.valueOf(speed));
- }else
- {
- double MBSpeed=speed/1024;
- UpSpeed.setText(String.valueOf((MBSpeed)).substring(0, String.valueOf(MBSpeed).indexOf(".")));
- }
+ //}else
+ //{
+ // double MBSpeed=speed/1024;
+ // UpSpeed.setText(String.valueOf((MBSpeed)).substring(0, String.valueOf(MBSpeed).indexOf(".")));
+ // }
}
}
+
+ public void createXML()
+ {
+ JSch j=new JSch();
+
+ try {
+ Session se=j.getSession("openslx", "132.230.4.16", 22);
+
+ Properties config = new Properties();
+ config.setProperty("StrictHostKeyChecking", "no");
+ se.setConfig(config);
+ se.setPassword("openslx-ng");
+ se.connect();
+ ChannelExec ch=(ChannelExec) se.openChannel("exec");
+
+ String OS="winvista";
+
+ ch.setCommand("sh /home/openslx/scripts/xml_file_creator.sh '"+vm.vl.getLaborname()+"' '"+person.ersteller.getName()+" "+person.ersteller.getVorname()+"' '"+person.ersteller.getEMail()+"' '"+vm.vl.getShortDesc()+"' '"+vm.vl.getLongDesc()+"' '"+OS+"'");
+ //ch.setCommand("ls");
+
+ ch.connect();
+
+
+
+
+ ch.disconnect();
+ se.disconnect();
+
+
+ } catch (JSchException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
} \ No newline at end of file
diff --git a/Dozentenmodul/src/GUI/FertigStellen.java b/Dozentenmodul/src/GUI/FertigStellen.java
index 3ff09ee6..1d9734c4 100644
--- a/Dozentenmodul/src/GUI/FertigStellen.java
+++ b/Dozentenmodul/src/GUI/FertigStellen.java
@@ -4,7 +4,6 @@ import java.awt.List;
import javax.swing.JButton;
import javax.swing.JDialog;
-import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
@@ -14,29 +13,23 @@ import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextPane;
import java.awt.SystemColor;
-import ftp.ftp;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JSeparator;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JMenu;
-import javax.swing.JTable;
-
import Models.person;
import Models.vm;
-import java.awt.TextArea;
import javax.swing.JTextArea;
import javax.swing.JScrollPane;
-import com.toedter.calendar.JDateChooser;
-
@SuppressWarnings("serial")
public class FertigStellen extends JDialog {
private final JScrollPane contentPanel = new JScrollPane();
String[] result;
- ftp f=new ftp();
+
/**
* Launch the application.
*/
diff --git a/Dozentenmodul/src/GUI/Summary.java b/Dozentenmodul/src/GUI/Summary.java
index d09f7391..4261d746 100644
--- a/Dozentenmodul/src/GUI/Summary.java
+++ b/Dozentenmodul/src/GUI/Summary.java
@@ -12,7 +12,6 @@ import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextPane;
import java.awt.SystemColor;
-import ftp.ftp;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JSeparator;
@@ -31,7 +30,7 @@ import java.text.SimpleDateFormat;
@SuppressWarnings("serial")
public class Summary extends JDialog {
String[] result;
- ftp f=new ftp();
+
/**
* Launch the application.
*/
diff --git a/Dozentenmodul/src/GUI/getVMwarePlayer.java b/Dozentenmodul/src/GUI/getVMwarePlayer.java
index c08411a1..919df825 100644
--- a/Dozentenmodul/src/GUI/getVMwarePlayer.java
+++ b/Dozentenmodul/src/GUI/getVMwarePlayer.java
@@ -13,7 +13,6 @@ import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextPane;
import java.awt.SystemColor;
-import ftp.ftp;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JSeparator;
@@ -32,7 +31,6 @@ public class getVMwarePlayer extends JDialog {
private final JPanel contentPanel = new JPanel();
String[] result;
- ftp f=new ftp();
/**
* Launch the application.
*/
@@ -58,7 +56,7 @@ public class getVMwarePlayer extends JDialog {
e.printStackTrace();
}
setTitle("Dozentenmodul");
- setBounds(100, 100, 545, 517);
+ setBounds(100, 100, 545, 483);
getContentPane().setLayout(null);
{
JPanel panel = new JPanel();
@@ -79,7 +77,7 @@ public class getVMwarePlayer extends JDialog {
txtpnBitteWhlenSie.setBounds(10, 36, 509, 42);
panel.add(txtpnBitteWhlenSie);
}
- contentPanel.setBounds(10, 113, 509, 252);
+ contentPanel.setBounds(10, 104, 509, 261);
contentPanel.setBackground(Color.WHITE);
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel);
@@ -111,7 +109,7 @@ public class getVMwarePlayer extends JDialog {
contentPanel.add(lblNewLabel_1);
{
JPanel buttonPane = new JPanel();
- buttonPane.setBounds(0, 423, 529, 33);
+ buttonPane.setBounds(0, 389, 529, 33);
buttonPane.setBackground(SystemColor.menu);
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
getContentPane().add(buttonPane);
@@ -143,7 +141,7 @@ public class getVMwarePlayer extends JDialog {
}
{
JSeparator separator = new JSeparator();
- separator.setBounds(0, 402, 519, 2);
+ separator.setBounds(0, 376, 519, 2);
getContentPane().add(separator);
}
{
diff --git a/Dozentenmodul/src/GUI/searchRohling.java b/Dozentenmodul/src/GUI/searchRohling.java
index 4b2ef1b0..d4bc1c47 100644
--- a/Dozentenmodul/src/GUI/searchRohling.java
+++ b/Dozentenmodul/src/GUI/searchRohling.java
@@ -13,7 +13,6 @@ import java.awt.Font;
import javax.swing.JTextPane;
import java.awt.SystemColor;
import javax.swing.JTextField;
-import ftp.ftp;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.net.SocketException;
@@ -25,6 +24,9 @@ import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
+import downloader.FTPException;
+import downloader.FTPUtility;
+
@SuppressWarnings("serial")
public class searchRohling extends JDialog {
@@ -32,7 +34,11 @@ public class searchRohling extends JDialog {
private JTextField textFieldsearch;
List list;
String[] result;
- ftp f=new ftp();
+ String host="132.230.4.16";
+ int port=21;
+ String user="openslx";
+ String pass="openslx-ng";
+ FTPUtility f=new FTPUtility(host, port, user, pass);
/**
* Launch the application.
*/
@@ -138,8 +144,9 @@ public class searchRohling extends JDialog {
System.out.println(textFieldsearch.getText().toString());
try {
+ f.connect();
result=f.getAllRohling(textFieldsearch.getText().toString());
- } catch (SocketException e) {
+ } catch (SocketException | FTPException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
@@ -183,7 +190,7 @@ public class searchRohling extends JDialog {
mnNewMenu_1.add(mntmOtrs);
try {
-
+ f.connect();
result=f.getAllRohling(textFieldsearch.getText().toString());
list.removeAll();
for(int i=0;i<result.length;i++)
@@ -191,7 +198,7 @@ try {
list.add(result[i]);
}
- } catch (SocketException e) {
+ } catch (SocketException | FTPException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}