note
	description: "[
		Widget that represents this VITP sea area
		]"
	author: "Jimmy J. Johnson"

class
	NORTH_PACIFIC_OCEAN_WIDGET

inherit

	SEA_AREA_WIDGET
		redefine
			create_interface_objects,
			position_widgets,
			build_land,
			build_ocean
--			build_bounding_figure
		end

create
	make

feature {NONE} -- Initialization

	create_interface_objects
			-- Initialize attributes
		do
			Precursor {SEA_AREA_WIDGET}
			aleutians_east := aleutians_east_imp
		end

	position_widgets
			-- Move Current and contained widgets to correct
			-- location and set their their sizes
		do
			Precursor {SEA_AREA_WIDGET}
			translate_widget (Current, 704, 236)
			translate_widget (name_mt, -80, -110)
			translate_widget (dot, -40, -80)
--			flag.center_on_dot (dot)
			flag.set_x_y (dot.x, dot.y)
		end

	build_land
			-- Build the `land'
		do
			Precursor {SEA_AREA_WIDGET}
				-- Initialize attributes
			land.extend (aleutians_east)
		end

	build_ocean
			-- Create the polygon representing the `ocean' here
			-- Redefined to add the points
		do
			Precursor {SEA_AREA_WIDGET}
				-- start at bottom south-west corner
			ocean.extend_point (create {EV_COORDINATE}.make (0, 0))
			ocean.extend_point (create {EV_COORDINATE}.make (-63, -2))
			ocean.extend_point (create {EV_COORDINATE}.make (-96, -105))
			ocean.extend_point (create {EV_COORDINATE}.make (0, -210))
		end

--	build_bounding_figure
--			-- Add points to the `jj_bounding_figure'.
--			-- Redefined to use the tile edges as the bounding area
--		do
--			if has (jj_bounding_figure) then
--				prune_all (jj_bounding_figure)
--			end
--			create jj_bounding_figure
--			extend (jj_bounding_figure)
--			jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (0, 0))
--			jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (-63, -2))
--			jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (-96, -105))
--			jj_bounding_figure.extend_point (create {EV_COORDINATE}.make (0, -210))
--			jj_bounding_figure.enable_closed
--			translate_widget (jj_bounding_figure, 704, 236)
--			jj_bounding_figure.set_line_width (2)
--		end

feature -- Access

	aleutians_east: EV_MODEL_POLYGON
			-- The one brown island in the {NORTH_PACIFIC_OCEAN_WIDGET}.

feature {NONE} -- Implementation

	aleutians_east_imp: EV_MODEL_POLYGON
			-- Create the polygon for theisland north of Australia

		local
			t: EV_MODEL_TRANSFORMATION
		do
			create Result
				-- Start at north point
			Result.extend_point (create {EV_COORDINATE}.make_precise (0, 0))
			Result.extend_point (create {EV_COORDINATE}.make_precise (1, 0.5))
			Result.extend_point (create {EV_COORDINATE}.make_precise (2, 1))
			Result.extend_point (create {EV_COORDINATE}.make_precise (2, 5))
			Result.extend_point (create {EV_COORDINATE}.make_precise (1.5, 5.5))
			Result.extend_point (create {EV_COORDINATE}.make_precise (0.5, 5))
			Result.extend_point (create {EV_COORDINATE}.make_precise (-0.5, 6))
			Result.extend_point (create {EV_COORDINATE}.make_precise (-4, 4))
			Result.extend_point (create {EV_COORDINATE}.make_precise (-5, 3))
			Result.extend_point (create {EV_COORDINATE}.make_precise (-7, 3))
			create t.make_zero
			t.translate (-2, -200)
			Result.transform (t)
		end

invariant

	is_valid_sea_area: attached target_imp implies sea_area = game.north_pacific_ocean

end
