use of megamek.common.util.EncodeControl in project megameklab by MegaMek.
the class ASChassisView method initUI.
public void initUI() {
// $NON-NLS-1$
ResourceBundle resourceMap = ResourceBundle.getBundle("megameklab.resources.Views", new EncodeControl());
setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
fighterTypeNames = resourceMap.getString("FighterChassisView.cbFighterType.values").split(",");
gbc.gridx = 0;
gbc.gridy = 0;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("FighterChassisView.spnTonnage.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 0;
setFieldSize(spnTonnage, spinnerSize);
// $NON-NLS-1$
spnTonnage.setToolTipText(resourceMap.getString("FighterChassisView.spnTonnage.tooltip"));
add(spnTonnage, gbc);
spnTonnage.addChangeListener(this);
// $NON-NLS-1$
chkOmni.setText(resourceMap.getString("FighterChassisView.chkOmni.text"));
gbc.gridx = 2;
gbc.gridy = 0;
gbc.anchor = GridBagConstraints.EAST;
// $NON-NLS-1$
chkOmni.setToolTipText(resourceMap.getString("FighterChassisView.chkOmni.tooltip"));
add(chkOmni, gbc);
chkOmni.addActionListener(this);
gbc.gridx = 0;
gbc.gridy = 1;
gbc.gridwidth = 1;
gbc.anchor = GridBagConstraints.WEST;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("FighterChassisView.txtSI.text"), labelSize), gbc);
setFieldSize(txtSI, editorSize);
// $NON-NLS-1$
txtSI.setToolTipText(resourceMap.getString("FighterChassisView.txtSI.tooltip"));
txtSI.setEditable(false);
// $NON-NLS-1$
chkVSTOL.setText(resourceMap.getString("FighterChassisView.chkVSTOL.text"));
// $NON-NLS-1$
chkVSTOL.setToolTipText(resourceMap.getString("FighterChassisView.chkVSTOL.tooltip"));
gbc.gridx = 1;
add(txtSI, gbc);
gbc.gridx = 2;
gbc.anchor = GridBagConstraints.EAST;
// $NON-NLS-1$
chkVSTOL.setToolTipText(resourceMap.getString("FighterChassisView.chkVSTOL.tooltip"));
add(chkVSTOL, gbc);
chkVSTOL.addActionListener(this);
gbc.gridx = 0;
gbc.gridy = 2;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("FighterChassisView.cbFighterType.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 2;
gbc.gridwidth = 3;
setFieldSize(cbFighterType, controlSize);
// $NON-NLS-1$
cbFighterType.setToolTipText(resourceMap.getString("FighterChassisView.cbFighterType.tooltip"));
add(cbFighterType, gbc);
cbFighterType.addActionListener(this);
gbc.gridx = 0;
gbc.gridy = 3;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("FighterChassisView.cbEngine.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 3;
gbc.gridwidth = 3;
setFieldSize(cbEngine, controlSize);
// $NON-NLS-1$
cbEngine.setToolTipText(resourceMap.getString("FighterChassisView.cbEngine.tooltip"));
add(cbEngine, gbc);
cbEngine.addActionListener(this);
// $NON-NLS-1$
btnResetChassis.setText(resourceMap.getString("FighterChassisView.btnResetChassis.text"));
gbc.gridx = 0;
gbc.gridy = 4;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("FighterChassisView.cbCockpit.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 4;
gbc.gridwidth = 3;
setFieldSize(cbCockpit, controlSize);
// $NON-NLS-1$
cbCockpit.setToolTipText(resourceMap.getString("FighterChassisView.cbCockpit.tooltip"));
add(cbCockpit, gbc);
cbCockpit.addActionListener(this);
gbc.gridx = 1;
gbc.gridy = 5;
gbc.gridwidth = 3;
setFieldSize(btnResetChassis, controlSize);
// $NON-NLS-1$
btnResetChassis.setToolTipText(resourceMap.getString("FighterChassisView.btnResetChassis.tooltip"));
add(btnResetChassis, gbc);
btnResetChassis.addActionListener(this);
}
use of megamek.common.util.EncodeControl in project megameklab by MegaMek.
the class ArmorAllocationView method initUI.
private void initUI() {
// $NON-NLS-1$
ResourceBundle resourceMap = ResourceBundle.getBundle("megameklab.resources.Views", new EncodeControl());
tooltipFormat = resourceMap.getString("ArmorAllocationView.locationTooltip.format");
setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
panLocations.setLayout(new GridBagLayout());
gbc.gridx = 0;
gbc.gridy = 0;
gbc.gridwidth = GridBagConstraints.REMAINDER;
add(panLocations, gbc);
updateLayout();
gbc.gridy++;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(new JLabel(resourceMap.getString("ArmorAllocationView.txtUnallocated.text"), SwingConstants.RIGHT), gbc);
gbc.gridx = 1;
txtUnallocated.setEditable(false);
setFieldSize(txtUnallocated, editorSizeLg);
add(txtUnallocated, gbc);
gbc.gridx = 0;
gbc.gridy++;
// $NON-NLS-1$
add(new JLabel(resourceMap.getString("ArmorAllocationView.txtAllocated.text"), SwingConstants.RIGHT), gbc);
gbc.gridx = 1;
txtAllocated.setEditable(false);
setFieldSize(txtAllocated, editorSizeLg);
add(txtAllocated, gbc);
gbc.gridx = 0;
gbc.gridy++;
// $NON-NLS-1$
add(new JLabel(resourceMap.getString("ArmorAllocationView.txtTotal.text"), SwingConstants.RIGHT), gbc);
gbc.gridx = 1;
txtTotal.setEditable(false);
setFieldSize(txtTotal, editorSizeLg);
add(txtTotal, gbc);
gbc.gridx = 0;
gbc.gridy++;
// $NON-NLS-1$
add(new JLabel(resourceMap.getString("ArmorAllocationView.txtMaxPossible.text"), SwingConstants.RIGHT), gbc);
gbc.gridx = 1;
txtMaxPossible.setEditable(false);
setFieldSize(txtMaxPossible, editorSizeLg);
add(txtMaxPossible, gbc);
gbc.gridx = 0;
gbc.gridy++;
// $NON-NLS-1$
add(new JLabel(resourceMap.getString("ArmorAllocationView.txtWasted.text"), SwingConstants.RIGHT), gbc);
gbc.gridx = 1;
txtWasted.setEditable(false);
setFieldSize(txtWasted, editorSizeLg);
add(txtWasted, gbc);
gbc.gridx = 0;
gbc.gridy++;
// $NON-NLS-1$
add(new JLabel(resourceMap.getString("ArmorAllocationView.txtPointsPerTon.text"), SwingConstants.RIGHT), gbc);
gbc.gridx = 1;
txtPointsPerTon.setEditable(false);
setFieldSize(txtPointsPerTon, editorSizeLg);
add(txtPointsPerTon, gbc);
// $NON-NLS-1$
btnAutoAllocate.setText(resourceMap.getString("ArmorAllocationView.btnAutoAllocate.text"));
gbc.gridx = 0;
gbc.gridy++;
gbc.gridwidth = 2;
gbc.anchor = GridBagConstraints.CENTER;
add(Box.createVerticalStrut(18), gbc);
gbc.gridy++;
add(btnAutoAllocate, gbc);
btnAutoAllocate.addActionListener(e -> listeners.forEach(BuildListener::autoAllocateArmor));
}
use of megamek.common.util.EncodeControl in project megameklab by MegaMek.
the class CVChassisView method initUI.
private void initUI() {
// $NON-NLS-1$
ResourceBundle resourceMap = ResourceBundle.getBundle("megameklab.resources.Views", new EncodeControl());
// $NON-NLS-1$
turretNames = resourceMap.getString("CVChassisView.turrets.values").split(",");
for (EntityMovementMode m : MOTIVE_TYPES) {
motiveNames.put(m, resourceMap.getString("MovementMode." + m.toString()));
}
setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.fill = java.awt.GridBagConstraints.HORIZONTAL;
gbc.anchor = GridBagConstraints.WEST;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("CVChassisView.spnTonnage.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 0;
setFieldSize(spnTonnage, spinnerSize);
// $NON-NLS-1$
spnTonnage.setToolTipText(resourceMap.getString("CVChassisView.spnTonnage.tooltip"));
add(spnTonnage, gbc);
spnTonnage.addChangeListener(this);
// $NON-NLS-1$
chkOmni.setText(resourceMap.getString("CVChassisView.chkOmni.text"));
gbc.gridx = 2;
// $NON-NLS-1$
chkOmni.setToolTipText(resourceMap.getString("CVChassisView.chkOmni.tooltip"));
add(chkOmni, gbc);
chkOmni.addActionListener(this);
// $NON-NLS-1$
chkSuperheavy.setText(resourceMap.getString("CVChassisView.chkSuperheavy.text"));
gbc.gridx = 3;
// $NON-NLS-1$
chkSuperheavy.setToolTipText(resourceMap.getString("CVChassisView.chkSuperheavy.tooltip"));
add(chkSuperheavy, gbc);
chkSuperheavy.addActionListener(this);
cbMotiveType.setModel(new DefaultComboBoxModel<>(MOTIVE_TYPES));
gbc.gridx = 0;
gbc.gridy = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("CVChassisView.cbMotiveType.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 1;
gbc.gridwidth = 3;
setFieldSize(cbMotiveType, controlSize);
// $NON-NLS-1$
cbMotiveType.setToolTipText(resourceMap.getString("CVChassisView.cbMotiveType.tooltip"));
add(cbMotiveType, gbc);
cbMotiveType.addActionListener(this);
gbc.gridx = 0;
gbc.gridy = 2;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("CVChassisView.cbEngine.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 2;
gbc.gridwidth = 3;
setFieldSize(cbEngine, controlSize);
// $NON-NLS-1$
cbEngine.setToolTipText(resourceMap.getString("CVChassisView.cbEngine.tooltip"));
add(cbEngine, gbc);
cbEngine.addActionListener(this);
gbc.gridx = 0;
gbc.gridy = 3;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("CVChassisView.cbTurrets.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 3;
gbc.gridwidth = 3;
setFieldSize(cbTurrets, controlSize);
// $NON-NLS-1$
cbTurrets.setToolTipText(resourceMap.getString("CVChassisView.cbTurrets.tooltip"));
add(cbTurrets, gbc);
cbTurrets.addActionListener(this);
gbc.gridx = 0;
gbc.gridy = 4;
gbc.gridwidth = 3;
// $NON-NLS-1$
JLabel lbl = createLabel(resourceMap.getString("CVChassisView.spnTurretWt.text"), labelSize);
add(lbl, gbc);
gbc.gridx = 3;
gbc.gridy = 4;
setFieldSize(spnChassisTurretWt, spinnerSize);
// $NON-NLS-1$
spnChassisTurretWt.setToolTipText(resourceMap.getString("CVChassisView.spnTurretWt.tooltip"));
add(spnChassisTurretWt, gbc);
spnChassisTurretWt.addChangeListener(this);
omniComponents.add(lbl);
omniComponents.add(spnChassisTurretWt);
gbc.gridx = 0;
gbc.gridy = 5;
gbc.gridwidth = 3;
// $NON-NLS-1$
lbl = createLabel(resourceMap.getString("CVChassisView.spnTurret2Wt.text"), labelSize);
add(lbl, gbc);
gbc.gridx = 3;
gbc.gridy = 5;
gbc.gridwidth = 1;
setFieldSize(spnChassisTurret2Wt, spinnerSize);
// $NON-NLS-1$
spnChassisTurret2Wt.setToolTipText(resourceMap.getString("CVChassisView.spnTurret2Wt.tooltip"));
add(spnChassisTurret2Wt, gbc);
spnChassisTurret2Wt.addChangeListener(this);
omniComponents.add(lbl);
omniComponents.add(spnChassisTurret2Wt);
// $NON-NLS-1$
JButton btnResetChassis = new JButton(resourceMap.getString("CVChassisView.btnResetChassis.text"));
btnResetChassis.setActionCommand(CMD_RESET_CHASSIS);
gbc.gridx = 1;
gbc.gridy = 6;
gbc.gridwidth = 3;
setFieldSize(btnResetChassis, controlSize);
// $NON-NLS-1$
btnResetChassis.setToolTipText(resourceMap.getString("CVChassisView.btnResetChassis.tooltip"));
add(btnResetChassis, gbc);
btnResetChassis.addActionListener(this);
omniComponents.add(btnResetChassis);
}
use of megamek.common.util.EncodeControl in project megameklab by MegaMek.
the class FighterChassisView method initUI.
public void initUI() {
// $NON-NLS-1$
ResourceBundle resourceMap = ResourceBundle.getBundle("megameklab.resources.Views", new EncodeControl());
setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
fighterTypeNames = resourceMap.getString("FighterChassisView.cbFighterType.values").split(",");
gbc.gridx = 0;
gbc.gridy = 0;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("FighterChassisView.spnTonnage.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 0;
setFieldSize(spnTonnage, spinnerSize);
// $NON-NLS-1$
spnTonnage.setToolTipText(resourceMap.getString("FighterChassisView.spnTonnage.tooltip"));
add(spnTonnage, gbc);
spnTonnage.addChangeListener(this);
// $NON-NLS-1$
chkOmni.setText(resourceMap.getString("FighterChassisView.chkOmni.text"));
gbc.gridx = 2;
gbc.gridy = 0;
gbc.anchor = GridBagConstraints.EAST;
// $NON-NLS-1$
chkOmni.setToolTipText(resourceMap.getString("FighterChassisView.chkOmni.tooltip"));
add(chkOmni, gbc);
chkOmni.addActionListener(this);
gbc.gridx = 0;
gbc.gridy = 1;
gbc.gridwidth = 1;
gbc.anchor = GridBagConstraints.WEST;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("FighterChassisView.txtSI.text"), labelSize), gbc);
setFieldSize(txtSI, editorSize);
// $NON-NLS-1$
txtSI.setToolTipText(resourceMap.getString("FighterChassisView.txtSI.tooltip"));
txtSI.setEditable(false);
// $NON-NLS-1$
chkVSTOL.setText(resourceMap.getString("FighterChassisView.chkVSTOL.text"));
// $NON-NLS-1$
chkVSTOL.setToolTipText(resourceMap.getString("FighterChassisView.chkVSTOL.tooltip"));
gbc.gridx = 1;
add(txtSI, gbc);
gbc.gridx = 2;
gbc.anchor = GridBagConstraints.EAST;
// $NON-NLS-1$
chkVSTOL.setToolTipText(resourceMap.getString("FighterChassisView.chkVSTOL.tooltip"));
add(chkVSTOL, gbc);
chkVSTOL.addActionListener(this);
gbc.gridx = 0;
gbc.gridy = 2;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("FighterChassisView.cbFighterType.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 2;
gbc.gridwidth = 3;
setFieldSize(cbFighterType, controlSize);
// $NON-NLS-1$
cbFighterType.setToolTipText(resourceMap.getString("FighterChassisView.cbFighterType.tooltip"));
add(cbFighterType, gbc);
cbFighterType.addActionListener(this);
gbc.gridx = 0;
gbc.gridy = 3;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("FighterChassisView.cbEngine.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 3;
gbc.gridwidth = 3;
setFieldSize(cbEngine, controlSize);
// $NON-NLS-1$
cbEngine.setToolTipText(resourceMap.getString("FighterChassisView.cbEngine.tooltip"));
add(cbEngine, gbc);
cbEngine.addActionListener(this);
// $NON-NLS-1$
btnResetChassis.setText(resourceMap.getString("FighterChassisView.btnResetChassis.text"));
gbc.gridx = 0;
gbc.gridy = 4;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("FighterChassisView.cbCockpit.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 4;
gbc.gridwidth = 3;
setFieldSize(cbCockpit, controlSize);
// $NON-NLS-1$
cbCockpit.setToolTipText(resourceMap.getString("FighterChassisView.cbCockpit.tooltip"));
add(cbCockpit, gbc);
cbCockpit.addActionListener(this);
gbc.gridx = 1;
gbc.gridy = 5;
gbc.gridwidth = 3;
setFieldSize(btnResetChassis, controlSize);
// $NON-NLS-1$
btnResetChassis.setToolTipText(resourceMap.getString("FighterChassisView.btnResetChassis.tooltip"));
add(btnResetChassis, gbc);
btnResetChassis.addActionListener(this);
}
use of megamek.common.util.EncodeControl in project megameklab by MegaMek.
the class InfantryWeaponView method initUI.
private void initUI() {
// $NON-NLS-1$
ResourceBundle resourceMap = ResourceBundle.getBundle("megameklab.resources.Views", new EncodeControl());
// $NON-NLS-1$
fgMotiveMsg = resourceMap.getString("InfantryWeaponView.txtGuns.badMotive");
// $NON-NLS-1$
noneMsg = resourceMap.getString("InfantryWeaponView.none");
setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.anchor = GridBagConstraints.WEST;
gbc.insets = new Insets(0, 0, 1, 2);
// $NON-NLS-1$
add(new JLabel(resourceMap.getString("InfantryWeaponView.txtPrimary.text")), gbc);
gbc.gridx = 1;
gbc.gridy = 0;
gbc.gridwidth = 3;
// $NON-NLS-1$
txtPrimary.setToolTipText(resourceMap.getString("InfantryWeaponView.txtPrimary.tooltip"));
setFieldSize(txtPrimary, controlSize);
txtPrimary.setEditable(false);
add(txtPrimary, gbc);
gbc.gridx = 0;
gbc.gridy = 1;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(new JLabel(resourceMap.getString("InfantryWeaponView.txtSecondary.text")), gbc);
gbc.gridx = 1;
gbc.gridy = 1;
gbc.gridwidth = 3;
setFieldSize(txtSecondary, controlSize);
// $NON-NLS-1$
txtSecondary.setToolTipText(resourceMap.getString("InfantryWeaponView.txtSecondary.tooltip"));
txtSecondary.setEditable(false);
add(txtSecondary, gbc);
gbc.gridx = 0;
gbc.gridy = 2;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(new JLabel(resourceMap.getString("InfantryWeaponView.cbNumSecondary.text")), gbc);
gbc.gridx = 1;
gbc.gridy = 2;
gbc.gridwidth = 3;
setFieldSize(cbNumSecondary, controlSize);
// $NON-NLS-1$
cbNumSecondary.setToolTipText(resourceMap.getString("InfantryWeaponView.cbNumSecondary.tooltip"));
add(cbNumSecondary, gbc);
cbNumSecondary.addActionListener(this);
gbc.gridx = 0;
gbc.gridy = 3;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(new JLabel(resourceMap.getString("InfantryWeaponView.txtGuns.text")), gbc);
gbc.gridx = 1;
gbc.gridy = 3;
gbc.gridwidth = 3;
setFieldSize(txtGuns, controlSize);
// $NON-NLS-1$
txtGuns.setToolTipText(resourceMap.getString("InfantryWeaponView.txtGuns.tooltip"));
txtGuns.setEditable(false);
add(txtGuns, gbc);
gbc.gridx = 0;
gbc.gridy = 4;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(new JLabel(resourceMap.getString("InfantryWeaponView.cbNumGuns.text")), gbc);
gbc.gridx = 1;
gbc.gridy = 4;
gbc.gridwidth = 3;
setFieldSize(cbNumGuns, controlSize);
// $NON-NLS-1$
cbNumGuns.setToolTipText(resourceMap.getString("InfantryWeaponView.cbNumGuns.tooltip"));
add(cbNumGuns, gbc);
cbNumGuns.addActionListener(this);
// $NON-NLS-1$
chkAntiMek.setText(resourceMap.getString("InfantryWeaponView.chkAntiMek.text"));
gbc.gridx = 0;
gbc.gridy = 5;
gbc.gridwidth = 2;
chkAntiMek.setHorizontalTextPosition(SwingConstants.LEFT);
// $NON-NLS-1$
chkAntiMek.setToolTipText(resourceMap.getString("InfantryWeaponView.chkAntiMek.tooltip"));
add(chkAntiMek, gbc);
chkAntiMek.addActionListener(this);
}
Aggregations