From: Daniel Kirschten Date: Mon, 13 May 2019 19:24:54 +0000 (+0200) Subject: Created first example class X-Git-Url: https://mograsim.net/gitweb/?a=commitdiff_plain;h=93b353a1acffd20ec7d29ffbea26a9671d422b9b;p=Mograsim.git Created first example class --- diff --git a/LogicUI/src/LogicUIPlayground.java b/LogicUI/src/LogicUIPlayground.java new file mode 100644 index 00000000..4bcf8aa8 --- /dev/null +++ b/LogicUI/src/LogicUIPlayground.java @@ -0,0 +1,27 @@ +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; + +import net.haspamelodica.swt.helper.zoomablecanvas.ZoomableCanvas; +import net.haspamelodica.swt.helper.zoomablecanvas.helper.ZoomableCanvasOverlay; +import net.haspamelodica.swt.helper.zoomablecanvas.helper.ZoomableCanvasUserInput; + +public class LogicUIPlayground +{ + public static void main(String[] args) + { + Display display = new Display(); + Shell shell = new Shell(display); + shell.setLayout(new FillLayout()); + ZoomableCanvas canvas = new ZoomableCanvas(shell, SWT.NONE); + canvas.setBackground(display.getSystemColor(SWT.COLOR_CYAN)); + canvas.addZoomedRenderer(gc -> gc.drawText("Test", 0, 0)); + new ZoomableCanvasUserInput(canvas).enableUserInput(); + new ZoomableCanvasOverlay(canvas, null).enableScale(); + shell.open(); + while(!shell.isDisposed()) + if(!display.readAndDispatch()) + display.sleep(); + } +} \ No newline at end of file