projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Created first version of ViewLogicModelAdapter
[Mograsim.git]
/
LogicUI
/
src
/
era
/
mi
/
gui
/
model
/
components
/
SimpleRectangularGUIGate.java
diff --git
a/LogicUI/src/era/mi/gui/model/components/SimpleRectangularGUIGate.java
b/LogicUI/src/era/mi/gui/model/components/SimpleRectangularGUIGate.java
index
6edf164
..
eb396cc
100644
(file)
--- a/
LogicUI/src/era/mi/gui/model/components/SimpleRectangularGUIGate.java
+++ b/
LogicUI/src/era/mi/gui/model/components/SimpleRectangularGUIGate.java
@@
-1,6
+1,7
@@
package era.mi.gui.model.components;
import java.util.ArrayList;
package era.mi.gui.model.components;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import era.mi.gui.model.ViewModel;
import java.util.List;
import era.mi.gui.model.ViewModel;
@@
-25,6
+26,7
@@
public class SimpleRectangularGUIGate extends GUIComponent
private MovablePin outputPin;
private final List<Pin> inputPins;
private MovablePin outputPin;
private final List<Pin> inputPins;
+ private final List<Pin> inputPinsUnmodifiable;
protected SimpleRectangularGUIGate(ViewModel model, int logicWidth, String label, boolean isInverted)
{
protected SimpleRectangularGUIGate(ViewModel model, int logicWidth, String label, boolean isInverted)
{
@@
-36,6
+38,7
@@
public class SimpleRectangularGUIGate extends GUIComponent
this.outputPin = new MovablePin(this, logicWidth, width, 0);
addPin(outputPin);
this.inputPins = new ArrayList<>();
this.outputPin = new MovablePin(this, logicWidth, width, 0);
addPin(outputPin);
this.inputPins = new ArrayList<>();
+ this.inputPinsUnmodifiable = Collections.unmodifiableList(inputPins);
setInputCount(1);
}
setInputCount(1);
}
@@
-56,6
+59,16
@@
public class SimpleRectangularGUIGate extends GUIComponent
outputPin.setRelPos(width, inputCount * pinDistance / 2);
}
outputPin.setRelPos(width, inputCount * pinDistance / 2);
}
+ public Pin getOutputPin()
+ {
+ return outputPin;
+ }
+
+ public List<Pin> getInputPins()
+ {
+ return inputPinsUnmodifiable;
+ }
+
@Override
public void render(GeneralGC gc, Rectangle visibleRegion)
{
@Override
public void render(GeneralGC gc, Rectangle visibleRegion)
{