public Window2D createWindow(HUDComponent component) {
if (logger.isLoggable(Level.FINE)) {
logger.fine("creating window for HUD component: " + component);
}
Window2D window = null;
//if (hudApp == null) {
hudApp = new HUDApp2D(hud, "HUD", new ControlArbHUD(), WonderlandHUD.HUD_WORLD_SCALE);
//}
try {
// TODO: pixel scale doesn't match
if (component instanceof HUDPopup2D) {
HUDPopup2D popup = (HUDPopup2D) component;
HUDWindow parent = popup.getParent();
HUDApp2D parentApp = (HUDApp2D) parent.getApp();
window = parentApp.createWindow(component.getWidth(), component.getHeight(),
Type.POPUP, parent, false, WonderlandHUD.HUD_SCALE,
"HUD popup");
window.setPixelOffset(popup.getXOffset(), popup.getYOffset());
} else {
window = hudApp.createWindow(component.getWidth(), component.getHeight(), Type.PRIMARY,
false, WonderlandHUD.HUD_SCALE, "HUD component");
}