MainDemoApp.java :  » GWT » ftr-gwt-library » eu » future » earth » gwt » client » Java Open Source

Java Open Source » GWT » ftr gwt library 
ftr gwt library » eu » future » earth » gwt » client » MainDemoApp.java
/*
 * Copyright 2007 Future Earth, info@future-earth.eu
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package eu.future.earth.gwt.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.google.gwt.user.client.ui.TabLayoutPanel;

import eu.future.earth.gwt.client.hordate.HorizontalDemo;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class MainDemoApp implements EntryPoint, ResizeHandler {

  private OverviewPanelDemo cal = new OverviewPanelDemo();

//  private HorizontalDemo cal2 = new HorizontalDemo();

//  private FileUploadDemo file = new FileUploadDemo();

  private TabLayoutPanel tabsPanel = new TabLayoutPanel(30, Unit.MM);

//  private ChartDemo graphDemo = new ChartDemo();

  /**
   * This is the entry point method.
   */
  public void onModuleLoad() {

    // singleton = this;

    RootLayoutPanel.get().add(tabsPanel);
    tabsPanel.add(cal, "Calander");
//    tabsPanel.add(cal2, "Horizontal time panel");
//    tabsPanel.add(file, "File Upload");
//    tabsPanel.add(graphDemo, "Graph");
    tabsPanel.selectTab(0);
    Window.addResizeHandler(this);
    Scheduler.get().scheduleDeferred(new ScheduledCommand() {

      @Override
      public void execute() {
        onResize(null);
      }
    });
  }

  public void onResize(ResizeEvent event) {
    cal.setPixelSize(Window.getClientWidth() - 230, Window.getClientHeight() - 280);

  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.