projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Wires connected to a component now get deleted with the component
[Mograsim.git]
/
net.mograsim.logic.model
/
src
/
net
/
mograsim
/
logic
/
model
/
model
/
components
/
submodels
/
SubmodelComponent.java
diff --git
a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/submodels/SubmodelComponent.java
b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/submodels/SubmodelComponent.java
index
7eaba80
..
4a2f46c
100644
(file)
--- a/
net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/submodels/SubmodelComponent.java
+++ b/
net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/submodels/SubmodelComponent.java
@@
-11,8
+11,8
@@
import net.haspamelodica.swt.helper.gcs.GeneralGC;
import net.haspamelodica.swt.helper.gcs.TranslatedGC;
import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
import net.mograsim.logic.model.LogicUIRenderer;
import net.haspamelodica.swt.helper.gcs.TranslatedGC;
import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
import net.mograsim.logic.model.LogicUIRenderer;
-import net.mograsim.logic.model.model.
View
Model;
-import net.mograsim.logic.model.model.
View
ModelModifiable;
+import net.mograsim.logic.model.model.
Logic
Model;
+import net.mograsim.logic.model.model.
Logic
ModelModifiable;
import net.mograsim.logic.model.model.components.ModelComponent;
import net.mograsim.logic.model.model.wires.MovablePin;
import net.mograsim.logic.model.model.wires.Pin;
import net.mograsim.logic.model.model.components.ModelComponent;
import net.mograsim.logic.model.model.wires.MovablePin;
import net.mograsim.logic.model.model.wires.Pin;
@@
-35,11
+35,11
@@
public abstract class SubmodelComponent extends ModelComponent
/**
* A modifiable view of {@link #submodel}.
*/
/**
* A modifiable view of {@link #submodel}.
*/
- protected final
View
ModelModifiable submodelModifiable;
+ protected final
Logic
ModelModifiable submodelModifiable;
/**
* The model this {@link SubmodelComponent} consists of.
*/
/**
* The model this {@link SubmodelComponent} consists of.
*/
- public final
View
Model submodel;
+ public final
Logic
Model submodel;
/**
* The list of all submodel interface pins of this {@link SubmodelComponent} on the submodel side.
*/
/**
* The list of all submodel interface pins of this {@link SubmodelComponent} on the submodel side.
*/
@@
-99,10
+99,10
@@
public abstract class SubmodelComponent extends ModelComponent
// creation and destruction
// creation and destruction
- public SubmodelComponent(
View
ModelModifiable model, String name)
+ public SubmodelComponent(
Logic
ModelModifiable model, String name)
{
super(model, name);
{
super(model, name);
- this.submodelModifiable = new
View
ModelModifiable();
+ this.submodelModifiable = new
Logic
ModelModifiable();
this.submodel = submodelModifiable;
this.submodelPins = new HashMap<>();
this.submodelMovablePinsUnmodifiable = Collections.unmodifiableMap(submodelPins);
this.submodel = submodelModifiable;
this.submodelPins = new HashMap<>();
this.submodelMovablePinsUnmodifiable = Collections.unmodifiableMap(submodelPins);
@@
-159,7
+159,7
@@
public abstract class SubmodelComponent extends ModelComponent
default:
throw new IllegalArgumentException("Unknown enum constant: " + supermodelPin.usage);
}
default:
throw new IllegalArgumentException("Unknown enum constant: " + supermodelPin.usage);
}
- MovablePin submodelPin = new MovablePin(submodelInterface, name, supermodelPin.logicWidth, submodelPinUsage,
+ MovablePin submodelPin = new MovablePin(
model,
submodelInterface, name, supermodelPin.logicWidth, submodelPinUsage,
supermodelPin.getRelX() / submodelScale, supermodelPin.getRelY() / submodelScale);
submodelPin.addPinMovedListener(p ->
supermodelPin.getRelX() / submodelScale, supermodelPin.getRelY() / submodelScale);
submodelPin.addPinMovedListener(p ->