+ /**
+ * Adds the given component to the list of components and calls all componentAddedListeners. Don't call this method from application
+ * code as it is automatically called in GUIComponent::new.
+ */
+ public void wireCreated(GUIWire wire)
+ {
+ if (wires.contains(wire))
+ throw new IllegalStateException("Don't add the same wire twice!");
+ wires.add(wire);
+ callWireAddedListeners(wire);
+ }
+
+ /**
+ * Removes the given component from the list of components and calls all componentRemovedListeners. Don't call this method from
+ * application code as it is automatically called in GUIComponent::destroy.
+ */
+ public void wireDestroyed(GUIWire wire)
+ {
+ if (!wires.contains(wire))
+ throw new IllegalStateException("Don't remove the same wire twice!");
+ wires.remove(wire);
+ callWireRemovedListeners(wire);
+ }
+
+ public List<GUIComponent> getComponents()
+ {
+ return componentsUnmodifiable;
+ }
+
+ public List<GUIWire> getWires()
+ {
+ return wiresUnmodifiable;
+ }
+