use of megamek.common.util.EncodeControl in project megameklab by MegaMek.
the class PMChassisView method initUI.
private void initUI() {
// $NON-NLS-1$
ResourceBundle resourceMap = ResourceBundle.getBundle("megameklab.resources.Views", new EncodeControl());
motiveTypeNames = resourceMap.getString("ProtomekChassisView.cbMotiveType.values").split(",");
setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("ProtomekChassisView.spnTonnage.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 0;
setFieldSize(spnTonnage, spinnerSize);
// $NON-NLS-1$
spnTonnage.setToolTipText(resourceMap.getString("ProtomekChassisView.spnTonnage.tooltip"));
add(spnTonnage, gbc);
spnTonnage.addChangeListener(this);
gbc.gridx = 0;
gbc.gridy = 1;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("ProtomekChassisView.cbMotiveType.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 1;
gbc.gridwidth = 3;
cbMotiveType.addItem(MOTIVE_TYPE_BIPED);
cbMotiveType.addItem(MOTIVE_TYPE_QUAD);
cbMotiveType.addItem(MOTIVE_TYPE_GLIDER);
setFieldSize(cbMotiveType, controlSize);
add(cbMotiveType, gbc);
cbMotiveType.addActionListener(this);
gbc.gridx = 0;
gbc.gridy++;
gbc.gridwidth = 2;
chkMainGun.setText(resourceMap.getString("ProtomekChassisView.chkMainGun.text"));
chkMainGun.setToolTipText(resourceMap.getString("ProtomekChassisView.chkMainGun.tooltip"));
add(chkMainGun, gbc);
chkMainGun.addActionListener(this);
gbc.gridx = 0;
gbc.gridy++;
gbc.gridwidth = 2;
gbc.anchor = GridBagConstraints.WEST;
add(createLabel(resourceMap.getString("ProtomekChassisView.lblEnhancements.text"), labelSize), gbc);
gbc.gridx = 0;
gbc.gridy++;
chkMyomerBooster.setText(resourceMap.getString("ProtomekChassisView.chkMyomerBooster.text"));
chkMyomerBooster.setToolTipText(resourceMap.getString("ProtomekChassisView.chkMyomerBooster.tooltip"));
add(chkMyomerBooster, gbc);
chkMyomerBooster.addActionListener(this);
gbc.gridx = 0;
gbc.gridy++;
chkPartialWing.setText(resourceMap.getString("ProtomekChassisView.chkPartialWing.text"));
chkPartialWing.setToolTipText(resourceMap.getString("ProtomekChassisView.chkPartialWing.tooltip"));
add(chkPartialWing, gbc);
chkPartialWing.addActionListener(this);
gbc.gridx = 0;
gbc.gridy++;
chkMagneticClamps.setText(resourceMap.getString("ProtomekChassisView.chkMagneticClamps.text"));
chkMagneticClamps.setToolTipText(resourceMap.getString("ProtomekChassisView.chkMagneticClamps.tooltip"));
add(chkMagneticClamps, gbc);
chkMagneticClamps.addActionListener(this);
gbc.gridx = 0;
gbc.gridy++;
chkISInterface.setText(resourceMap.getString("ProtomekChassisView.chkISInterface.text"));
chkISInterface.setToolTipText(resourceMap.getString("ProtomekChassisView.chkISInterface.tooltip"));
add(chkISInterface, gbc);
chkISInterface.addActionListener(this);
}
use of megamek.common.util.EncodeControl in project megameklab by MegaMek.
the class BMChassisView method initUI.
private void initUI() {
// $NON-NLS-1$
ResourceBundle resourceMap = ResourceBundle.getBundle("megameklab.resources.Views", new EncodeControl());
// $NON-NLS-1$
baseTypesModel = new DefaultComboBoxModel<>(resourceMap.getString("MekChassisView.baseType.values").split(","));
// $NON-NLS-1$
standardTypesModel = new DefaultComboBoxModel<>(resourceMap.getString("MekChassisView.motiveType.values").split(","));
// $NON-NLS-1$
lamTypesModel = new DefaultComboBoxModel<>(resourceMap.getString("MekChassisView.lamType.values").split(","));
// $NON-NLS-1$
qvTypesModel = new DefaultComboBoxModel<>(resourceMap.getString("MekChassisView.qvType.values").split(","));
// $NON-NLS-1$
primitiveTypesModel = new DefaultComboBoxModel<>(resourceMap.getString("MekChassisView.primitiveType.values").split(","));
// $NON-NLS-1$
primitiveMotiveTypesModel = new DefaultComboBoxModel<>(resourceMap.getString("MekChassisView.primitiveMotiveType.values").split(","));
// $NON-NLS-1$
stdMotiveTooltip = resourceMap.getString("MekChassisView.cbMotiveType.tooltip");
// $NON-NLS-1$
lamMotiveTooltip = resourceMap.getString("MekChassisView.cbMotiveType.LAM.tooltip");
// $NON-NLS-1$
qvMotiveTooltip = resourceMap.getString("MekChassisView.cbMotiveType.QuadVee.tooltip");
setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("MekChassisView.spnTonnage.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 0;
setFieldSize(spnTonnage, spinnerSize);
// $NON-NLS-1$
spnTonnage.setToolTipText(resourceMap.getString("MekChassisView.spnTonnage.tooltip"));
add(spnTonnage, gbc);
spnTonnage.addChangeListener(this);
add(spnTonnage, gbc);
gbc.gridx = 2;
gbc.gridy = 0;
// $NON-NLS-1$
chkOmni.setText(resourceMap.getString("MekChassisView.chkOmni.text"));
// $NON-NLS-1$
chkOmni.setToolTipText(resourceMap.getString("MekChassisView.chkOmni.tooltip"));
add(chkOmni, gbc);
chkOmni.addChangeListener(this);
gbc.gridx = 0;
gbc.gridy = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("MekChassisView.cbBaseType.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 1;
gbc.gridwidth = 3;
setFieldSize(cbBaseType, controlSize);
// $NON-NLS-1$
cbBaseType.setToolTipText(resourceMap.getString("MekChassisView.cbBaseType.tooltip"));
add(cbBaseType, gbc);
cbBaseType.addActionListener(this);
gbc.gridx = 0;
gbc.gridy = 2;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("MekChassisView.cbMotiveType.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 2;
gbc.gridwidth = 3;
setFieldSize(cbMotiveType, controlSize);
// $NON-NLS-1$
cbMotiveType.setToolTipText(resourceMap.getString("MekChassisView.cbMotiveType.tooltip"));
add(cbMotiveType, gbc);
cbMotiveType.addActionListener(this);
gbc.gridx = 0;
gbc.gridy = 3;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("MekChassisView.cbStructure.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 3;
gbc.gridwidth = 3;
setFieldSize(cbStructure, controlSize);
// $NON-NLS-1$
cbStructure.setToolTipText(resourceMap.getString("MekChassisView.cbStructure.tooltip"));
add(cbStructure, gbc);
cbStructure.addActionListener(this);
gbc.gridx = 0;
gbc.gridy = 4;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("MekChassisView.cbEngine.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 4;
gbc.gridwidth = 3;
setFieldSize(cbEngine, controlSize);
// $NON-NLS-1$
cbEngine.setToolTipText(resourceMap.getString("MekChassisView.cbEngine.tooltip"));
add(cbEngine, gbc);
cbEngine.addActionListener(this);
gbc.gridx = 0;
gbc.gridy = 5;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("MekChassisView.cbGyro.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 5;
gbc.gridwidth = 3;
setFieldSize(cbGyro, controlSize);
// $NON-NLS-1$
cbGyro.setToolTipText(resourceMap.getString("MekChassisView.cbGyro.tooltip"));
add(cbGyro, gbc);
cbGyro.addActionListener(this);
gbc.gridx = 0;
gbc.gridy = 6;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("MekChassisView.cbCockpit.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 6;
gbc.gridwidth = 3;
setFieldSize(cbCockpit, controlSize);
// $NON-NLS-1$
cbCockpit.setToolTipText(resourceMap.getString("MekChassisView.cbCockpit.tooltip"));
add(cbCockpit, gbc);
cbCockpit.addActionListener(this);
gbc.gridx = 0;
gbc.gridy = 7;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("MekChassisView.cbEnhancement.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 7;
gbc.gridwidth = 3;
setFieldSize(cbEnhancement, controlSize);
// $NON-NLS-1$
cbEnhancement.setNullValue(resourceMap.getString("MekChassisView.cbEnhancement.null"));
// $NON-NLS-1$
cbEnhancement.setToolTipText(resourceMap.getString("MekChassisView.cbEnhancement.tooltip"));
add(cbEnhancement, gbc);
cbEnhancement.addActionListener(this);
// $NON-NLS-1$
chkFullHeadEject.setText(resourceMap.getString("MekChassisView.chkFullHeadEject.text"));
gbc.gridx = 1;
gbc.gridy = 8;
gbc.gridwidth = 3;
add(chkFullHeadEject, gbc);
// $NON-NLS-1$
chkFullHeadEject.setToolTipText(resourceMap.getString("MekChassisView.chkFullHeadEject.tooltip"));
chkFullHeadEject.addActionListener(this);
// $NON-NLS-1$
btnResetChassis.setText(resourceMap.getString("MekChassisView.btnResetChassis.text"));
gbc.gridx = 1;
gbc.gridy = 9;
gbc.gridwidth = 3;
add(btnResetChassis, gbc);
// $NON-NLS-1$
btnResetChassis.setToolTipText(resourceMap.getString("MekChassisView.btnResetChassis.tooltip"));
btnResetChassis.addActionListener(this);
}
use of megamek.common.util.EncodeControl in project megameklab by MegaMek.
the class DSChassisView method initUI.
public void initUI() {
// $NON-NLS-1$
ResourceBundle resourceMap = ResourceBundle.getBundle("megameklab.resources.Views", new EncodeControl());
setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
cbBaseType.setModel(new DefaultComboBoxModel<>(resourceMap.getString("DropshipChassisView.cbBaseType.values").split(",")));
cbChassisType.setModel(new DefaultComboBoxModel<>(resourceMap.getString("DropshipChassisView.cbChassisType.values").split(",")));
gbc.gridx = 0;
gbc.gridy = 0;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("DropshipChassisView.spnTonnage.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.weightx = 1.0;
// $NON-NLS-1$
spnTonnage.setToolTipText(resourceMap.getString("DropshipChassisView.spnTonnage.tooltip"));
add(spnTonnage, gbc);
spnTonnage.addChangeListener(this);
// $NON-NLS-1$
chkMilitary.setText(resourceMap.getString("DropshipChassisView.chkFunction.text"));
gbc.gridx = 2;
gbc.gridy = 0;
gbc.fill = GridBagConstraints.NONE;
gbc.weightx = 0.0;
// $NON-NLS-1$
chkMilitary.setToolTipText(resourceMap.getString("DropshipChassisView.chkFunction.tooltip"));
add(chkMilitary, gbc);
chkMilitary.addActionListener(this);
// $NON-NLS-1$
chkKFBoom.setText(resourceMap.getString("DropshipChassisView.chkKFBoom.text"));
gbc.gridx = 3;
gbc.gridy = 0;
// $NON-NLS-1$
chkKFBoom.setToolTipText(resourceMap.getString("DropshipChassisView.chkKFBoom.tooltip"));
add(chkKFBoom, gbc);
chkKFBoom.addActionListener(this);
chkKFBoom.setVisible(false);
gbc.gridx = 0;
gbc.gridy = 2;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("DropshipChassisView.cbBaseType.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 2;
gbc.gridwidth = 3;
setFieldSize(cbBaseType, controlSize);
// $NON-NLS-1$
cbBaseType.setToolTipText(resourceMap.getString("DropshipChassisView.cbBaseType.tooltip"));
add(cbBaseType, gbc);
cbBaseType.addActionListener(this);
gbc.gridx = 0;
gbc.gridy = 3;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("DropshipChassisView.cbChassisType.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 3;
gbc.gridwidth = 3;
setFieldSize(cbChassisType, controlSize);
// $NON-NLS-1$
cbChassisType.setToolTipText(resourceMap.getString("DropshipChassisView.cbChassisType.tooltip"));
add(cbChassisType, gbc);
cbChassisType.addActionListener(this);
gbc.gridx = 0;
gbc.gridy = 4;
gbc.gridwidth = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("DropshipChassisView.spnSI.text"), labelSize), gbc);
gbc.gridx = 1;
gbc.gridy = 4;
gbc.gridwidth = 3;
setFieldSize(spnSI, controlSize);
// $NON-NLS-1$
spnSI.setToolTipText(resourceMap.getString("DropshipChassisView.spnSI.tooltip"));
add(spnSI, gbc);
spnSI.addChangeListener(this);
}
use of megamek.common.util.EncodeControl in project megameklab by MegaMek.
the class BAChassisView method initUI.
private void initUI() {
// $NON-NLS-1$
ResourceBundle resourceMap = ResourceBundle.getBundle("megameklab.resources.Views", new EncodeControl());
// $NON-NLS-1$
cbChassisType.setModel(new DefaultComboBoxModel<>(resourceMap.getString("BAChassisView.cbBodyType.values").split(",")));
// $NON-NLS-1$
cbTurretType.setModel(new DefaultComboBoxModel<>(resourceMap.getString("BAChassisView.cbTurretType.values").split(",")));
setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.fill = java.awt.GridBagConstraints.HORIZONTAL;
gbc.anchor = GridBagConstraints.WEST;
gbc.gridx = 0;
gbc.gridy = 0;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("BAChassisView.cbChassisType.text"), labelSize), gbc);
gbc.gridx = 1;
setFieldSize(cbChassisType, controlSize);
// $NON-NLS-1$
cbChassisType.setToolTipText(resourceMap.getString("BAChassisView.cbChassisType.tooltip"));
add(cbChassisType, gbc);
cbChassisType.addActionListener(this);
gbc.gridx = 0;
gbc.gridy++;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("BAChassisView.cbWeightClass.text"), labelSize), gbc);
gbc.gridx = 1;
setFieldSize(cbWeightClass, controlSize);
// $NON-NLS-1$
cbWeightClass.setToolTipText(resourceMap.getString("BAChassisView.cbWeightClass.tooltip"));
add(cbWeightClass, gbc);
cbWeightClass.addActionListener(this);
gbc.gridx = 0;
gbc.gridy++;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("BAChassisView.spnSquadSize.text"), labelSize), gbc);
gbc.gridx = 1;
setFieldSize(spnSquadSize, controlSize);
// $NON-NLS-1$
spnSquadSize.setToolTipText(resourceMap.getString("BAChassisView.spnSquadSize.tooltip"));
add(spnSquadSize, gbc);
spnSquadSize.addChangeListener(this);
gbc.gridx = 0;
gbc.gridy++;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("BAChassisView.cbTurretType.text"), labelSize), gbc);
gbc.gridx = 1;
setFieldSize(cbTurretType, controlSize);
// $NON-NLS-1$
cbTurretType.setToolTipText(resourceMap.getString("BAChassisView.cbTurretType.tooltip"));
add(cbTurretType, gbc);
cbTurretType.addActionListener(this);
gbc.gridx = 0;
gbc.gridy++;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("BAChassisView.spnTurretSize.text"), labelSize), gbc);
gbc.gridx = 1;
setFieldSize(spnTurretSize, controlSize);
// $NON-NLS-1$
spnTurretSize.setToolTipText(resourceMap.getString("BAChassisView.spnTurretSize.tooltip"));
add(spnTurretSize, gbc);
spnTurretSize.addChangeListener(this);
JPanel chassisOptions = new JPanel();
// $NON-NLS-1$
chkExoskeleton.setText(resourceMap.getString("BAChassisView.chkExoskeleton.text"));
chkExoskeleton.addActionListener(this);
// $NON-NLS-1$
chkExoskeleton.setToolTipText(resourceMap.getString("BAChassisView.chkExoskeleton.tooltip"));
chassisOptions.add(chkExoskeleton);
// $NON-NLS-1$
chkHarjel.setText(resourceMap.getString("BAChassisView.chkHarjel.text"));
chkHarjel.addActionListener(this);
// $NON-NLS-1$
chkHarjel.setToolTipText(resourceMap.getString("BAChassisView.chkHarjel.tooltip"));
chassisOptions.add(chkHarjel);
gbc.gridx = 0;
gbc.gridy++;
gbc.gridwidth = 2;
add(chassisOptions, gbc);
}
use of megamek.common.util.EncodeControl in project megameklab by MegaMek.
the class CVTransportView method initUI.
private void initUI() {
// $NON-NLS-1$
ResourceBundle resourceMap = ResourceBundle.getBundle("megameklab.resources.Views", new EncodeControl());
setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = 0;
gbc.fill = java.awt.GridBagConstraints.HORIZONTAL;
gbc.anchor = GridBagConstraints.WEST;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("CVTransportView.lblFixed.text"), labelSize), gbc);
gbc.gridx = 2;
gbc.gridy = 0;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("CVTransportView.lblPod.text"), labelSize), gbc);
gbc.gridx = 0;
gbc.gridy = 1;
// $NON-NLS-1$
add(createLabel(resourceMap.getString("CVTransportView.lblTroopSpace.text"), labelSizeLg), gbc);
gbc.gridx = 1;
setFieldSize(spnFixedTroop, editorSize);
add(spnFixedTroop, gbc);
spnFixedTroop.addChangeListener(this);
gbc.gridx = 2;
setFieldSize(spnPodTroop, editorSize);
add(spnPodTroop, gbc);
spnPodTroop.addChangeListener(this);
for (BayData bayType : BayData.values()) {
if (!bayType.isCargoBay()) {
continue;
}
String tooltip = String.format(resourceMap.getString("CVTransportView.bay.tooltipFormat"), 1 / bayType.getWeight());
gbc.gridx = 0;
gbc.gridy++;
add(createLabel(bayType.getDisplayName(), labelSizeLg), gbc);
gbc.gridx = 1;
SpinnerNumberModel model = new SpinnerNumberModel(0.0, 0.0, null, 0.5);
JSpinner spinner = new JSpinner(model);
spinner.setToolTipText(tooltip);
spinner.setName(bayType.toString());
setFieldSize(spinner, editorSize);
fixedSpinnerModels.put(bayType, model);
fixedSpinners.put(bayType, spinner);
add(spinner, gbc);
spinner.addChangeListener(this);
gbc.gridx = 2;
model = new SpinnerNumberModel(0.0, 0.0, null, 0.5);
spinner = new JSpinner(model);
spinner.setToolTipText(tooltip);
spinner.setName(bayType.toString());
setFieldSize(spinner, editorSize);
podSpinnerModels.put(bayType, model);
podSpinners.put(bayType, spinner);
add(spinner, gbc);
spinner.addChangeListener(this);
}
}
Aggregations