1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
| package fr.iut2.sil1.Game_Of_Troll.client.vues;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DeckPanel;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.google.gwt.user.client.ui.Widget;
import fr.iut2.sil1.Game_Of_Troll.client.services.XMLTools;
public class Racine extends Composite {
private static RacineUiBinder uiBinder = GWT.create(RacineUiBinder.class);
interface RacineUiBinder extends UiBinder<Widget, Racine> {
}
private static Racine SINGLETON;
@UiField
DeckPanel deckPanel;
@UiField
Edit_Troll Edit;
@UiField
Image_Troll Image;
@UiField
Liste_Troll Liste;
@UiField(provided=true)
ActionPanel actionPanel;
public Racine(HandlerManager eventBus) {
deckPanel = new DeckPanel();
actionPanel = new ActionPanel(eventBus);
Edit = new Edit_Troll();
Image = new Image_Troll();
Liste = new Liste_Troll();
deckPanel.add(Edit);
deckPanel.add(Image);
deckPanel.add(Liste);
initWidget(uiBinder.createAndBindUi(this));
deckPanel.showWidget(0);
try {
Troll troll = new Troll("Kichnifou", "d", "e", "f", 8, 9, 10, 78, 1422);
XMLTools.encodeToFile(troll, "troll.xml");
} catch(Exception e) {
e.printStackTrace();
}
SINGLETON = this;
RootLayoutPanel.get().add(this);
}
public static Racine get(){
return SINGLETON;
}
public DeckPanel getDeckPanel() {
return deckPanel;
}
public void go(HasWidgets container){
container.clear();
container.add(this);
}
} |
Partager