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

class
	CEYLON_WIDGET

inherit

--	RED_PORT_WIDGET
--		undefine
--			paint
--		redefine
--			create_interface_objects,
--			initialize,
--			extend_widgets,
--			position_widgets
--		end

	ISLAND_PORT_WIDGET
		redefine
			create_interface_objects,
			extend_widgets,
--			initialize,
			set_fonts_and_colors,
			position_widgets,
			rotation_amount
		end

create
	make

feature {NONE} -- Initialization

	create_interface_objects
			-- Create widgets
		do
			create not_allowed_text_mt.make_with_text ("(No U.S. Allowed)")
			create reinforcements_text_mt.make_with_text ("British Reinforcements%Nexcept the Victorious")
			Precursor {ISLAND_PORT_WIDGET}
--			Precursor {RED_PORT_WIDGET}
		end

	extend_widgets
			-- Put widgets into Current.  This cannot be done
			-- in `create_interface_object', because cannot call
			-- `extend' feature until all objects [in descendants]
			-- are also created.
		do
			Precursor {ISLAND_PORT_WIDGET}
--			Precursor {RED_PORT_WIDGET}
			text_group.extend (not_allowed_text_mt)
			text_group.extend (reinforcements_text_mt)
		end

	set_fonts_and_colors
			-- Set the default fonts for any text widgets and set
			-- the default colors for any contained widgets.
		do
			Precursor {ISLAND_PORT_WIDGET}
--			Precursor {RED_PORT_WIDGET}
			not_allowed_text_mt.set_font (Subtext_font)
			reinforcements_text_mt.set_font (Subtext_font)
		end

	position_widgets
			-- Move Current and contained widgets to correct
			-- location and set their their sizes
		do
			Precursor {ISLAND_PORT_WIDGET}
--			Precursor {RED_PORT_WIDGET}
			center_on (22, 178)
--			center_on (50, 200)
			text_group.set_x_y (inner_circle.x + 2, inner_circle.y + 6)
			anchor.set_x_y (inner_circle.x + 1, inner_circle.y - 2)

			not_allowed_text_mt.set_x_y (inner_circle.x + 19, inner_circle.y - 10)
			reinforcements_text_mt.set_x_y (inner_circle.x + 17, inner_circle.y + 17)
			marker.set_x_y (inner_circle.x - 6, inner_circle.y - 6)

--			text_widget.center_on_dot (dot)
--			translate_widget (name_mt, 0, 6)
--			translate_widget (not_allowed_text, 58, 41)
--			translate_widget (reinforcements_text, 55, 70)
--			marker.center_on_dot (dot)
--			marker.set_x_y (dot.x, dot.y)
--			anchor.center_on_dot (dot)
--			anchor.set_x_y (dot.x, dot.y)
--			translate_widget (marker, -7, -6)
--			translate_widget (anchor, -1, -4)
		end

feature -- Status report

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

feature {NONE} -- Implementation

	not_allowed_text_mt: EV_MODEL_TEXT
			-- Extra text on some Red ports (e.g. "No British Allowed").

	reinforcements_text_mt: EV_MODEL_TEXT
			-- Extra text about reinforcement placement

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

end
