The bluegammon.gui.popup package contains the general functionality for drawing a popup and handle the interaction.

Concepts and Structures

A popup is a gui element consisting of text and alternatives. This is represented in the Popup class. A PopupListener can be attached to a Popup to receive events when the user has made a selection among the alternatives or the popup has reached its timeout.

The popup has callback methods for handle painting and user interaction - these should be invoked from the Canvas showing the popup.

In the Bluegammon game, the popup functionality is centralized in the Bluegammon class to centralize popup behaviour, meaning popups can be invoked indifferent from game state.