panMain.add(main, component);
panSecondary.add(secondary, ((ChatLounge) component)
.getSecondaryDisplay());
break;
case PHASE_STARTING_SCENARIO:
component = new Label(Messages
.getString("ClientGUI.StartingScenario")); //$NON-NLS-1$
main = "Label-StartingScenario"; //$NON-NLS-1$
secondary = main;
panMain.add(main, component);
panSecondary.add(secondary, new Label("")); //$NON-NLS-1$
break;
case PHASE_EXCHANGE:
component = new Label(Messages
.getString("ClientGUI.TransmittingData")); //$NON-NLS-1$
main = "Label-Exchange"; //$NON-NLS-1$
secondary = main;
panMain.add(main, component);
panSecondary.add(secondary, new Label("")); //$NON-NLS-1$
break;
case PHASE_SET_ARTYAUTOHITHEXES:
component = new SelectArtyAutoHitHexDisplay(this);
main = "BoardView"; //$NON-NLS-1$
secondary = "SelectArtyAutoHitHexDisplay"; //$NON-NLS-1$
if (!mainNames.keySet().contains(main)) {
panMain.add(main, bvc);
}
panSecondary.add(secondary, component);
break;
case PHASE_DEPLOY_MINEFIELDS:
component = new DeployMinefieldDisplay(this);
main = "BoardView"; //$NON-NLS-1$
secondary = "DeployMinefieldDisplay"; //$NON-NLS-1$
if (!mainNames.keySet().contains(main)) {
panMain.add(main, bvc);
}
panSecondary.add(secondary, component);
break;
case PHASE_DEPLOYMENT:
component = new DeploymentDisplay(this);
main = "BoardView"; //$NON-NLS-1$
secondary = "DeploymentDisplay"; //$NON-NLS-1$
if (!mainNames.keySet().contains(main)) {
panMain.add(main, bvc);
}
panSecondary.add(secondary, component);
break;
case PHASE_TARGETING:
component = new TargetingPhaseDisplay(this, false);
((TargetingPhaseDisplay) component).initializeListeners();
main = "BoardView"; //$NON-NLS-1$
secondary = "TargetingPhaseDisplay"; //$NON-NLS-1$
if (!mainNames.keySet().contains(main)) {
panMain.add(main, bvc);
}
panSecondary.add(secondary, component);
break;
case PHASE_MOVEMENT:
component = new MovementDisplay(this);
main = "BoardView"; //$NON-NLS-1$
secondary = "MovementDisplay"; //$NON-NLS-1$
if (!mainNames.keySet().contains(main)) {
panMain.add(main, bvc);
}
panSecondary.add(secondary, component);
break;
case PHASE_OFFBOARD:
component = new TargetingPhaseDisplay(this, true);
((TargetingPhaseDisplay) component).initializeListeners();
main = "BoardView"; //$NON-NLS-1$
secondary = "OffboardDisplay"; //$NON-NLS-1$
if (!mainNames.keySet().contains(main)) {
panMain.add(main, bvc);
}
panSecondary.add(secondary, component);
break;
case PHASE_FIRING:
component = new FiringDisplay(this);
main = "BoardView"; //$NON-NLS-1$
secondary = "FiringDisplay"; //$NON-NLS-1$
if (!mainNames.keySet().contains(main)) {
panMain.add(main, bvc);
}
panSecondary.add(secondary, component);
break;
case PHASE_PHYSICAL:
component = new PhysicalDisplay(this);
main = "BoardView"; //$NON-NLS-1$
secondary = "PhysicalDisplay"; //$NON-NLS-1$
if (!mainNames.keySet().contains(main)) {
panMain.add(main, bvc);
}
panSecondary.add(secondary, component);
break;
case PHASE_INITIATIVE_REPORT:
component = new ReportDisplay(client);
main = "ReportDisplay"; //$NON-NLS-1$
secondary = main;
panMain.add(main, component);
panSecondary.add(secondary, ((ReportDisplay) component)
.getSecondaryDisplay());
break;
case PHASE_TARGETING_REPORT:
case PHASE_MOVEMENT_REPORT:
case PHASE_OFFBOARD_REPORT:
case PHASE_FIRING_REPORT:
case PHASE_PHYSICAL_REPORT:
case PHASE_END_REPORT:
case PHASE_VICTORY:
// Try to reuse the ReportDisplay for other phases...
component = phaseComponents.get(String
.valueOf(IGame.Phase.PHASE_INITIATIVE_REPORT));
if (null == component) {
// no ReportDisplay to reuse -- get a new one
component = initializePanel(IGame.Phase.PHASE_INITIATIVE_REPORT);
}
main = "ReportDisplay"; //$NON-NLS-1$
secondary = main;
break;
default:
component = new Label(Messages
.getString("ClientGUI.waitingOnTheServer")); //$NON-NLS-1$
main = "Label-Default"; //$NON-NLS-1$
secondary = main;
panMain.add(main, component);
panSecondary.add(secondary, new Label("")); //$NON-NLS-1$
}
phaseComponents.put(name, component);
mainNames.put(name, main);
secondaryNames.put(name, secondary);