Added preferences for mouse button assignments
[Mograsim.git] / plugins / net.mograsim.logic.model / src / net / mograsim / logic / model / LogicUIStandaloneGUI.java
index 49182d6..55a96a5 100644 (file)
@@ -8,6 +8,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.preferences.Preferences;
 
 /**
  * Standalone simulation visualizer graphical user interface.
@@ -28,8 +29,8 @@ public class LogicUIStandaloneGUI implements Runnable
                ui = new LogicUICanvas(shell, SWT.NONE, model);
 
                ZoomableCanvasUserInput userInput = new ZoomableCanvasUserInput(ui);
-               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();
                new ZoomableCanvasOverlay(ui, null).enableScale();
        }