note
	description: "[
		The widget representing this port
		]"
	author: "Jimmy J. Johnson"

class
	MALOELAP_WIDGET

inherit

--	GREEN_PORT_WIDGET
--		undefine
--			paint
--		redefine
--			create_interface_objects,
--			initialize,
--			position_widgets,
--			build_land
--		end

	ISLAND_PORT_WIDGET
		redefine
			create_interface_objects,
--			initialize,
			position_widgets,
			build_land,
			rotation_amount
		end

create
	make

feature {NONE} -- Initialization

	create_interface_objects
			-- Initialize attributes
		do
			taroa_island := taroa_island_imp
			Precursor {ISLAND_PORT_WIDGET}
--			Precursor {GREEN_PORT_WIDGET}
		end

--	initialize
--			-- Set up the widgets in Current.
--		do
--			Precursor {ISLAND_PORT_WIDGET}
----			Precursor {GREEN_PORT_WIDGET}
--		end

	position_widgets
			-- Move Current and contained widgets to correct
			-- location and set their their sizes
		do
			Precursor {ISLAND_PORT_WIDGET}
--			Precursor {GREEN_PORT_WIDGET}
			scale_widget (land, 0.21)
			rotate_widget (land, 13.0)
			center_on (521, 345)
			translate_widget (land, -26, -8)
--			text_widget.center_on_dot (dot)
--			translate_widget (name_mt, 0, 1)
			translate_widget (dot, 2, 5)
--			marker.center_on_dot (dot)
			marker.set_x_y (dot.x, dot.y)
		end

	build_land
			-- Add widgets to Current
		do
			Precursor {ISLAND_PORT_WIDGET}
			land.extend (taroa_island)
		end

feature -- Status report

	is_red: BOOLEAN = False
			-- Does Current represent a red (i.e. major) port?

feature {NONE} -- Implementation

	taroa_island: EV_MODEL_POLYGON

feature {NONE} -- Implementation

	taroa_island_imp: EV_MODEL_POLYGON
			-- Make the polygon
		do
			create Result
				-- Points generated by Grabber application
			Result.extend_point (create {EV_COORDINATE}.make_precise (0, 0))
			Result.extend_point (create {EV_COORDINATE}.make_precise (19.999999999999773, -1.3333333333332575))
			Result.extend_point (create {EV_COORDINATE}.make_precise (35.111111111111086, 2.6666666666665151))
			Result.extend_point (create {EV_COORDINATE}.make_precise (47.555555555555429, 14.222222222222399))
			Result.extend_point (create {EV_COORDINATE}.make_precise (55.111111111111086, 16.444444444444343))
			Result.extend_point (create {EV_COORDINATE}.make_precise (61.333333333333258, 27.111111111111086))
			Result.extend_point (create {EV_COORDINATE}.make_precise (53.333333333333258, 39.111111111111086))
			Result.extend_point (create {EV_COORDINATE}.make_precise (52.444444444444116, 52))
			Result.extend_point (create {EV_COORDINATE}.make_precise (54.222222222221944, 57.333333333333485))
			Result.extend_point (create {EV_COORDINATE}.make_precise (48, 59.111111111110858))
			Result.extend_point (create {EV_COORDINATE}.make_precise (35.111111111111086, 57.333333333333485))
			Result.extend_point (create {EV_COORDINATE}.make_precise (29.333333333333258, 48.444444444444343))
			Result.extend_point (create {EV_COORDINATE}.make_precise (28, 40.888888888889142))
			Result.extend_point (create {EV_COORDINATE}.make_precise (16.888888888888914, 20.888888888889142))
			Result.extend_point (create {EV_COORDINATE}.make_precise (9.3333333333332575, 14.222222222222399))
		end

feature {NONE} -- Implementation

	rotation_amount: REAL_64 = 180.0
			-- Make the arrow point north-east

invariant

	corrrect_port: attached target_imp implies port = game.maloelap

end
