* Creates the affordance HUD frame.
*
* NOTE: This method should NOT be called on the AWT Event Thread.
*/
private void createHUD() {
HUD mainHUD = HUDManagerFactory.getHUDManager().getHUD("main");
// create affordances Swing control
affordanceHUDPanel = new AffordanceHUDPanel();
// create HUD control
affordanceHUD = mainHUD.createComponent(affordanceHUDPanel);
affordanceHUDPanel.setHUDComponent(affordanceHUD);
affordanceHUD.setName(BUNDLE.getString("Edit_Object_None_Selected"));
affordanceHUD.setPreferredLocation(Layout.SOUTH);
affordanceHUD.addEventListener(new HUDEventListener() {
public void HUDObjectChanged(HUDEvent event) {
/**
* Handles when the affordance frame is closed
*/
if (event.getEventType() == HUDEventType.CLOSED) {
// Tell all of the affordances to remove themselves by
// posting an event to the input system as such. Also tell
// the affordance panel it has closed
affordanceHUDPanel.closed();
InputManager.inputManager().postEvent(new AffordanceRemoveEvent());
}
}
});
// add affordances HUD panel to main HUD
mainHUD.addComponent(affordanceHUD);
}