<commit_before>/* *********************************************************************
 *
 *  This file is part of Full Metal Galaxy.
 *  http://www.fullmetalgalaxy.com
 *
 *  Full Metal Galaxy is free software: you can redistribute it and/or 
 *  modify it under the terms of the GNU Affero General Public License
 *  as published by the Free Software Foundation, either version 3 of 
 *  the License, or (at your option) any later version.
 *
 *  Full Metal Galaxy is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public 
 *  License along with Full Metal Galaxy.  
 *  If not, see <http://www.gnu.org/licenses/>.
 *
 *  Copyright 2010, 2011 <NAME>
 *
 * *********************************************************************/
package com.fullmetalgalaxy.client.creation;


import com.fullmetalgalaxy.client.game.GameEngine;
import com.fullmetalgalaxy.client.game.board.WgtBoardLayerBase;
import com.fullmetalgalaxy.client.game.board.WgtBoardLayerLand;
import com.fullmetalgalaxy.model.LandType;
import com.fullmetalgalaxy.model.persist.AnBoardPosition;
import com.fullmetalgalaxy.model.persist.AnPair;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.FocusPanel;
import com.google.gwt.user.client.ui.MouseListener;
import com.google.gwt.user.client.ui.Widget;

/**
 * @author <NAME>
 *
 */
public class WgtBoardEditLand extends WgtBoardLayerLand implements MouseListener
{
  private FocusPanel m_focus = new FocusPanel();
  private LandType m_leftClic = LandType.Montain;
  private LandType m_rightClic = LandType.None;

  /**
   * 
   */
  public WgtBoardEditLand()
  {
    super();
    m_focus.add( m_html );
    m_focus.addMouseListener( this );
    m_focus.setSize( "100%", "100%" );
    add( m_focus, 0, 0 );
  }


  /**
   * 
   * @see com.fullmetalgalaxy.client.game.board.WgtBoardLayerBase#redraw()
   */
  @Override
  public void onModelChange(boolean p_forceRedraw)
  {
    // always redraw game in construction as all lands may have been regenerated
    if( (GameEngine.model().getGame().getId() == 0) || p_forceRedraw )
    {
      m_lastGameId = -1;
    }
    super.onModelChange( p_forceRedraw );
  }

  /*private void redrawAllLands()
  {
    m_images.resetImageIndex();
    EbGame game = ModelFmpMain.model().getGame();
    Image image = null;
    for( int ix = 0; ix < game.getLandWidth(); ix++ )
    {
      for( int iy = 0; iy < game.getLandHeight(); iy++ )<commit_msg>Issue 108:	zoom out map during game creation<commit_after>/* *********************************************************************
 *
 *  This file is part of Full Metal Galaxy.
 *  http://www.fullmetalgalaxy.com
 *
 *  Full Metal Galaxy is free software: you can redistribute it and/or 
 *  modify it under the terms of the GNU Affero General Public License
 *  as published by the Free Software Foundation, either version 3 of 
 *  the License, or (at your option) any later version.
 *
 *  Full Metal Galaxy is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public 
 *  License along with Full Metal Galaxy.  
 *  If not, see <http://www.gnu.org/licenses/>.
 *
 *  Copyright 2010, 2011 <NAME>
 *
 * *********************************************************************/
package com.fullmetalgalaxy.client.creation;


import com.fullmetalgalaxy.client.game.GameEngine;
import com.fullmetalgalaxy.client.game.board.WgtBoardLayerBase;
import com.fullmetalgalaxy.client.game.board.WgtBoardLayerLand;
import com.fullmetalgalaxy.model.EnuZoom;
import com.fullmetalgalaxy.model.LandType;
import com.fullmetalgalaxy.model.persist.AnBoardPosition;
import com.fullmetalgalaxy.model.persist.AnPair;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.FocusPanel;
import com.google.gwt.user.client.ui.MouseListener;
import com.google.gwt.user.client.ui.Widget;

/**
 * @author <NAME>
 *
 */
public class WgtBoardEditLand extends WgtBoardLayerLand implements MouseListener
{
  private FocusPanel m_focus = new FocusPanel();
  private LandType m_leftClic = LandType.Montain;
  private LandType m_rightClic = LandType.None;

  /**
   * 
   */
  public WgtBoardEditLand()
  {
    super();
    GameEngine.model().setZoomDisplayed( EnuZoom.Small );
    m_focus.add( m_html );
    m_focus.addMouseListener( this );
    m_focus.setSize( "100%", "100%" );
    add( m_focus, 0, 0 );
  }


  /**
   * 
   * @see com.fullmetalgalaxy.client.game.board.WgtBoardLayerBase#redraw()
   */
  @Override
  public void onModelChange(boolean p_forceRedraw)
  {
    // always redraw game in construction as all lands may have been regenerated
    if( (GameEngine.model().getGame().getId() == 0) || p_forceRedraw )
    {
      m_lastGameId = -1;
    }
    super.onModelChange( p_forceRedraw );
  }

  /*private void redrawAllLands()
  {
    m_images.resetImageIndex();
    EbGame game = ModelFmpMain.model().getGame();
    Image image = null;
    for( int ix = 0; ix < game.getLandWidth(); ix++ )
    {
      for( int iy = 0; iy < game.getLandHeight(); iy++ )
{'fraction_non_alphanumeric': 0.15123179284301386, 'fraction_numerical': 0.008092069771623809, 'mean_word_length': 3.823937554206418, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6270779', 'n_tokens_mistral': 1796, 'n_tokens_neox': 1696, 'n_words': 471}