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
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 ->
{
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)
{
IFileEditorInput fileInput = (IFileEditorInput) input;
context = ProjectMachineContext.getMachineContextOf(fileInput.getFile().getProject());
context.activateMachine();
- context.addActiveMachineListener(activeMNachineListener);
+ context.addActiveMachineListener(activeMachineListener);
recreateContextDependentControls();
setPartName(fileInput.getName());
public void dispose()
{
stopExecAndDeregisterContextDependentListeners();
- context.removeActiveMachineListener(activeMNachineListener);
+ context.removeActiveMachineListener(activeMachineListener);
super.dispose();
}
}
\ No newline at end of file