summaryrefslogtreecommitdiffstats
path: root/Dozentenmodul/src
diff options
context:
space:
mode:
authorTobias Spitzer2014-05-23 11:31:42 +0200
committerTobias Spitzer2014-05-23 11:31:42 +0200
commit5d24cdec4d239f473ee2359493ab47d1ef3273dd (patch)
tree872bfaae8ef25df70f5d140fbf33df2a8dd5d9f8 /Dozentenmodul/src
parentBug: Fehler beim Download wirde behoben (diff)
downloadtutor-module-5d24cdec4d239f473ee2359493ab47d1ef3273dd.tar.gz
tutor-module-5d24cdec4d239f473ee2359493ab47d1ef3273dd.tar.xz
tutor-module-5d24cdec4d239f473ee2359493ab47d1ef3273dd.zip
Freigabe Mechanismus implementiert, nun sollte die notwendige Grundlage für die Syncronisation vorhanden sein.
Diffstat (limited to 'Dozentenmodul/src')
-rw-r--r--Dozentenmodul/src/Models/Image.java8
-rw-r--r--Dozentenmodul/src/gui/image/CreateImageFreigabe_GUI.java251
-rw-r--r--Dozentenmodul/src/gui/image/CreateImageTechnisch_GUI.java2
-rw-r--r--Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java11
-rw-r--r--Dozentenmodul/src/gui/image/EditImageFreigabe_GUI.java251
-rw-r--r--Dozentenmodul/src/gui/image/EditImageTechnisch_GUI.java2
-rw-r--r--Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java2
-rw-r--r--Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java18
-rw-r--r--Dozentenmodul/src/gui/image/SearchEditImage_GUI.java39
-rw-r--r--Dozentenmodul/src/gui/intro/Login_GUI.java1
-rw-r--r--Dozentenmodul/src/models/Image.java8
11 files changed, 578 insertions, 15 deletions
diff --git a/Dozentenmodul/src/Models/Image.java b/Dozentenmodul/src/Models/Image.java
index e08ed5a2..89df5cd5 100644
--- a/Dozentenmodul/src/Models/Image.java
+++ b/Dozentenmodul/src/Models/Image.java
@@ -7,6 +7,7 @@ public class Image {
private String imagename;
private String newName;
private String imagepath;
+ private int shareMode;
private boolean licensed;
private boolean internet;
private int ram;
@@ -15,6 +16,13 @@ public class Image {
public static Image image =new Image();
+
+ public int getShareMode() {
+ return shareMode;
+ }
+ public void setShareMode(int shareMode) {
+ this.shareMode = shareMode;
+ }
public String getImagepath() {
return imagepath;
}
diff --git a/Dozentenmodul/src/gui/image/CreateImageFreigabe_GUI.java b/Dozentenmodul/src/gui/image/CreateImageFreigabe_GUI.java
new file mode 100644
index 00000000..ce77282a
--- /dev/null
+++ b/Dozentenmodul/src/gui/image/CreateImageFreigabe_GUI.java
@@ -0,0 +1,251 @@
+package gui.image;
+
+
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Toolkit;
+import javax.swing.JFrame;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import java.awt.Color;
+import javax.swing.JLabel;
+import java.awt.Font;
+import javax.swing.JTextPane;
+import java.awt.SystemColor;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import javax.swing.JSeparator;
+import javax.swing.JMenuBar;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import javax.swing.border.TitledBorder;
+import javax.swing.JTextArea;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.io.IOException;
+
+import javax.swing.JRadioButton;
+import javax.swing.ButtonGroup;
+import javax.swing.JSpinner;
+import javax.swing.SpinnerNumberModel;
+
+import models.Image;
+import models.Links;
+import javax.swing.JComboBox;
+import javax.swing.DefaultComboBoxModel;
+
+@SuppressWarnings("serial")
+public class CreateImageFreigabe_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ private final ButtonGroup buttonGrouplicense = new ButtonGroup();
+ private final ButtonGroup buttonGroupInternet = new ButtonGroup();
+ JComboBox comboBox;
+
+ /**
+ * Create the dialog.
+ */
+ public CreateImageFreigabe_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ System.exit(0);
+ }
+ });
+ setResizable(false);
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("bwLehrpool Suite *Prototyp* - Image erzeugen");
+ 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, 722);
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 577, 57);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Image Freigabe");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie.setText("W\u00E4hlen Sie bitte hier die von Ihnen gew\u00FCnschte Freigabe f\u00FCr Ihr Image aus.");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 493);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Freigabe", TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 51, 557, 124);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JLabel lblNewLabel_2 = new JLabel("Freigabemodus:");
+ lblNewLabel_2.setBounds(10, 55, 250, 20);
+ panel_1.add(lblNewLabel_2);
+
+ comboBox = new JComboBox();
+ comboBox.setModel(new DefaultComboBoxModel(new String[] {"Lokal (Eigene Hochschule)", "\u00D6ffentlich (Alle Hochschulen)"}));
+ comboBox.setSelectedIndex(0);
+ comboBox.setBounds(270, 55, 250, 20);
+ panel_1.add(comboBox);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+
+ CreateImageFreigabe_GUI.this.setVisible(false);
+ MainMenue_GUI main=new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("VL-Image");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 45, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(133, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Neu");
+ lblNewLabel_1.setBounds(146, 11, 46, 14);
+ contentPanel.add(lblNewLabel_1);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton cancelButton = new JButton("Zur\u00FCck");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+ Image.image.setShareMode(comboBox.getSelectedIndex());
+ CreateImageTechnisch_GUI sr=new CreateImageTechnisch_GUI();
+ sr.setVisible(true);
+ dispose();
+ }
+ });
+ cancelButton.setActionCommand("OK");
+ buttonPane.add(cancelButton);
+ //getRootPane().setDefaultButton(cancelButton);
+ }
+ {
+ JButton continueButton = new JButton("Weiter");
+ continueButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ Image.image.setShareMode(comboBox.getSelectedIndex());
+ FTPCreateUploader_GUI ea=new FTPCreateUploader_GUI();
+ ea.setVisible(true);
+ dispose();
+
+ }
+ });
+ continueButton.setActionCommand("Cancel");
+ buttonPane.add(continueButton);
+ getRootPane().setDefaultButton(continueButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu = new JMenu("Suchen");
+ menuBar.add(mnNewMenu);
+
+ JMenuItem mntmVlSuche = new JMenuItem("VL Suche");
+ mnNewMenu.add(mntmVlSuche);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ mntmFaq.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mousePressed(MouseEvent arg0) {
+
+ String faq;
+
+ faq = Links.getFAQ();
+
+ try {
+ Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler " + faq );
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ });
+
+ mnNewMenu_1.add(mntmFaq);
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mousePressed(MouseEvent arg0) {
+ String otrs;
+
+ otrs = Links.getOTRS();
+
+ try {
+ Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler " + otrs );
+ } catch (IOException f) {
+ // TODO Auto-generated catch block
+ f.printStackTrace();
+ }
+
+ }
+ });
+
+ mnNewMenu_1.add(mntmOtrs);
+
+ }
+}
diff --git a/Dozentenmodul/src/gui/image/CreateImageTechnisch_GUI.java b/Dozentenmodul/src/gui/image/CreateImageTechnisch_GUI.java
index 45331b21..bbed38b7 100644
--- a/Dozentenmodul/src/gui/image/CreateImageTechnisch_GUI.java
+++ b/Dozentenmodul/src/gui/image/CreateImageTechnisch_GUI.java
@@ -315,7 +315,7 @@ public class CreateImageTechnisch_GUI extends JFrame {
}
Image.image.setCpu(Integer.valueOf(spinnerCPU.getValue().toString()).intValue());
Image.image.setRam(Integer.valueOf(spinnerRam.getValue().toString()).intValue());
- FTPCreateUploader_GUI ea=new FTPCreateUploader_GUI();
+ CreateImageFreigabe_GUI ea=new CreateImageFreigabe_GUI();
ea.setVisible(true);
dispose();
diff --git a/Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java b/Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java
index c0ad0a06..ae779d30 100644
--- a/Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java
+++ b/Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java
@@ -394,6 +394,17 @@ public class EditImageAllgemein_GUI extends JFrame {
Image.image.setImagename(map.get("name"));
Image.image.setRam(Integer.parseInt(map.get("ram")));
Image.image.setCpu(Integer.parseInt(map.get("cpu")));
+ Image.image.setImagepath(map.get("path"));
+ Image.image.setFilesize(Long.parseLong(map.get("filesize")));
+ int mode=0;
+ if(map.get("shareMode").equals("only_local")){
+ mode=0;
+ }
+ else
+ {
+ mode=1;
+ }
+ Image.image.setShareMode(mode);
} catch (TException e) {
// TODO Auto-generated catch block
e.printStackTrace();
diff --git a/Dozentenmodul/src/gui/image/EditImageFreigabe_GUI.java b/Dozentenmodul/src/gui/image/EditImageFreigabe_GUI.java
new file mode 100644
index 00000000..0f54c346
--- /dev/null
+++ b/Dozentenmodul/src/gui/image/EditImageFreigabe_GUI.java
@@ -0,0 +1,251 @@
+package gui.image;
+
+
+import gui.intro.MainMenue_GUI;
+
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Toolkit;
+import javax.swing.JFrame;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import java.awt.Color;
+import javax.swing.JLabel;
+import java.awt.Font;
+import javax.swing.JTextPane;
+import java.awt.SystemColor;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import javax.swing.JSeparator;
+import javax.swing.JMenuBar;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import javax.swing.border.TitledBorder;
+import javax.swing.JTextArea;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.io.IOException;
+
+import javax.swing.JRadioButton;
+import javax.swing.ButtonGroup;
+import javax.swing.JSpinner;
+import javax.swing.SpinnerNumberModel;
+
+import models.Image;
+import models.Links;
+import javax.swing.JComboBox;
+import javax.swing.DefaultComboBoxModel;
+
+@SuppressWarnings("serial")
+public class EditImageFreigabe_GUI extends JFrame {
+
+ private final JPanel contentPanel = new JPanel();
+ String[] result;
+ private final ButtonGroup buttonGrouplicense = new ButtonGroup();
+ private final ButtonGroup buttonGroupInternet = new ButtonGroup();
+ JComboBox comboBox;
+
+ /**
+ * Create the dialog.
+ */
+ public EditImageFreigabe_GUI() {
+ addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosing(WindowEvent arg0) {
+ System.exit(0);
+ }
+ });
+ setResizable(false);
+
+ try {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("bwLehrpool Suite *Prototyp* - Image erzeugen");
+ 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, 722);
+ getContentPane().setLayout(null);
+ {
+ JPanel panel = new JPanel();
+ panel.setBackground(SystemColor.menu);
+ panel.setBounds(10, 11, 577, 57);
+ getContentPane().add(panel);
+ panel.setLayout(null);
+ {
+ JLabel lblNewLabel = new JLabel("Image Freigabe");
+ lblNewLabel.setBounds(10, 11, 509, 22);
+ panel.add(lblNewLabel);
+ lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18));
+ }
+
+ JTextPane txtpnBitteWhlenSie = new JTextPane();
+ txtpnBitteWhlenSie.setEditable(false);
+ txtpnBitteWhlenSie.setBackground(SystemColor.menu);
+ txtpnBitteWhlenSie.setText("W\u00E4hlen Sie bitte hier die von Ihnen gew\u00FCnschte Freigabe f\u00FCr Ihr Image aus.");
+ txtpnBitteWhlenSie.setBounds(10, 36, 509, 32);
+ panel.add(txtpnBitteWhlenSie);
+ }
+ contentPanel.setBounds(10, 85, 577, 493);
+ contentPanel.setBackground(SystemColor.menu);
+ contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ getContentPane().add(contentPanel);
+ contentPanel.setLayout(null);
+
+ JPanel panel_1 = new JPanel();
+ panel_1.setBackground(SystemColor.menu);
+ panel_1.setBorder(new TitledBorder(null, "Freigabe", TitledBorder.LEADING, TitledBorder.TOP, null, null));
+ panel_1.setBounds(10, 51, 557, 124);
+ contentPanel.add(panel_1);
+ panel_1.setLayout(null);
+
+ JLabel lblNewLabel_2 = new JLabel("Freigabemodus:");
+ lblNewLabel_2.setBounds(10, 55, 250, 20);
+ panel_1.add(lblNewLabel_2);
+
+ comboBox = new JComboBox();
+ comboBox.setModel(new DefaultComboBoxModel(new String[] {"Lokal (Eigene Hochschule)", "\u00D6ffentlich (Alle Hochschulen)"}));
+ comboBox.setSelectedIndex(Image.image.getShareMode());
+ comboBox.setBounds(270, 55, 250, 20);
+ panel_1.add(comboBox);
+
+ JLabel lblHauptmen = new JLabel("Hauptmen\u00FC");
+ lblHauptmen.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+
+ EditImageFreigabe_GUI.this.setVisible(false);
+ MainMenue_GUI main=new MainMenue_GUI();
+ main.setVisible(true);
+ }
+ });
+ lblHauptmen.setForeground(Color.BLUE);
+ lblHauptmen.setBounds(10, 11, 61, 14);
+ contentPanel.add(lblHauptmen);
+
+ JLabel label_1 = new JLabel(">");
+ label_1.setBounds(69, 11, 13, 14);
+ contentPanel.add(label_1);
+
+ JLabel lblVlimage = new JLabel("VL-Image");
+ lblVlimage.setForeground(Color.BLUE);
+ lblVlimage.setBounds(81, 11, 45, 14);
+ contentPanel.add(lblVlimage);
+
+ JLabel label_2 = new JLabel(">");
+ label_2.setBounds(133, 11, 13, 14);
+ contentPanel.add(label_2);
+
+ JLabel lblNewLabel_1 = new JLabel("Neu");
+ lblNewLabel_1.setBounds(146, 11, 46, 14);
+ contentPanel.add(lblNewLabel_1);
+ {
+ JPanel buttonPane = new JPanel();
+ buttonPane.setBounds(0, 640, 597, 33);
+ buttonPane.setBackground(SystemColor.menu);
+ buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+ getContentPane().add(buttonPane);
+ {
+ JButton cancelButton = new JButton("Zur\u00FCck");
+ cancelButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+ Image.image.setShareMode(comboBox.getSelectedIndex());
+ EditImageTechnisch_GUI sr=new EditImageTechnisch_GUI();
+ sr.setVisible(true);
+ dispose();
+ }
+ });
+ cancelButton.setActionCommand("OK");
+ buttonPane.add(cancelButton);
+ //getRootPane().setDefaultButton(cancelButton);
+ }
+ {
+ JButton continueButton = new JButton("Weiter");
+ continueButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ Image.image.setShareMode(comboBox.getSelectedIndex());
+ FTPEditUploader_GUI ea=new FTPEditUploader_GUI();
+ ea.setVisible(true);
+ dispose();
+
+ }
+ });
+ continueButton.setActionCommand("Cancel");
+ buttonPane.add(continueButton);
+ getRootPane().setDefaultButton(continueButton);
+ }
+ }
+
+ JSeparator separator = new JSeparator();
+ separator.setBounds(0, 78, 597, 2);
+ getContentPane().add(separator);
+
+ JSeparator separator_1 = new JSeparator();
+ separator_1.setBounds(0, 627, 597, 2);
+ getContentPane().add(separator_1);
+
+ JMenuBar menuBar = new JMenuBar();
+ setJMenuBar(menuBar);
+
+ JMenu mnNewMenu = new JMenu("Suchen");
+ menuBar.add(mnNewMenu);
+
+ JMenuItem mntmVlSuche = new JMenuItem("VL Suche");
+ mnNewMenu.add(mntmVlSuche);
+
+ JMenu mnNewMenu_1 = new JMenu("Hilfe");
+ menuBar.add(mnNewMenu_1);
+
+ JMenuItem mntmFaq = new JMenuItem("FAQ");
+ mntmFaq.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mousePressed(MouseEvent arg0) {
+
+ String faq;
+
+ faq = Links.getFAQ();
+
+ try {
+ Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler " + faq );
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ });
+
+ mnNewMenu_1.add(mntmFaq);
+
+ JMenuItem mntmOtrs = new JMenuItem("OTRS");
+ mntmOtrs.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mousePressed(MouseEvent arg0) {
+ String otrs;
+
+ otrs = Links.getOTRS();
+
+ try {
+ Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler " + otrs );
+ } catch (IOException f) {
+ // TODO Auto-generated catch block
+ f.printStackTrace();
+ }
+
+ }
+ });
+
+ mnNewMenu_1.add(mntmOtrs);
+
+ }
+}
diff --git a/Dozentenmodul/src/gui/image/EditImageTechnisch_GUI.java b/Dozentenmodul/src/gui/image/EditImageTechnisch_GUI.java
index 1bbfa699..108d5343 100644
--- a/Dozentenmodul/src/gui/image/EditImageTechnisch_GUI.java
+++ b/Dozentenmodul/src/gui/image/EditImageTechnisch_GUI.java
@@ -318,7 +318,7 @@ public class EditImageTechnisch_GUI extends JFrame {
Image.image.setLicensed(false);
}
// oeffnet das naechste Fenster
- FTPEditUploader_GUI ea = new FTPEditUploader_GUI();
+ EditImageFreigabe_GUI ea=new EditImageFreigabe_GUI();
ea.setVisible(true);
dispose();
diff --git a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java
index b1394c0e..c41b6799 100644
--- a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java
+++ b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java
@@ -500,7 +500,7 @@ public class FTPCreateUploader_GUI extends JFrame implements
person.verantwortlicher.getFakultaet(),
Image.image.isLicensed(), Image.image.isInternet(),
Image.image.getRam(), Image.image.getCpu(),
- "temp/" + Image.image.getNewName(),false,Image.image.getFilesize());
+ "temp/" + Image.image.getNewName(),false,Image.image.getFilesize(),Image.image.getShareMode());
client.startFileCopy(Image.image.getNewName());
} catch (TException e) {
// TODO Auto-generated catch block
diff --git a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java
index 05846e25..591d0f83 100644
--- a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java
+++ b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java
@@ -297,7 +297,7 @@ public class FTPEditUploader_GUI extends JFrame implements
getContentPane().add(buttonPane, BorderLayout.SOUTH);
{
- finishButton.setEnabled(false);
+ //finishButton.setEnabled(false);
finishButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@@ -425,7 +425,7 @@ public class FTPEditUploader_GUI extends JFrame implements
progressBar.setValue(progress);
// Button zum Fertigstellen freischalten, wenn 100% erreicht sind
- if (progress == 0 || progress == 100) {
+ if (progress == 100) {
// not uploading currently
btnZurck.setEnabled(true);
} else {
@@ -484,12 +484,24 @@ public class FTPEditUploader_GUI extends JFrame implements
try {
System.out.println("NewName="+Image.image.getNewName());
System.out.println("OldName="+Image.image.getImagename());
+ if(Image.image.getNewName().isEmpty()){
+ client.updateImageData(Image.image.getImagename(),
+ Image.image.getImagename(),Image.image.getImagepath(), Image.image.isLicensed(),
+ Image.image.isInternet(), Image.image.getRam(),
+ Image.image.getCpu(), Image.image.getImageId(),
+ Image.image.getVersion(), false,Image.image.getFilesize(),Image.image.getShareMode());
+ client.startFileCopy(Image.image.getNewName());
+ }
+ else{
+
+
client.updateImageData(Image.image.getImagename(),
Image.image.getImagename(),"temp/" + Image.image.getNewName(), Image.image.isLicensed(),
Image.image.isInternet(), Image.image.getRam(),
Image.image.getCpu(), Image.image.getImageId(),
- Image.image.getVersion(), false,Image.image.getFilesize());
+ Image.image.getVersion(), false,Image.image.getFilesize(),Image.image.getShareMode());
client.startFileCopy(Image.image.getNewName());
+ }
} catch (TException e) {
// TODO Auto-generated catch block
e.printStackTrace();
diff --git a/Dozentenmodul/src/gui/image/SearchEditImage_GUI.java b/Dozentenmodul/src/gui/image/SearchEditImage_GUI.java
index 30e2b06d..b5838efa 100644
--- a/Dozentenmodul/src/gui/image/SearchEditImage_GUI.java
+++ b/Dozentenmodul/src/gui/image/SearchEditImage_GUI.java
@@ -65,6 +65,7 @@ public class SearchEditImage_GUI extends JFrame {
JComboBox<String> comboBox;
JTable tableAllImages;
JTable tablemyImages;
+ boolean activeSearch=false;
private JTextField textFieldName;
JTabbedPane tabbedPane;
String[] titles = { "Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung",
@@ -101,6 +102,8 @@ public class SearchEditImage_GUI extends JFrame {
@Override
public void windowOpened(WindowEvent arg0) {
+ initTableModel(modelMyImages);
+ initTableModel(modelAll);
textFieldName.requestFocusInWindow();
}
});
@@ -178,14 +181,22 @@ public class SearchEditImage_GUI extends JFrame {
String stext = textFieldName.getText();
// Wenn Textfield nicht leer
- if (stext != "") {
+ if (stext.isEmpty()==false) {
+ activeSearch=true;
// Filtere nach der Eingabe
rowSorterAll.setRowFilter(RowFilter.regexFilter(
textFieldName.getText(), 0));
rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
textFieldName.getText(), 0));
-
- }
+ }
+ else{
+ activeSearch=false;
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ username, 4));
+ rowSorterAll.setRowFilter(null);
+ }
}
});
@@ -230,13 +241,23 @@ public class SearchEditImage_GUI extends JFrame {
comboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
// Prueft das die Auswahl nicht leer ist
- if (comboBox.getSelectedItem().toString() != "") {
+ if (comboBox.getSelectedItem().toString().isEmpty()==false) {
// Filtert nach dem ausgewaehlten Betriebssystem
+ activeSearch=true;
rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox
.getSelectedItem().toString(), 2));
rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
comboBox.getSelectedItem().toString(), 2));
}
+ else{
+ activeSearch=false;
+ String username = person.verantwortlicher.getName() + " "
+ + person.verantwortlicher.getVorname();
+ rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
+ username, 4));
+
+ rowSorterAll.setRowFilter(null);
+ }
}
});
@@ -278,15 +299,15 @@ public class SearchEditImage_GUI extends JFrame {
tabbedPane = new JTabbedPane(JTabbedPane.TOP);
tabbedPane.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent arg0) {
- if (tabbedPane.getSelectedIndex() == 0) {
+ if (tabbedPane.getSelectedIndex() == 0 && activeSearch==false) {
String username = person.verantwortlicher.getName() + " "
+ person.verantwortlicher.getVorname();
// String username="Spitzer Tobias";
rowSorterMyImages.setRowFilter(RowFilter.regexFilter(
username, 4));
- } else if (tabbedPane.getSelectedIndex() == 1) {
-
+ } else if(tabbedPane.getSelectedIndex()==1 && activeSearch==false){
+ rowSorterAll.setRowFilter(null);
}
}
@@ -294,7 +315,7 @@ public class SearchEditImage_GUI extends JFrame {
tabbedPane.setBounds(10, 197, 557, 300);
contentPanel.add(tabbedPane);
- initTableModel(modelMyImages);
+
JScrollPane scrollPaneAllImages = new JScrollPane();
tableAllImages = new JTable();
@@ -304,7 +325,7 @@ public class SearchEditImage_GUI extends JFrame {
tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit();
tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit();
tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit();
- initTableModel(modelAll);
+
JScrollPane scrollPaneMyImage = new JScrollPane();
tablemyImages = new JTable();
diff --git a/Dozentenmodul/src/gui/intro/Login_GUI.java b/Dozentenmodul/src/gui/intro/Login_GUI.java
index 34469617..5b4ecbd9 100644
--- a/Dozentenmodul/src/gui/intro/Login_GUI.java
+++ b/Dozentenmodul/src/gui/intro/Login_GUI.java
@@ -212,6 +212,7 @@ public class Login_GUI extends JFrame {
//set connection to bwLehrpoolSuiteServer
ThriftConnection bwthrift=new ThriftConnection();
server.Server.Client bwClient=bwthrift.getThriftConnection();
+ System.out.println("Connection zu Satellit aufgebaut!");
models.Client.clientcon.setClient(bwClient);
diff --git a/Dozentenmodul/src/models/Image.java b/Dozentenmodul/src/models/Image.java
index e08ed5a2..89df5cd5 100644
--- a/Dozentenmodul/src/models/Image.java
+++ b/Dozentenmodul/src/models/Image.java
@@ -7,6 +7,7 @@ public class Image {
private String imagename;
private String newName;
private String imagepath;
+ private int shareMode;
private boolean licensed;
private boolean internet;
private int ram;
@@ -15,6 +16,13 @@ public class Image {
public static Image image =new Image();
+
+ public int getShareMode() {
+ return shareMode;
+ }
+ public void setShareMode(int shareMode) {
+ this.shareMode = shareMode;
+ }
public String getImagepath() {
return imagepath;
}