Package ch.fusun.baron.city.ui

Source Code of ch.fusun.baron.city.ui.CityTileChild

package ch.fusun.baron.city.ui;

import ch.fusun.baron.city.City;
import ch.fusun.baron.map.ui.gef.editpart.TileChild;
import ch.fusun.baron.swt.isometry.components.Sprite;

/**
* Tile child for cities
*/
public class CityTileChild implements TileChild<City> {

  private static final String ICONS_CITY_MASK = "icons/city_mask.png"; //$NON-NLS-1$
  private static final String ICONS_CITY = "icons/city.png"; //$NON-NLS-1$
  private final City city;

  /**
   * @param city
   *            The city
   */
  public CityTileChild(City city) {
    this.city = city;
  }

  @Override
  public City getModel() {
    return this.city;
  }

  @Override
  public Sprite getSprite() {
    return new Sprite(Activator.getImage(ICONS_CITY),
        Activator.getImage(ICONS_CITY_MASK), 20);
  }
}
TOP

Related Classes of ch.fusun.baron.city.ui.CityTileChild

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.