From be61c6453178f9383bcbeb2d2071618cd4dc4388 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 9 Sep 2016 15:32:39 +0200 Subject: [client] minor: update commentaries of NetrulesConfigurator --- .../dozmod/gui/control/NetrulesConfigurator.java | 31 ++++++++-------------- 1 file changed, 11 insertions(+), 20 deletions(-) (limited to 'dozentenmodul/src/main/java') 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 040fc6eb..793e6e4a 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 @@ -30,7 +30,7 @@ import org.openslx.dozmod.gui.helper.MessageType; import org.openslx.dozmod.gui.helper.TextChangeListener; /** - * Widget for netrules configuration options for lectures + * Widget for netrules configuration of lectures */ public class NetrulesConfigurator extends NetrulesConfiguratorLayout { @@ -66,25 +66,20 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout { } /** - * Gets the state of the widget. This will first try to parse the - * tpNetworkRules and taRunScript and build the corresponding - * AdvancedConfiguration Object returned. + * Gets the state of the widget as a list of netrules. Internally it first transforms + * the input text in a list of netrules. * - * @return advanced configuration object composed of the parsed network - * rules as List and the raw runscript text as String - * @see org.openslx.dozmod.gui.control.NetrulesConfigurator.AdvancedConfiguration + * @return the list of rules as parsed by parseNetRules() */ public List getState() { // cleanup the TextPane for network rules if needed String input = tpNetworkRules.getText().trim(); - final List rules = parseNetRules(input); - return rules; + return parseNetRules(input); } /** - * Sets the state of this widget to the given AdvancedConfiguration. Basicly - * this sets the content of the text areas to the corresponding network - * rules/runscript as given by the AdvancedConfiguration object + * Sets the state of this widget to the given list of netrules. This will internally + * transform the list to its string representation * * @param config * AdvancedConfiguration to set the state to @@ -129,14 +124,11 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout { } /** - * Parsed the given rawNetRules String to a list of NetRule + * Parses the given rawNetRules String to a list of NetRule * * @param rawNetRules * the raw text to be parsed - * @return list of valid net rules parsed from the given rawNetRules, - * invalid ones are not included - * @throws Exception - * when parsing fails + * @return list of netrules if successful. If any errors occured while parsing, null is returned. */ public List parseNetRules(final String rawNetRules) { if (rawNetRules == null) @@ -340,7 +332,7 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout { } /** - * Custom event mechanism to detect changes to the user list (Mostly needed + * Custom event mechanism to detect changes to the netrules list (Mostly needed * for the reactToChange() stuff in LectureDetailsWindow) */ protected EventListenerList listenerList = new EventListenerList(); @@ -384,8 +376,7 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout { } /** - * Internal layout class for the advanced configurator (to keep it clean even - * for widgets) + * Internal layout class for this widget */ class NetrulesConfiguratorLayout extends JPanel { -- cgit v1.2.3-55-g7522