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

class
	SAIPAN_WIDGET

inherit

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

	ISLAND_PORT_WIDGET
		redefine
			create_interface_objects,
			position_widgets,
			build_land,
			rotation_amount
		end

create
	make

feature {NONE} -- Initialization

	create_interface_objects
			-- Initialize attributes
		do
			mainland := mainland_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.95)
			scale_widget (land, 0.7)
			rotate_widget (land, 10.0)
			translate_widget (land, -16, 8)
--			name_mt.center_on_dot (dot)
--			translate_widget (name_mt, 0, 0)
--			marker.center_on_dot (dot)
			marker.set_x_y (dot.x, dot.y)
			translate_widget (marker, 2, 4)
			center_on (382, 263)
				-- This scaling is slightly bigger than the scale of the other islands
				-- in the Marianas islands.  There is brown land to scale under this.
			dot.show
			dot.set_foreground_color (Cyan)
			bring_to_front (dot)
		end

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

feature -- Status report

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

feature {NONE} -- Implementation

	mainland: EV_MODEL_POLYGON

feature {NONE} -- Implementation

	mainland_imp: EV_MODEL_POLYGON
			-- Build the island poygon
		do
			create Result
				-- Points generated by Grabber application
			Result.extend_point (create {EV_COORDINATE}.make_precise (0.0, 0.0))
			Result.extend_point (create {EV_COORDINATE}.make_precise (-3.8518518518519613, -0.8888888888889142))
			Result.extend_point (create {EV_COORDINATE}.make_precise (-7.407407407407504, -4.148148148148152))
			Result.extend_point (create {EV_COORDINATE}.make_precise (-6.51851851851859, -6.814814814814781))
			Result.extend_point (create {EV_COORDINATE}.make_precise (-4.7407407407408755, -9.48148148148141))
			Result.extend_point (create {EV_COORDINATE}.make_precise (-3.5555555555556566, -11.555555555555543))
			Result.extend_point (create {EV_COORDINATE}.make_precise (-1.1851851851852189, -10.370370370370324))
			Result.extend_point (create {EV_COORDINATE}.make_precise (-1.4814814814816373, -7.111111111111086))
			Result.extend_point (create {EV_COORDINATE}.make_precise (0.5925925925924957, -5.629629629629562))
			Result.extend_point (create {EV_COORDINATE}.make_precise (0.5925925925924957, -3.8518518518518476))
			Result.extend_point (create {EV_COORDINATE}.make_precise (-1.4814814814816373, -4.740740740740648))
			Result.extend_point (create {EV_COORDINATE}.make_precise (-1.4814814814816373, -2.9629629629629335))
		end

feature {NONE} -- Implementation

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

end
