Package org.codemap.sandbox.main

Source Code of org.codemap.sandbox.main.SwtMain

package org.codemap.sandbox.main;

/*******************************************************************************
* Copyright (c) 2000, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
*     IBM Corporation - initial API and implementation
*******************************************************************************/

/*
* Canvas snippet: paint a circle in a canvas
*
* For a list of all SWT example snippets see
* http://www.eclipse.org/swt/snippets/
*/

import org.codemap.callhierarchy.vizualization.Globals;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class SwtMain extends Canvas {
   
    public SwtMain(Composite parent) {
        super(parent, SWT.NONE);
       
        setSize(Globals.getScreenDimension());
    }

    public static void main(String[] args) {
//        System.setProperty("java.awt.headless", "true");
        Display display = new Display();
        Shell shell = new Shell(display);
        shell.setLayout(new FillLayout());
        new SwtMain(shell);

        shell.open();
        while (!shell.isDisposed()) {
            if (!display.readAndDispatch())
                display.sleep();
        }
        display.dispose();
    }
}
TOP

Related Classes of org.codemap.sandbox.main.SwtMain

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.