List of usage examples for com.google.gwt.user.client.ui HTML HTML
protected HTML(Element element)
From source file:com.fullmetalgalaxy.client.creation.WgtEditAdmin.java
License:Open Source License
public WgtEditAdmin() { m_panel.add(new Label("current turn:")); m_panel.add(m_intCurrentTurn);//w ww . j a v a 2s .com m_intCurrentTurn.addValueChangeHandler(new ValueChangeHandler<Integer>() { @Override public void onValueChange(ValueChangeEvent<Integer> p_event) { int delta = m_intCurrentTurn.getValue() - GameEngine.model().getGame().getCurrentTimeStep(); GameEngine.model().getGame() .setLastTideChange(GameEngine.model().getGame().getLastTideChange() + delta); GameEngine.model().getGame().setCurrentTimeStep(m_intCurrentTurn.getValue()); } }); m_panel.add(new Label("game status:")); for (GameStatus status : GameStatus.values()) { m_lstStatus.addItem(status.toString()); } m_lstStatus.setVisibleItemCount(1); m_lstStatus.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent p_event) { GameEngine.model().getGame() .setStatus(GameStatus.valueOf(m_lstStatus.getItemText(m_lstStatus.getSelectedIndex()))); } }); m_panel.add(m_lstStatus); m_panel.add(new Label("creator pseudo:")); m_panel.add(m_txtCreatorPseudo); m_txtCreatorPseudo.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent p_event) { GameEngine.model().getGame().getAccountCreator().setPseudo(m_txtCreatorPseudo.getText()); } }); m_panel.add(new Label("creator ID:")); m_panel.add(m_txtCreatorId); m_txtCreatorId.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent p_event) { GameEngine.model().getGame().getAccountCreator().setId(Long.parseLong(m_txtCreatorId.getText())); } }); m_panel.add(new HTML("<hr>")); // =================== m_lstReg.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent p_event) { m_wgtOneReg.loadRegistration(m_mapReg.get(m_lstReg.getItemText(m_lstReg.getSelectedIndex()))); } }); m_lstReg.setVisibleItemCount(10); HorizontalPanel hpanel = new HorizontalPanel(); hpanel.add(m_lstReg); hpanel.add(m_wgtOneReg); m_panel.add(hpanel); m_panel.add(new HTML("<hr>")); // =================== m_panel.add(m_wgtConfigGameTime); initWidget(m_panel); }
From source file:com.fullmetalgalaxy.client.creation.WgtToolsEditLands.java
License:Open Source License
/** * /*www .j a v a 2 s. co m*/ */ public WgtToolsEditLands(WgtBoardEditLand p_wgtlayerEditLand) { assert p_wgtlayerEditLand != null; m_wgtlayerEditLand = p_wgtlayerEditLand; m_lstPlanet.addChangeListener(this); m_lstPlanet.setVisibleItemCount(1); for (PlanetType planet : PlanetType.values()) { m_lstPlanet.addItem(Messages.getPlanetString(0, planet)); m_planets.add(planet); } m_panel.add(m_lstPlanet); for (MapShape shape : MapShape.values()) { m_lstMapShape.addItem(shape.toString()); } m_lstMapShape.setVisibleItemCount(1); m_lstMapShape.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent p_event) { GameEngine.model().getGame() .setMapShape(MapShape.valueOf(m_lstMapShape.getValue(m_lstMapShape.getSelectedIndex()))); } }); m_panel.add(m_lstMapShape); m_panel.add(new Label("taille de carte")); Panel hpanel = new HorizontalPanel(); m_txtLandWidth.setWidth("30px"); m_txtLandHeight.setWidth("30px"); hpanel.add(m_txtLandWidth); hpanel.add(m_txtLandHeight); m_panel.add(hpanel); m_btnClear.addClickHandler(this); m_panel.add(m_btnClear); m_btnGenerate.addClickHandler(this); m_panel.add(m_btnGenerate); m_lstAlgo.addItem("Lakes", "" + Boolean.TRUE); m_lstAlgo.addItem("Islands", "" + Boolean.FALSE); m_lstAlgo.setSelectedIndex(0); m_lstAlgo.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent p_event) { GameGenerator.setLakeBoard(Boolean.parseBoolean(m_lstAlgo.getValue(m_lstAlgo.getSelectedIndex()))); } }); m_panel.add(m_lstAlgo); hpanel = new HorizontalPanel(); hpanel.add(new Label("terre en %")); m_txtLandPercent.addChangeListener(this); hpanel.add(m_txtLandPercent); m_txtLandPercent.setText("" + GameGenerator.getLandPercent()); m_txtLandPercent.setMaxLength(3); m_txtLandPercent.setWidth("30px"); m_panel.add(hpanel); hpanel = new HorizontalPanel(); hpanel.add(new Label("Hexagonale")); hpanel.add(m_chkRoundMap); m_chkRoundMap.setChecked(GameGenerator.isHexagonMap()); m_panel.add(hpanel); m_btnLoadMap.addClickHandler(this); m_panel.add(m_btnLoadMap); m_panel.add(new HTML("<hr>")); hpanel = new HorizontalPanel(); hpanel.add(new Label("Brush ")); m_lstBrush.addItem("1"); m_lstBrush.addItem("3"); m_lstBrush.addItem("7"); m_lstBrush.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent p_event) { try { m_wgtlayerEditLand .setBrushSize(Integer.parseInt(m_lstBrush.getValue(m_lstBrush.getSelectedIndex()))); } catch (NumberFormatException e) { } } }); m_lstBrush.setSelectedIndex(0); hpanel.add(m_lstBrush); m_panel.add(hpanel); hpanel = new HorizontalPanel(); hpanel.add(m_leftLand); hpanel.add(m_rightLand); m_panel.add(hpanel); m_btnNone.addMouseListener(this); m_panel.add(m_btnNone); m_btnSea.addMouseListener(this); m_panel.add(m_btnSea); m_btnReef.addMouseListener(this); m_panel.add(m_btnReef); m_btnMarsh.addMouseListener(this); m_panel.add(m_btnMarsh); m_btnPlain.addMouseListener(this); m_panel.add(m_btnPlain); m_btnMontain.addMouseListener(this); m_panel.add(m_btnMontain); setClicTool(Event.BUTTON_LEFT, LandType.Sea); setClicTool(Event.BUTTON_RIGHT, LandType.Montain); initWidget(m_panel); redraw(); }
From source file:com.fullmetalgalaxy.client.game.board.DlgAIJoinGame.java
License:Open Source License
@Override public void show() { m_panel.clear();/* w w w. j a va 2 s. c o m*/ m_panel.add(new HTML("Add an automatic player<hr/>Action point bonus:")); intAPBonus.setValue(0); m_panel.add(intAPBonus); m_panel.add(new HTML("Select avaliable player")); m_panel.add(listAI); HorizontalPanel hPanel = new HorizontalPanel(); hPanel.add(m_btnCancel); hPanel.add(m_btnOk); m_panel.add(hPanel); super.show(); }
From source file:com.fullmetalgalaxy.client.game.board.DlgJoinChooseColor.java
License:Open Source License
/** * /*w ww . java2 s. c o m*/ */ public DlgJoinChooseColor() { // auto hide / modal super(false, true); // Set the dialog box's caption. setText(MAppBoard.s_messages.unitsTitle()); // add company list widget // ======================= List<Company> freeCompany = new ArrayList<Company>(); for (Company company : Company.values()) { if (company != Company.Freelancer) { freeCompany.add(company); } } if (!GameEngine.model().getGame().isTeamAllowed()) { // remove already chosen company for (EbTeam team : GameEngine.model().getGame().getTeams()) { if (team.getCompany() != null && team.getCompany() != Company.Freelancer) { freeCompany.remove(team.getCompany()); } } freeCompany.add(0, Company.Freelancer); } else { m_panel.add(new HTML("<b>" + MAppBoard.s_messages.warningTeamAllowed() + "</b>")); if (GameEngine.model().getGame().getMaxTeamAllowed() <= GameEngine.model().getGame().getTeams() .size()) { // player shouldn't choose other team freeCompany.clear(); for (EbTeam team : GameEngine.model().getGame().getTeams()) { freeCompany.add(team.getCompany()); } } } for (Company company : freeCompany) { m_companySelection.addItem(company.getFullName(), company.toString()); } m_companySelection.setSelectedIndex(Random.nextInt(m_companySelection.getItemCount())); Company company = Company.valueOf(m_companySelection.getValue(m_companySelection.getSelectedIndex())); m_companyPreview.setUrl("/images/avatar/" + company + ".jpg"); m_companySelection.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent p_event) { Company company = Company .valueOf(m_companySelection.getValue(m_companySelection.getSelectedIndex())); m_companyPreview.setUrl("/images/avatar/" + company + ".jpg"); } }); Panel hpanel = new HorizontalPanel(); hpanel.add(m_companySelection); hpanel.add(m_companyPreview); m_panel.add(new HTML("<b>" + MAppBoard.s_messages.chooseCompany() + "</b>")); m_panel.add(hpanel); // add color list widget // ===================== Set<EnuColor> freeColors = null; if (GameEngine.model().getGame().getSetRegistration().size() >= GameEngine.model().getGame() .getMaxNumberOfPlayer()) { // this is a player replacement: don't allow company selection m_companySelection.setVisible(false); freeColors = GameEngine.model().getGame().getFreeRegistrationColors(); } else { freeColors = GameEngine.model().getGame().getFreePlayersColors(); } for (EnuColor color : freeColors) { if (color.getValue() != EnuColor.None) { m_colorSelection.addItem(Messages.getColorString(0, color.getValue()), "" + color.getValue()); } } m_colorSelection.setSelectedIndex(Random.nextInt(m_colorSelection.getItemCount())); // initialize company icon int colorValue = Integer.parseInt(m_colorSelection.getValue(m_colorSelection.getSelectedIndex())); EbRegistration registration = GameEngine.model().getGame().getRegistrationByColor(colorValue); if (registration != null && registration.getTeam(GameEngine.model().getGame()) != null) { m_companyPreview.setUrl( "/images/avatar/" + registration.getTeam(GameEngine.model().getGame()).getCompany() + ".jpg"); } // initialize color icon m_colorPreview.setUrl("/images/board/" + (new EnuColor(colorValue)).toString() + "/preview.jpg"); m_colorSelection.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent p_event) { int colorValue = Integer.parseInt(m_colorSelection.getValue(m_colorSelection.getSelectedIndex())); EnuColor color = new EnuColor(colorValue); m_colorPreview.setUrl("/images/board/" + color.toString() + "/preview.jpg"); m_btnOk.setEnabled(true); // for replacement: search corresponding team EbRegistration registration = GameEngine.model().getGame().getRegistrationByColor(colorValue); if (registration != null && registration.getTeam(GameEngine.model().getGame()) != null) { m_companyPreview.setUrl("/images/avatar/" + registration.getTeam(GameEngine.model().getGame()).getCompany() + ".jpg"); } } }); hpanel = new HorizontalPanel(); hpanel.add(m_colorSelection); hpanel.add(m_colorPreview); m_panel.add(new HTML("<b>" + MAppBoard.s_messages.chooseColor() + "</b>")); m_panel.add(hpanel); // add buttons // =========== hpanel = new HorizontalPanel(); // add cancel button m_btnCancel.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent p_event) { hide(); } }); hpanel.add(m_btnCancel); // add OK button m_btnOk.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent p_event) { int colorValue = Integer.parseInt(m_colorSelection.getValue(m_colorSelection.getSelectedIndex())); EnuColor color = new EnuColor(colorValue); EbGameJoin action = new EbGameJoin(); Company company = Company.Freelancer; try { company = Company.valueOf(m_companySelection.getValue(m_companySelection.getSelectedIndex())); } catch (Exception e) { } action.setCompany(company); action.setGame(GameEngine.model().getGame()); action.setAccountId(AppMain.instance().getMyAccount().getId()); action.setAccount(AppMain.instance().getMyAccount()); action.setColor(color.getValue()); GameEngine.model().runSingleAction(action); hide(); } }); hpanel.add(m_btnOk); m_panel.add(hpanel); setWidget(m_panel); }
From source file:com.fullmetalgalaxy.client.game.board.DlgJoinDisplayVariant.java
License:Open Source License
/** * /*from ww w .jav a 2s. c om*/ */ public DlgJoinDisplayVariant() { // auto hide / modal super(false, true); // Set the dialog box's caption. setText(MAppBoard.s_messages.variantTitle()); // display common construction reserve m_panel.add(new HTML("<b>" + MAppBoard.s_messages.commonConstructReserve() + "</b>")); m_panel.add(createTokenList(GameEngine.model().getGame().getConstructReserve())); // display initial hold m_panel.add(new HTML("<b>" + MAppBoard.s_messages.initialHold() + "</b>")); m_panel.add(createTokenList(GameEngine.model().getGame().getInitialHolds())); // add buttons HorizontalPanel hpanel = new HorizontalPanel(); // add cancel button m_btnCancel.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent p_event) { hide(); } }); hpanel.add(m_btnCancel); // add OK button m_btnOk.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent p_event) { hide(); DlgJoinChooseColor.instance().show(); DlgJoinChooseColor.instance().center(); } }); hpanel.add(m_btnOk); m_panel.add(hpanel); setWidget(m_panel); }
From source file:com.fullmetalgalaxy.client.game.board.DlgJoinGame.java
License:Open Source License
@Override public void show() { m_panel.clear();/*from ww w . j ava 2 s . c o m*/ m_panel.add(new HTML(ClientUtil.formatUserMessage(GameEngine.model().getGame().getDescription()))); m_panel.add(new HTML("<hr/>")); WgtGameTime wgtGameTime = new WgtGameTime(); wgtGameTime.setReadOnly(true); m_panel.add(wgtGameTime); m_panel.add(new HTML("<hr/>")); if (GameEngine.model().getGame().isPasswordProtected()) { HorizontalPanel hPanel = new HorizontalPanel(); hPanel.add(new Label(MAppBoard.s_messages.pasword())); hPanel.add(m_txtPassword); m_panel.add(hPanel); } else { m_panel.add(new HTML(MAppBoard.s_messages.joinWarning())); } HorizontalPanel hPanel = new HorizontalPanel(); hPanel.add(m_btnCancel); hPanel.add(m_btnOk); m_panel.add(hPanel); super.show(); }
From source file:com.fullmetalgalaxy.client.game.context.WgtContextExtra.java
License:Open Source License
private void addToken(EbToken p_token, Sector p_sectorValue) { FlowPanel panelToken = new FlowPanel(); HTML label = new HTML(""); if (p_token.getType() == TokenType.Freighter) { String lblStr = "???"; EbRegistration registration = GameEngine.model().getGame().getRegistrationByColor(p_token.getColor()); if (registration != null) { if (registration.haveAccount()) { lblStr = registration.getAccount().getPseudo(); }/*from w ww . j a va 2s . com*/ EbTeam team = registration.getTeam(GameEngine.model().getGame()); if (team != null && team.getCompany() != Company.Freelancer) { lblStr += "<br/>" + team.getCompany().getFullName(); } } label.setHTML(lblStr); } else { String lblStr = Messages.getTokenString(0, p_token.getType()); if ((p_token.getType().getMaxBulletCount() > 0) && (p_token.getBulletCount() != p_token.getType().getMaxBulletCount())) { if (p_token.getType().getMaxBulletCount() - p_token.getBulletCount() >= 2) lblStr += "<br/>xx"; else lblStr += "<br/>x"; } label.setHTML(lblStr); } Image wgtToken = new Image( TokenImages.getTokenImage(p_token.getEnuColor(), EnuZoom.Small, p_token.getType(), p_sectorValue)); wgtToken.addClickHandler(this); wgtToken.setTitle(Messages.getTokenString(0, p_token)); m_wgtTokenLink.put(wgtToken, p_token); panelToken.add(wgtToken); panelToken.add(label); m_hPanel.add(panelToken); }
From source file:com.fullmetalgalaxy.client.game.context.WgtContextLand.java
License:Open Source License
public void redraw() { assert GameEngine.model() != null; EventsPlayBuilder actionBuilder = GameEngine.model().getActionBuilder(); if (actionBuilder.getLastUpdate().getTime() != m_actionLastUpdate) { assert GameEngine.model() != null; m_panel.clear();/*from w w w . j av a2 s . c o m*/ LandType land2Display = GameEngine.model().getGame().getLand(actionBuilder.getSelectedPosition()); // int pxHexWidth = FmpConstant.getHexWidth( EnuZoom.Medium ); int pxHexHeight = FmpConstant.getHexHeight(GameEngine.model().getZoomDisplayed()); // display land itself String landStr = Messages.getLandString(0, land2Display); m_panel.add(new HTML(landStr)); m_panel.add(new HTML( "<div style=\"height: " + pxHexHeight + "px;\" class=\"fmp-" + land2Display + "\"></div>")); // display firecover BoardFireCover firecover = GameEngine.model().getGame().getBoardFireCover(); for (int iColor = 0; iColor < EnuColor.getTotalNumberOfColor(); iColor++) { EnuColor color = EnuColor.getColorFromIndex(iColor); byte fireCount = firecover.getFireCover(actionBuilder.getSelectedPosition(), color); byte disableFireCount = firecover.getDisabledFireCover(actionBuilder.getSelectedPosition(), color); if (fireCount != 0 || disableFireCount != 0) { m_panel.add(new HTML("couverture de feu " + Messages.getColorString(0, color.getValue()) + ": " + fireCount + " (+" + disableFireCount + ")")); } } } }
From source file:com.fullmetalgalaxy.client.game.context.WgtContextToken.java
License:Open Source License
public void redraw() { assert GameEngine.model() != null; EventsPlayBuilder actionBuilder = GameEngine.model().getActionBuilder(); if (actionBuilder.getLastUpdate().getTime() != m_actionLastUpdate) { assert GameEngine.model() != null; m_panel.clear();/* www . jav a 2 s. co m*/ m_actionLastUpdate = actionBuilder.getLastUpdate().getTime(); Image wgtToken = new Image(TokenImages.getTokenImage(actionBuilder.getSelectedToken(), EnuZoom.Medium)); /*wgtToken.setUrl( FmpConstant.getTokenUrl( selectedToken, new EnuZoom( EnuZoom.Medium ) ) ); wgtToken.setPixelSize( 70, 70 );*/ wgtToken.setTitle(Messages.getTokenString(0, actionBuilder.getSelectedToken())); // m_vPanel.add( new HTML( "<center>" ) ); AbsolutePanel absPanel = new AbsolutePanel(); m_panel.add(absPanel); absPanel.setSize("100%", "100%"); absPanel.add(wgtToken, absPanel.getOffsetWidth() / 2 - wgtToken.getWidth() / 2, absPanel.getOffsetHeight() / 2 - wgtToken.getHeight() / 2 + 30); absPanel.add(new HTML("<b>" + Messages.getTokenString(0, actionBuilder.getSelectedToken()) + "</b>"), 0, 0); if (actionBuilder.getSelectedToken().getColor() != EnuColor.None) { EbRegistration player = GameEngine.model().getGame() .getRegistrationByColor(actionBuilder.getSelectedToken().getColor()); if (player != null && player.haveAccount()) { absPanel.add(new HTML(player.getAccount().getPseudo()), 0, 20); } } // display land under token AnBoardPosition position = GameEngine.model().getActionBuilder().getSelectedPosition(); if (position != null) { String landStr = Messages.getLandString(0, GameEngine.model().getGame().getLand(position)); if (GameEngine.model().getGame().getToken(position, TokenType.Pontoon) != null) { landStr += " & " + Messages.getTokenString(0, TokenType.Pontoon); } if (GameEngine.model().getGame().getToken(position, TokenType.Sluice) != null) { landStr += " & " + Messages.getTokenString(0, TokenType.Sluice); } absPanel.add(new HTML(landStr), 0, 40); } // display ore count for freither EbToken token = GameEngine.model().getActionBuilder().getSelectedToken(); if (token != null && token.getType() == TokenType.Freighter) { absPanel.add(new HTML(Messages.getTokenString(0, TokenType.Ore) + " : " + token.getContainOre()), 150, 0); if (token.getBulletCount() > 0) { absPanel.add(new HTML(MAppBoard.s_messages.repairTurret() + " : " + token.getBulletCount()), 150, 30); } } else if (token != null && token.getType().isDestroyer()) { absPanel.add(new HTML(MAppBoard.s_messages.bullet() + " : " + token.getBulletCount()), 150, 0); } else if (token != null && token.getType() == TokenType.WeatherHen) { absPanel.add(new HTML(MAppBoard.s_messages.construct() + " : " + token.getBulletCount()), 150, 0); } else if (token != null && (token.getType() == TokenType.Ore2Generator || token.getType() == TokenType.Ore3Generator)) { float percentage = 0; if (GameEngine.model().getGame().getEbConfigGameTime().isParallel()) { percentage = token.getBulletCount() / (2 * FmpConstant.oreGenerationInTurn + 1); } else { percentage = token.getBulletCount() / (GameEngine.model().getGame().countTeamOnBoard() * FmpConstant.oreGenerationInTurn + 1); } absPanel.add(new HTML((int) (percentage * 100) + "%"), 200, 0); } // m_vPanel.add( new HTML( "</center>" ) ); } }
From source file:com.fullmetalgalaxy.client.game.tabmenu.WgtGameInfo.java
License:Open Source License
private void initGeneralPanel() { Game game = GameEngine.model().getGame(); // set general informations // ------------------------ m_generalPanel.clear();/*from www .jav a2s. c o m*/ m_generalPanel.add(new HTML(game.getGameType().getIconAsHtml() + game.getStatus().getIconAsHtml() + " " + Messages.getGameStatusString(0, game.getStatus()))); m_generalPanel.add(new Label(game.getDescription())); // Display tides String htmlTide = MAppBoard.s_messages.tide() + " " + BoardIcons.iconTide(game.getCurrentTide()).getHTML() + " "; // + Messages.getTideString( game.getCurrentTide() ) + "'> "; if ((GameEngine.model().getMyRegistration() != null) && (GameEngine.model().getMyRegistration().getTeam(game).getTideForeCast(game.getPreview()) > 0)) { htmlTide += BoardIcons.iconTide(game.getNextTide()).getHTML() + " "; // + Messages.getTideString( game.getNextTide() ) + "'>"; } else { htmlTide += AbstractImagePrototype.create(Icons.s_instance.tide_unknown()).getHTML(); // + MAppBoard.s_messages.noForecast() + "'> "; } if (game.isParallel()) { htmlTide += " at " + ClientUtil.s_dateTimeFormat.format(game.estimateNextTideChange()); } HTMLPanel tidePanel = new HTMLPanel(htmlTide); tidePanel.setWidth("100%"); m_generalPanel.add(tidePanel); // display start game date if ((game.getGameType() == GameType.MultiPlayer || game.getGameType() == GameType.Initiation)) { m_generalPanel.add(new HTML( MAppBoard.s_messages.gameCreation(ClientUtil.s_dateTimeFormat.format(game.getCreationDate())) + " par <a href='/profile.jsp?id=" + (game.getAccountCreator() == null ? "0" : game.getAccountCreator().getId()) + "' target='_blank'>" + (game.getAccountCreator() == null ? "???" : game.getAccountCreator().getPseudo()) + "</a>")); m_generalPanel.add(new HTML(MAppBoard.s_messages.reportAnIssueToAdmin())); } if (GameEngine.model().isJoined()) { EbRegistration registration = GameEngine.model().getMyRegistration(); if (game.isParallel()) { // Display next action point increments Date nextActionIncrement = game.estimateTimeStepDate(game.getCurrentTimeStep() + 1); m_generalPanel.add(new Label(MAppBoard.s_messages.nextActionPt(registration.getActionInc(game), ClientUtil.s_dateTimeFormat.format(nextActionIncrement)))); } else if (registration.getTeam(game).getEndTurnDate() != null) { if (game.getCurrentPlayerIds().contains(registration.getId())) { m_generalPanel.add(new Label("Fin du tour: " + ClientUtil.s_dateTimeFormat.format(registration.getTeam(game).getEndTurnDate()))); } else { m_generalPanel.add(new Label("Prochain tour avant: " + ClientUtil.s_dateTimeFormat.format(registration.getTeam(game).getEndTurnDate()))); } } } // grid button m_generalPanel.add(m_btnGrid); m_btnGrid.setDown(GameEngine.model().isGridDisplayed()); // atmosphere button m_generalPanel.add(m_btnAtmosphere); m_btnAtmosphere.setDown(GameEngine.model().isAtmosphereDisplayed()); // standard display button if (game.getMapUri() != null) { m_generalPanel.add(m_btnCustomMap); m_btnCustomMap.setDown(GameEngine.model().isCustomMapDisplayed()); } // display end game date if (!game.isParallel()) { m_generalPanel.add(new Label(MAppBoard.s_messages.turn() + " " + game.getCurrentTimeStep() + "/" + game.getEbConfigGameTime().getTotalTimeStep())); } if (game.estimateEndingDate().after(new Date())) { m_generalPanel.add(new Label(MAppBoard.s_messages .gameFinishAt(ClientUtil.s_dateTimeFormat.format(game.estimateEndingDate())))); } if ((game.getAccountCreator() != null && AppMain.instance().getMyAccount().getId() == game.getAccountCreator().getId() && game.getStatus() != GameStatus.History) || AppMain.instance().iAmAdmin()) { // display password if present if (game.isPasswordProtected()) { m_generalPanel.add(new Label("Mot de passe: " + game.getPassword())); } // play / pause button if ((game.getGameType() == GameType.MultiPlayer || game.getGameType() == GameType.Initiation)) { if (game.getStatus() == GameStatus.Running) { m_generalPanel.add(m_btnPause); } else if (game.getStatus() == GameStatus.Open || game.getStatus() == GameStatus.Pause) { m_generalPanel.add(m_btnPlay); } } // edit button m_generalPanel.add(m_btnEdit); m_generalPanel.add(m_btnAbort); } if (AppMain.instance().iAmAdmin()) { // download button m_generalPanel.add(new HTML("<a href='/admin/Servlet?downloadgame=" + game.getId() + "'>download</a>")); // record events m_generalPanel.add(m_btnRecordEvent); } m_generalPanel.add(new HTML("<br/>")); WgtGameTime wgtGameTime = new WgtGameTime(); wgtGameTime.setReadOnly(true); m_generalPanel.add(wgtGameTime); }