From 54e068bdef858a1fd601ddd3f24e0c730b4be4ee Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Apr 2014 10:47:01 +0200 Subject: Unterordner hinzugefügt und überflüssige Imports gelöscht --- .../src/gui/image/FTPEditUploader_GUI.java | 428 +++++++++++++++++++++ 1 file changed, 428 insertions(+) create mode 100644 Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java (limited to 'Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java') diff --git a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java new file mode 100644 index 00000000..c8a23428 --- /dev/null +++ b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java @@ -0,0 +1,428 @@ +package gui.image; + +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 java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; + +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 models.person; + +import org.apache.thrift.TException; + +import server.Server.Client; +import thrift.ThriftConnection; +import ftp.UploadTask; +import gui.intro.MainMenue_GUI; + + +@SuppressWarnings("serial") +public class FTPEditUploader_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 { + FTPEditUploader_GUI frame = new FTPEditUploader_GUI(); + frame.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Create the frame. + */ + public FTPEditUploader_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); + + JButton btnCopyFileTo = new JButton("Copy File to Prod"); + btnCopyFileTo.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + try { + client.startFileCopy(user.path+"/"+uploadFile.getName()); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + }); + btnCopyFileTo.setBounds(10, 375, 264, 23); + contentPanel.add(btnCopyFileTo); + { + 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) { + + updateData(); + 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); + } + thrift.closeThriftConnection(); + } + }); + + 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(); + } + DateFormat formatter = new SimpleDateFormat("yyyMMddhhmmss"); + Image.image.setNewName(formatter.format(new Date()) + "_" + + person.verantwortlicher.getHochschule() + "_" + + person.verantwortlicher.getUsername() + "_" + + Image.image.getImagename() + ".vmdk"); + 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 updateData(){ + + try { + + + System.out.println("Start Update"); + client.updateImageData(Image.image.getImagename(),Image.image.getNewName(), Image.image.isLicensed(), Image.image.isInternet(), Image.image.getRam(), Image.image.getCpu(),Image.image.getImageId(),Image.image.getVersion()); + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return false; + } + return true; + + + } +} \ No newline at end of file -- cgit v1.2.3-55-g7522 From b753407b7c70a412eb3dd916e444ac63ad66846f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 9 Apr 2014 16:15:57 +0200 Subject: Bugfixes: -Buttons funktionieren jetzt korrekt --- .../src/gui/image/FTPCreateUploader_GUI.java | 38 +- .../src/gui/image/FTPEditUploader_GUI.java | 460 +++++++++++---------- 2 files changed, 274 insertions(+), 224 deletions(-) (limited to 'Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java') diff --git a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java index d34db8f0..b585fa50 100644 --- a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java @@ -42,7 +42,8 @@ import ftp.UploadTask; import gui.intro.MainMenue_GUI; @SuppressWarnings("serial") -public class FTPCreateUploader_GUI extends JFrame implements PropertyChangeListener { +public class FTPCreateUploader_GUI extends JFrame implements + PropertyChangeListener { @SuppressWarnings("unused") private JPanel contentPane; @@ -105,7 +106,7 @@ public class FTPCreateUploader_GUI extends JFrame implements PropertyChangeListe task.cancel(true); } System.exit(0); - }//end window closing + }// end window closing }); setResizable(false); @@ -278,7 +279,7 @@ public class FTPCreateUploader_GUI extends JFrame implements PropertyChangeListe label_5.setBounds(139, 91, 14, 14); contentPanel.add(label_5); - JLabel lblNeubearbeiten = new JLabel("Neu/Bearbeiten"); + JLabel lblNeubearbeiten = new JLabel("Neu"); lblNeubearbeiten.setBounds(149, 91, 108, 14); contentPanel.add(lblNeubearbeiten); @@ -370,9 +371,9 @@ public class FTPCreateUploader_GUI extends JFrame implements PropertyChangeListe } private void buttonUploadActionPerformed(ActionEvent event) { - + progressBar.setValue(0); - btnUploadStarten.setEnabled(false); //verhindert einen weiteren klick + btnUploadStarten.setEnabled(false); // verhindert einen weiteren klick btnUploadStarten.setText("Bitte warten"); try { @@ -409,19 +410,22 @@ public class FTPCreateUploader_GUI extends JFrame implements PropertyChangeListe progress = (Integer) arg0.getNewValue(); progressBar.setValue(progress); - - //if (progress == 100) { - // finishButton.setEnabled(true); - //} - // Button zum Fertigstellen freischalten, wenn 100% erreicht sind - if (progress == 0 || progress == 100) { - // not uploading currently - btnZurck.setEnabled(true); - } else { - // currently uploading, don't let user interact - btnZurck.setEnabled(false); - } + } + + // Button zum Fertigstellen freischalten, wenn 100% erreicht sind + if (progress == 0 || progress == 100) { + // not uploading currently + btnZurck.setEnabled(true); + } else { + // currently uploading, don't let user interact + btnZurck.setEnabled(false); + } + // Fertigstellen erlauben wenn upload abgeschlossen + if (progress == 100) { + finishButton.setEnabled(true); + } else { + finishButton.setEnabled(false); } if ("speed" == arg0.getPropertyName()) { diff --git a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java index c8a23428..9e60e788 100644 --- a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java @@ -18,7 +18,6 @@ import java.io.File; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; - import javax.swing.JButton; import javax.swing.JFileChooser; import javax.swing.JFrame; @@ -35,30 +34,27 @@ import javax.swing.UnsupportedLookAndFeelException; import javax.swing.border.EmptyBorder; import models.Image; import models.person; -//import models.person; - import org.apache.thrift.TException; - import server.Server.Client; import thrift.ThriftConnection; import ftp.UploadTask; import gui.intro.MainMenue_GUI; - @SuppressWarnings("serial") -public class FTPEditUploader_GUI extends JFrame implements PropertyChangeListener { +public class FTPEditUploader_GUI extends JFrame implements + PropertyChangeListener { @SuppressWarnings("unused") private JPanel contentPane; private final JPanel contentPanel = new JPanel(); - JLabel lblNewLabel; + JLabel lblPath; JProgressBar progressBar; - String host="141.79.128.121"; - int port=21; + String host = "141.79.128.121"; + int port = 21; server.User user; - String filename=""; + String filename = ""; File uploadFile; - static String arg=""; + static String arg = ""; UploadTask task; JLabel UpSpeed; JLabel labelfertig; @@ -68,9 +64,16 @@ public class FTPEditUploader_GUI extends JFrame implements PropertyChangeListene long filesize; double speed; long bytesread; - boolean taskrun=false; - ThriftConnection thrift=new ThriftConnection(); - Client client=thrift.getThriftConnection(); + boolean taskrun = false; + int progress = 0; + ThriftConnection thrift = new ThriftConnection(); + Client client = thrift.getThriftConnection(); + JButton btnUploadStarten = new JButton("Upload auf Server starten"); + JButton btnSpeicherortAuswhlen = new JButton("Image ausw\u00E4hlen"); + JButton btnCopyFileTo = new JButton("Copy File to Prod"); + JButton finishButton = new JButton("Fertigstellen"); + JButton btnZurck = new JButton("Zur\u00FCck"); + /** * Launch the application. */ @@ -94,24 +97,21 @@ public class FTPEditUploader_GUI extends JFrame implements PropertyChangeListene addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent arg0) { - if(taskrun==true) - { + if (taskrun == true) { try { - + client.DeleteFtpUser(user.userName); } catch (TException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } - task.cancel(true); + task.cancel(true); } } }); setResizable(false); - //setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - - - + // setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException @@ -120,309 +120,355 @@ public class FTPEditUploader_GUI extends JFrame implements PropertyChangeListene e.printStackTrace(); } - //filename=name; + // 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; + int top = (screenSize.height - 722) / 2; + int left = (screenSize.width - 603) / 2; setBounds(left, top, 603, 722); - //setBounds(100, 100, 603, 250); + // 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(); + 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()); + File file = fc.getSelectedFile(); + // check if a file is selected and exists + if (file != null) { + System.out.println("File to upload exists"); + uploadFile = file; + filename = uploadFile.getName(); + lblPath.setText(file.getAbsolutePath()); + } else { + System.out.println("No file selected"); + lblPath.setText(""); + }// end if } }); - btnSpeicherortAuswhlen.setBounds(10, 124, 141, 23); + btnSpeicherortAuswhlen.setBounds(102, 124, 173, 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() { + + lblPath = new JLabel(""); + lblPath.addPropertyChangeListener(new PropertyChangeListener() { + public void propertyChange(PropertyChangeEvent arg0) { + if (lblPath.getText().isEmpty()) { + // wenn leer, dann upload button nicht freigeben + btnUploadStarten.setEnabled(false); + btnUploadStarten.setText("Bitte warten"); + } else { + // wenn leer, dann upload button nicht freigeben + btnUploadStarten.setEnabled(true); + btnUploadStarten.setText("Upload auf Server starten"); + } + } + }); + lblPath.setBounds(102, 158, 485, 23); + contentPanel.add(lblPath); + + btnUploadStarten.setEnabled(false); + btnUploadStarten.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { buttonUploadActionPerformed(arg0); - + } }); - btnDownloadStarten.setBounds(10, 330, 141, 23); - contentPanel.add(btnDownloadStarten); - - progressBar = new JProgressBar(0,100); + btnUploadStarten.setBounds(102, 200, 173, 23); + contentPanel.add(btnUploadStarten); + + progressBar = new JProgressBar(0, 100); progressBar.setStringPainted(true); - - progressBar.setBounds(10, 158, 577, 30); + progressBar.setBounds(102, 234, 485, 30); contentPanel.add(progressBar); - - JLabel label = new JLabel("Downloadgeschwindigkeit:"); - label.setBounds(10, 199, 141, 14); - contentPanel.add(label); - + + JLabel lblUploadgeschwindigkeit = new JLabel("Uploadgeschwindigkeit:"); + lblUploadgeschwindigkeit.setBounds(102, 275, 141, 14); + contentPanel.add(lblUploadgeschwindigkeit); + JLabel label_1 = new JLabel("Fertig:"); - label_1.setBounds(10, 249, 46, 14); + label_1.setBounds(102, 325, 46, 14); contentPanel.add(label_1); - + labelfertig = new JLabel("0"); - labelfertig.setBounds(66, 249, 108, 14); + labelfertig.setBounds(183, 325, 108, 14); contentPanel.add(labelfertig); - + UpSpeed = new JLabel("0"); - UpSpeed.setBounds(329, 199, 95, 14); + UpSpeed.setBounds(374, 275, 117, 14); contentPanel.add(UpSpeed); - + JLabel label_4 = new JLabel("von:"); - label_4.setBounds(184, 249, 46, 14); + label_4.setBounds(318, 325, 46, 14); contentPanel.add(label_4); - + labelfilesize = new JLabel("0"); - labelfilesize.setBounds(240, 249, 108, 14); + labelfilesize.setBounds(374, 325, 117, 14); contentPanel.add(labelfilesize); - + JLabel label_6 = new JLabel("Verbleibend:"); - label_6.setBounds(10, 274, 71, 14); + label_6.setBounds(102, 350, 71, 14); contentPanel.add(label_6); - + JLabel label_7 = new JLabel("Gesch\u00E4tzte Verbleibende Zeit:"); - label_7.setBounds(10, 224, 150, 14); + label_7.setBounds(102, 300, 150, 14); contentPanel.add(label_7); - + labelZeit = new JLabel("0"); - labelZeit.setBounds(329, 224, 117, 14); + labelZeit.setBounds(374, 300, 117, 14); contentPanel.add(labelZeit); - + labelverbleibend = new JLabel("0"); - labelverbleibend.setBounds(91, 274, 108, 14); + labelverbleibend.setBounds(183, 350, 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); - + + JLabel lblUploadIhresImage = new JLabel("Upload Ihres Image"); + lblUploadIhresImage.setFont(new Font("Tahoma", Font.BOLD, 18)); + lblUploadIhresImage.setBounds(10, 11, 509, 22); + panel.add(lblUploadIhresImage); + + JTextPane txtpnFhreSieBitte = new JTextPane(); + txtpnFhreSieBitte + .setText("F\u00FChre Sie bitte die folgenden 3 Schritte aus um Ihr Image auf unseren Server zu laden."); + txtpnFhreSieBitte.setEditable(false); + txtpnFhreSieBitte.setBackground(SystemColor.menu); + txtpnFhreSieBitte.setBounds(10, 36, 509, 32); + panel.add(txtpnFhreSieBitte); + 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"); + + JLabel lblNeubearbeiten = new JLabel("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); - - JButton btnCopyFileTo = new JButton("Copy File to Prod"); + + btnCopyFileTo.setEnabled(false); btnCopyFileTo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { - client.startFileCopy(user.path+"/"+uploadFile.getName()); + client.startFileCopy(user.path + "/" + uploadFile.getName()); } catch (TException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } }); - btnCopyFileTo.setBounds(10, 375, 264, 23); + btnCopyFileTo.setBounds(102, 375, 173, 23); contentPanel.add(btnCopyFileTo); + + JLabel lblSchritt_1 = new JLabel("Schritt 1:"); + lblSchritt_1.setBounds(24, 128, 57, 14); + contentPanel.add(lblSchritt_1); + + JLabel lblSchritt_2 = new JLabel("Schritt 2:"); + lblSchritt_2.setBounds(24, 204, 57, 14); + contentPanel.add(lblSchritt_2); + + JLabel label = new JLabel("Schritt 3:"); + label.setBounds(20, 423, 57, 14); + contentPanel.add(label); + + JLabel label_2 = new JLabel("Klicken Sie auf \"Fertigstellen\"."); + label_2.setBounds(98, 423, 241, 14); + contentPanel.add(label_2); { 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() { + + finishButton.setEnabled(false); + finishButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - + updateData(); dispose(); - MainMenue_GUI m=new MainMenue_GUI(); + 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); + + if (taskrun == true) { + try { + client.DeleteFtpUser(user.userName); + + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + task.cancel(true); } thrift.closeThriftConnection(); } }); - - JButton buttonCancel = new JButton("Schlie\u00DFen"); - buttonCancel.setActionCommand("Cancel"); - buttonPane.add(buttonCancel); - ButtonReady.setActionCommand("Cancel"); - buttonPane.add(ButtonReady); + btnZurck.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + dispose(); + EditImageTechnisch_GUI ei = new EditImageTechnisch_GUI(); + ei.setVisible(true); + } + }); + + btnZurck.setActionCommand("Cancel"); + buttonPane.add(btnZurck); + finishButton.setActionCommand("Cancel"); + buttonPane.add(finishButton); } } - + 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); + + private void buttonUploadActionPerformed(ActionEvent event) { + + progressBar.setValue(0); + btnUploadStarten.setEnabled(false); // verhindert einen weiteren klick + btnUploadStarten.setText("Bitte warten"); + + 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(); } - DateFormat formatter = new SimpleDateFormat("yyyMMddhhmmss"); + DateFormat formatter = new SimpleDateFormat("yyyMMddhhmmss"); Image.image.setNewName(formatter.format(new Date()) + "_" + person.verantwortlicher.getHochschule() + "_" + person.verantwortlicher.getUsername() + "_" + Image.image.getImagename() + ".vmdk"); - task=new UploadTask(host,port,user.userName,user.password,user.path, uploadFile); - - task.addPropertyChangeListener(this); - task.execute(); - taskrun=true; - - //createXML(); - //TransferToSatellit(); - - - } + task = new UploadTask(host, port, user.userName, user.password, + user.path, uploadFile); + + 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){ - - 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 updateData(){ - - try { - - - System.out.println("Start Update"); - client.updateImageData(Image.image.getImagename(),Image.image.getNewName(), Image.image.isLicensed(), Image.image.isInternet(), Image.image.getRam(), Image.image.getCpu(),Image.image.getImageId(),Image.image.getVersion()); - } catch (TException e) { + if ("progress" == arg0.getPropertyName()) { + progress = (Integer) arg0.getNewValue(); + progressBar.setValue(progress); + + } + + // Button zum Fertigstellen freischalten, wenn 100% erreicht sind + if (progress == 0 || progress == 100) { + // not uploading currently + btnZurck.setEnabled(true); + } else { + // currently uploading, don't let user interact + btnZurck.setEnabled(false); + } + + // Fertigstellen erlauben wenn upload abgeschlossen + if (progress == 100) { + finishButton.setEnabled(true); + } else { + finishButton.setEnabled(false); + } + + 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"); + + } + 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 updateData() { + + try { + + System.out.println("Start Update"); + client.updateImageData(Image.image.getImagename(), + Image.image.getNewName(), Image.image.isLicensed(), + Image.image.isInternet(), Image.image.getRam(), + Image.image.getCpu(), Image.image.getImageId(), + Image.image.getVersion()); + } catch (TException e) { // TODO Auto-generated catch block e.printStackTrace(); return false; } return true; - - - } + + } } \ No newline at end of file -- cgit v1.2.3-55-g7522 From 685f72fdcef38b9bfd5fd1b1122a4a6d33c6b708 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 9 Apr 2014 16:40:07 +0200 Subject: Anwendung schließt nun, wenn Fenster schließt --- Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java') diff --git a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java index 9e60e788..dd35ad83 100644 --- a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java @@ -107,7 +107,8 @@ public class FTPEditUploader_GUI extends JFrame implements } task.cancel(true); } - } + System.exit(0); + }// end window closing }); setResizable(false); // setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); -- cgit v1.2.3-55-g7522 From 7f129e45b05c27ff84c61569d11aec0e8ff2dbe8 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 9 Apr 2014 18:36:41 +0200 Subject: Haufen Konsolenausgaben enfernt --- .../bin/gui/image/EditImageAllgemein_GUI$4.class | Bin 1889 -> 1616 bytes .../bin/gui/image/EditImageAllgemein_GUI.class | Bin 9112 -> 9112 bytes .../bin/gui/image/FTPCreateUploader_GUI$3.class | Bin 1626 -> 1446 bytes .../bin/gui/image/FTPCreateUploader_GUI.class | Bin 12294 -> 12313 bytes .../bin/gui/image/FTPDownloader_GUI$2.class | Bin 1452 -> 1303 bytes .../bin/gui/image/FTPDownloader_GUI$3.class | Bin 1167 -> 1167 bytes .../bin/gui/image/FTPDownloader_GUI$4.class | Bin 785 -> 785 bytes .../bin/gui/image/FTPDownloader_GUI$5.class | Bin 1557 -> 1557 bytes .../bin/gui/image/FTPDownloader_GUI$6.class | Bin 972 -> 972 bytes Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class | Bin 10072 -> 10072 bytes .../bin/gui/image/FTPEditUploader_GUI$3.class | Bin 1614 -> 1434 bytes .../bin/gui/image/FTPEditUploader_GUI.class | Bin 11883 -> 11869 bytes .../bin/gui/image/SearchEditImage_GUI.class | Bin 11743 -> 11743 bytes Dozentenmodul/bin/gui/intro/Login_GUI.class | Bin 7818 -> 7783 bytes .../src/gui/image/EditImageAllgemein_GUI.java | 7 +------ .../src/gui/image/FTPCreateUploader_GUI.java | 10 +++++----- Dozentenmodul/src/gui/image/FTPDownloader_GUI.java | 1 - .../src/gui/image/FTPEditUploader_GUI.java | 12 +++++------- .../src/gui/image/SearchEditImage_GUI.java | 1 - Dozentenmodul/src/gui/intro/Login_GUI.java | 2 +- .../src/gui/lecture/CreateLectureLink_GUI.java | 2 +- .../src/gui/lecture/EditLectureLink_GUI.java | 11 +++-------- .../src/gui/lecture/EditLectureSearch_GUI.java | 11 +---------- 23 files changed, 17 insertions(+), 40 deletions(-) (limited to 'Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java') diff --git a/Dozentenmodul/bin/gui/image/EditImageAllgemein_GUI$4.class b/Dozentenmodul/bin/gui/image/EditImageAllgemein_GUI$4.class index fd8e0655..64a79922 100644 Binary files a/Dozentenmodul/bin/gui/image/EditImageAllgemein_GUI$4.class and b/Dozentenmodul/bin/gui/image/EditImageAllgemein_GUI$4.class differ diff --git a/Dozentenmodul/bin/gui/image/EditImageAllgemein_GUI.class b/Dozentenmodul/bin/gui/image/EditImageAllgemein_GUI.class index b7fda6b3..c0b072cf 100644 Binary files a/Dozentenmodul/bin/gui/image/EditImageAllgemein_GUI.class and b/Dozentenmodul/bin/gui/image/EditImageAllgemein_GUI.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$3.class b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$3.class index 39c2910f..a788e377 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$3.class and b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$3.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class index 6613c5db..bddb3425 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class and b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$2.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$2.class index 0c902bbd..30c1812c 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$2.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$2.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$3.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$3.class index f2ab99cc..6d6c863c 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$3.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$3.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$4.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$4.class index 70a5c30b..ef04eb8c 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$4.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$4.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$5.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$5.class index 34e4f69a..d4bc6778 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$5.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$5.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$6.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$6.class index 52cf6065..623a9c0e 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$6.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$6.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class index 2961f5f1..c8860206 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$3.class b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$3.class index 3933987c..b790203f 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$3.class and b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$3.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class index 8fa34671..5a6ea8fa 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class and b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI.class b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI.class index c0b06c44..264f9d4a 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI.class and b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI.class differ diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI.class b/Dozentenmodul/bin/gui/intro/Login_GUI.class index 8da7aa27..26499333 100644 Binary files a/Dozentenmodul/bin/gui/intro/Login_GUI.class and b/Dozentenmodul/bin/gui/intro/Login_GUI.class differ diff --git a/Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java b/Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java index cdcf9f6d..b80e4953 100644 --- a/Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java +++ b/Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java @@ -267,12 +267,7 @@ public class EditImageAllgemein_GUI extends JFrame { okButton = new JButton("Weiter"); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { - System.out.println("text length="+imagename.getText().length()); - //Setzen der Eingabe im Model, dadurch bleiben die Daten bei einem erneuten Aufruf verfügbar - - //TODO - //Prüfung ob alle notwendigen Felder ausgefüllt sind --> funktioniert aktuell nicht - //der Button wechselt beim Klick auf die nächste Seite, selbst wenn kein handler implementiert ist... WTF??? + //check is textfield has content if(imagename.getText().length() <= 0){ JOptionPane.showMessageDialog(null, "Bitte geben Sie einen Labornamen ein.", diff --git a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java index b585fa50..e8c0c4b9 100644 --- a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java @@ -142,12 +142,12 @@ public class FTPCreateUploader_GUI extends JFrame implements File file = fc.getSelectedFile(); // check if a file is selected and exists if (file != null) { - System.out.println("File to upload exists"); + // file selected uploadFile = file; filename = uploadFile.getName(); lblPath.setText(file.getAbsolutePath()); } else { - System.out.println("No file selected"); + // no file selected lblPath.setText(""); }// end if } @@ -378,9 +378,9 @@ public class FTPCreateUploader_GUI extends JFrame implements try { user = client.getFtpUser(); - System.out.println("name" + user.userName); - System.out.println("path" + user.path); - System.out.println("pass" + user.password); + System.out.println("FTP name" + user.userName); + System.out.println("FTP path" + user.path); + System.out.println("FTP pass" + user.password); } catch (TException e) { // TODO Auto-generated catch block e.printStackTrace(); diff --git a/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java b/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java index f6175934..4a54e346 100644 --- a/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java @@ -124,7 +124,6 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener // check if directory is selected if (dir != null) { // is selected - System.out.println("Target directory exists."); lblPath.setText(dir.getAbsolutePath()); } else { // no directory selected diff --git a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java index dd35ad83..9863c1c6 100644 --- a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java @@ -145,12 +145,12 @@ public class FTPEditUploader_GUI extends JFrame implements File file = fc.getSelectedFile(); // check if a file is selected and exists if (file != null) { - System.out.println("File to upload exists"); + // file exists uploadFile = file; filename = uploadFile.getName(); lblPath.setText(file.getAbsolutePath()); } else { - System.out.println("No file selected"); + // no file selected lblPath.setText(""); }// end if } @@ -374,9 +374,9 @@ public class FTPEditUploader_GUI extends JFrame implements try { user = client.getFtpUser(); - System.out.println("name" + user.userName); - System.out.println("path" + user.path); - System.out.println("pass" + user.password); + System.out.println("FTP name" + user.userName); + System.out.println("FTP path" + user.path); + System.out.println("FTP pass" + user.password); } catch (TException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -457,8 +457,6 @@ public class FTPEditUploader_GUI extends JFrame implements public boolean updateData() { try { - - System.out.println("Start Update"); client.updateImageData(Image.image.getImagename(), Image.image.getNewName(), Image.image.isLicensed(), Image.image.isInternet(), Image.image.getRam(), diff --git a/Dozentenmodul/src/gui/image/SearchEditImage_GUI.java b/Dozentenmodul/src/gui/image/SearchEditImage_GUI.java index 95a50732..e6bb055e 100644 --- a/Dozentenmodul/src/gui/image/SearchEditImage_GUI.java +++ b/Dozentenmodul/src/gui/image/SearchEditImage_GUI.java @@ -502,7 +502,6 @@ public class SearchEditImage_GUI extends JFrame { images.get(x).getUserData(), images.get(x).getUpdateTime(), "", images.get(x).id, images.get(x).getVersion() }; - // System.out.println("id:"+images.get(x).getId()); // Füge diese Objekte der Tabelle hinzu model.addRow(obj); x++; diff --git a/Dozentenmodul/src/gui/intro/Login_GUI.java b/Dozentenmodul/src/gui/intro/Login_GUI.java index 586b8d13..488c6b69 100644 --- a/Dozentenmodul/src/gui/intro/Login_GUI.java +++ b/Dozentenmodul/src/gui/intro/Login_GUI.java @@ -177,7 +177,7 @@ public class Login_GUI extends JFrame { final thrift.SessionData result; try { String passText = new String(pass.getPassword()); - System.out.println(username.getText() + " " + passText); + System.out.println("Benutzer:" +username.getText() + "\nPasswort" + passText); result = client.authenticate(username.getText(), passText); } catch (thrift.AuthenticationException e) { diff --git a/Dozentenmodul/src/gui/lecture/CreateLectureLink_GUI.java b/Dozentenmodul/src/gui/lecture/CreateLectureLink_GUI.java index 29193798..a9125829 100644 --- a/Dozentenmodul/src/gui/lecture/CreateLectureLink_GUI.java +++ b/Dozentenmodul/src/gui/lecture/CreateLectureLink_GUI.java @@ -374,7 +374,7 @@ public class CreateLectureLink_GUI extends JFrame { try { DateFormat formatter = new SimpleDateFormat( "yyyy-MM-dd hh:mm:ss"); - System.out.println("Veranstaltung anlegen um: " + System.out.println("Veranstaltung angelegt um: " + formatter.format( Lecture.lecture.getStartdate()) .toString()); diff --git a/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java b/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java index 819f3541..c245ce79 100644 --- a/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java +++ b/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java @@ -116,7 +116,8 @@ public class EditLectureLink_GUI extends JFrame { getContentPane().add(panel); panel.setLayout(null); { - JLabel lblNewLabel = new JLabel("Image zur Verlinkung ausw\u00E4hlen"); + JLabel lblNewLabel = new JLabel( + "Image zur Verlinkung ausw\u00E4hlen"); lblNewLabel.setBounds(10, 11, 509, 22); panel.add(lblNewLabel); lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); @@ -357,13 +358,7 @@ public class EditLectureLink_GUI extends JFrame { "Veranstaltung erzeugen und abschlie\u00DFen"); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - - System.out.println("\ntableAllImages.getSelectedRow() = "+tableAllImages.getSelectedRow() - +"\ntablemyImages.getSelectedRow() = "+tablemyImages.getSelectedRow() - +"\ntableCoopImages.getSelectedRow() = "+tableCoopImages.getSelectedRow() - +"\ntablePublicImages.getSelectedRow() = "+tablePublicImages.getSelectedRow() - +"\ntablePublicVorlagen.getSelectedRow() = "+tablePublicVorlagen.getSelectedRow() ); - + // check if a row is selected if ((tableAllImages.getSelectedRow() != -1) || (tablemyImages.getSelectedRow() != -1) diff --git a/Dozentenmodul/src/gui/lecture/EditLectureSearch_GUI.java b/Dozentenmodul/src/gui/lecture/EditLectureSearch_GUI.java index c1ac5790..ae50fa22 100644 --- a/Dozentenmodul/src/gui/lecture/EditLectureSearch_GUI.java +++ b/Dozentenmodul/src/gui/lecture/EditLectureSearch_GUI.java @@ -256,7 +256,6 @@ public class EditLectureSearch_GUI extends JFrame { tabbedPane.setBounds(10, 197, 557, 323); contentPanel.add(tabbedPane); - System.out.println("haaaaaaaaaaa"); initTableModel(modelMyLectures); JScrollPane scrollPaneAllImages = new JScrollPane(); @@ -402,13 +401,7 @@ public class EditLectureSearch_GUI extends JFrame { .convertRowIndexToModel(tablemyLectures .getSelectedRow()), 2).toString(); - System.out.println("original date = " - + modelMyLectures - .getValueAt( - tablemyLectures - .convertRowIndexToModel(tablemyLectures - .getSelectedRow()), - 2).toString()); + Lecture.lecture.setLinkedImagename(modelMyLectures .getValueAt( tablemyLectures @@ -423,8 +416,6 @@ public class EditLectureSearch_GUI extends JFrame { zweitesLeerzeichen); String enddate = date .substring(zweitesLeerzeichen); - System.out.println("startdate = " + startdate); - System.out.println("enddate = " + enddate); DateFormat df = new SimpleDateFormat( "yyyy-MM-dd hh:mm:ss"); -- cgit v1.2.3-55-g7522 From fc1f221a322076478ddff1e457a5ce97f1352834 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Apr 2014 09:19:57 +0200 Subject: FTP "Fertigstellen" Button nun korrekt --- .../src/gui/image/FTPCreateUploader_GUI.java | 33 +++++++++++---------- Dozentenmodul/src/gui/image/FTPDownloader_GUI.java | 3 +- .../src/gui/image/FTPEditUploader_GUI.java | 34 ++++++++++++---------- 3 files changed, 38 insertions(+), 32 deletions(-) (limited to 'Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java') diff --git a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java index e8c0c4b9..80285684 100644 --- a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java @@ -50,7 +50,8 @@ public class FTPCreateUploader_GUI extends JFrame implements private final JPanel contentPanel = new JPanel(); JLabel lblPath; JProgressBar progressBar; - String host = "141.79.128.121"; + //String host = "141.79.128.121"; + String host = "141.79.128.102"; int port = 21; server.User user; String filename = ""; @@ -409,24 +410,26 @@ public class FTPCreateUploader_GUI extends JFrame implements if ("progress" == arg0.getPropertyName()) { progress = (Integer) arg0.getNewValue(); progressBar.setValue(progress); + + // Button zum Fertigstellen freischalten, wenn 100% erreicht sind + if (progress == 0 || progress == 100) { + // not uploading currently + btnZurck.setEnabled(true); + } else { + // currently uploading, don't let user interact + btnZurck.setEnabled(false); + } - } + // Fertigstellen erlauben wenn upload abgeschlossen + if (progress == 100) { + finishButton.setEnabled(true); + } else { + finishButton.setEnabled(false); + } - // Button zum Fertigstellen freischalten, wenn 100% erreicht sind - if (progress == 0 || progress == 100) { - // not uploading currently - btnZurck.setEnabled(true); - } else { - // currently uploading, don't let user interact - btnZurck.setEnabled(false); } - // Fertigstellen erlauben wenn upload abgeschlossen - if (progress == 100) { - finishButton.setEnabled(true); - } else { - finishButton.setEnabled(false); - } + if ("speed" == arg0.getPropertyName()) { speed = (double) arg0.getNewValue(); diff --git a/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java b/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java index 4a54e346..be31c364 100644 --- a/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java @@ -45,7 +45,8 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener JLabel downspeed; User user; JProgressBar progressBar; - String host = "141.79.128.121"; + //String host = "141.79.128.121"; + String host = "141.79.128.102"; int port = 21; String username = "openslx"; String password = "openslx-ng"; diff --git a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java index 9863c1c6..b184c96c 100644 --- a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java @@ -49,7 +49,8 @@ public class FTPEditUploader_GUI extends JFrame implements private final JPanel contentPanel = new JPanel(); JLabel lblPath; JProgressBar progressBar; - String host = "141.79.128.121"; + //String host = "141.79.128.121"; + String host = "141.79.128.102"; int port = 21; server.User user; String filename = ""; @@ -399,24 +400,25 @@ public class FTPEditUploader_GUI extends JFrame implements if ("progress" == arg0.getPropertyName()) { progress = (Integer) arg0.getNewValue(); progressBar.setValue(progress); + + // Button zum Fertigstellen freischalten, wenn 100% erreicht sind + if (progress == 0 || progress == 100) { + // not uploading currently + btnZurck.setEnabled(true); + } else { + // currently uploading, don't let user interact + btnZurck.setEnabled(false); + } + // Fertigstellen erlauben wenn upload abgeschlossen + if (progress == 100) { + finishButton.setEnabled(true); + } else { + finishButton.setEnabled(false); + } } - // Button zum Fertigstellen freischalten, wenn 100% erreicht sind - if (progress == 0 || progress == 100) { - // not uploading currently - btnZurck.setEnabled(true); - } else { - // currently uploading, don't let user interact - btnZurck.setEnabled(false); - } - - // Fertigstellen erlauben wenn upload abgeschlossen - if (progress == 100) { - finishButton.setEnabled(true); - } else { - finishButton.setEnabled(false); - } + if ("speed" == arg0.getPropertyName()) { speed = (double) arg0.getNewValue(); -- cgit v1.2.3-55-g7522 From 0fbe8c2ce5354de8a2725003e9d259a7d722c184 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Apr 2014 13:13:21 +0200 Subject: Update der Datenbank beim Update der Veranstaltung funktioniert nun --- Dozentenmodul/bin/Models/Lecture.class | Bin 2035 -> 2226 bytes .../bin/gui/image/FTPCreateUploader_GUI$1.class | Bin 792 -> 792 bytes .../bin/gui/image/FTPCreateUploader_GUI$2.class | Bin 1313 -> 1313 bytes .../bin/gui/image/FTPCreateUploader_GUI$3.class | Bin 1446 -> 1446 bytes .../bin/gui/image/FTPCreateUploader_GUI$4.class | Bin 1198 -> 1198 bytes .../bin/gui/image/FTPCreateUploader_GUI$5.class | Bin 813 -> 813 bytes .../bin/gui/image/FTPCreateUploader_GUI$6.class | Bin 1707 -> 1707 bytes .../bin/gui/image/FTPCreateUploader_GUI$7.class | Bin 1652 -> 1652 bytes .../bin/gui/image/FTPCreateUploader_GUI$8.class | Bin 1014 -> 1014 bytes .../bin/gui/image/FTPCreateUploader_GUI.class | Bin 12313 -> 12312 bytes .../bin/gui/image/FTPDownloader_GUI$1.class | Bin 1414 -> 1414 bytes .../bin/gui/image/FTPDownloader_GUI$2.class | Bin 1303 -> 1303 bytes .../bin/gui/image/FTPDownloader_GUI$3.class | Bin 1167 -> 1167 bytes .../bin/gui/image/FTPDownloader_GUI$4.class | Bin 785 -> 785 bytes .../bin/gui/image/FTPDownloader_GUI$5.class | Bin 1557 -> 1557 bytes .../bin/gui/image/FTPDownloader_GUI$6.class | Bin 972 -> 972 bytes .../bin/gui/image/FTPDownloader_GUI.class | Bin 9974 -> 9974 bytes .../bin/gui/image/FTPEditUploader_GUI$1.class | Bin 782 -> 782 bytes .../bin/gui/image/FTPEditUploader_GUI$2.class | Bin 1301 -> 1301 bytes .../bin/gui/image/FTPEditUploader_GUI$3.class | Bin 1434 -> 1434 bytes .../bin/gui/image/FTPEditUploader_GUI$4.class | Bin 1186 -> 1186 bytes .../bin/gui/image/FTPEditUploader_GUI$5.class | Bin 799 -> 799 bytes .../bin/gui/image/FTPEditUploader_GUI$6.class | Bin 1503 -> 1503 bytes .../bin/gui/image/FTPEditUploader_GUI.class | Bin 11869 -> 11868 bytes .../gui/lecture/EditLectureAllgemein_GUI$4.class | Bin 1912 -> 1951 bytes .../bin/gui/lecture/EditLectureAllgemein_GUI.class | Bin 9977 -> 9977 bytes Dozentenmodul/bin/models/Lecture.class | Bin 2035 -> 2226 bytes Dozentenmodul/src/Models/Lecture.java | 9 ++++ .../src/gui/image/FTPCreateUploader_GUI.java | 4 +- Dozentenmodul/src/gui/image/FTPDownloader_GUI.java | 4 +- .../src/gui/image/FTPEditUploader_GUI.java | 4 +- .../src/gui/lecture/CreateLectureLink_GUI.java | 5 +- .../src/gui/lecture/EditLectureAllgemein_GUI.java | 3 +- .../src/gui/lecture/EditLectureLink_GUI.java | 29 ++++++----- Dozentenmodul/src/models/Lecture.java | 9 ++++ Dozentenmodulserver/bin/server/ServerHandler.class | Bin 11027 -> 11415 bytes Dozentenmodulserver/bin/sql/SQL.class | Bin 14453 -> 14580 bytes Dozentenmodulserver/src/server/ServerHandler.java | 16 ++++++- Dozentenmodulserver/src/sql/SQL.java | 53 ++++++++------------- 39 files changed, 83 insertions(+), 53 deletions(-) (limited to 'Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java') diff --git a/Dozentenmodul/bin/Models/Lecture.class b/Dozentenmodul/bin/Models/Lecture.class index 7c968cd1..a0cb753d 100644 Binary files a/Dozentenmodul/bin/Models/Lecture.class and b/Dozentenmodul/bin/Models/Lecture.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$1.class b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$1.class index 8a14b449..3eded544 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$1.class and b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$1.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$2.class b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$2.class index 8a5194f2..aac75f6d 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$2.class and b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$2.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$3.class b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$3.class index a788e377..4adde720 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$3.class and b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$3.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$4.class b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$4.class index 8dcb0f90..03aeea73 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$4.class and b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$4.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$5.class b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$5.class index 70962f9c..7ffa5033 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$5.class and b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$5.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$6.class b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$6.class index c02959c2..720ce3cd 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$6.class and b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$6.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$7.class b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$7.class index f5009ce3..496f2158 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$7.class and b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$7.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$8.class b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$8.class index e3beaa57..29269bbd 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$8.class and b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$8.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class index cec2cfad..bf24ef25 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class and b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$1.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$1.class index 28596b7f..3be2f5f1 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$1.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$1.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$2.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$2.class index 8b17dab5..217b987a 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$2.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$2.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$3.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$3.class index 0b03bc49..0b7106e2 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$3.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$3.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$4.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$4.class index 75c93b92..9b5b4107 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$4.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$4.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$5.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$5.class index 0c97260a..847b6416 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$5.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$5.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$6.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$6.class index 842bbb87..cb5888ae 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$6.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$6.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class index 0f9f8a09..97b76e5c 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$1.class b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$1.class index 5df62ad7..a25d7157 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$1.class and b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$1.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$2.class b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$2.class index 4a933e6e..55d72ee9 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$2.class and b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$2.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$3.class b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$3.class index b790203f..23f71ee1 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$3.class and b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$3.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$4.class b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$4.class index 44bbface..dfb69143 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$4.class and b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$4.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$5.class b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$5.class index cadf961a..87c0067c 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$5.class and b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$5.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$6.class b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$6.class index cd7f2b25..8d99419a 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$6.class and b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI$6.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class index 5a6ea8fa..71d93a4a 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class and b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class differ diff --git a/Dozentenmodul/bin/gui/lecture/EditLectureAllgemein_GUI$4.class b/Dozentenmodul/bin/gui/lecture/EditLectureAllgemein_GUI$4.class index 57e66269..c412ac7b 100644 Binary files a/Dozentenmodul/bin/gui/lecture/EditLectureAllgemein_GUI$4.class and b/Dozentenmodul/bin/gui/lecture/EditLectureAllgemein_GUI$4.class differ diff --git a/Dozentenmodul/bin/gui/lecture/EditLectureAllgemein_GUI.class b/Dozentenmodul/bin/gui/lecture/EditLectureAllgemein_GUI.class index 05c6ac16..83d7cf3e 100644 Binary files a/Dozentenmodul/bin/gui/lecture/EditLectureAllgemein_GUI.class and b/Dozentenmodul/bin/gui/lecture/EditLectureAllgemein_GUI.class differ diff --git a/Dozentenmodul/bin/models/Lecture.class b/Dozentenmodul/bin/models/Lecture.class index 7c968cd1..a0cb753d 100644 Binary files a/Dozentenmodul/bin/models/Lecture.class and b/Dozentenmodul/bin/models/Lecture.class differ diff --git a/Dozentenmodul/src/Models/Lecture.java b/Dozentenmodul/src/Models/Lecture.java index 069946b3..6b7e6fa1 100644 --- a/Dozentenmodul/src/Models/Lecture.java +++ b/Dozentenmodul/src/Models/Lecture.java @@ -6,6 +6,7 @@ public class Lecture { private String name; + private String newName; private String shortDesc; private String desc; private Date startdate; @@ -18,6 +19,14 @@ public class Lecture { public static Lecture lecture =new Lecture(); + public String getNewName() { + return newName; + } + + public void setNewName(String newName) { + this.newName = newName; + } + public String getLinkedImagename() { return linkedImagename; } diff --git a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java index 1bf8cc3a..cd952d0f 100644 --- a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java @@ -50,8 +50,8 @@ public class FTPCreateUploader_GUI extends JFrame implements private final JPanel contentPanel = new JPanel(); JLabel lblPath; JProgressBar progressBar; - //String host = "141.79.128.121"; - String host = "141.79.128.102"; + String host = "141.79.128.121"; + //String host = "141.79.128.102"; int port = 21; server.User user; String filename = ""; diff --git a/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java b/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java index d0f789f4..2ace42c6 100644 --- a/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java @@ -45,8 +45,8 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener JLabel downspeed; User user; JProgressBar progressBar; - //String host = "141.79.128.121"; - String host = "141.79.128.102"; + String host = "141.79.128.121"; + //String host = "141.79.128.102"; int port = 21; String downloadFile = ""; static String arg = ""; diff --git a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java index b184c96c..a23e85d2 100644 --- a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java @@ -49,8 +49,8 @@ public class FTPEditUploader_GUI extends JFrame implements private final JPanel contentPanel = new JPanel(); JLabel lblPath; JProgressBar progressBar; - //String host = "141.79.128.121"; - String host = "141.79.128.102"; + String host = "141.79.128.121"; + //String host = "141.79.128.102"; int port = 21; server.User user; String filename = ""; diff --git a/Dozentenmodul/src/gui/lecture/CreateLectureLink_GUI.java b/Dozentenmodul/src/gui/lecture/CreateLectureLink_GUI.java index a9125829..2243fd43 100644 --- a/Dozentenmodul/src/gui/lecture/CreateLectureLink_GUI.java +++ b/Dozentenmodul/src/gui/lecture/CreateLectureLink_GUI.java @@ -476,8 +476,9 @@ public class CreateLectureLink_GUI extends JFrame { images.get(x).getLicenseRestriction(), images.get(x).getOsName(), images.get(x).getLectureName(), - images.get(x).getUpdateTime(), - images.get(x).getUserData() }; + images.get(x).getUserData(), + images.get(x).getUpdateTime() + }; ListObj.add(obj); model.addRow(ListObj.get(x)); x++; diff --git a/Dozentenmodul/src/gui/lecture/EditLectureAllgemein_GUI.java b/Dozentenmodul/src/gui/lecture/EditLectureAllgemein_GUI.java index 40b3ce84..115a9f1f 100644 --- a/Dozentenmodul/src/gui/lecture/EditLectureAllgemein_GUI.java +++ b/Dozentenmodul/src/gui/lecture/EditLectureAllgemein_GUI.java @@ -361,13 +361,14 @@ public class EditLectureAllgemein_GUI extends JFrame { } Lecture.lecture.setName(textFieldLaborname.getText()); + Lecture.lecture.setNewName(textFieldLaborname.getText()); Lecture.lecture.setDesc(description.getText()); Lecture.lecture.setEnddate(dateChooserend.getDate()); Lecture.lecture.setStartdate(dateChooserstart.getDate()); Image.image.setImagename(textFieldLaborname.getText()); - CreateLectureLink_GUI ev=new CreateLectureLink_GUI(); + EditLectureLink_GUI ev=new EditLectureLink_GUI(); ev.setVisible(true); dispose(); } diff --git a/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java b/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java index c245ce79..c1fdec80 100644 --- a/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java +++ b/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java @@ -63,7 +63,7 @@ public class EditLectureLink_GUI extends JFrame { JTable tablePublicVorlagen = new JTable(); private JTextField textFieldName; String[] titles = { "Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung", - "Verantwortlicher", "Letztes Update", "Schlagwort" }; + "Verantwortlicher", "Letztes Update", "Schlagwort", "ID", "Version" }; ThriftConnection thrift = new ThriftConnection(); Client client = thrift.getThriftConnection(); @@ -355,7 +355,7 @@ public class EditLectureLink_GUI extends JFrame { } { JButton cancelButton = new JButton( - "Veranstaltung erzeugen und abschlie\u00DFen"); + "Veranstaltung ändern und abschlie\u00DFen"); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -370,14 +370,16 @@ public class EditLectureLink_GUI extends JFrame { String imagename = tableAllImages.getValueAt( tableAllImages.getSelectedRow(), 0) .toString(); + System.out.println("ID: "+Lecture.lecture.getid()); + try { - DateFormat formatter = new SimpleDateFormat( - "yyyy-MM-dd hh:mm:ss"); - System.out.println(formatter.format( - Lecture.lecture.getStartdate()) + + DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + System.out.println( formatter.format( + Lecture.lecture.getEnddate()) .toString()); - client.writeLecturedata( - Lecture.lecture.getName(), + client.updateLecturedata(Lecture.lecture.getName(), + Lecture.lecture.getNewName(), Lecture.lecture.getShortDesc(), Lecture.lecture.getDesc(), formatter.format( @@ -393,7 +395,9 @@ public class EditLectureLink_GUI extends JFrame { person.verantwortlicher.getHochschule(), person.verantwortlicher.getEMail(), person.verantwortlicher.getTel(), - person.verantwortlicher.getFakultät()); + person.verantwortlicher.getFakultät(), + Lecture.lecture.getid()); + } catch (TException e1) { // TODO Auto-generated catch block e1.printStackTrace(); @@ -407,6 +411,8 @@ public class EditLectureLink_GUI extends JFrame { JOptionPane.INFORMATION_MESSAGE); } + MainMenue_GUI m = new MainMenue_GUI(); + m.setVisible(true); dispose(); } @@ -459,8 +465,9 @@ public class EditLectureLink_GUI extends JFrame { images.get(x).getLicenseRestriction(), images.get(x).getOsName(), images.get(x).getLectureName(), - images.get(x).getUpdateTime(), - images.get(x).getUserData() }; + images.get(x).getUserData(), + images.get(x).getUpdateTime(), "", images.get(x).id, + images.get(x).getVersion() }; ListObj.add(obj); model.addRow(ListObj.get(x)); x++; diff --git a/Dozentenmodul/src/models/Lecture.java b/Dozentenmodul/src/models/Lecture.java index 069946b3..6b7e6fa1 100644 --- a/Dozentenmodul/src/models/Lecture.java +++ b/Dozentenmodul/src/models/Lecture.java @@ -6,6 +6,7 @@ public class Lecture { private String name; + private String newName; private String shortDesc; private String desc; private Date startdate; @@ -18,6 +19,14 @@ public class Lecture { public static Lecture lecture =new Lecture(); + public String getNewName() { + return newName; + } + + public void setNewName(String newName) { + this.newName = newName; + } + public String getLinkedImagename() { return linkedImagename; } diff --git a/Dozentenmodulserver/bin/server/ServerHandler.class b/Dozentenmodulserver/bin/server/ServerHandler.class index d14b9ee1..76357894 100644 Binary files a/Dozentenmodulserver/bin/server/ServerHandler.class and b/Dozentenmodulserver/bin/server/ServerHandler.class differ diff --git a/Dozentenmodulserver/bin/sql/SQL.class b/Dozentenmodulserver/bin/sql/SQL.class index ea2ae3c3..6a4524b7 100644 Binary files a/Dozentenmodulserver/bin/sql/SQL.class and b/Dozentenmodulserver/bin/sql/SQL.class differ diff --git a/Dozentenmodulserver/src/server/ServerHandler.java b/Dozentenmodulserver/src/server/ServerHandler.java index c7ab500b..9474d942 100644 --- a/Dozentenmodulserver/src/server/ServerHandler.java +++ b/Dozentenmodulserver/src/server/ServerHandler.java @@ -311,7 +311,21 @@ public class ServerHandler implements Server.Iface { boolean isActive, String imagename, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws TException { - // TODO Auto-generated method stub + int pk_image=0; + int imageversion=0; + ResultSet image=sql.getImageIDandVersion(con, imagename); + + try { + while(image.next()) + { + pk_image=image.getInt("GUID_imageID"); + imageversion=image.getInt("imageVersion"); + } + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + sql.updateLectureData(con, pk_image, imageversion, lastname, newName, desc, shortdesc, startDate, endDate, isActive, id); return false; } diff --git a/Dozentenmodulserver/src/sql/SQL.java b/Dozentenmodulserver/src/sql/SQL.java index ec1ea11f..27bdc17c 100644 --- a/Dozentenmodulserver/src/sql/SQL.java +++ b/Dozentenmodulserver/src/sql/SQL.java @@ -6,6 +6,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.text.DateFormat; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Random; @@ -447,8 +448,8 @@ public class SQL { return -1; } - public int updateLectureData(Connection con, int pk_person, int pk_image, - int imageversion, String name, String desc, String shortdesc, + public int updateLectureData(Connection con, int pk_image, + int imageversion, String name, String newName ,String desc, String shortdesc, String start, String end, boolean isactive, String id) { DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); @@ -459,36 +460,24 @@ public class SQL { } try { Statement stm = con.createStatement(); - Random random = new Random(); - int uid = random.nextInt(); - stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_VLData_lecture`(`lectureID`,`name`,`isActive`,`startTime`,`endTime`,`lastUsed`,`shortDescription`,`description`,`imageID`,`imageVersion`,`admin_createTime`,`admin_changeTime`,`admin_owner`,`admin_change_by`)VALUES('" - + uid - + "','" - + name - + "','" - + active_bol - + "','" - + start - + "','" - + end - + "','" - + formatter.format(new Date()) - + "','" - + shortdesc - + "','" - + desc - + "','" - + pk_image - + "','" - + imageversion - + "','" - + formatter.format(new Date()) - + "','" - + formatter.format(new Date()) - + "','" - + pk_person - + "','" - + pk_person + "');"); + stm.executeUpdate("UPDATE `bwLehrpool`.`m_VLData_lecture` SET `name` = '" + +newName + +"',`isActive` = '" + +active_bol + +"',`startTime` = '" + +start + +"',`endTime` = '" + +end + +"',`description` = '" + +desc + +"',`imageID` = '" + +pk_image + +"',`imageVersion` = '" + +imageversion + +"',`admin_changeTime` = '" + +formatter.format(new Date()) + +"'WHERE `lectureID` = '" + +id+"';" ); con.commit(); } catch (SQLException e) { -- cgit v1.2.3-55-g7522 From 8c4c1a9a113f37ff5c88ad72d27619f9924b66e8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Apr 2014 15:50:48 +0200 Subject: cdsc --- .../bin/gui/image/FTPCreateUploader_GUI.class | Bin 12312 -> 12312 bytes Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class | Bin 9974 -> 9974 bytes .../bin/gui/image/FTPEditUploader_GUI.class | Bin 11868 -> 11868 bytes .../gui/lecture/CreateLectureAllgemein_GUI$6.class | Bin 3062 -> 3105 bytes .../gui/lecture/CreateLectureAllgemein_GUI.class | Bin 10794 -> 10794 bytes .../src/gui/image/FTPCreateUploader_GUI.java | 4 ++-- Dozentenmodul/src/gui/image/FTPDownloader_GUI.java | 4 ++-- .../src/gui/image/FTPEditUploader_GUI.java | 4 ++-- .../src/gui/lecture/CreateLectureAllgemein_GUI.java | 1 + 9 files changed, 7 insertions(+), 6 deletions(-) (limited to 'Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java') diff --git a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class index bf24ef25..785ecb6b 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class and b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class index 97b76e5c..dca740f2 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class index 71d93a4a..d3571c94 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class and b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class differ diff --git a/Dozentenmodul/bin/gui/lecture/CreateLectureAllgemein_GUI$6.class b/Dozentenmodul/bin/gui/lecture/CreateLectureAllgemein_GUI$6.class index e4b01d60..adcc7fd5 100644 Binary files a/Dozentenmodul/bin/gui/lecture/CreateLectureAllgemein_GUI$6.class and b/Dozentenmodul/bin/gui/lecture/CreateLectureAllgemein_GUI$6.class differ diff --git a/Dozentenmodul/bin/gui/lecture/CreateLectureAllgemein_GUI.class b/Dozentenmodul/bin/gui/lecture/CreateLectureAllgemein_GUI.class index 8bbcc3d0..031b69b7 100644 Binary files a/Dozentenmodul/bin/gui/lecture/CreateLectureAllgemein_GUI.class and b/Dozentenmodul/bin/gui/lecture/CreateLectureAllgemein_GUI.class differ diff --git a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java index cd952d0f..1bf8cc3a 100644 --- a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java @@ -50,8 +50,8 @@ public class FTPCreateUploader_GUI extends JFrame implements private final JPanel contentPanel = new JPanel(); JLabel lblPath; JProgressBar progressBar; - String host = "141.79.128.121"; - //String host = "141.79.128.102"; + //String host = "141.79.128.121"; + String host = "141.79.128.102"; int port = 21; server.User user; String filename = ""; diff --git a/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java b/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java index 2ace42c6..d0f789f4 100644 --- a/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java @@ -45,8 +45,8 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener JLabel downspeed; User user; JProgressBar progressBar; - String host = "141.79.128.121"; - //String host = "141.79.128.102"; + //String host = "141.79.128.121"; + String host = "141.79.128.102"; int port = 21; String downloadFile = ""; static String arg = ""; diff --git a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java index a23e85d2..b184c96c 100644 --- a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java @@ -49,8 +49,8 @@ public class FTPEditUploader_GUI extends JFrame implements private final JPanel contentPanel = new JPanel(); JLabel lblPath; JProgressBar progressBar; - String host = "141.79.128.121"; - //String host = "141.79.128.102"; + //String host = "141.79.128.121"; + String host = "141.79.128.102"; int port = 21; server.User user; String filename = ""; diff --git a/Dozentenmodul/src/gui/lecture/CreateLectureAllgemein_GUI.java b/Dozentenmodul/src/gui/lecture/CreateLectureAllgemein_GUI.java index 936f9b13..026cb7c5 100644 --- a/Dozentenmodul/src/gui/lecture/CreateLectureAllgemein_GUI.java +++ b/Dozentenmodul/src/gui/lecture/CreateLectureAllgemein_GUI.java @@ -412,6 +412,7 @@ public class CreateLectureAllgemein_GUI extends JFrame { "Das End-Datum liegt zu weit in der Zukunft. Erlaubt ist maximal:\n" + endDate, "Datum fehlerhaft", JOptionPane.INFORMATION_MESSAGE); + dateChooserend.setDate(endDate); //setze Datum auf maximum } else { // bereit isDateMaxLifeTimeCorrect = true; -- cgit v1.2.3-55-g7522