X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=plugins%2Fnet.mograsim.plugin.core%2Fsrc%2Fnet%2Fmograsim%2Fplugin%2Feditors%2FSimulationViewEditor.java;h=3000d65a2352795af6ac0d0ca0dd7be5e34de050;hb=b1b3d8cc232d51c3a5d505acd2be052eb72300ee;hp=06fadc001fc880876b2867bf7f3aa0925e5e2440;hpb=26eb7899013bc52e4501ee97422d79d6e1ea2b9c;p=Mograsim.git diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/SimulationViewEditor.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/SimulationViewEditor.java index 06fadc00..3000d65a 100644 --- a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/SimulationViewEditor.java +++ b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/SimulationViewEditor.java @@ -38,6 +38,7 @@ import net.mograsim.plugin.nature.ProjectMachineContext; import net.mograsim.plugin.tables.DisplaySettings; import net.mograsim.plugin.tables.mi.ActiveInstructionPreviewContentProvider; import net.mograsim.plugin.tables.mi.InstructionTable; +import net.mograsim.preferences.Preferences; //TODO what if we open multiple editors? //TODO actually save / load register and latch states @@ -59,13 +60,13 @@ public class SimulationViewEditor extends EditorPart private InstructionTable instPreview; private Label noMachineLabel; - private ActiveMachineListener activeMNachineListener; + private ActiveMachineListener activeMachineListener; private MemoryCellModifiedListener memCellListener; private LogicObserver clockObserver; public SimulationViewEditor() { - activeMNachineListener = m -> recreateContextDependentControls(); + activeMachineListener = m -> recreateContextDependentControls(); memCellListener = a -> instPreview.refresh(); clockObserver = o -> { @@ -135,8 +136,8 @@ public class SimulationViewEditor extends EditorPart machine = machineOptional.get(); canvas = new LogicUICanvas(canvasParent, SWT.NONE, machine.getModel()); ZoomableCanvasUserInput userInput = new ZoomableCanvasUserInput(canvas); - userInput.buttonDrag = 3; - userInput.buttonZoom = 2; + userInput.buttonDrag = Preferences.current().getInt("net.mograsim.logic.model.button.drag"); + userInput.buttonZoom = Preferences.current().getInt("net.mograsim.logic.model.button.zoom"); userInput.enableUserInput(); if (zoom > 0) { @@ -288,7 +289,7 @@ public class SimulationViewEditor extends EditorPart IFileEditorInput fileInput = (IFileEditorInput) input; context = ProjectMachineContext.getMachineContextOf(fileInput.getFile().getProject()); context.activateMachine(); - context.addActiveMachineListener(activeMNachineListener); + context.addActiveMachineListener(activeMachineListener); recreateContextDependentControls(); setPartName(fileInput.getName()); @@ -348,7 +349,7 @@ public class SimulationViewEditor extends EditorPart public void dispose() { stopExecAndDeregisterContextDependentListeners(); - context.removeActiveMachineListener(activeMNachineListener); + context.removeActiveMachineListener(activeMachineListener); super.dispose(); } } \ No newline at end of file