331db12386575e6cf9bf94e9cfdb0dad4870ede6
[Mograsim.git] / net.mograsim.logic.model / src / net / mograsim / logic / model / model / components / submodels / SubmodelInterface.java
1 package net.mograsim.logic.model.model.components.submodels;
2
3 import net.haspamelodica.swt.helper.gcs.GeneralGC;
4 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
5 import net.mograsim.logic.model.model.LogicModelModifiable;
6 import net.mograsim.logic.model.model.components.ModelComponent;
7 import net.mograsim.logic.model.model.wires.Pin;
8 import net.mograsim.logic.model.serializing.IdentifyParams;
9
10 public class SubmodelInterface extends ModelComponent
11 {
12         public SubmodelInterface(LogicModelModifiable model)
13         {
14                 super(model, SubmodelComponent.SUBMODEL_INTERFACE_NAME, true);
15         }
16
17         @Override
18         public void render(GeneralGC gc, Rectangle visibleRegion)
19         {// nothing to do here
20         }
21
22         @Override
23         public String getIDForSerializing(IdentifyParams idParams)
24         {
25                 throw new UnsupportedOperationException("A SubmodelInterface can't be serialized. Use SubmodelComponent.addSubmodelInterface");
26         }
27
28         /**
29          * {@inheritDoc}<br>
30          * This method is only marked public in {@link SubmodelInterface} for {@link SubmodelComponent} to be able to add / remove pins to /
31          * from a SubmodelInterface.<br>
32          * 
33          * @see ModelComponent#removePin(Pin)
34          * 
35          * @author Daniel Kirschten
36          */
37         @Override
38         public void addPin(Pin pin)
39         {
40                 super.addPin(pin);
41         }
42
43         /**
44          * {@inheritDoc}<br>
45          * This method is only marked public in {@link SubmodelInterface} for {@link SubmodelComponent} to be able to add / remove pins to /
46          * from a SubmodelInterface.<br>
47          * 
48          * @see ModelComponent#removePin(Pin)
49          * 
50          * @author Daniel Kirschten
51          */
52         @Override
53         protected void removePin(String name)
54         {
55                 super.removePin(name);
56         }
57 }