/*
 * WeatherMap.java
 * 2008/12/11
 * 
 * Copyright (c) 2008 Potkuri-group
 */

package filecontroller;

import java.awt.image.BufferedImage;

/**
 * This class contains a collection of current weather map information.
 * Note that it's users responsibility to check that values are acceptable.
 * 
 * @author Potkuri-group
 * @version 1
 */
public class WeatherMap {
	
	/** Weather map scale. */
	private double scale;
	
	/** Map latitude. */
	private double cornerLat;
	
	/** Map longitude. */
	private double cornerLon;
	
	/** Current weather map. */
	private BufferedImage image;
	
	/** Current weather map information in numerical array.  */
	private int[][] mapMatrix;

	/*************************************************************************/

	/**
	 * Construct new instance.
	 * 
	 */
	public WeatherMap() {
		this.cornerLat = 100;
		this.cornerLon = 101;
		this.scale = 10;
	}

	/**
	 * Apply values.
	 * 
	 * @param map image
	 * @param mapMatrix Current weather map information in numerical array.
	 */
	public void apply(BufferedImage map, int[][] mapMatrix) {
		this.image = map;
		this.mapMatrix = mapMatrix;
	}

	/**
	 * For testing. Apply values.
	 * 
	 * @param cornerLat Latitude
	 * @param cornerLon Longitude
	 * @param scale	Map scale
	 */
	public void apply(double cornerLat, double cornerLon, double scale) {
		this.cornerLat = cornerLat;
		this.cornerLon = cornerLon;
		this.scale = scale;
	}

	
	/**
	 * Returns weather map.
	 * 
	 * @return BufferedImage
	 */
	public BufferedImage getMap() {
		return this.image;
	}

	/**
	 * Returns map matrix.
	 * 
	 * @return Weather map information in numerical array.
	 */
	public int[][] getMapMatrix() {
		return this.mapMatrix;
	}

	/**
	 * Returns map scale.
	 * 
	 * @return double
	 */
	public double getScale() {
		return this.scale;
	}

	/**
	 * Returns map latitude.
	 * 
	 * @return double
	 */
	public double getLat() {
		return this.cornerLat;
	}

	/**
	 * Returns map longitude.
	 * 
	 * @return double
	 */
	public double getLon() {
		return this.cornerLon;
	}
}
