Rev 25 | Blame | Last modification | View Log | RSS feed
/**David Delon david.delon@clapas.net 2007*//** Cel.java (Point d'entree de l'application carnet en ligne)** Cas d'utilisation :* Initialisation de l'application** 1: Le programme initialise la classe intercesseur (mediator), classe ou sont decrites les actions de l'application.* 2: Le programme s'enregistre aupres de la classe intercesseur* 3: Le programme recherche les informations de connections (utilisateur ou anonyme)* 4: Le programme initialise les differents panneaux composant l'affichage**/package org.tela_botanica.client;import com.google.gwt.core.client.EntryPoint;import com.google.gwt.user.client.Command;import com.google.gwt.user.client.DeferredCommand;import com.google.gwt.user.client.Window;import com.google.gwt.user.client.WindowResizeListener;import com.google.gwt.user.client.ui.DockPanel;import com.google.gwt.user.client.ui.RootPanel;import com.google.gwt.user.client.ui.VerticalPanel;/*** Entry point classes define <code>onModuleLoad()</code>.*/public class Cel implements EntryPoint, WindowResizeListener {private TopPanel topPanel = null; // Identifiant de connexion et titreprivate CenterPanel centerPanel = null; // Liste de relevesprivate LeftPanel leftPanel = null; // Filtres sur liste de relevesprivate EntryPanel entryPanel = null; // Saisie d'un releveprivate ActionPanel actionPanel = null; // Action sur les relevés saisisprivate SearchPanel searchPanel = null; // Recherche dans les relevés saisisprivate VerticalPanel rightPanel = null; // Container panneau précedents (sauf left et popup)private Mediator mediator = null; // Intermediaire entre les differents classes/*** Point d'entree : recherche du pres-requis : information de connection.*/public void onModuleLoad() {mediator= new Mediator();mediator.registerCel(this); // Declaration point d'entree aupres de la classe intercesseurmediator.initUser(); // Initialisation environnement utilisateur (Cette methode appelle la methode initAsync() suivante)}/*** Fin de l'initialisation**/public void initAsync() {centerPanel = new CenterPanel(mediator); // Liste de relevestopPanel = new TopPanel(mediator); // Identifiant de connectionleftPanel = new LeftPanel(mediator); // Filte de liste de relevesentryPanel = new EntryPanel(mediator); // Formulaire de saisieactionPanel = new ActionPanel(mediator); // Action sur releves saisissearchPanel = new SearchPanel(mediator); // Recherche dans relevesrightPanel = new VerticalPanel(); // Container des panneaux precedentsentryPanel.setStyleName("item-Input");// Assemblage des differents panneauxrightPanel.add(searchPanel);rightPanel.add(entryPanel);rightPanel.add(centerPanel);rightPanel.add(actionPanel);rightPanel.setWidth("100%");centerPanel.setWidth("100%");entryPanel.setWidth("100%");topPanel.setWidth("100%");rightPanel.setSpacing(2);// Disposition générale :DockPanel outer = new DockPanel();outer.add(topPanel, DockPanel.NORTH);outer.add(rightPanel, DockPanel.CENTER);outer.add(leftPanel, DockPanel.WEST);outer.setWidth("100%");outer.setSpacing(2);outer.setCellWidth(rightPanel, "100%");// Window.enableScrolling(false);Window.setMargin("0px");// Initialisation des differents contenus ...mediator.onInit();RootPanel.get().add(outer);// Call the window resized handler to get the initial sizes setup. Doing// this in a deferred command causes it to occur after all widgets' sizes// have been computed by the browser.DeferredCommand.add(new Command() {public void execute() {onWindowResized(Window.getClientWidth(), Window.getClientHeight());}});}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);}}/* +--Fin du code ---------------------------------------------------------------------------------------+* $Log$**/