/** ************************************************************************* * * Constructor */ public HaloLayoutSetupPanel( BTState appState, Genome genome, String selectedID, HaloLayout halo, HaloLayout.HaloLayoutParams params) { appState_ = appState; haveResult_ = false; params_ = (HaloLayout.HaloLayoutParams) params.clone(); params_.selected = selectedID; ResourceManager rMan = appState_.getRMan(); setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); if ((params_.selected != null) && !halo.selectionIsValid(genome, params_.selected)) { params_.selected = null; } JLabel strategyLabel = new JLabel(rMan.getString("haloLayout.strategyType")); strategyCombo_ = new JComboBox(HaloLayout.StartSeed.getChoices(appState_, params_.selected != null)); UiUtil.gbcSet(gbc, 0, 0, 1, 1, UiUtil.HOR, 0, 0, 5, 5, 5, 5, UiUtil.CEN, 1.0, 0.0); add(strategyLabel, gbc); UiUtil.gbcSet(gbc, 1, 0, 1, 1, UiUtil.HOR, 0, 0, 5, 5, 5, 5, UiUtil.CEN, 1.0, 0.0); add(strategyCombo_, gbc); JLabel overlayLabel = new JLabel(rMan.getString("haloLayout.overlayOptions")); Vector<ChoiceContent> relayoutChoices = NetOverlayProperties.getRelayoutOptions(appState); overlayOptionCombo_ = new JComboBox(relayoutChoices); boolean activate = (genome == null) || (genome.getNetworkOverlayCount() > 0); if (!activate) { overlayLabel.setEnabled(false); overlayOptionCombo_.setEnabled(false); } UiUtil.gbcSet(gbc, 0, 1, 1, 1, UiUtil.HOR, 0, 0, 5, 5, 5, 5, UiUtil.CEN, 1.0, 0.0); add(overlayLabel, gbc); UiUtil.gbcSet(gbc, 1, 1, 1, 1, UiUtil.HOR, 0, 0, 5, 5, 5, 5, UiUtil.CEN, 1.0, 0.0); add(overlayOptionCombo_, gbc); }
/** * ************************************************************************* * * Apply the current * data values to our UI components * */ public void displayProperties() { strategyCombo_.setSelectedItem(params_.startType.generateCombo(appState_)); overlayOptionCombo_.setSelectedItem( NetOverlayProperties.relayoutForCombo(appState_, params_.overlayOption)); return; }