Made get/setHighLevelState ordering uniform: get... comes before set...
[Mograsim.git] / net.mograsim.logic.model / src / net / mograsim / logic / model / model / components / GUIComponent.java
index 1b97cd3..382d7e3 100644 (file)
@@ -14,11 +14,13 @@ import net.haspamelodica.swt.helper.gcs.GeneralGC;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.model.model.ViewModelModifiable;
 import net.mograsim.logic.model.model.wires.Pin;
-import net.mograsim.logic.model.serializing.snippets.HighLevelStateHandler;
+import net.mograsim.logic.model.snippets.HighLevelStateHandler;
 
 /**
  * The base class for all GUI components.<br>
- * A <code>GUIComponent</code> has a position and size. The size can only be modified by subclasses.<br>
+ * A <code>GUIComponent</code> has a reference to the ViewModel it belongs to.<br>
+ * A <code>GUIComponent</code> has a name. This name is unique in the model the <code>GUIComponent</code> belongs to.<br>
+ * A <code>GUIComponent</code> has a position and size. The size can only be modified by subclasses.
  * 
  * @author Daniel Kirschten
  */
@@ -29,7 +31,7 @@ public abstract class GUIComponent
         */
        protected final ViewModelModifiable model;
        /**
-        * The name of this component. Is unique in its model.
+        * The name of this component. Is unique for all components in its model.
         */
        public final String name;
        private final Rectangle bounds;
@@ -147,31 +149,31 @@ public abstract class GUIComponent
        // high-level access
 
        /**
-        * Sets the given high-level state to the given value. <br>
-        * See {@link HighLevelStateHandler#setHighLevelState(String, Object)} for an explanation of high-level state IDs.
+        * Gets the current value of the given high-level state. <br>
+        * See {@link HighLevelStateHandler} for an explanation of high-level state IDs.
         * 
-        * @see #getHighLevelState(String)
-        * @see HighLevelStateHandler#setHighLevelState(String, Object)
+        * @see #setHighLevelState(String, Object)
+        * @see HighLevelStateHandler#getHighLevelState(String)
         * 
         * @author Daniel Kirschten
         */
-       @SuppressWarnings({ "static-method", "unused" }) // this method is intended to be overridden
-       public void setHighLevelState(String stateID, Object newState)
+       @SuppressWarnings("static-method") // this method is intended to be overridden
+       public Object getHighLevelState(String stateID)
        {
                throw new IllegalArgumentException("No high level state with ID " + stateID);
        }
 
        /**
-        * Gets the current value of the given high-level state. <br>
-        * See {@link HighLevelStateHandler#setHighLevelState(String, Object)} for an explanation of high-level state IDs.
+        * Sets the given high-level state to the given value. <br>
+        * See {@link HighLevelStateHandler} for an explanation of high-level state IDs.
         * 
-        * @see #setHighLevelState(String, Object)
-        * @see HighLevelStateHandler#getHighLevelState(String)
+        * @see #getHighLevelState(String)
+        * @see HighLevelStateHandler#setHighLevelState(String, Object)
         * 
         * @author Daniel Kirschten
         */
-       @SuppressWarnings("static-method") // this method is intended to be overridden
-       public Object getHighLevelState(String stateID)
+       @SuppressWarnings({ "static-method", "unused" }) // this method is intended to be overridden
+       public void setHighLevelState(String stateID, Object newState)
        {
                throw new IllegalArgumentException("No high level state with ID " + stateID);
        }
@@ -277,7 +279,7 @@ public abstract class GUIComponent
        // serializing
 
        @SuppressWarnings("static-method") // this method is intended to be overridden
-       public JsonElement getParams()
+       public JsonElement getParamsForSerializing()
        {
                return JsonNull.INSTANCE;
        }