projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed a problem with ModelComponent's names
[Mograsim.git]
/
net.mograsim.logic.model
/
src
/
net
/
mograsim
/
logic
/
model
/
model
/
LogicModel.java
diff --git
a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/LogicModel.java
b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/LogicModel.java
index
227d9b1
..
839d5f9
100644
(file)
--- a/
net.mograsim.logic.model/src/net/mograsim/logic/model/model/LogicModel.java
+++ b/
net.mograsim.logic.model/src/net/mograsim/logic/model/model/LogicModel.java
@@
-51,10
+51,10
@@
public class LogicModel
*/
protected void componentCreated(ModelComponent component, Runnable destroyed)
{
*/
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!");
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();
}
callComponentAddedListeners(component);
requestRedraw();
}
@@
-66,10
+66,10
@@
public class LogicModel
*/
protected void destroyComponent(ModelComponent component)
{
*/
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!");
throw new IllegalStateException("Don't remove the same component twice!");
- components.remove(component.
name
);
+ components.remove(component.
getName()
);
callComponentRemovedListeners(component);
requestRedraw();
}
callComponentRemovedListeners(component);
requestRedraw();
}