Subversion Repositories eFlore/Archives.cel-v1

Rev

Rev 4 | Blame | Last modification | View Log | RSS feed

package org.tela_botanica.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.RootPanel;

import org.tela_botanica.client.TopPanel;
import org.tela_botanica.client.CenterPanel;
import org.tela_botanica.client.LeftPanel;



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


  
  private TopPanel topPanel = null;
  private CenterPanel centerPanel = null;
  private LeftPanel leftPanel = null;

  private Mediator mediator = null;


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


         mediator= new Mediator();
         mediator.registerCel(this);
         mediator.initUser();
                
                
  }
  
  public void initAsync() {
          

          topPanel = new TopPanel();
          centerPanel = new CenterPanel(mediator);
          leftPanel = new LeftPanel(mediator);

          
          // Information haut de page (nom application, connexion ... etc).
          // A regler 
          
          topPanel.setWidth("100%");

          
          // DockPanel permet d'arranger plusieurs panneaux au coins cardinaux, le panneau central remplissant
          // l'espace laissé.
          
          
          DockPanel outer = new DockPanel();
          outer.add(topPanel, DockPanel.NORTH);
          outer.add(centerPanel, DockPanel.CENTER);
          outer.add(leftPanel, DockPanel.WEST);
          
          centerPanel.setWidth("100%");
          // LeftPanel : 
          // Pour l'instant : relevés.
          
          outer.setWidth("100%");

          outer.setSpacing(4);
          outer.setCellWidth(centerPanel, "100%");
         
//        Window.enableScrolling(false);
          Window.setMargin("0px");

          // Finally, add the outer panel to the RootPanel, so that it will be
          // displayed.
          RootPanel.get().add(outer);


  }
  
  
  public void onWindowResized(int width, int height) {
            // Adjust the shortcut panel and detail area to take up the available room
            // in the window.
            int shortcutHeight = height - leftPanel.getAbsoluteTop() - 8;
            if (shortcutHeight < 1)
              shortcutHeight = 1;
            leftPanel.setHeight("" + shortcutHeight);

  }
  


}