Package ch.fusun.baron.coatofarms.ui

Source Code of ch.fusun.baron.coatofarms.ui.Starter

package ch.fusun.baron.coatofarms.ui;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

import ch.fusun.baron.coatofarms.ui.background.DiagonallyDownDividedBackground;

/**
* Test class
*/
public class Starter {

  /**
   * @param args
   *            glug
   */
  public static void main(String[] args) {
    Display display = new Display();
    final Shell shell = new Shell(display);
    shell.setLayout(new GridLayout());

    CoatOfArmsData coa = new CoatOfArmsData(
        new DiagonallyDownDividedBackground(COAColor.AZURE,
            COAColor.ARGENT), new COAForeground() {

          @Override
          public void drawForeground(GC gc) {
            // Do nothing
          }
        });

    CoatOfArmsViewer viewer = new CoatOfArmsViewer(shell, SWT.None);
    viewer.setCoatOfArms(coa);
    viewer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    shell.setText("Configure a coat of arms"); //$NON-NLS-1$
    shell.open();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
    display.dispose();
  }
}
TOP

Related Classes of ch.fusun.baron.coatofarms.ui.Starter

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.