*/
protected void componentCreated(ModelComponent component, Runnable destroyed)
{
- if (components.containsKey(component.name))
+ if (components.containsKey(component.getName()))
throw new IllegalStateException("Don't add the same component twice!");
- components.put(component.name, component);
- componentDestroyFunctions.put(component.name, destroyed);
+ components.put(component.getName(), component);
+ componentDestroyFunctions.put(component.getName(), destroyed);
callComponentAddedListeners(component);
requestRedraw();
}
*/
protected void destroyComponent(ModelComponent component)
{
- componentDestroyFunctions.get(component.name).run();
- if (!components.containsKey(component.name))
+ componentDestroyFunctions.get(component.getName()).run();
+ if (!components.containsKey(component.getName()))
throw new IllegalStateException("Don't remove the same component twice!");
- components.remove(component.name);
+ components.remove(component.getName());
callComponentRemovedListeners(component);
requestRedraw();
}
/**
- * Adds the given wire to the list of wires and calls all wireAddedListeners.
+ * Adds the given wire to the list of wires and calls all wireAddedListeners. Don't call this method from application code as it is
+ * automatically called in {@link ModelWire}'s constructor.
*
* @author Daniel Kirschten
*/