X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=plugins%2Fnet.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2FLogicUIStandaloneGUI.java;h=e803c2640fffedf5b8ebc9784e9fcc7653fd8ad4;hb=7908fec28b61e5911bf6523a3c10cd3a31dc95e6;hp=49182d6680142e13c325123807ae9c7155168890;hpb=7d05144c25daa53e60fc9ed9fd503546a86567f8;p=Mograsim.git diff --git a/plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/LogicUIStandaloneGUI.java b/plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/LogicUIStandaloneGUI.java index 49182d66..e803c264 100644 --- a/plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/LogicUIStandaloneGUI.java +++ b/plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/LogicUIStandaloneGUI.java @@ -1,5 +1,8 @@ package net.mograsim.logic.model; +import static net.mograsim.logic.model.preferences.RenderPreferences.DRAG_BUTTON; +import static net.mograsim.logic.model.preferences.RenderPreferences.ZOOM_BUTTON; + import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Display; @@ -8,6 +11,7 @@ import org.eclipse.swt.widgets.Shell; import net.haspamelodica.swt.helper.zoomablecanvas.helper.ZoomableCanvasOverlay; import net.haspamelodica.swt.helper.zoomablecanvas.helper.ZoomableCanvasUserInput; import net.mograsim.logic.model.model.LogicModel; +import net.mograsim.logic.model.preferences.RenderPreferences; /** * Standalone simulation visualizer graphical user interface. @@ -20,16 +24,18 @@ public class LogicUIStandaloneGUI implements Runnable private final Shell shell; private final LogicUICanvas ui; - public LogicUIStandaloneGUI(LogicModel model) + public LogicUIStandaloneGUI(LogicModel model, RenderPreferences renderPrefs) { display = new Display(); shell = new Shell(display); shell.setLayout(new FillLayout()); - ui = new LogicUICanvas(shell, SWT.NONE, model); + ui = new LogicUICanvas(shell, SWT.NONE, model, renderPrefs); ZoomableCanvasUserInput userInput = new ZoomableCanvasUserInput(ui); - userInput.buttonDrag = 3; - userInput.buttonZoom = 2; + // TODO add a listener + userInput.buttonDrag = renderPrefs.getInt(DRAG_BUTTON); + // TODO add a listener + userInput.buttonZoom = renderPrefs.getInt(ZOOM_BUTTON); userInput.enableUserInput(); new ZoomableCanvasOverlay(ui, null).enableScale(); }