From 7af812f7c30eb407cae3235b7d19dc902727ef29 Mon Sep 17 00:00:00 2001 From: Daniel Kirschten Date: Thu, 30 May 2019 06:24:38 +0200 Subject: [PATCH] Renamed mograsim to net.mograsim --- LogicUI/.project | 4 +- LogicUI/META-INF/MANIFEST.MF | 22 +- .../componentadapters/ComponentAdapter.java | 18 -- .../mograsim/logic/ui/ColorHelper.java | 6 +- .../mograsim/logic/ui/LogicExecuter.java | 4 +- .../mograsim/logic/ui/LogicUICanvas.java | 226 +++++++++--------- .../logic/ui/LogicUIStandaloneGUI.java | 6 +- .../logic/ui/SimpleLogicUIStandalone.java | 10 +- .../logic/ui/examples/RSLatchExample.java | 18 +- .../mograsim/logic/ui/model/ViewModel.java | 6 +- .../logic/ui/model/components/GUIAndGate.java | 4 +- .../ui/model/components/GUIComponent.java | 6 +- .../ui/model/components/GUIManualSwitch.java | 12 +- .../logic/ui/model/components/GUINotGate.java | 4 +- .../logic/ui/model/components/GUIOrGate.java | 4 +- .../components/SimpleRectangularGUIGate.java | 8 +- .../logic/ui/model/wires/GUIWire.java | 10 +- .../logic/ui/model/wires/MovablePin.java | 4 +- .../mograsim/logic/ui/model/wires/Pin.java | 4 +- .../logic/ui/model/wires/WireCrossPoint.java | 12 +- .../ui/modeladapter/LogicModelParameters.java | 2 +- .../modeladapter/ViewLogicModelAdapter.java | 38 +-- .../componentadapters/ComponentAdapter.java | 18 ++ .../ManualSwitchAdapter.java | 18 +- .../componentadapters/SimpleGateAdapter.java | 18 +- SampleERCP/.project | 4 +- SampleERCP/Application.e4xmi | 22 +- SampleERCP/META-INF/MANIFEST.MF | 10 +- ...m.rcp.product => net.mograsim.rcp.product} | 18 +- SampleERCP/plugin.xml | 12 +- .../mograsim/rcp/handlers/AboutHandler.java | 2 +- .../mograsim/rcp/handlers/OpenHandler.java | 2 +- .../mograsim/rcp/handlers/QuitHandler.java | 2 +- .../mograsim/rcp/handlers/SaveHandler.java | 2 +- .../mograsim/rcp/parts/LogicUIPart.java | 16 +- .../mograsim/rcp/parts/SamplePart.java | 2 +- .../ExtensibleSplashHandler.java | 2 +- era.mi/.project | 2 +- era.mi/META-INF/MANIFEST.MF | 20 +- .../logic/core/components/gates/AndGate.java | 14 -- .../logic/core/components/gates/OrGate.java | 14 -- .../logic/core/wires/WireObserver.java | 9 - .../{ => net}/mograsim/logic/core/Util.java | 4 +- .../logic/core/components/BasicComponent.java | 10 +- .../logic/core/components/BitDisplay.java | 12 +- .../mograsim/logic/core/components/Clock.java | 16 +- .../logic/core/components/Component.java | 8 +- .../logic/core/components/Connector.java | 12 +- .../mograsim/logic/core/components/Demux.java | 10 +- .../logic/core/components/ManualSwitch.java | 10 +- .../logic/core/components/Merger.java | 14 +- .../mograsim/logic/core/components/Mux.java | 10 +- .../logic/core/components/Splitter.java | 12 +- .../logic/core/components/TriStateBuffer.java | 10 +- .../logic/core/components/gates/AndGate.java | 14 ++ .../core/components/gates/MultiInputGate.java | 14 +- .../logic/core/components/gates/NotGate.java | 10 +- .../logic/core/components/gates/OrGate.java | 14 ++ .../logic/core/components/gates/XorGate.java | 10 +- .../logic/core/tests/ComponentTest.java | 34 +-- .../mograsim/logic/core/tests/GUITest.java | 14 +- .../logic/core/tests/TestBitDisplay.java | 10 +- .../logic/core/timeline/Timeline.java | 2 +- .../logic/core/timeline/TimelineEvent.java | 2 +- .../core/timeline/TimelineEventHandler.java | 2 +- .../mograsim/logic/core/types/Bit.java | 2 +- .../mograsim/logic/core/types/BitVector.java | 2 +- .../logic/core/types/BitVectorFormatter.java | 6 +- .../logic/core/types/ColorDefinition.java | 2 +- .../mograsim/logic/core/types/LogicType.java | 2 +- .../logic/core/types/MutationOperation.java | 4 +- .../logic/core/types/StrictLogicType.java | 2 +- .../mograsim/logic/core/wires/Wire.java | 14 +- .../logic/core/wires/WireObserver.java | 9 + 74 files changed, 466 insertions(+), 466 deletions(-) delete mode 100644 LogicUI/src/mograsim/logic/ui/modeladapter/componentadapters/ComponentAdapter.java rename LogicUI/src/{ => net}/mograsim/logic/ui/ColorHelper.java (93%) rename LogicUI/src/{ => net}/mograsim/logic/ui/LogicExecuter.java (96%) rename LogicUI/src/{ => net}/mograsim/logic/ui/LogicUICanvas.java (90%) rename LogicUI/src/{ => net}/mograsim/logic/ui/LogicUIStandaloneGUI.java (90%) rename LogicUI/src/{ => net}/mograsim/logic/ui/SimpleLogicUIStandalone.java (76%) rename LogicUI/src/{ => net}/mograsim/logic/ui/examples/RSLatchExample.java (81%) rename LogicUI/src/{ => net}/mograsim/logic/ui/model/ViewModel.java (96%) rename LogicUI/src/{ => net}/mograsim/logic/ui/model/components/GUIAndGate.java (67%) rename LogicUI/src/{ => net}/mograsim/logic/ui/model/components/GUIComponent.java (96%) rename LogicUI/src/{ => net}/mograsim/logic/ui/model/components/GUIManualSwitch.java (84%) rename LogicUI/src/{ => net}/mograsim/logic/ui/model/components/GUINotGate.java (65%) rename LogicUI/src/{ => net}/mograsim/logic/ui/model/components/GUIOrGate.java (66%) rename LogicUI/src/{ => net}/mograsim/logic/ui/model/components/SimpleRectangularGUIGate.java (93%) rename LogicUI/src/{ => net}/mograsim/logic/ui/model/wires/GUIWire.java (90%) rename LogicUI/src/{ => net}/mograsim/logic/ui/model/wires/MovablePin.java (72%) rename LogicUI/src/{ => net}/mograsim/logic/ui/model/wires/Pin.java (93%) rename LogicUI/src/{ => net}/mograsim/logic/ui/model/wires/WireCrossPoint.java (75%) rename LogicUI/src/{ => net}/mograsim/logic/ui/modeladapter/LogicModelParameters.java (67%) rename LogicUI/src/{ => net}/mograsim/logic/ui/modeladapter/ViewLogicModelAdapter.java (82%) create mode 100644 LogicUI/src/net/mograsim/logic/ui/modeladapter/componentadapters/ComponentAdapter.java rename LogicUI/src/{ => net}/mograsim/logic/ui/modeladapter/componentadapters/ManualSwitchAdapter.java (55%) rename LogicUI/src/{ => net}/mograsim/logic/ui/modeladapter/componentadapters/SimpleGateAdapter.java (70%) rename SampleERCP/{mograsim.rcp.product => net.mograsim.rcp.product} (86%) rename SampleERCP/src/{ => net}/mograsim/rcp/handlers/AboutHandler.java (85%) rename SampleERCP/src/{ => net}/mograsim/rcp/handlers/OpenHandler.java (84%) rename SampleERCP/src/{ => net}/mograsim/rcp/handlers/QuitHandler.java (88%) rename SampleERCP/src/{ => net}/mograsim/rcp/handlers/SaveHandler.java (88%) rename SampleERCP/src/{ => net}/mograsim/rcp/parts/LogicUIPart.java (76%) rename SampleERCP/src/{ => net}/mograsim/rcp/parts/SamplePart.java (94%) rename SampleERCP/src/{ => net}/mograsim/rcp/splashhandlers/ExtensibleSplashHandler.java (95%) delete mode 100644 era.mi/src/mograsim/logic/core/components/gates/AndGate.java delete mode 100644 era.mi/src/mograsim/logic/core/components/gates/OrGate.java delete mode 100644 era.mi/src/mograsim/logic/core/wires/WireObserver.java rename era.mi/src/{ => net}/mograsim/logic/core/Util.java (97%) rename era.mi/src/{ => net}/mograsim/logic/core/components/BasicComponent.java (71%) rename era.mi/src/{ => net}/mograsim/logic/core/components/BitDisplay.java (66%) rename era.mi/src/{ => net}/mograsim/logic/core/components/Clock.java (65%) rename era.mi/src/{ => net}/mograsim/logic/core/components/Component.java (70%) rename era.mi/src/{ => net}/mograsim/logic/core/components/Connector.java (76%) rename era.mi/src/{ => net}/mograsim/logic/core/components/Demux.java (86%) rename era.mi/src/{ => net}/mograsim/logic/core/components/ManualSwitch.java (76%) rename era.mi/src/{ => net}/mograsim/logic/core/components/Merger.java (78%) rename era.mi/src/{ => net}/mograsim/logic/core/components/Mux.java (86%) rename era.mi/src/{ => net}/mograsim/logic/core/components/Splitter.java (75%) rename era.mi/src/{ => net}/mograsim/logic/core/components/TriStateBuffer.java (77%) create mode 100644 era.mi/src/net/mograsim/logic/core/components/gates/AndGate.java rename era.mi/src/{ => net}/mograsim/logic/core/components/gates/MultiInputGate.java (71%) rename era.mi/src/{ => net}/mograsim/logic/core/components/gates/NotGate.java (66%) create mode 100644 era.mi/src/net/mograsim/logic/core/components/gates/OrGate.java rename era.mi/src/{ => net}/mograsim/logic/core/components/gates/XorGate.java (50%) rename era.mi/src/{ => net}/mograsim/logic/core/tests/ComponentTest.java (90%) rename era.mi/src/{ => net}/mograsim/logic/core/tests/GUITest.java (91%) rename era.mi/src/{ => net}/mograsim/logic/core/tests/TestBitDisplay.java (74%) rename era.mi/src/{ => net}/mograsim/logic/core/timeline/Timeline.java (99%) rename era.mi/src/{ => net}/mograsim/logic/core/timeline/TimelineEvent.java (91%) rename era.mi/src/{ => net}/mograsim/logic/core/timeline/TimelineEventHandler.java (69%) rename era.mi/src/{ => net}/mograsim/logic/core/types/Bit.java (98%) rename era.mi/src/{ => net}/mograsim/logic/core/types/BitVector.java (99%) rename era.mi/src/{ => net}/mograsim/logic/core/types/BitVectorFormatter.java (89%) rename era.mi/src/{ => net}/mograsim/logic/core/types/ColorDefinition.java (97%) rename era.mi/src/{ => net}/mograsim/logic/core/types/LogicType.java (98%) rename era.mi/src/{ => net}/mograsim/logic/core/types/MutationOperation.java (68%) rename era.mi/src/{ => net}/mograsim/logic/core/types/StrictLogicType.java (90%) rename era.mi/src/{ => net}/mograsim/logic/core/wires/Wire.java (93%) create mode 100644 era.mi/src/net/mograsim/logic/core/wires/WireObserver.java diff --git a/LogicUI/.project b/LogicUI/.project index 9ba08bbd..8ce0afd8 100644 --- a/LogicUI/.project +++ b/LogicUI/.project @@ -1,9 +1,9 @@ - mograsim.logic.ui + net.mograsim.logic.ui - mograsim.logic.core + net.mograsim.logic.core SWTZoomableCanvas diff --git a/LogicUI/META-INF/MANIFEST.MF b/LogicUI/META-INF/MANIFEST.MF index c1dcd55a..24a1c9a2 100644 --- a/LogicUI/META-INF/MANIFEST.MF +++ b/LogicUI/META-INF/MANIFEST.MF @@ -1,17 +1,17 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 -Bundle-Name: mograsim.logic.ui -Bundle-SymbolicName: mograsim.logic.ui;singleton:=true +Bundle-Name: net.mograsim.logic.ui +Bundle-SymbolicName: net.mograsim.logic.ui;singleton:=true Bundle-Version: 1.0.0 -Export-Package: mograsim.logic.ui, - mograsim.logic.ui.examples, - mograsim.logic.ui.model, - mograsim.logic.ui.model.components, - mograsim.logic.ui.model.wires, - mograsim.logic.ui.modeladapter, - mograsim.logic.ui.modeladapter.componentadapters +Export-Package: net.mograsim.logic.ui, + net.mograsim.logic.ui.examples, + net.mograsim.logic.ui.model, + net.mograsim.logic.ui.model.components, + net.mograsim.logic.ui.model.wires, + net.mograsim.logic.ui.modeladapter, + net.mograsim.logic.ui.modeladapter.componentadapters Bundle-RequiredExecutionEnvironment: JavaSE-10 Require-Bundle: org.eclipse.swt;bundle-version="3.110.0", SWTZoomableCanvas;bundle-version="1.0.0";visibility:=reexport, - mograsim.logic.core;bundle-version="1.0.0";visibility:=reexport -Automatic-Module-Name: mograsim.logic.ui + net.mograsim.logic.core;bundle-version="1.0.0";visibility:=reexport +Automatic-Module-Name: net.mograsim.logic.ui diff --git a/LogicUI/src/mograsim/logic/ui/modeladapter/componentadapters/ComponentAdapter.java b/LogicUI/src/mograsim/logic/ui/modeladapter/componentadapters/ComponentAdapter.java deleted file mode 100644 index 9be1b96e..00000000 --- a/LogicUI/src/mograsim/logic/ui/modeladapter/componentadapters/ComponentAdapter.java +++ /dev/null @@ -1,18 +0,0 @@ -package mograsim.logic.ui.modeladapter.componentadapters; - -import java.util.Map; - -import mograsim.logic.core.components.Component; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.wires.Wire; -import mograsim.logic.ui.model.components.GUIComponent; -import mograsim.logic.ui.model.wires.Pin; -import mograsim.logic.ui.modeladapter.LogicModelParameters; - -public interface ComponentAdapter -{ - public Class getSupportedClass(); - - public Component createAndLinkComponent(Timeline timeline, LogicModelParameters params, G guiComponent, - Map logicWiresPerPin); -} \ No newline at end of file diff --git a/LogicUI/src/mograsim/logic/ui/ColorHelper.java b/LogicUI/src/net/mograsim/logic/ui/ColorHelper.java similarity index 93% rename from LogicUI/src/mograsim/logic/ui/ColorHelper.java rename to LogicUI/src/net/mograsim/logic/ui/ColorHelper.java index 886c6f76..b6315072 100644 --- a/LogicUI/src/mograsim/logic/ui/ColorHelper.java +++ b/LogicUI/src/net/mograsim/logic/ui/ColorHelper.java @@ -1,4 +1,4 @@ -package mograsim.logic.ui; +package net.mograsim.logic.ui; import java.util.function.Consumer; import java.util.function.Supplier; @@ -7,9 +7,9 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Device; -import mograsim.logic.core.types.ColorDefinition; -import mograsim.logic.core.types.ColorDefinition.BuiltInColor; import net.haspamelodica.swt.helper.gcs.GeneralGC; +import net.mograsim.logic.core.types.ColorDefinition; +import net.mograsim.logic.core.types.ColorDefinition.BuiltInColor; //TODO replace with a proper ColorManager public class ColorHelper diff --git a/LogicUI/src/mograsim/logic/ui/LogicExecuter.java b/LogicUI/src/net/mograsim/logic/ui/LogicExecuter.java similarity index 96% rename from LogicUI/src/mograsim/logic/ui/LogicExecuter.java rename to LogicUI/src/net/mograsim/logic/ui/LogicExecuter.java index dec5c53a..fadfbe94 100644 --- a/LogicUI/src/mograsim/logic/ui/LogicExecuter.java +++ b/LogicUI/src/net/mograsim/logic/ui/LogicExecuter.java @@ -1,9 +1,9 @@ -package mograsim.logic.ui; +package net.mograsim.logic.ui; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; -import mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.timeline.Timeline; //TODO maybe move to logic core? public class LogicExecuter diff --git a/LogicUI/src/mograsim/logic/ui/LogicUICanvas.java b/LogicUI/src/net/mograsim/logic/ui/LogicUICanvas.java similarity index 90% rename from LogicUI/src/mograsim/logic/ui/LogicUICanvas.java rename to LogicUI/src/net/mograsim/logic/ui/LogicUICanvas.java index 2dd89a35..3a080973 100644 --- a/LogicUI/src/mograsim/logic/ui/LogicUICanvas.java +++ b/LogicUI/src/net/mograsim/logic/ui/LogicUICanvas.java @@ -1,114 +1,114 @@ -package mograsim.logic.ui; - -import java.util.function.Consumer; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; - -import mograsim.logic.ui.model.ViewModel; -import mograsim.logic.ui.model.components.GUIComponent; -import mograsim.logic.ui.model.wires.GUIWire; -import mograsim.logic.ui.model.wires.Pin; -import net.haspamelodica.swt.helper.gcs.GeneralGC; -import net.haspamelodica.swt.helper.swtobjectwrappers.Point; -import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle; -import net.haspamelodica.swt.helper.zoomablecanvas.ZoomableCanvas; - -/** - * Simulation visualizer canvas. - * - * @author Daniel Kirschten - */ -public class LogicUICanvas extends ZoomableCanvas -{ - private static final boolean DRAW_PINS = false; - - private final ViewModel model; - - public LogicUICanvas(Composite parent, int style, ViewModel model) - { - super(parent, style); - - this.model = model; - - Consumer redrawConsumer = o -> redrawThreadsafe(); - Consumer pinAddedListener = p -> - { - p.addPinMovedListener(redrawConsumer); - redrawThreadsafe(); - }; - Consumer pinRemovedListener = p -> - { - p.removePinMovedListener(redrawConsumer); - redrawThreadsafe(); - }; - Consumer componentAddedListener = c -> - { - c.addComponentLookChangedListener(redrawConsumer); - c.addComponentMovedListener(redrawConsumer); - c.addPinAddedListener(pinAddedListener); - c.addPinRemovedListener(pinRemovedListener); - redrawThreadsafe(); - }; - model.addComponentAddedListener(componentAddedListener); - model.getComponents().forEach(componentAddedListener); - model.addComponentRemovedListener(c -> - { - c.removeComponentLookChangedListener(redrawConsumer); - c.removeComponentMovedListener(redrawConsumer); - c.removePinAddedListener(pinAddedListener); - c.removePinRemovedListener(pinRemovedListener); - redrawThreadsafe(); - }); - Consumer wireAddedListener = w -> - { - w.addWireLookChangedListener(redrawConsumer); - redrawThreadsafe(); - }; - model.addWireAddedListener(wireAddedListener); - model.getWires().forEach(wireAddedListener); - model.addWireRemovedListener(w -> - { - w.removeWireLookChangedListener(redrawConsumer); - redrawThreadsafe(); - }); - - addZoomedRenderer(gc -> - { - gc.setLineWidth(.5); - model.getWires().forEach(w -> w.render(gc)); - Rectangle visibleRegion = new Rectangle(offX, offY, gW / zoom, gH / zoom); - model.getComponents().forEach(c -> drawComponent(gc, c, visibleRegion)); - }); - addListener(SWT.MouseDown, this::mouseDown); - } - - private void drawComponent(GeneralGC gc, GUIComponent component, Rectangle visibleRegion) - { - component.render(gc, visibleRegion); - if (DRAW_PINS) - { - gc.setBackground(getDisplay().getSystemColor(SWT.COLOR_DARK_CYAN)); - for (Pin p : component.getPins()) - { - Point pos = p.getPos(); - gc.fillOval(pos.x - 1, pos.y - 1, 2, 2); - } - } - } - - private void mouseDown(Event e) - { - if (e.button == 1) - { - Point click = displayToWorldCoords(e.x, e.y); - for (GUIComponent component : model.getComponents()) - if (component.getBounds().contains(click) && component.clicked(click.x, click.y)) - { - redraw(); - break; - } - } - } +package net.mograsim.logic.ui; + +import java.util.function.Consumer; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Event; + +import net.haspamelodica.swt.helper.gcs.GeneralGC; +import net.haspamelodica.swt.helper.swtobjectwrappers.Point; +import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle; +import net.haspamelodica.swt.helper.zoomablecanvas.ZoomableCanvas; +import net.mograsim.logic.ui.model.ViewModel; +import net.mograsim.logic.ui.model.components.GUIComponent; +import net.mograsim.logic.ui.model.wires.GUIWire; +import net.mograsim.logic.ui.model.wires.Pin; + +/** + * Simulation visualizer canvas. + * + * @author Daniel Kirschten + */ +public class LogicUICanvas extends ZoomableCanvas +{ + private static final boolean DRAW_PINS = false; + + private final ViewModel model; + + public LogicUICanvas(Composite parent, int style, ViewModel model) + { + super(parent, style); + + this.model = model; + + Consumer redrawConsumer = o -> redrawThreadsafe(); + Consumer pinAddedListener = p -> + { + p.addPinMovedListener(redrawConsumer); + redrawThreadsafe(); + }; + Consumer pinRemovedListener = p -> + { + p.removePinMovedListener(redrawConsumer); + redrawThreadsafe(); + }; + Consumer componentAddedListener = c -> + { + c.addComponentLookChangedListener(redrawConsumer); + c.addComponentMovedListener(redrawConsumer); + c.addPinAddedListener(pinAddedListener); + c.addPinRemovedListener(pinRemovedListener); + redrawThreadsafe(); + }; + model.addComponentAddedListener(componentAddedListener); + model.getComponents().forEach(componentAddedListener); + model.addComponentRemovedListener(c -> + { + c.removeComponentLookChangedListener(redrawConsumer); + c.removeComponentMovedListener(redrawConsumer); + c.removePinAddedListener(pinAddedListener); + c.removePinRemovedListener(pinRemovedListener); + redrawThreadsafe(); + }); + Consumer wireAddedListener = w -> + { + w.addWireLookChangedListener(redrawConsumer); + redrawThreadsafe(); + }; + model.addWireAddedListener(wireAddedListener); + model.getWires().forEach(wireAddedListener); + model.addWireRemovedListener(w -> + { + w.removeWireLookChangedListener(redrawConsumer); + redrawThreadsafe(); + }); + + addZoomedRenderer(gc -> + { + gc.setLineWidth(.5); + model.getWires().forEach(w -> w.render(gc)); + Rectangle visibleRegion = new Rectangle(offX, offY, gW / zoom, gH / zoom); + model.getComponents().forEach(c -> drawComponent(gc, c, visibleRegion)); + }); + addListener(SWT.MouseDown, this::mouseDown); + } + + private void drawComponent(GeneralGC gc, GUIComponent component, Rectangle visibleRegion) + { + component.render(gc, visibleRegion); + if (DRAW_PINS) + { + gc.setBackground(getDisplay().getSystemColor(SWT.COLOR_DARK_CYAN)); + for (Pin p : component.getPins()) + { + Point pos = p.getPos(); + gc.fillOval(pos.x - 1, pos.y - 1, 2, 2); + } + } + } + + private void mouseDown(Event e) + { + if (e.button == 1) + { + Point click = displayToWorldCoords(e.x, e.y); + for (GUIComponent component : model.getComponents()) + if (component.getBounds().contains(click) && component.clicked(click.x, click.y)) + { + redraw(); + break; + } + } + } } \ No newline at end of file diff --git a/LogicUI/src/mograsim/logic/ui/LogicUIStandaloneGUI.java b/LogicUI/src/net/mograsim/logic/ui/LogicUIStandaloneGUI.java similarity index 90% rename from LogicUI/src/mograsim/logic/ui/LogicUIStandaloneGUI.java rename to LogicUI/src/net/mograsim/logic/ui/LogicUIStandaloneGUI.java index f39727c8..64b442e3 100644 --- a/LogicUI/src/mograsim/logic/ui/LogicUIStandaloneGUI.java +++ b/LogicUI/src/net/mograsim/logic/ui/LogicUIStandaloneGUI.java @@ -1,14 +1,14 @@ -package mograsim.logic.ui; +package net.mograsim.logic.ui; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; -import mograsim.logic.ui.model.ViewModel; -import mograsim.logic.ui.modeladapter.LogicModelParameters; import net.haspamelodica.swt.helper.zoomablecanvas.helper.ZoomableCanvasOverlay; import net.haspamelodica.swt.helper.zoomablecanvas.helper.ZoomableCanvasUserInput; +import net.mograsim.logic.ui.model.ViewModel; +import net.mograsim.logic.ui.modeladapter.LogicModelParameters; /** * Standalone simulation visualizer graphical user interface. diff --git a/LogicUI/src/mograsim/logic/ui/SimpleLogicUIStandalone.java b/LogicUI/src/net/mograsim/logic/ui/SimpleLogicUIStandalone.java similarity index 76% rename from LogicUI/src/mograsim/logic/ui/SimpleLogicUIStandalone.java rename to LogicUI/src/net/mograsim/logic/ui/SimpleLogicUIStandalone.java index ef0beb32..aa1dd57a 100644 --- a/LogicUI/src/mograsim/logic/ui/SimpleLogicUIStandalone.java +++ b/LogicUI/src/net/mograsim/logic/ui/SimpleLogicUIStandalone.java @@ -1,11 +1,11 @@ -package mograsim.logic.ui; +package net.mograsim.logic.ui; import java.util.function.Consumer; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.ui.model.ViewModel; -import mograsim.logic.ui.modeladapter.LogicModelParameters; -import mograsim.logic.ui.modeladapter.ViewLogicModelAdapter; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.ui.model.ViewModel; +import net.mograsim.logic.ui.modeladapter.LogicModelParameters; +import net.mograsim.logic.ui.modeladapter.ViewLogicModelAdapter; public class SimpleLogicUIStandalone { diff --git a/LogicUI/src/mograsim/logic/ui/examples/RSLatchExample.java b/LogicUI/src/net/mograsim/logic/ui/examples/RSLatchExample.java similarity index 81% rename from LogicUI/src/mograsim/logic/ui/examples/RSLatchExample.java rename to LogicUI/src/net/mograsim/logic/ui/examples/RSLatchExample.java index f787c815..af91d1f1 100644 --- a/LogicUI/src/mograsim/logic/ui/examples/RSLatchExample.java +++ b/LogicUI/src/net/mograsim/logic/ui/examples/RSLatchExample.java @@ -1,12 +1,12 @@ -package mograsim.logic.ui.examples; - -import mograsim.logic.ui.SimpleLogicUIStandalone; -import mograsim.logic.ui.model.ViewModel; -import mograsim.logic.ui.model.components.GUIManualSwitch; -import mograsim.logic.ui.model.components.GUINotGate; -import mograsim.logic.ui.model.components.GUIOrGate; -import mograsim.logic.ui.model.wires.GUIWire; -import mograsim.logic.ui.model.wires.WireCrossPoint; +package net.mograsim.logic.ui.examples; + +import net.mograsim.logic.ui.SimpleLogicUIStandalone; +import net.mograsim.logic.ui.model.ViewModel; +import net.mograsim.logic.ui.model.components.GUIManualSwitch; +import net.mograsim.logic.ui.model.components.GUINotGate; +import net.mograsim.logic.ui.model.components.GUIOrGate; +import net.mograsim.logic.ui.model.wires.GUIWire; +import net.mograsim.logic.ui.model.wires.WireCrossPoint; import net.haspamelodica.swt.helper.swtobjectwrappers.Point; public class RSLatchExample diff --git a/LogicUI/src/mograsim/logic/ui/model/ViewModel.java b/LogicUI/src/net/mograsim/logic/ui/model/ViewModel.java similarity index 96% rename from LogicUI/src/mograsim/logic/ui/model/ViewModel.java rename to LogicUI/src/net/mograsim/logic/ui/model/ViewModel.java index 31cd1a8e..717ee13a 100644 --- a/LogicUI/src/mograsim/logic/ui/model/ViewModel.java +++ b/LogicUI/src/net/mograsim/logic/ui/model/ViewModel.java @@ -1,12 +1,12 @@ -package mograsim.logic.ui.model; +package net.mograsim.logic.ui.model; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.function.Consumer; -import mograsim.logic.ui.model.components.GUIComponent; -import mograsim.logic.ui.model.wires.GUIWire; +import net.mograsim.logic.ui.model.components.GUIComponent; +import net.mograsim.logic.ui.model.wires.GUIWire; public class ViewModel { diff --git a/LogicUI/src/mograsim/logic/ui/model/components/GUIAndGate.java b/LogicUI/src/net/mograsim/logic/ui/model/components/GUIAndGate.java similarity index 67% rename from LogicUI/src/mograsim/logic/ui/model/components/GUIAndGate.java rename to LogicUI/src/net/mograsim/logic/ui/model/components/GUIAndGate.java index 8efea1c4..440881df 100644 --- a/LogicUI/src/mograsim/logic/ui/model/components/GUIAndGate.java +++ b/LogicUI/src/net/mograsim/logic/ui/model/components/GUIAndGate.java @@ -1,6 +1,6 @@ -package mograsim.logic.ui.model.components; +package net.mograsim.logic.ui.model.components; -import mograsim.logic.ui.model.ViewModel; +import net.mograsim.logic.ui.model.ViewModel; public class GUIAndGate extends SimpleRectangularGUIGate { diff --git a/LogicUI/src/mograsim/logic/ui/model/components/GUIComponent.java b/LogicUI/src/net/mograsim/logic/ui/model/components/GUIComponent.java similarity index 96% rename from LogicUI/src/mograsim/logic/ui/model/components/GUIComponent.java rename to LogicUI/src/net/mograsim/logic/ui/model/components/GUIComponent.java index c3e4529f..9cea86a6 100644 --- a/LogicUI/src/mograsim/logic/ui/model/components/GUIComponent.java +++ b/LogicUI/src/net/mograsim/logic/ui/model/components/GUIComponent.java @@ -1,12 +1,12 @@ -package mograsim.logic.ui.model.components; +package net.mograsim.logic.ui.model.components; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.function.Consumer; -import mograsim.logic.ui.model.ViewModel; -import mograsim.logic.ui.model.wires.Pin; +import net.mograsim.logic.ui.model.ViewModel; +import net.mograsim.logic.ui.model.wires.Pin; import net.haspamelodica.swt.helper.gcs.GeneralGC; import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle; diff --git a/LogicUI/src/mograsim/logic/ui/model/components/GUIManualSwitch.java b/LogicUI/src/net/mograsim/logic/ui/model/components/GUIManualSwitch.java similarity index 84% rename from LogicUI/src/mograsim/logic/ui/model/components/GUIManualSwitch.java rename to LogicUI/src/net/mograsim/logic/ui/model/components/GUIManualSwitch.java index a89bc6a6..8ca57ee5 100644 --- a/LogicUI/src/mograsim/logic/ui/model/components/GUIManualSwitch.java +++ b/LogicUI/src/net/mograsim/logic/ui/model/components/GUIManualSwitch.java @@ -1,14 +1,14 @@ -package mograsim.logic.ui.model.components; +package net.mograsim.logic.ui.model.components; -import mograsim.logic.core.components.ManualSwitch; -import mograsim.logic.core.types.BitVectorFormatter; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.ui.model.ViewModel; -import mograsim.logic.ui.model.wires.Pin; +import net.mograsim.logic.ui.model.ViewModel; +import net.mograsim.logic.ui.model.wires.Pin; import net.haspamelodica.swt.helper.gcs.GeneralGC; import net.haspamelodica.swt.helper.swtobjectwrappers.Font; import net.haspamelodica.swt.helper.swtobjectwrappers.Point; import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle; +import net.mograsim.logic.core.components.ManualSwitch; +import net.mograsim.logic.core.types.BitVectorFormatter; +import net.mograsim.logic.core.wires.Wire.ReadEnd; public class GUIManualSwitch extends GUIComponent { diff --git a/LogicUI/src/mograsim/logic/ui/model/components/GUINotGate.java b/LogicUI/src/net/mograsim/logic/ui/model/components/GUINotGate.java similarity index 65% rename from LogicUI/src/mograsim/logic/ui/model/components/GUINotGate.java rename to LogicUI/src/net/mograsim/logic/ui/model/components/GUINotGate.java index 7a6865f3..01df349b 100644 --- a/LogicUI/src/mograsim/logic/ui/model/components/GUINotGate.java +++ b/LogicUI/src/net/mograsim/logic/ui/model/components/GUINotGate.java @@ -1,6 +1,6 @@ -package mograsim.logic.ui.model.components; +package net.mograsim.logic.ui.model.components; -import mograsim.logic.ui.model.ViewModel; +import net.mograsim.logic.ui.model.ViewModel; public class GUINotGate extends SimpleRectangularGUIGate { diff --git a/LogicUI/src/mograsim/logic/ui/model/components/GUIOrGate.java b/LogicUI/src/net/mograsim/logic/ui/model/components/GUIOrGate.java similarity index 66% rename from LogicUI/src/mograsim/logic/ui/model/components/GUIOrGate.java rename to LogicUI/src/net/mograsim/logic/ui/model/components/GUIOrGate.java index 3a3c3241..bbc436d7 100644 --- a/LogicUI/src/mograsim/logic/ui/model/components/GUIOrGate.java +++ b/LogicUI/src/net/mograsim/logic/ui/model/components/GUIOrGate.java @@ -1,6 +1,6 @@ -package mograsim.logic.ui.model.components; +package net.mograsim.logic.ui.model.components; -import mograsim.logic.ui.model.ViewModel; +import net.mograsim.logic.ui.model.ViewModel; public class GUIOrGate extends SimpleRectangularGUIGate { diff --git a/LogicUI/src/mograsim/logic/ui/model/components/SimpleRectangularGUIGate.java b/LogicUI/src/net/mograsim/logic/ui/model/components/SimpleRectangularGUIGate.java similarity index 93% rename from LogicUI/src/mograsim/logic/ui/model/components/SimpleRectangularGUIGate.java rename to LogicUI/src/net/mograsim/logic/ui/model/components/SimpleRectangularGUIGate.java index b09d9c9d..a2875c6a 100644 --- a/LogicUI/src/mograsim/logic/ui/model/components/SimpleRectangularGUIGate.java +++ b/LogicUI/src/net/mograsim/logic/ui/model/components/SimpleRectangularGUIGate.java @@ -1,12 +1,12 @@ -package mograsim.logic.ui.model.components; +package net.mograsim.logic.ui.model.components; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import mograsim.logic.ui.model.ViewModel; -import mograsim.logic.ui.model.wires.MovablePin; -import mograsim.logic.ui.model.wires.Pin; +import net.mograsim.logic.ui.model.ViewModel; +import net.mograsim.logic.ui.model.wires.MovablePin; +import net.mograsim.logic.ui.model.wires.Pin; import net.haspamelodica.swt.helper.gcs.GeneralGC; import net.haspamelodica.swt.helper.swtobjectwrappers.Font; import net.haspamelodica.swt.helper.swtobjectwrappers.Point; diff --git a/LogicUI/src/mograsim/logic/ui/model/wires/GUIWire.java b/LogicUI/src/net/mograsim/logic/ui/model/wires/GUIWire.java similarity index 90% rename from LogicUI/src/mograsim/logic/ui/model/wires/GUIWire.java rename to LogicUI/src/net/mograsim/logic/ui/model/wires/GUIWire.java index 2512b884..736c0ea6 100644 --- a/LogicUI/src/mograsim/logic/ui/model/wires/GUIWire.java +++ b/LogicUI/src/net/mograsim/logic/ui/model/wires/GUIWire.java @@ -1,15 +1,15 @@ -package mograsim.logic.ui.model.wires; +package net.mograsim.logic.ui.model.wires; import java.util.ArrayList; import java.util.List; import java.util.function.Consumer; -import mograsim.logic.core.types.BitVectorFormatter; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.ui.ColorHelper; -import mograsim.logic.ui.model.ViewModel; +import net.mograsim.logic.ui.ColorHelper; +import net.mograsim.logic.ui.model.ViewModel; import net.haspamelodica.swt.helper.gcs.GeneralGC; import net.haspamelodica.swt.helper.swtobjectwrappers.Point; +import net.mograsim.logic.core.types.BitVectorFormatter; +import net.mograsim.logic.core.wires.Wire.ReadEnd; public class GUIWire { diff --git a/LogicUI/src/mograsim/logic/ui/model/wires/MovablePin.java b/LogicUI/src/net/mograsim/logic/ui/model/wires/MovablePin.java similarity index 72% rename from LogicUI/src/mograsim/logic/ui/model/wires/MovablePin.java rename to LogicUI/src/net/mograsim/logic/ui/model/wires/MovablePin.java index 40364320..669bb1be 100644 --- a/LogicUI/src/mograsim/logic/ui/model/wires/MovablePin.java +++ b/LogicUI/src/net/mograsim/logic/ui/model/wires/MovablePin.java @@ -1,6 +1,6 @@ -package mograsim.logic.ui.model.wires; +package net.mograsim.logic.ui.model.wires; -import mograsim.logic.ui.model.components.GUIComponent; +import net.mograsim.logic.ui.model.components.GUIComponent; public class MovablePin extends Pin { diff --git a/LogicUI/src/mograsim/logic/ui/model/wires/Pin.java b/LogicUI/src/net/mograsim/logic/ui/model/wires/Pin.java similarity index 93% rename from LogicUI/src/mograsim/logic/ui/model/wires/Pin.java rename to LogicUI/src/net/mograsim/logic/ui/model/wires/Pin.java index 350de8d2..f3a78023 100644 --- a/LogicUI/src/mograsim/logic/ui/model/wires/Pin.java +++ b/LogicUI/src/net/mograsim/logic/ui/model/wires/Pin.java @@ -1,10 +1,10 @@ -package mograsim.logic.ui.model.wires; +package net.mograsim.logic.ui.model.wires; import java.util.ArrayList; import java.util.List; import java.util.function.Consumer; -import mograsim.logic.ui.model.components.GUIComponent; +import net.mograsim.logic.ui.model.components.GUIComponent; import net.haspamelodica.swt.helper.swtobjectwrappers.Point; import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle; diff --git a/LogicUI/src/mograsim/logic/ui/model/wires/WireCrossPoint.java b/LogicUI/src/net/mograsim/logic/ui/model/wires/WireCrossPoint.java similarity index 75% rename from LogicUI/src/mograsim/logic/ui/model/wires/WireCrossPoint.java rename to LogicUI/src/net/mograsim/logic/ui/model/wires/WireCrossPoint.java index 34f69032..0949ffbb 100644 --- a/LogicUI/src/mograsim/logic/ui/model/wires/WireCrossPoint.java +++ b/LogicUI/src/net/mograsim/logic/ui/model/wires/WireCrossPoint.java @@ -1,12 +1,12 @@ -package mograsim.logic.ui.model.wires; +package net.mograsim.logic.ui.model.wires; -import mograsim.logic.core.types.BitVectorFormatter; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.ui.ColorHelper; -import mograsim.logic.ui.model.ViewModel; -import mograsim.logic.ui.model.components.GUIComponent; +import net.mograsim.logic.ui.ColorHelper; +import net.mograsim.logic.ui.model.ViewModel; +import net.mograsim.logic.ui.model.components.GUIComponent; import net.haspamelodica.swt.helper.gcs.GeneralGC; import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle; +import net.mograsim.logic.core.types.BitVectorFormatter; +import net.mograsim.logic.core.wires.Wire.ReadEnd; public class WireCrossPoint extends GUIComponent { diff --git a/LogicUI/src/mograsim/logic/ui/modeladapter/LogicModelParameters.java b/LogicUI/src/net/mograsim/logic/ui/modeladapter/LogicModelParameters.java similarity index 67% rename from LogicUI/src/mograsim/logic/ui/modeladapter/LogicModelParameters.java rename to LogicUI/src/net/mograsim/logic/ui/modeladapter/LogicModelParameters.java index 010cdd1f..d75cb1b9 100644 --- a/LogicUI/src/mograsim/logic/ui/modeladapter/LogicModelParameters.java +++ b/LogicUI/src/net/mograsim/logic/ui/modeladapter/LogicModelParameters.java @@ -1,4 +1,4 @@ -package mograsim.logic.ui.modeladapter; +package net.mograsim.logic.ui.modeladapter; public class LogicModelParameters { diff --git a/LogicUI/src/mograsim/logic/ui/modeladapter/ViewLogicModelAdapter.java b/LogicUI/src/net/mograsim/logic/ui/modeladapter/ViewLogicModelAdapter.java similarity index 82% rename from LogicUI/src/mograsim/logic/ui/modeladapter/ViewLogicModelAdapter.java rename to LogicUI/src/net/mograsim/logic/ui/modeladapter/ViewLogicModelAdapter.java index 076d64b6..6f4e7b73 100644 --- a/LogicUI/src/mograsim/logic/ui/modeladapter/ViewLogicModelAdapter.java +++ b/LogicUI/src/net/mograsim/logic/ui/modeladapter/ViewLogicModelAdapter.java @@ -1,4 +1,4 @@ -package mograsim.logic.ui.modeladapter; +package net.mograsim.logic.ui.modeladapter; import java.util.ArrayList; import java.util.Collections; @@ -11,24 +11,24 @@ import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; -import mograsim.logic.core.components.Component; -import mograsim.logic.core.components.gates.AndGate; -import mograsim.logic.core.components.gates.NotGate; -import mograsim.logic.core.components.gates.OrGate; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.wires.Wire; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.ui.model.ViewModel; -import mograsim.logic.ui.model.components.GUIAndGate; -import mograsim.logic.ui.model.components.GUIComponent; -import mograsim.logic.ui.model.components.GUINotGate; -import mograsim.logic.ui.model.components.GUIOrGate; -import mograsim.logic.ui.model.wires.GUIWire; -import mograsim.logic.ui.model.wires.Pin; -import mograsim.logic.ui.model.wires.WireCrossPoint; -import mograsim.logic.ui.modeladapter.componentadapters.ComponentAdapter; -import mograsim.logic.ui.modeladapter.componentadapters.ManualSwitchAdapter; -import mograsim.logic.ui.modeladapter.componentadapters.SimpleGateAdapter; +import net.mograsim.logic.ui.model.ViewModel; +import net.mograsim.logic.ui.model.components.GUIAndGate; +import net.mograsim.logic.ui.model.components.GUIComponent; +import net.mograsim.logic.ui.model.components.GUINotGate; +import net.mograsim.logic.ui.model.components.GUIOrGate; +import net.mograsim.logic.ui.model.wires.GUIWire; +import net.mograsim.logic.ui.model.wires.Pin; +import net.mograsim.logic.ui.model.wires.WireCrossPoint; +import net.mograsim.logic.ui.modeladapter.componentadapters.ComponentAdapter; +import net.mograsim.logic.ui.modeladapter.componentadapters.ManualSwitchAdapter; +import net.mograsim.logic.ui.modeladapter.componentadapters.SimpleGateAdapter; +import net.mograsim.logic.core.components.Component; +import net.mograsim.logic.core.components.gates.AndGate; +import net.mograsim.logic.core.components.gates.NotGate; +import net.mograsim.logic.core.components.gates.OrGate; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.wires.Wire; +import net.mograsim.logic.core.wires.Wire.ReadEnd; public class ViewLogicModelAdapter { diff --git a/LogicUI/src/net/mograsim/logic/ui/modeladapter/componentadapters/ComponentAdapter.java b/LogicUI/src/net/mograsim/logic/ui/modeladapter/componentadapters/ComponentAdapter.java new file mode 100644 index 00000000..0dd563e5 --- /dev/null +++ b/LogicUI/src/net/mograsim/logic/ui/modeladapter/componentadapters/ComponentAdapter.java @@ -0,0 +1,18 @@ +package net.mograsim.logic.ui.modeladapter.componentadapters; + +import java.util.Map; + +import net.mograsim.logic.ui.model.components.GUIComponent; +import net.mograsim.logic.ui.model.wires.Pin; +import net.mograsim.logic.ui.modeladapter.LogicModelParameters; +import net.mograsim.logic.core.components.Component; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.wires.Wire; + +public interface ComponentAdapter +{ + public Class getSupportedClass(); + + public Component createAndLinkComponent(Timeline timeline, LogicModelParameters params, G guiComponent, + Map logicWiresPerPin); +} \ No newline at end of file diff --git a/LogicUI/src/mograsim/logic/ui/modeladapter/componentadapters/ManualSwitchAdapter.java b/LogicUI/src/net/mograsim/logic/ui/modeladapter/componentadapters/ManualSwitchAdapter.java similarity index 55% rename from LogicUI/src/mograsim/logic/ui/modeladapter/componentadapters/ManualSwitchAdapter.java rename to LogicUI/src/net/mograsim/logic/ui/modeladapter/componentadapters/ManualSwitchAdapter.java index c27cbdf2..197cf747 100644 --- a/LogicUI/src/mograsim/logic/ui/modeladapter/componentadapters/ManualSwitchAdapter.java +++ b/LogicUI/src/net/mograsim/logic/ui/modeladapter/componentadapters/ManualSwitchAdapter.java @@ -1,15 +1,15 @@ -package mograsim.logic.ui.modeladapter.componentadapters; +package net.mograsim.logic.ui.modeladapter.componentadapters; import java.util.Map; -import mograsim.logic.core.components.Component; -import mograsim.logic.core.components.ManualSwitch; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.wires.Wire; -import mograsim.logic.core.wires.Wire.ReadWriteEnd; -import mograsim.logic.ui.model.components.GUIManualSwitch; -import mograsim.logic.ui.model.wires.Pin; -import mograsim.logic.ui.modeladapter.LogicModelParameters; +import net.mograsim.logic.ui.model.components.GUIManualSwitch; +import net.mograsim.logic.ui.model.wires.Pin; +import net.mograsim.logic.ui.modeladapter.LogicModelParameters; +import net.mograsim.logic.core.components.Component; +import net.mograsim.logic.core.components.ManualSwitch; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.wires.Wire; +import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; public class ManualSwitchAdapter implements ComponentAdapter { diff --git a/LogicUI/src/mograsim/logic/ui/modeladapter/componentadapters/SimpleGateAdapter.java b/LogicUI/src/net/mograsim/logic/ui/modeladapter/componentadapters/SimpleGateAdapter.java similarity index 70% rename from LogicUI/src/mograsim/logic/ui/modeladapter/componentadapters/SimpleGateAdapter.java rename to LogicUI/src/net/mograsim/logic/ui/modeladapter/componentadapters/SimpleGateAdapter.java index f88308bd..1902d626 100644 --- a/LogicUI/src/mograsim/logic/ui/modeladapter/componentadapters/SimpleGateAdapter.java +++ b/LogicUI/src/net/mograsim/logic/ui/modeladapter/componentadapters/SimpleGateAdapter.java @@ -1,16 +1,16 @@ -package mograsim.logic.ui.modeladapter.componentadapters; +package net.mograsim.logic.ui.modeladapter.componentadapters; import java.util.List; import java.util.Map; -import mograsim.logic.core.components.Component; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.wires.Wire; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.core.wires.Wire.ReadWriteEnd; -import mograsim.logic.ui.model.components.SimpleRectangularGUIGate; -import mograsim.logic.ui.model.wires.Pin; -import mograsim.logic.ui.modeladapter.LogicModelParameters; +import net.mograsim.logic.ui.model.components.SimpleRectangularGUIGate; +import net.mograsim.logic.ui.model.wires.Pin; +import net.mograsim.logic.ui.modeladapter.LogicModelParameters; +import net.mograsim.logic.core.components.Component; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.wires.Wire; +import net.mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; public class SimpleGateAdapter implements ComponentAdapter { diff --git a/SampleERCP/.project b/SampleERCP/.project index f95d7d22..3097b7c7 100644 --- a/SampleERCP/.project +++ b/SampleERCP/.project @@ -1,9 +1,9 @@ - mograsim.rcp + net.mograsim.rcp - mograsim.rcp + net.mograsim.rcp diff --git a/SampleERCP/Application.e4xmi b/SampleERCP/Application.e4xmi index fe5c4cc4..8c9871c4 100644 --- a/SampleERCP/Application.e4xmi +++ b/SampleERCP/Application.e4xmi @@ -1,10 +1,10 @@ - + - - + + @@ -12,8 +12,8 @@ - - + + @@ -22,15 +22,15 @@ - - + + - - - - + + + + diff --git a/SampleERCP/META-INF/MANIFEST.MF b/SampleERCP/META-INF/MANIFEST.MF index 2597b53f..1c5e2a77 100644 --- a/SampleERCP/META-INF/MANIFEST.MF +++ b/SampleERCP/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name -Bundle-SymbolicName: mograsim.rcp;singleton:=true +Bundle-SymbolicName: net.mograsim.rcp;singleton:=true Bundle-Version: 1.0.0.qualifier Bundle-Vendor: %Bundle-Vendor Require-Bundle: org.eclipse.core.runtime;bundle-version="3.15.200", @@ -12,9 +12,9 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.15.200", org.eclipse.e4.ui.di;bundle-version="1.2.500", org.eclipse.ui.workbench;bundle-version="3.113.0", javax.annotation;bundle-version="1.2.0", - mograsim.logic.ui + net.mograsim.logic.ui Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Automatic-Module-Name: Sample -Export-Package: mograsim.rcp.handlers;uses:="org.eclipse.swt.widgets,org.eclipse.e4.ui.workbench,org.eclipse.e4.ui.workbench.modeling", - mograsim.rcp.parts;uses:="org.eclipse.swt.widgets", - mograsim.rcp.splashhandlers +Export-Package: net.mograsim.rcp.handlers;uses:="org.eclipse.swt.widgets,org.eclipse.e4.ui.workbench,org.eclipse.e4.ui.workbench.modeling", + net.mograsim.rcp.parts;uses:="org.eclipse.swt.widgets", + net.mograsim.rcp.splashhandlers diff --git a/SampleERCP/mograsim.rcp.product b/SampleERCP/net.mograsim.rcp.product similarity index 86% rename from SampleERCP/mograsim.rcp.product rename to SampleERCP/net.mograsim.rcp.product index 3614ce7d..829a7b59 100644 --- a/SampleERCP/mograsim.rcp.product +++ b/SampleERCP/net.mograsim.rcp.product @@ -1,7 +1,7 @@ - + @@ -19,15 +19,15 @@ - + - - + + - + @@ -66,9 +66,9 @@ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - - - + + + @@ -143,7 +143,7 @@ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 - + diff --git a/SampleERCP/plugin.xml b/SampleERCP/plugin.xml index 2c76a90a..2ad9229b 100644 --- a/SampleERCP/plugin.xml +++ b/SampleERCP/plugin.xml @@ -11,7 +11,7 @@ name="Simulator WIP"> + value="platform:/plugin/net.mograsim.rcp/css/default.css"> + class="net.mograsim.rcp.splashhandlers.ExtensibleSplashHandler" + id="net.mograsim.rcp.splashHandlers.extensible"> + productId="net.mograsim.rcp.product" + splashId="net.mograsim.rcp.splashHandlers.extensible"> + point="net.mograsim.rcp.splashExtension"> - mograsim.logic.core + net.mograsim.logic.core diff --git a/era.mi/META-INF/MANIFEST.MF b/era.mi/META-INF/MANIFEST.MF index fad3aa8a..655b5755 100644 --- a/era.mi/META-INF/MANIFEST.MF +++ b/era.mi/META-INF/MANIFEST.MF @@ -1,14 +1,14 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 -Bundle-Name: mograsim.logic.core -Bundle-SymbolicName: mograsim.logic.core +Bundle-Name: net.mograsim.logic.core +Bundle-SymbolicName: net.mograsim.logic.core Bundle-Version: 1.0.0.qualifier -Export-Package: mograsim.logic.core, - mograsim.logic.core.components, - mograsim.logic.core.components.gates, - mograsim.logic.core.tests, - mograsim.logic.core.timeline, - mograsim.logic.core.types, - mograsim.logic.core.wires +Export-Package: net.mograsim.logic.core, + net.mograsim.logic.core.components, + net.mograsim.logic.core.components.gates, + net.mograsim.logic.core.tests, + net.mograsim.logic.core.timeline, + net.mograsim.logic.core.types, + net.mograsim.logic.core.wires Bundle-RequiredExecutionEnvironment: JavaSE-10 -Automatic-Module-Name: mograsim.logic.core +Automatic-Module-Name: net.mograsim.logic.core diff --git a/era.mi/src/mograsim/logic/core/components/gates/AndGate.java b/era.mi/src/mograsim/logic/core/components/gates/AndGate.java deleted file mode 100644 index ef1a1d08..00000000 --- a/era.mi/src/mograsim/logic/core/components/gates/AndGate.java +++ /dev/null @@ -1,14 +0,0 @@ -package mograsim.logic.core.components.gates; - -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.types.BitVector.BitVectorMutator; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.core.wires.Wire.ReadWriteEnd; - -public class AndGate extends MultiInputGate -{ - public AndGate(Timeline timeline, int processTime, ReadWriteEnd out, ReadEnd... in) - { - super(timeline, processTime, BitVectorMutator::and, out, in); - } -} diff --git a/era.mi/src/mograsim/logic/core/components/gates/OrGate.java b/era.mi/src/mograsim/logic/core/components/gates/OrGate.java deleted file mode 100644 index 3f507a51..00000000 --- a/era.mi/src/mograsim/logic/core/components/gates/OrGate.java +++ /dev/null @@ -1,14 +0,0 @@ -package mograsim.logic.core.components.gates; - -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.types.BitVector.BitVectorMutator; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.core.wires.Wire.ReadWriteEnd; - -public class OrGate extends MultiInputGate -{ - public OrGate(Timeline timeline, int processTime, ReadWriteEnd out, ReadEnd... in) - { - super(timeline, processTime, BitVectorMutator::or, out, in); - } -} diff --git a/era.mi/src/mograsim/logic/core/wires/WireObserver.java b/era.mi/src/mograsim/logic/core/wires/WireObserver.java deleted file mode 100644 index 4356c1ec..00000000 --- a/era.mi/src/mograsim/logic/core/wires/WireObserver.java +++ /dev/null @@ -1,9 +0,0 @@ -package mograsim.logic.core.wires; - -import mograsim.logic.core.types.BitVector; -import mograsim.logic.core.wires.Wire.ReadEnd; - -public interface WireObserver -{ - public void update(ReadEnd initiator, BitVector oldValues); -} diff --git a/era.mi/src/mograsim/logic/core/Util.java b/era.mi/src/net/mograsim/logic/core/Util.java similarity index 97% rename from era.mi/src/mograsim/logic/core/Util.java rename to era.mi/src/net/mograsim/logic/core/Util.java index 5f88e834..dd3671c2 100644 --- a/era.mi/src/mograsim/logic/core/Util.java +++ b/era.mi/src/net/mograsim/logic/core/Util.java @@ -1,8 +1,8 @@ -package mograsim.logic.core; +package net.mograsim.logic.core; import java.util.Arrays; -import mograsim.logic.core.types.Bit; +import net.mograsim.logic.core.types.Bit; public final class Util { diff --git a/era.mi/src/mograsim/logic/core/components/BasicComponent.java b/era.mi/src/net/mograsim/logic/core/components/BasicComponent.java similarity index 71% rename from era.mi/src/mograsim/logic/core/components/BasicComponent.java rename to era.mi/src/net/mograsim/logic/core/components/BasicComponent.java index 5056a96a..05225571 100644 --- a/era.mi/src/mograsim/logic/core/components/BasicComponent.java +++ b/era.mi/src/net/mograsim/logic/core/components/BasicComponent.java @@ -1,9 +1,9 @@ -package mograsim.logic.core.components; +package net.mograsim.logic.core.components; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.types.BitVector; -import mograsim.logic.core.wires.WireObserver; -import mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.types.BitVector; +import net.mograsim.logic.core.wires.WireObserver; +import net.mograsim.logic.core.wires.Wire.ReadEnd; /** * A basic component that recomputes all outputs (with a delay), when it is updated. diff --git a/era.mi/src/mograsim/logic/core/components/BitDisplay.java b/era.mi/src/net/mograsim/logic/core/components/BitDisplay.java similarity index 66% rename from era.mi/src/mograsim/logic/core/components/BitDisplay.java rename to era.mi/src/net/mograsim/logic/core/components/BitDisplay.java index 1f18e125..a4830446 100644 --- a/era.mi/src/mograsim/logic/core/components/BitDisplay.java +++ b/era.mi/src/net/mograsim/logic/core/components/BitDisplay.java @@ -1,12 +1,12 @@ -package mograsim.logic.core.components; +package net.mograsim.logic.core.components; import java.util.List; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.types.Bit; -import mograsim.logic.core.types.BitVector; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.core.wires.Wire.ReadWriteEnd; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.types.Bit; +import net.mograsim.logic.core.types.BitVector; +import net.mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; public class BitDisplay extends BasicComponent { diff --git a/era.mi/src/mograsim/logic/core/components/Clock.java b/era.mi/src/net/mograsim/logic/core/components/Clock.java similarity index 65% rename from era.mi/src/mograsim/logic/core/components/Clock.java rename to era.mi/src/net/mograsim/logic/core/components/Clock.java index 7a1c136b..1cbb697a 100644 --- a/era.mi/src/mograsim/logic/core/components/Clock.java +++ b/era.mi/src/net/mograsim/logic/core/components/Clock.java @@ -1,14 +1,14 @@ -package mograsim.logic.core.components; +package net.mograsim.logic.core.components; import java.util.List; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.timeline.TimelineEvent; -import mograsim.logic.core.timeline.TimelineEventHandler; -import mograsim.logic.core.types.Bit; -import mograsim.logic.core.wires.Wire; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.core.wires.Wire.ReadWriteEnd; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.timeline.TimelineEvent; +import net.mograsim.logic.core.timeline.TimelineEventHandler; +import net.mograsim.logic.core.types.Bit; +import net.mograsim.logic.core.wires.Wire; +import net.mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; public class Clock extends Component implements TimelineEventHandler { diff --git a/era.mi/src/mograsim/logic/core/components/Component.java b/era.mi/src/net/mograsim/logic/core/components/Component.java similarity index 70% rename from era.mi/src/mograsim/logic/core/components/Component.java rename to era.mi/src/net/mograsim/logic/core/components/Component.java index ee0f62cb..71e0f923 100644 --- a/era.mi/src/mograsim/logic/core/components/Component.java +++ b/era.mi/src/net/mograsim/logic/core/components/Component.java @@ -1,10 +1,10 @@ -package mograsim.logic.core.components; +package net.mograsim.logic.core.components; import java.util.List; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.core.wires.Wire.ReadWriteEnd; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; public abstract class Component { diff --git a/era.mi/src/mograsim/logic/core/components/Connector.java b/era.mi/src/net/mograsim/logic/core/components/Connector.java similarity index 76% rename from era.mi/src/mograsim/logic/core/components/Connector.java rename to era.mi/src/net/mograsim/logic/core/components/Connector.java index 5cdd2347..0b2e55ae 100644 --- a/era.mi/src/mograsim/logic/core/components/Connector.java +++ b/era.mi/src/net/mograsim/logic/core/components/Connector.java @@ -1,12 +1,12 @@ -package mograsim.logic.core.components; +package net.mograsim.logic.core.components; import java.util.List; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.types.BitVector; -import mograsim.logic.core.wires.WireObserver; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.core.wires.Wire.ReadWriteEnd; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.types.BitVector; +import net.mograsim.logic.core.wires.WireObserver; +import net.mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; public class Connector extends Component implements WireObserver { diff --git a/era.mi/src/mograsim/logic/core/components/Demux.java b/era.mi/src/net/mograsim/logic/core/components/Demux.java similarity index 86% rename from era.mi/src/mograsim/logic/core/components/Demux.java rename to era.mi/src/net/mograsim/logic/core/components/Demux.java index 08063082..a0514578 100644 --- a/era.mi/src/mograsim/logic/core/components/Demux.java +++ b/era.mi/src/net/mograsim/logic/core/components/Demux.java @@ -1,11 +1,11 @@ -package mograsim.logic.core.components; +package net.mograsim.logic.core.components; import java.util.List; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.wires.Wire; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.core.wires.Wire.ReadWriteEnd; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.wires.Wire; +import net.mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; /** * Models a multiplexer. Takes an arbitrary amount of input {@link Wire}s, one of which, as determined by select, is put through to the diff --git a/era.mi/src/mograsim/logic/core/components/ManualSwitch.java b/era.mi/src/net/mograsim/logic/core/components/ManualSwitch.java similarity index 76% rename from era.mi/src/mograsim/logic/core/components/ManualSwitch.java rename to era.mi/src/net/mograsim/logic/core/components/ManualSwitch.java index 061073be..04a8d835 100644 --- a/era.mi/src/mograsim/logic/core/components/ManualSwitch.java +++ b/era.mi/src/net/mograsim/logic/core/components/ManualSwitch.java @@ -1,11 +1,11 @@ -package mograsim.logic.core.components; +package net.mograsim.logic.core.components; import java.util.List; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.types.Bit; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.core.wires.Wire.ReadWriteEnd; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.types.Bit; +import net.mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; /** * This class models a simple on/off (ONE/ZERO) switch for user interaction. diff --git a/era.mi/src/mograsim/logic/core/components/Merger.java b/era.mi/src/net/mograsim/logic/core/components/Merger.java similarity index 78% rename from era.mi/src/mograsim/logic/core/components/Merger.java rename to era.mi/src/net/mograsim/logic/core/components/Merger.java index d2c0516b..7088aa5d 100644 --- a/era.mi/src/mograsim/logic/core/components/Merger.java +++ b/era.mi/src/net/mograsim/logic/core/components/Merger.java @@ -1,13 +1,13 @@ -package mograsim.logic.core.components; +package net.mograsim.logic.core.components; import java.util.List; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.types.BitVector; -import mograsim.logic.core.wires.Wire; -import mograsim.logic.core.wires.WireObserver; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.core.wires.Wire.ReadWriteEnd; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.types.BitVector; +import net.mograsim.logic.core.wires.Wire; +import net.mograsim.logic.core.wires.WireObserver; +import net.mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; public class Merger extends Component implements WireObserver { diff --git a/era.mi/src/mograsim/logic/core/components/Mux.java b/era.mi/src/net/mograsim/logic/core/components/Mux.java similarity index 86% rename from era.mi/src/mograsim/logic/core/components/Mux.java rename to era.mi/src/net/mograsim/logic/core/components/Mux.java index a45cc6cb..9046585c 100644 --- a/era.mi/src/mograsim/logic/core/components/Mux.java +++ b/era.mi/src/net/mograsim/logic/core/components/Mux.java @@ -1,14 +1,14 @@ -package mograsim.logic.core.components; +package net.mograsim.logic.core.components; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.wires.Wire; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.core.wires.Wire.ReadWriteEnd; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.wires.Wire; +import net.mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; /** * Models a multiplexer. Takes an arbitrary amount of input {@link Wire}s, one of which, as determined by select, is put through to the diff --git a/era.mi/src/mograsim/logic/core/components/Splitter.java b/era.mi/src/net/mograsim/logic/core/components/Splitter.java similarity index 75% rename from era.mi/src/mograsim/logic/core/components/Splitter.java rename to era.mi/src/net/mograsim/logic/core/components/Splitter.java index d82c75c7..bc834e1f 100644 --- a/era.mi/src/mograsim/logic/core/components/Splitter.java +++ b/era.mi/src/net/mograsim/logic/core/components/Splitter.java @@ -1,12 +1,12 @@ -package mograsim.logic.core.components; +package net.mograsim.logic.core.components; import java.util.List; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.types.BitVector; -import mograsim.logic.core.wires.WireObserver; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.core.wires.Wire.ReadWriteEnd; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.types.BitVector; +import net.mograsim.logic.core.wires.WireObserver; +import net.mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; public class Splitter extends Component implements WireObserver { diff --git a/era.mi/src/mograsim/logic/core/components/TriStateBuffer.java b/era.mi/src/net/mograsim/logic/core/components/TriStateBuffer.java similarity index 77% rename from era.mi/src/mograsim/logic/core/components/TriStateBuffer.java rename to era.mi/src/net/mograsim/logic/core/components/TriStateBuffer.java index c957d804..321f5bb5 100644 --- a/era.mi/src/mograsim/logic/core/components/TriStateBuffer.java +++ b/era.mi/src/net/mograsim/logic/core/components/TriStateBuffer.java @@ -1,11 +1,11 @@ -package mograsim.logic.core.components; +package net.mograsim.logic.core.components; import java.util.List; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.types.Bit; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.core.wires.Wire.ReadWriteEnd; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.types.Bit; +import net.mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; public class TriStateBuffer extends BasicComponent { diff --git a/era.mi/src/net/mograsim/logic/core/components/gates/AndGate.java b/era.mi/src/net/mograsim/logic/core/components/gates/AndGate.java new file mode 100644 index 00000000..650ee528 --- /dev/null +++ b/era.mi/src/net/mograsim/logic/core/components/gates/AndGate.java @@ -0,0 +1,14 @@ +package net.mograsim.logic.core.components.gates; + +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.types.BitVector.BitVectorMutator; +import net.mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; + +public class AndGate extends MultiInputGate +{ + public AndGate(Timeline timeline, int processTime, ReadWriteEnd out, ReadEnd... in) + { + super(timeline, processTime, BitVectorMutator::and, out, in); + } +} diff --git a/era.mi/src/mograsim/logic/core/components/gates/MultiInputGate.java b/era.mi/src/net/mograsim/logic/core/components/gates/MultiInputGate.java similarity index 71% rename from era.mi/src/mograsim/logic/core/components/gates/MultiInputGate.java rename to era.mi/src/net/mograsim/logic/core/components/gates/MultiInputGate.java index 0344f6fb..508e21c0 100644 --- a/era.mi/src/mograsim/logic/core/components/gates/MultiInputGate.java +++ b/era.mi/src/net/mograsim/logic/core/components/gates/MultiInputGate.java @@ -1,13 +1,13 @@ -package mograsim.logic.core.components.gates; +package net.mograsim.logic.core.components.gates; import java.util.List; -import mograsim.logic.core.components.BasicComponent; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.types.MutationOperation; -import mograsim.logic.core.types.BitVector.BitVectorMutator; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.core.wires.Wire.ReadWriteEnd; +import net.mograsim.logic.core.components.BasicComponent; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.types.MutationOperation; +import net.mograsim.logic.core.types.BitVector.BitVectorMutator; +import net.mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; public abstract class MultiInputGate extends BasicComponent { diff --git a/era.mi/src/mograsim/logic/core/components/gates/NotGate.java b/era.mi/src/net/mograsim/logic/core/components/gates/NotGate.java similarity index 66% rename from era.mi/src/mograsim/logic/core/components/gates/NotGate.java rename to era.mi/src/net/mograsim/logic/core/components/gates/NotGate.java index bd1aac3e..552e1d70 100644 --- a/era.mi/src/mograsim/logic/core/components/gates/NotGate.java +++ b/era.mi/src/net/mograsim/logic/core/components/gates/NotGate.java @@ -1,11 +1,11 @@ -package mograsim.logic.core.components.gates; +package net.mograsim.logic.core.components.gates; import java.util.List; -import mograsim.logic.core.components.BasicComponent; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.core.wires.Wire.ReadWriteEnd; +import net.mograsim.logic.core.components.BasicComponent; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; public class NotGate extends BasicComponent { diff --git a/era.mi/src/net/mograsim/logic/core/components/gates/OrGate.java b/era.mi/src/net/mograsim/logic/core/components/gates/OrGate.java new file mode 100644 index 00000000..987da5e0 --- /dev/null +++ b/era.mi/src/net/mograsim/logic/core/components/gates/OrGate.java @@ -0,0 +1,14 @@ +package net.mograsim.logic.core.components.gates; + +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.types.BitVector.BitVectorMutator; +import net.mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; + +public class OrGate extends MultiInputGate +{ + public OrGate(Timeline timeline, int processTime, ReadWriteEnd out, ReadEnd... in) + { + super(timeline, processTime, BitVectorMutator::or, out, in); + } +} diff --git a/era.mi/src/mograsim/logic/core/components/gates/XorGate.java b/era.mi/src/net/mograsim/logic/core/components/gates/XorGate.java similarity index 50% rename from era.mi/src/mograsim/logic/core/components/gates/XorGate.java rename to era.mi/src/net/mograsim/logic/core/components/gates/XorGate.java index 9a75900a..eaf0bc16 100644 --- a/era.mi/src/mograsim/logic/core/components/gates/XorGate.java +++ b/era.mi/src/net/mograsim/logic/core/components/gates/XorGate.java @@ -1,9 +1,9 @@ -package mograsim.logic.core.components.gates; +package net.mograsim.logic.core.components.gates; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.types.BitVector.BitVectorMutator; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.core.wires.Wire.ReadWriteEnd; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.types.BitVector.BitVectorMutator; +import net.mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; /** * Outputs 1 when the number of 1 inputs is odd. diff --git a/era.mi/src/mograsim/logic/core/tests/ComponentTest.java b/era.mi/src/net/mograsim/logic/core/tests/ComponentTest.java similarity index 90% rename from era.mi/src/mograsim/logic/core/tests/ComponentTest.java rename to era.mi/src/net/mograsim/logic/core/tests/ComponentTest.java index ec6b77f5..0ed90243 100644 --- a/era.mi/src/mograsim/logic/core/tests/ComponentTest.java +++ b/era.mi/src/net/mograsim/logic/core/tests/ComponentTest.java @@ -1,4 +1,4 @@ -package mograsim.logic.core.tests; +package net.mograsim.logic.core.tests; import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertArrayEquals; @@ -9,22 +9,22 @@ import java.util.function.LongConsumer; import org.junit.jupiter.api.Test; -import mograsim.logic.core.components.Connector; -import mograsim.logic.core.components.Demux; -import mograsim.logic.core.components.Merger; -import mograsim.logic.core.components.Mux; -import mograsim.logic.core.components.Splitter; -import mograsim.logic.core.components.TriStateBuffer; -import mograsim.logic.core.components.gates.AndGate; -import mograsim.logic.core.components.gates.NotGate; -import mograsim.logic.core.components.gates.OrGate; -import mograsim.logic.core.components.gates.XorGate; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.types.Bit; -import mograsim.logic.core.types.BitVector; -import mograsim.logic.core.wires.Wire; -import mograsim.logic.core.wires.Wire.ReadEnd; -import mograsim.logic.core.wires.Wire.ReadWriteEnd; +import net.mograsim.logic.core.components.Connector; +import net.mograsim.logic.core.components.Demux; +import net.mograsim.logic.core.components.Merger; +import net.mograsim.logic.core.components.Mux; +import net.mograsim.logic.core.components.Splitter; +import net.mograsim.logic.core.components.TriStateBuffer; +import net.mograsim.logic.core.components.gates.AndGate; +import net.mograsim.logic.core.components.gates.NotGate; +import net.mograsim.logic.core.components.gates.OrGate; +import net.mograsim.logic.core.components.gates.XorGate; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.types.Bit; +import net.mograsim.logic.core.types.BitVector; +import net.mograsim.logic.core.wires.Wire; +import net.mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; class ComponentTest { diff --git a/era.mi/src/mograsim/logic/core/tests/GUITest.java b/era.mi/src/net/mograsim/logic/core/tests/GUITest.java similarity index 91% rename from era.mi/src/mograsim/logic/core/tests/GUITest.java rename to era.mi/src/net/mograsim/logic/core/tests/GUITest.java index ad6ad183..4232710f 100644 --- a/era.mi/src/mograsim/logic/core/tests/GUITest.java +++ b/era.mi/src/net/mograsim/logic/core/tests/GUITest.java @@ -1,4 +1,4 @@ -package mograsim.logic.core.tests; +package net.mograsim.logic.core.tests; import java.awt.Color; import java.awt.Graphics; @@ -15,12 +15,12 @@ import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.WindowConstants; -import mograsim.logic.core.components.ManualSwitch; -import mograsim.logic.core.components.gates.NotGate; -import mograsim.logic.core.components.gates.OrGate; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.timeline.Timeline.ExecutionResult; -import mograsim.logic.core.wires.Wire; +import net.mograsim.logic.core.components.ManualSwitch; +import net.mograsim.logic.core.components.gates.NotGate; +import net.mograsim.logic.core.components.gates.OrGate; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.timeline.Timeline.ExecutionResult; +import net.mograsim.logic.core.wires.Wire; public class GUITest extends JPanel { diff --git a/era.mi/src/mograsim/logic/core/tests/TestBitDisplay.java b/era.mi/src/net/mograsim/logic/core/tests/TestBitDisplay.java similarity index 74% rename from era.mi/src/mograsim/logic/core/tests/TestBitDisplay.java rename to era.mi/src/net/mograsim/logic/core/tests/TestBitDisplay.java index aea2d36b..41a8f58c 100644 --- a/era.mi/src/mograsim/logic/core/tests/TestBitDisplay.java +++ b/era.mi/src/net/mograsim/logic/core/tests/TestBitDisplay.java @@ -1,13 +1,13 @@ -package mograsim.logic.core.tests; +package net.mograsim.logic.core.tests; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import java.util.function.LongConsumer; -import mograsim.logic.core.components.BitDisplay; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.types.Bit; -import mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.components.BitDisplay; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.types.Bit; +import net.mograsim.logic.core.wires.Wire.ReadEnd; public final class TestBitDisplay extends BitDisplay { diff --git a/era.mi/src/mograsim/logic/core/timeline/Timeline.java b/era.mi/src/net/mograsim/logic/core/timeline/Timeline.java similarity index 99% rename from era.mi/src/mograsim/logic/core/timeline/Timeline.java rename to era.mi/src/net/mograsim/logic/core/timeline/Timeline.java index 1a380b41..fb639bed 100644 --- a/era.mi/src/mograsim/logic/core/timeline/Timeline.java +++ b/era.mi/src/net/mograsim/logic/core/timeline/Timeline.java @@ -1,4 +1,4 @@ -package mograsim.logic.core.timeline; +package net.mograsim.logic.core.timeline; import java.util.ArrayList; import java.util.List; diff --git a/era.mi/src/mograsim/logic/core/timeline/TimelineEvent.java b/era.mi/src/net/mograsim/logic/core/timeline/TimelineEvent.java similarity index 91% rename from era.mi/src/mograsim/logic/core/timeline/TimelineEvent.java rename to era.mi/src/net/mograsim/logic/core/timeline/TimelineEvent.java index 6372bde8..c46e6ad6 100644 --- a/era.mi/src/mograsim/logic/core/timeline/TimelineEvent.java +++ b/era.mi/src/net/mograsim/logic/core/timeline/TimelineEvent.java @@ -1,4 +1,4 @@ -package mograsim.logic.core.timeline; +package net.mograsim.logic.core.timeline; /** * A class that stores all relevant information about an event in the {@link Timeline}. Currently, there is not much relevant information to diff --git a/era.mi/src/mograsim/logic/core/timeline/TimelineEventHandler.java b/era.mi/src/net/mograsim/logic/core/timeline/TimelineEventHandler.java similarity index 69% rename from era.mi/src/mograsim/logic/core/timeline/TimelineEventHandler.java rename to era.mi/src/net/mograsim/logic/core/timeline/TimelineEventHandler.java index dd58c0b3..badbabcb 100644 --- a/era.mi/src/mograsim/logic/core/timeline/TimelineEventHandler.java +++ b/era.mi/src/net/mograsim/logic/core/timeline/TimelineEventHandler.java @@ -1,4 +1,4 @@ -package mograsim.logic.core.timeline; +package net.mograsim.logic.core.timeline; @FunctionalInterface public interface TimelineEventHandler diff --git a/era.mi/src/mograsim/logic/core/types/Bit.java b/era.mi/src/net/mograsim/logic/core/types/Bit.java similarity index 98% rename from era.mi/src/mograsim/logic/core/types/Bit.java rename to era.mi/src/net/mograsim/logic/core/types/Bit.java index 60c4e192..fbfd0d56 100644 --- a/era.mi/src/mograsim/logic/core/types/Bit.java +++ b/era.mi/src/net/mograsim/logic/core/types/Bit.java @@ -1,4 +1,4 @@ -package mograsim.logic.core.types; +package net.mograsim.logic.core.types; import java.util.Arrays; import java.util.Map; diff --git a/era.mi/src/mograsim/logic/core/types/BitVector.java b/era.mi/src/net/mograsim/logic/core/types/BitVector.java similarity index 99% rename from era.mi/src/mograsim/logic/core/types/BitVector.java rename to era.mi/src/net/mograsim/logic/core/types/BitVector.java index 2d28b2ce..1e87f9a4 100644 --- a/era.mi/src/mograsim/logic/core/types/BitVector.java +++ b/era.mi/src/net/mograsim/logic/core/types/BitVector.java @@ -1,4 +1,4 @@ -package mograsim.logic.core.types; +package net.mograsim.logic.core.types; import static java.lang.String.format; diff --git a/era.mi/src/mograsim/logic/core/types/BitVectorFormatter.java b/era.mi/src/net/mograsim/logic/core/types/BitVectorFormatter.java similarity index 89% rename from era.mi/src/mograsim/logic/core/types/BitVectorFormatter.java rename to era.mi/src/net/mograsim/logic/core/types/BitVectorFormatter.java index 9a61c11a..a7985319 100644 --- a/era.mi/src/mograsim/logic/core/types/BitVectorFormatter.java +++ b/era.mi/src/net/mograsim/logic/core/types/BitVectorFormatter.java @@ -1,7 +1,7 @@ -package mograsim.logic.core.types; +package net.mograsim.logic.core.types; -import mograsim.logic.core.types.ColorDefinition.BuiltInColor; -import mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.types.ColorDefinition.BuiltInColor; +import net.mograsim.logic.core.wires.Wire.ReadEnd; public class BitVectorFormatter { diff --git a/era.mi/src/mograsim/logic/core/types/ColorDefinition.java b/era.mi/src/net/mograsim/logic/core/types/ColorDefinition.java similarity index 97% rename from era.mi/src/mograsim/logic/core/types/ColorDefinition.java rename to era.mi/src/net/mograsim/logic/core/types/ColorDefinition.java index 7d69837a..28017362 100644 --- a/era.mi/src/mograsim/logic/core/types/ColorDefinition.java +++ b/era.mi/src/net/mograsim/logic/core/types/ColorDefinition.java @@ -1,4 +1,4 @@ -package mograsim.logic.core.types; +package net.mograsim.logic.core.types; /** * A way to define a color with the possibility to use colors built into the system (called "system colors" in SWT). diff --git a/era.mi/src/mograsim/logic/core/types/LogicType.java b/era.mi/src/net/mograsim/logic/core/types/LogicType.java similarity index 98% rename from era.mi/src/mograsim/logic/core/types/LogicType.java rename to era.mi/src/net/mograsim/logic/core/types/LogicType.java index b4e4efbc..39ae6816 100644 --- a/era.mi/src/mograsim/logic/core/types/LogicType.java +++ b/era.mi/src/net/mograsim/logic/core/types/LogicType.java @@ -1,4 +1,4 @@ -package mograsim.logic.core.types; +package net.mograsim.logic.core.types; /** * Interface for types that support the basic logic operations diff --git a/era.mi/src/mograsim/logic/core/types/MutationOperation.java b/era.mi/src/net/mograsim/logic/core/types/MutationOperation.java similarity index 68% rename from era.mi/src/mograsim/logic/core/types/MutationOperation.java rename to era.mi/src/net/mograsim/logic/core/types/MutationOperation.java index 998e5979..1fdae21c 100644 --- a/era.mi/src/mograsim/logic/core/types/MutationOperation.java +++ b/era.mi/src/net/mograsim/logic/core/types/MutationOperation.java @@ -1,8 +1,8 @@ -package mograsim.logic.core.types; +package net.mograsim.logic.core.types; import java.util.function.BiFunction; -import mograsim.logic.core.types.BitVector.BitVectorMutator; +import net.mograsim.logic.core.types.BitVector.BitVectorMutator; @FunctionalInterface public interface MutationOperation extends BiFunction diff --git a/era.mi/src/mograsim/logic/core/types/StrictLogicType.java b/era.mi/src/net/mograsim/logic/core/types/StrictLogicType.java similarity index 90% rename from era.mi/src/mograsim/logic/core/types/StrictLogicType.java rename to era.mi/src/net/mograsim/logic/core/types/StrictLogicType.java index 91cb10f2..c830b586 100644 --- a/era.mi/src/mograsim/logic/core/types/StrictLogicType.java +++ b/era.mi/src/net/mograsim/logic/core/types/StrictLogicType.java @@ -1,4 +1,4 @@ -package mograsim.logic.core.types; +package net.mograsim.logic.core.types; /** * Interface for types that support the basic logic operations only among themselves, making it mathematically closed diff --git a/era.mi/src/mograsim/logic/core/wires/Wire.java b/era.mi/src/net/mograsim/logic/core/wires/Wire.java similarity index 93% rename from era.mi/src/mograsim/logic/core/wires/Wire.java rename to era.mi/src/net/mograsim/logic/core/wires/Wire.java index 6a6a9fa2..d56ca2a5 100644 --- a/era.mi/src/mograsim/logic/core/wires/Wire.java +++ b/era.mi/src/net/mograsim/logic/core/wires/Wire.java @@ -1,15 +1,15 @@ -package mograsim.logic.core.wires; +package net.mograsim.logic.core.wires; -import static mograsim.logic.core.types.Bit.U; -import static mograsim.logic.core.types.Bit.Z; +import static net.mograsim.logic.core.types.Bit.U; +import static net.mograsim.logic.core.types.Bit.Z; import java.util.ArrayList; import java.util.List; -import mograsim.logic.core.timeline.Timeline; -import mograsim.logic.core.types.Bit; -import mograsim.logic.core.types.BitVector; -import mograsim.logic.core.types.BitVector.BitVectorMutator; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.types.Bit; +import net.mograsim.logic.core.types.BitVector; +import net.mograsim.logic.core.types.BitVector.BitVectorMutator; /** * Represents an array of wires that can store n bits of information. diff --git a/era.mi/src/net/mograsim/logic/core/wires/WireObserver.java b/era.mi/src/net/mograsim/logic/core/wires/WireObserver.java new file mode 100644 index 00000000..93cdcb4e --- /dev/null +++ b/era.mi/src/net/mograsim/logic/core/wires/WireObserver.java @@ -0,0 +1,9 @@ +package net.mograsim.logic.core.wires; + +import net.mograsim.logic.core.types.BitVector; +import net.mograsim.logic.core.wires.Wire.ReadEnd; + +public interface WireObserver +{ + public void update(ReadEnd initiator, BitVector oldValues); +} -- 2.17.1