diff options
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui')
3 files changed, 73 insertions, 72 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/NetrulesConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/NetrulesConfigurator.java index d471349f..d98c4cd6 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/NetrulesConfigurator.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/NetrulesConfigurator.java @@ -44,7 +44,7 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout { * Example: "8.8.8.8 80 in" would be split in -hostname "8.8.8.8" -port "80" * -direction "in" */ - private static final String FIELD_DELIMITER = "\\s"; + private static final String FIELD_DELIMITER = "\\s+"; public NetrulesConfigurator() { super(); @@ -113,8 +113,8 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout { + ":" + currentRule.port); continue; } - currentLine += currentRule.host + " "; - currentLine += currentRule.port + " "; + currentLine += currentRule.host + " \t "; + currentLine += currentRule.port + " \t "; currentLine += currentRule.direction.name(); decodedRules += currentLine + (it.hasNext() ? System.lineSeparator() : ""); @@ -160,7 +160,7 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout { + fields.length); Gui.showMessageBox( "Ungültige Syntax: Bitte definieren Sie Ihre Regel im Format: <host> <port> [in|out|both]", - MessageType.ERROR, LOGGER, null); + MessageType.ERROR, null, null); break; } @@ -175,7 +175,7 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout { + ruleDirection); Gui.showMessageBox( "Ungültige Richtung: Bitte nutzen Sie 'in' bzw. 'out'.", - MessageType.ERROR, LOGGER, null); + MessageType.ERROR, null, null); break; } // check port: accept if > -2 and < 65535 @@ -191,8 +191,8 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout { markText(ruleLine, Color.RED); LOGGER.debug("Invalid port! Got: " + port); Gui.showMessageBox( - "Ungültiges Port! Bitte nutzen Sie einen Port aus dem Bereich [0-65536].", - MessageType.ERROR, LOGGER, null); + "Ungültiger Port! Bitte nutzen Sie einen Port aus dem Bereich [0-65536].", + MessageType.ERROR, null, null); break; } // check hostname: bit more to do here @@ -222,7 +222,7 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout { "Konnte '" + fields[0] + "' nicht auflösen. Wollen Sie diesen Hostnamen trotzdem verwenden?", - MessageType.WARNING_RETRY, LOGGER, null)) { + MessageType.WARNING_RETRY, null, null)) { break; } } else { @@ -262,7 +262,7 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout { private boolean checkHostnameSimple(final String hostname) { if (hostname.length() > 254) { Gui.showMessageBox("Hostname ist zu lang!", MessageType.ERROR, - LOGGER, null); + null, null); return false; } // split by '.' to get domain levels @@ -272,7 +272,7 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout { // fail since domain level should be max 63 chars Gui.showMessageBox("Domain-Ebene '" + domainLabel + "' länger als 63 Zeichen!", MessageType.ERROR, - LOGGER, null); + null, null); return false; } // length is ok, check for invalid characters @@ -283,7 +283,7 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout { if (!(Character.isDigit(c) || Character.isLetter(c) || c.equals('-') || c.equals('/'))) { Gui.showMessageBox("Ungültiges Zeichen '" + c - + "' in hostname!", MessageType.ERROR, LOGGER, null); + + "' in hostname!", MessageType.ERROR, null, null); return false; } } @@ -382,7 +382,11 @@ class NetrulesConfiguratorLayout extends JPanel { private static final long serialVersionUID = 5266120380443817325L; private final static String txtNetworkOptionsTitle = "Netzwerk Einstellungen"; - private final static String txtNetworkOptionsDesc = "Wenn Sie den Internetzugriff deaktiviert haben, können Sie hier Ausnahmen definieren (Whitelist). Bitte definieren Sie Ihre Regeln im Format <host> <port> <in|out>."; + private final static String txtNetworkOptionsDesc = "Wenn Sie den Internetzugriff deaktiviert haben," + + " können Sie hier Ausnahmen definieren (Whitelist)." + + " Bitte definieren Sie Ihre Regeln im Format\n<host> <port> <in|out>.\n" + + "Sie können Port 0 angeben, was sämtlichen TCP und UDP Ports eines Hosts entspricht.\n\n" + + "Wenn Sie Internetzugriff aktivieren, hat diese Liste den gegenteiligen Effekt"; private final static String txtNetworkRulesTitle = "Netzwerkregeln"; private final JPanel pnlNetworkOptions; @@ -407,7 +411,7 @@ class NetrulesConfiguratorLayout extends JPanel { pnlNetworkOptions.setBorder(BorderFactory .createTitledBorder(txtNetworkRulesTitle)); gridNetworkOptions - .add(new WordWrapLabel(txtNetworkOptionsDesc, false, true)) + .add(new WordWrapLabel(txtNetworkOptionsDesc)) .fill(true, false).expand(true, false); gridNetworkOptions.nextRow(); gridNetworkOptions.add(scpNetworkRules).fill(true, true) diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureDetailsWindowLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureDetailsWindowLayout.java index 54b0536d..fbf04ad1 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureDetailsWindowLayout.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureDetailsWindowLayout.java @@ -17,7 +17,6 @@ import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JDialog; import javax.swing.JFrame; -import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSpinner; @@ -77,7 +76,6 @@ public abstract class LectureDetailsWindowLayout extends JDialog { protected final JTextField txtId; protected final QLabel lblUseCount; - protected final JButton btnPermissions; protected final JButton btnNetrules; protected final QLabel lblError; @@ -91,7 +89,7 @@ public abstract class LectureDetailsWindowLayout extends JDialog { protected final JSpinner spnEndTime; protected Color dateTimeTextColor; - + protected JTabbedPane pnlTabs; protected final LectureCustomPermissionManager ctlPermissionManager; protected final LocationSelector ctlLocationSelector; @@ -115,20 +113,17 @@ public abstract class LectureDetailsWindowLayout extends JDialog { } public LectureDetailsWindowLayout(Frame modalParent) { - super(modalParent, "Veranstaltungsdetails", - ModalityType.APPLICATION_MODAL); + super(modalParent, "Veranstaltungsdetails", ModalityType.APPLICATION_MODAL); setResizable(true); setPreferredSize(Gui.getScaledDimension(525, 550)); setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); setLayout(new BorderLayout()); - ((JPanel) getContentPane()).setBorder(BorderFactory.createEmptyBorder( - 10, 10, 10, 10)); + ((JPanel) getContentPane()).setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); pnlTabInfo = new JPanel(); pnlTabInfo.setBorder(BorderFactory.createEmptyBorder(25, 25, 25, 25)); - GridManager grdInfo = new GridManager(pnlTabInfo, 3, true, new Insets(7, - 7, 7, 7)); - + GridManager grdInfo = new GridManager(pnlTabInfo, 3, true, new Insets(7, 7, 7, 7)); + // title lblTitleInfo = new QLabel(); lblTitleInfo.setFont(lblTitleInfo.getFont().deriveFont(Font.BOLD, @@ -177,8 +172,7 @@ public abstract class LectureDetailsWindowLayout extends JDialog { pnlTabGeneral = new JPanel(); pnlTabGeneral.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); - GridManager grdGeneral = new GridManager(pnlTabGeneral, 5, true, - new Insets(3, 3, 3, 3)); + GridManager grdGeneral = new GridManager(pnlTabGeneral, 5, true, new Insets(3, 3, 3, 3)); // lecture title txtTitle = new JTextArea(); grdGeneral.add(new QLabel("Name")); @@ -189,10 +183,8 @@ public abstract class LectureDetailsWindowLayout extends JDialog { txtDescription = new JTextArea(); txtDescription.setLineWrap(true); txtDescription.setWrapStyleWord(true); - grdGeneral.add(new QLabel("Beschreibung")).anchor( - GridBagConstraints.FIRST_LINE_START); - JScrollPane jsp = new JScrollPane(txtDescription, - JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, + grdGeneral.add(new QLabel("Beschreibung")).anchor(GridBagConstraints.FIRST_LINE_START); + JScrollPane jsp = new JScrollPane(txtDescription, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); jsp.setMinimumSize(Gui.getScaledDimension(450, 120)); jsp.setPreferredSize(Gui.getScaledDimension(450, 120)); @@ -202,8 +194,7 @@ public abstract class LectureDetailsWindowLayout extends JDialog { // ID. NOTE: currently disabled txtId = new JTextField(); txtId.setEditable(false); - txtId.setFont(txtId.getFont().deriveFont(Font.BOLD, - txtId.getFont().getSize2D() * 0.66f)); + txtId.setFont(txtId.getFont().deriveFont(Font.BOLD, txtId.getFont().getSize2D() * 0.66f)); grdGeneral.add(new QLabel("ID")); grdGeneral.add(txtId, 4).expand(true, false).fill(true, false); grdGeneral.nextRow(); @@ -216,13 +207,12 @@ public abstract class LectureDetailsWindowLayout extends JDialog { grdGeneral.add(btnChangeOwner).fill(true, false); grdGeneral.nextRow(); - // linked image // name txtImageName = new QLabel(); grdGeneral.add(new QLabel("Verknüpfte VM")); grdGeneral.add(txtImageName, 3).expand(true, false); - + // link button for image btnLinkImage = new JButton("Ändern"); grdGeneral.add(btnLinkImage).fill(true, false); @@ -241,14 +231,12 @@ public abstract class LectureDetailsWindowLayout extends JDialog { if (item.isValid) { return FormatHelper.longDate(item.getCreateTime()); } else { - return FormatHelper.longDate(item.getCreateTime()) - + " [ungültig]"; + return FormatHelper.longDate(item.getCreateTime()) + " [ungültig]"; } } }); btnDownloadImage = new JButton("Download"); - btnDownloadImage - .setToolTipText("Momentan verwendete Version herunterladen"); + btnDownloadImage.setToolTipText("Momentan verwendete Version herunterladen"); JPanel versionPanel = new JPanel(new BorderLayout()); versionPanel.add(cboVersions, BorderLayout.CENTER); versionPanel.add(chkAutoUpdate, BorderLayout.SOUTH); @@ -259,10 +247,8 @@ public abstract class LectureDetailsWindowLayout extends JDialog { // start time of the lecture JPanel startTimePanel = new JPanel(); - startTimePanel.setLayout(new BoxLayout(startTimePanel, - BoxLayout.LINE_AXIS)); - dtpStartDate = new QDatePickerImpl(new JDatePanelImpl( - new UtilDateModel(new Date()), pickerStrings), + startTimePanel.setLayout(new BoxLayout(startTimePanel, BoxLayout.LINE_AXIS)); + dtpStartDate = new QDatePickerImpl(new JDatePanelImpl(new UtilDateModel(new Date()), pickerStrings), new DateLabelFormatter()); spnStartTime = makeTimeSpinner(23, 59); startTimePanel.add(dtpStartDate); @@ -275,10 +261,9 @@ public abstract class LectureDetailsWindowLayout extends JDialog { // end time of the lecture JPanel endTimePanel = new JPanel(); - endTimePanel - .setLayout(new BoxLayout(endTimePanel, BoxLayout.LINE_AXIS)); - dtpEndDate = new QDatePickerImpl(new JDatePanelImpl(new UtilDateModel( - new Date()), pickerStrings), new DateLabelFormatter()); + endTimePanel.setLayout(new BoxLayout(endTimePanel, BoxLayout.LINE_AXIS)); + dtpEndDate = new QDatePickerImpl(new JDatePanelImpl(new UtilDateModel(new Date()), pickerStrings), + new DateLabelFormatter()); spnEndTime = makeTimeSpinner(00, 59); endTimePanel.add(dtpEndDate); endTimePanel.add(spnEndTime); @@ -296,35 +281,49 @@ public abstract class LectureDetailsWindowLayout extends JDialog { grdGeneral.finish(true); pnlTabRestrictions = new JPanel(); - GridManager grdRestrictions = new GridManager(pnlTabRestrictions, 3, true, - new Insets(3, 3, 3, 3)); + GridManager grdRestrictions = new GridManager(pnlTabRestrictions, 2, true, new Insets(9, 4, 2, 4)); + Insets descriptionInset = new Insets(2, 4, 2, 4); + Insets firstInset = new Insets(12, 4, 2, 4); // "restrictions": internet access / usb access / exam - grdRestrictions.add(new JLabel("Internetzugriff")); - btnNetrules = new JButton("Ausnahmen"); - chkHasInternetAccess = new JCheckBox("zulassen"); - grdRestrictions.add(new WordWrapLabel("Legen Sie hier fest, ob die Veranstaltung Zugriff zum Internet haben soll", false, true), 2).fill(true, false).expand(true, false); + chkHasInternetAccess = new JCheckBox("Netzwerk-/Internetzugriff zulassen"); + btnNetrules = new JButton("Ausnahmen..."); + grdRestrictions.add(chkHasInternetAccess).fill(true, false).expand(true, false).insets(firstInset); + grdRestrictions.add(btnNetrules).fill(true, false).expand(true, false).insets(firstInset); grdRestrictions.nextRow(); - grdRestrictions.skip(); - grdRestrictions.add(chkHasInternetAccess).fill(true, false).expand(true, false); - grdRestrictions.add(btnNetrules).fill(true, false).expand(true, false); + grdRestrictions.add( + new WordWrapLabel( + "Legen Sie hier fest, ob die Veranstaltung Zugriff zum Internet haben soll." + + " Unter 'Ausnahmen' können Sie bestimmte Adressen und Services" + + " ein- oder ausschließen.", false, true), 2) + .fill(true, false) + .expand(true, false) + .insets(descriptionInset); grdRestrictions.nextRow(); - grdRestrictions.add(new JLabel("Speichermedien")); - chkHasUsbAccess = new JCheckBox("zulassen"); - grdRestrictions.add(new WordWrapLabel("Legen Sie hier fest, ob die Veranstaltung den Zugriff auf Speichermedien (CD, USB, ...) erlauben soll", false, true), 2).fill(true, false).expand(true, false); - grdRestrictions.nextRow(); - grdRestrictions.skip(); + chkHasUsbAccess = new JCheckBox("Externe Speichermedien zulassen"); grdRestrictions.add(chkHasUsbAccess, 2); grdRestrictions.nextRow(); - - grdRestrictions.add(new JLabel("Prüfung")); - chkIsExam = new JCheckBox("aktiv"); - grdRestrictions.add(new WordWrapLabel("Markieren Sie diese Veranstaltung als E-Prüfung", false, true), 2).fill(true, false).expand(true, false); + grdRestrictions.add( + new WordWrapLabel("Legen Sie hier fest, ob die Veranstaltung den Zugriff" + + " auf Speichermedien (CD, USB, ...) erlauben soll", false, true), 2) + .fill(true, false) + .expand(true, false) + .insets(descriptionInset); grdRestrictions.nextRow(); - grdRestrictions.skip(); + + chkIsExam = new JCheckBox("Prüfungsmodus"); grdRestrictions.add(chkIsExam, 2); - btnPermissions = new JButton("Ändern"); + grdRestrictions.nextRow(); + grdRestrictions.add( + new WordWrapLabel( + "Markieren Sie diese Veranstaltung als E-Prüfung.\n" + + "Die Veranstaltung wird nur dann startbar sein, wenn bwLehrpool in den" + + " Prüfungsmodus versetzt wird. Kontaktieren Sie dazu Ihren lokalen bwLehrpool-Administrator.", + false, true), 2) + .fill(true, false) + .expand(true, false) + .insets(descriptionInset); grdRestrictions.finish(true); /* ******************************************************************************* @@ -353,7 +352,7 @@ public abstract class LectureDetailsWindowLayout extends JDialog { ********************************************************************************/ ctlLocationSelector = new LocationSelector(); pnlTabLocations = new JPanel(); - GridManager grdLocations = new GridManager(pnlTabLocations, 1, false); + GridManager grdLocations = new GridManager(pnlTabLocations, 1, false); grdLocations.add(ctlLocationSelector).fill(true, true).expand(true, true); grdLocations.finish(false); @@ -364,7 +363,7 @@ public abstract class LectureDetailsWindowLayout extends JDialog { ********************************************************************************/ ctlRunscriptConfigurator = new RunscriptConfigurator(); pnlTabRunscript = new JPanel(); - GridManager grdAdvanced = new GridManager(pnlTabRunscript, 1, false); + GridManager grdAdvanced = new GridManager(pnlTabRunscript, 1, false); grdAdvanced.add(ctlRunscriptConfigurator).fill(true, true).expand(true, true); grdAdvanced.finish(false); @@ -413,8 +412,7 @@ public abstract class LectureDetailsWindowLayout extends JDialog { model.setValue(calendar.getTime()); JSpinner spinner = new JSpinner(model); JSpinner.DateEditor editor = new JSpinner.DateEditor(spinner, "HH:mm"); - DateFormatter formatter = (DateFormatter) editor.getTextField() - .getFormatter(); + DateFormatter formatter = (DateFormatter) editor.getTextField().getFormatter(); formatter.setAllowsInvalid(false); formatter.setOverwriteMode(true); spinner.setEditor(editor); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/LectureOptionsPageLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/LectureOptionsPageLayout.java index a0baef9b..51ac6491 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/LectureOptionsPageLayout.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/LectureOptionsPageLayout.java @@ -1,7 +1,6 @@ package org.openslx.dozmod.gui.wizard.layout; import javax.swing.Box; -import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JLabel; @@ -54,8 +53,8 @@ public abstract class LectureOptionsPageLayout extends WizardPage { JLabel lblRestriction = new JLabel("Beschränkungen"); grid.add(lblRestriction); - chkInternetEnabled = new JCheckBox("Internetzugriff", true); - btnNetrules = new JButton("Ausnahmen"); + chkInternetEnabled = new JCheckBox("Netzwerk-/Internetzugriff zulassen", true); + btnNetrules = new JButton("Ausnahmen..."); grid.add(chkInternetEnabled).fill(true, false).expand(true, false); grid.add(btnNetrules); grid.nextRow(); |