Example usage for com.google.gwt.useragent.client UserAgent getCompileTimeValue

List of usage examples for com.google.gwt.useragent.client UserAgent getCompileTimeValue

Introduction

In this page you can find the example usage for com.google.gwt.useragent.client UserAgent getCompileTimeValue.

Prototype

String getCompileTimeValue();

Source Link

Document

Returns the value of user agent for this permutation

Usage

From source file:mobi.openddr.example.gwtcanvasdemo.client.DmapGwtCanvas.java

License:Open Source License

public void onModuleLoad() {
    UserAgent impl = GWT.create(UserAgent.class);
    Window win = GWT.create(Window.class);

    String compileTimeValue = impl.getCompileTimeValue();
    String runtimeValue = impl.getRuntimeValue();
    System.out.println(compileTimeValue + "->" + runtimeValue);
    height = win.getClientHeight() - 100;
    width = win.getClientWidth() - 80;//from ww w .j  a v a  2s  .  c o m

    canvas = Canvas.createIfSupported();
    backBuffer = Canvas.createIfSupported();
    if (canvas == null) {
        RootPanel.get(HOLDER_ID).add(new Label(UPGRADE_MESSAGE));
        return;
    }

    // init the canvases
    canvas.setWidth(width + "px");
    canvas.setHeight(height + "px");
    canvas.setCoordinateSpaceWidth(width);
    canvas.setCoordinateSpaceHeight(height);
    backBuffer.setCoordinateSpaceWidth(width);
    backBuffer.setCoordinateSpaceHeight(height);
    RootPanel.get(HOLDER_ID).add(canvas);
    context = canvas.getContext2d();
    backBufferContext = backBuffer.getContext2d();

    // init the objects
    logoGroup = new LogoGroup(width, height, 18, 165);
    ballGroup = new BallGroup(width, height);
    lens = new Lens(35, 15, width, height, new Vector(320, 150), new Vector(1, 1));

    // init handlers
    initHandlers();

    // setup timer
    final Timer timer = new Timer() {
        @Override
        public void run() {
            doUpdate();
        }
    };
    timer.scheduleRepeating(REFRESH_RATE);
}