projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Timeline updated (executeUntil, setTimeFunction)
[Mograsim.git]
/
LogicUI
/
src
/
era
/
mi
/
gui
/
components
/
GUIManualSwitch.java
diff --git
a/LogicUI/src/era/mi/gui/components/GUIManualSwitch.java
b/LogicUI/src/era/mi/gui/components/GUIManualSwitch.java
index
a4d0c23
..
ff674c5
100644
(file)
--- a/
LogicUI/src/era/mi/gui/components/GUIManualSwitch.java
+++ b/
LogicUI/src/era/mi/gui/components/GUIManualSwitch.java
@@
-6,9
+6,11
@@
import java.util.HashMap;
import java.util.List;
\r
import java.util.Map;
\r
\r
import java.util.List;
\r
import java.util.Map;
\r
\r
-import era.mi.logic.Bit;
\r
import era.mi.logic.components.ManualSwitch;
\r
import era.mi.logic.components.ManualSwitch;
\r
-import era.mi.logic.wires.WireArray;
\r
+import era.mi.logic.timeline.Timeline;
\r
+import era.mi.logic.types.Bit;
\r
+import era.mi.logic.wires.Wire.ReadEnd;
\r
+import era.mi.logic.wires.Wire.ReadWriteEnd;
\r
import net.haspamelodica.swt.helper.gcs.GeneralGC;
\r
import net.haspamelodica.swt.helper.swtobjectwrappers.Font;
\r
import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
\r
import net.haspamelodica.swt.helper.gcs.GeneralGC;
\r
import net.haspamelodica.swt.helper.swtobjectwrappers.Font;
\r
import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
\r
@@
-28,24
+30,24
@@
public class GUIManualSwitch extends ManualSwitch implements BasicGUIComponent
bitNames = Collections.unmodifiableMap(bitNamesModifiable);
\r
}
\r
\r
bitNames = Collections.unmodifiableMap(bitNamesModifiable);
\r
}
\r
\r
- private final
WireArray wa
;
\r
- private final List<
WireArray> connectedWireArray
s;
\r
- private final List<Point> wire
Array
ConnectionPoints;
\r
+ private final
ReadEnd we
;
\r
+ private final List<
ReadEnd> connectedWireEnd
s;
\r
+ private final List<Point> wire
End
ConnectionPoints;
\r
\r
\r
- public GUIManualSwitch(
WireArray
output)
\r
+ public GUIManualSwitch(
Timeline timeline, ReadWriteEnd
output)
\r
{
\r
{
\r
- super(output);
\r
+ super(
timeline,
output);
\r
\r
\r
- this.w
a
= output;
\r
+ this.w
e
= output;
\r
\r
\r
- List<
WireArray> connectedWireArray
sModifiable = new ArrayList<>();
\r
- List<Point> wire
Array
ConnectionPointsModifiable = new ArrayList<>();
\r
+ List<
ReadEnd> connectedWireEnd
sModifiable = new ArrayList<>();
\r
+ List<Point> wire
End
ConnectionPointsModifiable = new ArrayList<>();
\r
\r
\r
- connectedWire
Array
sModifiable.add(output);
\r
- wire
Array
ConnectionPointsModifiable.add(new Point(20, 7.5));
\r
+ connectedWire
End
sModifiable.add(output);
\r
+ wire
End
ConnectionPointsModifiable.add(new Point(20, 7.5));
\r
\r
\r
- this.connectedWire
Arrays = Collections.unmodifiableList(connectedWireArray
sModifiable);
\r
- this.wire
ArrayConnectionPoints = Collections.unmodifiableList(wireArray
ConnectionPointsModifiable);
\r
+ this.connectedWire
Ends = Collections.unmodifiableList(connectedWireEnd
sModifiable);
\r
+ this.wire
EndConnectionPoints = Collections.unmodifiableList(wireEnd
ConnectionPointsModifiable);
\r
}
\r
\r
@Override
\r
}
\r
\r
@Override
\r
@@
-58,7
+60,7
@@
public class GUIManualSwitch extends ManualSwitch implements BasicGUIComponent
public void render(GeneralGC gc)
\r
{
\r
gc.drawRectangle(0, 0, 20, 15);
\r
public void render(GeneralGC gc)
\r
{
\r
gc.drawRectangle(0, 0, 20, 15);
\r
- String label = bitNames.get(w
a
.getValue());
\r
+ String label = bitNames.get(w
e
.getValue());
\r
Font oldFont = gc.getFont();
\r
Font labelFont = new Font(oldFont.getName(), 6, oldFont.getStyle());
\r
gc.setFont(labelFont);
\r
Font oldFont = gc.getFont();
\r
Font labelFont = new Font(oldFont.getName(), 6, oldFont.getStyle());
\r
gc.setFont(labelFont);
\r
@@
-70,25
+72,25
@@
public class GUIManualSwitch extends ManualSwitch implements BasicGUIComponent
@Override
\r
public boolean clicked(double x, double y)
\r
{
\r
@Override
\r
public boolean clicked(double x, double y)
\r
{
\r
- t
oggle(
);
\r
+ t
imeline.addEvent((e) -> toggle(), (int) (System.currentTimeMillis() - timeline.getSimulationTime())
);
\r
return true;
\r
}
\r
\r
@Override
\r
return true;
\r
}
\r
\r
@Override
\r
- public int getConnectedWire
Array
sCount()
\r
+ public int getConnectedWire
End
sCount()
\r
{
\r
{
\r
- return connectedWire
Array
s.size();
\r
+ return connectedWire
End
s.size();
\r
}
\r
\r
@Override
\r
}
\r
\r
@Override
\r
- public
WireArray getConnectedWireArray
(int connectionIndex)
\r
+ public
ReadEnd getConnectedWireEnd
(int connectionIndex)
\r
{
\r
{
\r
- return connectedWire
Array
s.get(connectionIndex);
\r
+ return connectedWire
End
s.get(connectionIndex);
\r
}
\r
\r
@Override
\r
}
\r
\r
@Override
\r
- public Point getWire
Array
ConnectionPoint(int connectionI)
\r
+ public Point getWire
End
ConnectionPoint(int connectionI)
\r
{
\r
{
\r
- return wire
Array
ConnectionPoints.get(connectionI);
\r
+ return wire
End
ConnectionPoints.get(connectionI);
\r
}
\r
}
\ No newline at end of file
}
\r
}
\ No newline at end of file