From d6fa96b4cd67cf4fa18b5b9b6739f9bc2494a9f4 Mon Sep 17 00:00:00 2001 From: guest Date: Tue, 23 Sep 2008 21:29:27 +0000 Subject: initial import git-svn-id: http://manut.eu/svn/yalp/trunk@1 f059d3a0-6783-47b7-97ff-1fe0bbf25129 --- src/YalpClients/SwtClient/GUI/InitGUI.java | 58 ++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/YalpClients/SwtClient/GUI/InitGUI.java (limited to 'src/YalpClients/SwtClient/GUI/InitGUI.java') diff --git a/src/YalpClients/SwtClient/GUI/InitGUI.java b/src/YalpClients/SwtClient/GUI/InitGUI.java new file mode 100644 index 0000000..6b1fa51 --- /dev/null +++ b/src/YalpClients/SwtClient/GUI/InitGUI.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2006 Manuel Traut and Volker Dahnke + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: Manuel Traut and Volker Dahnke + */ + +package YalpClients.SwtClient.GUI; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; + +import YalpClients.SwtClient.*; +import YalpInterfaces.AccessRights; + +/* + * Class InitGUI + * + * + * + * @author Volker Dahnke / Manuel Traut + * + * @version 1 02-04-2006
+ * + */ + +public class InitGUI { + private Model model; + private Display display; + private int time = 1000; + + public InitGUI(Model model,AccessRights kind){ + this.model=model; + this.display = Display.getDefault(); + final Runnable timer = new Runnable() { + public void run() { + serverStillAlive(this); + } + }; + display.timerExec(time, timer); + + GUI gui= new GUI( + new Shell(display ,SWT.MIN), display, model, kind, SWT.NULL ); + gui.show(); + } + + public void serverStillAlive(Runnable timer){ + model.serverStillAlive(); + if (!this.model.getLogoff()){ + this.display.timerExec(time, timer); + } + } + +} -- cgit v1.2.3