+ /**
+ * This method is called in {@link SubmodelComponent#getHighLevelState(String)} when the state ID is in the set of allowed atomic state
+ * IDs. <br>
+ * See {@link GUIComponent#setHighLevelState(String, Object)} for details about atomic state IDs.
+ *
+ * @author Daniel Kirschten
+ */
+ @SuppressWarnings("static-method") // this method is intended to be overridden
+ protected Object getAtomicHighLevelState(String stateID)
+ {
+ throw new IllegalStateException("Unknown high level state ID: " + stateID);
+ }
+
+ private static void checkHighLevelStateIDPart(String stateIDPart)
+ {
+ if (stateIDPart.indexOf('.') != -1)
+ throw new IllegalArgumentException("Illegal high level state ID part (contains dot): " + stateIDPart);
+
+ }
+
+ // "graphical" operations
+
+ /**
+ * Sets the factor by which the submodel is scaled when rendering and calls redrawListeners. Note that the submodel interface pins will
+ * stay at their position relative to the supermodel, which means they will move relative to the submodel.
+ *
+ * @author Daniel Kirschten
+ */
+ protected void setSubmodelScale(double submodelScale)
+ {
+ this.submodelScale = submodelScale;
+
+ for (Entry<String, MovablePin> e : supermodelPins.entrySet())
+ getSubmodelMovablePin(e.getKey()).setRelPos(e.getValue().getRelX() * submodelScale, e.getValue().getRelY() * submodelScale);
+
+ requestRedraw();// needed if there is no submodel interface pin
+ }
+
+ /**
+ * Returns the current factor by which the submodel is scaled when rendering.
+ *
+ * @author Daniel Kirschten
+ */
+ protected double getSubmodelScale()
+ {
+ return submodelScale;
+ }
+
+ @Override
+ public void render(GeneralGC gc, Rectangle visibleRegion)
+ {