summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java
diff options
context:
space:
mode:
Diffstat (limited to 'dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java')
-rw-r--r--dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java142
1 files changed, 25 insertions, 117 deletions
diff --git a/dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java b/dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java
index 2b590b0b..84891f6c 100644
--- a/dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java
+++ b/dozentenmodul/src/main/java/gui/image/PermissionCreateImage_GUI.java
@@ -1,6 +1,5 @@
package gui.image;
-import gui.intro.About_GUI;
import gui.intro.MainMenue_GUI;
import java.awt.Color;
@@ -15,10 +14,6 @@ import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.net.URI;
-import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -28,12 +23,8 @@ import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
-import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
import javax.swing.JLabel;
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
-import javax.swing.JMenuItem;
-import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
@@ -52,23 +43,18 @@ import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;
import models.Image;
-import models.Links;
import models.RightsManagement;
-import models.SessionData;
import models.person;
-import org.apache.thrift.TException;
import org.openslx.sat.thrift.iface.Person;
-import org.openslx.sat.thrift.iface.Server.Client;
import util.CheckIntegrity;
+import util.GuiManager;
import util.ListAllOtherUsers_GUI;
-import util.OpenLinks;
@SuppressWarnings("serial")
-public class PermissionCreateImage_GUI extends JFrame {
+public class PermissionCreateImage_GUI extends JInternalFrame {
- Client client = models.Client.clientcon.getClient();
private final JPanel contentPanel = new JPanel();
String[] result;
private JTable table = null;
@@ -105,7 +91,7 @@ public class PermissionCreateImage_GUI extends JFrame {
private JLabel lblWriteDesc;
private JLabel lblAdminDesc;
private JLabel lblLinkallowedDesc;
- private static final String HELP_MESSAGE = "<html><div align=\"center\">"
+ public static final String HELP_MESSAGE = "<html><div align=\"center\">"
+ "Legen Sie fest, welche Personen welche Rechte an Ihrem Image haben.<br />"
+ "Sie können die Rechte Lesen, Schreiben, Link und Admin vergeben.<br />"
+ "Link bedeutet, dass diese Person Veranstaltungen auf Ihr Image verlinken darf und dieses somit<br />"
@@ -115,22 +101,22 @@ public class PermissionCreateImage_GUI extends JFrame {
private JButton btnAddUser;
private JButton btnDeleteUser;
- public PermissionCreateImage_GUI(Component formerGUI) {
+ public PermissionCreateImage_GUI() {
-
- addWindowListener(new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent arg0) {
- try {
- client.setSessionInvalid(SessionData.session.getAuthToken());
- } catch (TException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- System.exit(0);
- }
- });
+//
+// addWindowListener(new WindowAdapter() {
+// @Override
+// public void windowClosing(WindowEvent arg0) {
+// try {
+// client.setSessionInvalid(SessionData.session.getAuthToken());
+// } catch (TException e) {
+// // TODO Auto-generated catch block
+// e.printStackTrace();
+// }
+// System.exit(0);
+// }
+// });
setResizable(false);
@@ -144,7 +130,7 @@ public class PermissionCreateImage_GUI extends JFrame {
setTitle("bwLehrpool Suite - Image bearbeiten - "+person.verantwortlicher.getUserID());
setBounds(0, 0, 603, 722);
- setLocationRelativeTo(formerGUI);
+
getContentPane().setLayout(null);
{
@@ -362,9 +348,9 @@ public class PermissionCreateImage_GUI extends JFrame {
panel_1.add(btnDeleteUser);
btnAddUser.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- //show list of all other relevant users
- ListAllOtherUsers_GUI lu = new ListAllOtherUsers_GUI(c, table, 5); //give access to the table model and inform that the userID is position 5 in the model
- lu.setVisible(true);
+ // show list of all other relevant users
+ // give access to the table model and inform that the userID is position 5 in the model
+ GuiManager.openPopup(new ListAllOtherUsers_GUI(table, 5));
}
});
@@ -372,10 +358,7 @@ public class PermissionCreateImage_GUI extends JFrame {
lblHauptmen.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent arg0) {
-
- PermissionCreateImage_GUI.this.setVisible(false);
- MainMenue_GUI main = new MainMenue_GUI(c);
- main.setVisible(true);
+ GuiManager.show(new MainMenue_GUI());
}
});
lblHauptmen.setForeground(Color.BLUE);
@@ -452,11 +435,7 @@ public class PermissionCreateImage_GUI extends JFrame {
JButton cancelButton = new JButton("Zurück");
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
-
- CreateImageTechnisch_GUI ci = new CreateImageTechnisch_GUI(
- c);
- ci.setVisible(true);
- dispose();
+ GuiManager.show(new CreateImageTechnisch_GUI());
}
});
cancelButton.setActionCommand("OK");
@@ -479,9 +458,7 @@ public class PermissionCreateImage_GUI extends JFrame {
saveTableToList();
Image.image.setShareMode(comboBox_1.getSelectedIndex());
- FTPCreateUploader_GUI ea = new FTPCreateUploader_GUI(c);
- ea.setVisible(true);
- dispose();
+ GuiManager.show(new FTPCreateUploader_GUI());
}
});
@@ -499,75 +476,6 @@ public class PermissionCreateImage_GUI extends JFrame {
separator_1.setBounds(0, 627, 597, 2);
getContentPane().add(separator_1);
- JMenuBar menuBar = new JMenuBar();
- setJMenuBar(menuBar);
-
- 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) {
-
- URI windows;
- try {
- windows = new URI(Links.getFAQ());
-
- OpenLinks.openWebpage(windows);
-
- } catch (URISyntaxException 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) {
-
- URI windows;
- try {
- windows = new URI(Links.getOTRS());
-
- OpenLinks.openWebpage(windows);
-
- } catch (URISyntaxException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
- });
- mnNewMenu_1.add(mntmOtrs);
-
- JMenuItem mntmAbout = new JMenuItem("About");
- mntmAbout.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- About_GUI ab = new About_GUI();
- ab.setVisible(true);
- }
- });
- mnNewMenu_1.add(mntmAbout);
-
- JMenu mnNewMenu_Info = new JMenu("Info");
- mnNewMenu_Info.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent arg0) {
- JOptionPane.showMessageDialog(c, HELP_MESSAGE,
- "Hilfe zu dieser Oberfläche",
- JOptionPane.INFORMATION_MESSAGE);
- }
- });
- menuBar.add(mnNewMenu_Info);
-
- c = this;
-
- this.setLocationRelativeTo(formerGUI);
- this.setVisible(true);
}// end constructor
private void checkIntegrity(int row) {