Search in sources :

Example 36 with EncodeControl

use of megamek.common.util.EncodeControl in project megameklab by MegaMek.

the class BAProtoArmorView 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 = 0;
    gbc.gridy = 0;
    gbc.gridwidth = 1;
    // $NON-NLS-1$
    add(createLabel(resourceMap.getString("ArmorView.cbArmorType.text"), labelSize), gbc);
    gbc.gridx = 1;
    gbc.gridy = 0;
    gbc.gridwidth = 2;
    setFieldSize(cbArmorType, controlSize);
    // $NON-NLS-1$
    cbArmorType.setToolTipText(resourceMap.getString("ArmorView.cbArmorType.tooltip"));
    add(cbArmorType, gbc);
    cbArmorType.addActionListener(this);
    gbc.gridx = 0;
    gbc.gridy = 1;
    gbc.gridwidth = 1;
    // $NON-NLS-1$
    add(createLabel(resourceMap.getString("ArmorView.spnArmorPoints.text"), labelSize), gbc);
    gbc.gridx = 1;
    gbc.gridy = 1;
    setFieldSize(spnArmorPoints.getEditor(), editorSize);
    // $NON-NLS-1$
    spnArmorPoints.setToolTipText(resourceMap.getString("ArmorView.spnArmorPoints.tooltip"));
    add(spnArmorPoints, gbc);
    spnArmorPoints.addChangeListener(this);
    gbc.gridx = 0;
    gbc.gridy = 2;
    gbc.gridwidth = 3;
    // $NON-NLS-1$
    btnMaximize.setText(resourceMap.getString("ArmorView.btnMaximize.text"));
    btnMaximize.setActionCommand(CMD_MAXIMIZE);
    setFieldSize(btnMaximize, controlSize);
    // $NON-NLS-1$
    btnMaximize.setToolTipText(resourceMap.getString("ArmorView.btnMaximize.tooltip"));
    add(btnMaximize, gbc);
    btnMaximize.addActionListener(this);
    gbc.gridx = 0;
    gbc.gridy = 3;
    gbc.gridwidth = 3;
    // $NON-NLS-1$
    btnUseRemaining.setText(resourceMap.getString("ArmorView.btnRemaining.text"));
    btnUseRemaining.setActionCommand(CMD_REMAINING);
    setFieldSize(btnUseRemaining, controlSize);
    // $NON-NLS-1$
    btnUseRemaining.setToolTipText(resourceMap.getString("ArmorView.btnRemaining.tooltip"));
    add(btnUseRemaining, gbc);
    btnUseRemaining.addActionListener(this);
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) EncodeControl(megamek.common.util.EncodeControl) ResourceBundle(java.util.ResourceBundle)

Example 37 with EncodeControl

use of megamek.common.util.EncodeControl in project megameklab by MegaMek.

the class BasicInfoView method initUI.

private void initUI() {
    ResourceBundle resourceMap = ResourceBundle.getBundle("megameklab.resources.Views", new EncodeControl());
    techBaseNames = resourceMap.getString("BasicInfoView.cbTechBase.values").split(",");
    setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.insets = new Insets(0, 0, 1, 2);
    add(createLabel(resourceMap.getString("BasicInfoView.txtChassis.text"), labelSize), gbc);
    gbc.gridx = 1;
    txtChassis.setToolTipText(resourceMap.getString("BasicInfoView.txtChassis.tooltip"));
    add(txtChassis, gbc);
    setFieldSize(txtChassis, controlSize);
    txtChassis.addFocusListener(this);
    gbc.gridx = 0;
    gbc.gridy++;
    add(createLabel(resourceMap.getString("BasicInfoView.txtModel.text"), labelSize), gbc);
    gbc.gridx = 1;
    txtModel.setToolTipText(resourceMap.getString("BasicInfoView.txtModel.tooltip"));
    add(txtModel, gbc);
    setFieldSize(txtModel, controlSize);
    txtModel.addFocusListener(this);
    gbc.gridx = 0;
    gbc.gridy++;
    lblMulId.setText(resourceMap.getString("BasicInfoView.txtMulId.text"));
    add(lblMulId, gbc);
    gbc.gridx = 1;
    txtMulId.setToolTipText(resourceMap.getString("BasicInfoView.txtMulId.tooltip"));
    add(txtMulId, gbc);
    setFieldSize(txtMulId, controlSize);
    txtMulId.addFocusListener(this);
    gbc.gridx = 0;
    gbc.gridy++;
    gbc.gridwidth = 2;
    gbc.insets = new Insets(0, 30, 0, 30);
    browseMul.setToolTipText(resourceMap.getString("BasicInfoView.browseMul.tooltip"));
    browseMul.addActionListener(e -> openMUL());
    add(browseMul, gbc);
    gbc.insets = new Insets(0, 0, 1, 2);
    gbc.gridwidth = 1;
    gbc.gridx = 0;
    gbc.gridy++;
    add(createLabel(resourceMap.getString("BasicInfoView.txtYear.text"), labelSize), gbc);
    gbc.gridx = 1;
    add(txtYear, gbc);
    txtYear.setToolTipText(resourceMap.getString("BasicInfoView.txtYear.tooltip"));
    setFieldSize(txtYear, controlSize);
    txtYear.setMaximum(9999);
    txtYear.addFocusListener(this);
    gbc.gridx = 0;
    gbc.gridy++;
    lblFaction.setText(resourceMap.getString("BasicInfoView.cbFaction.text"));
    add(lblFaction, gbc);
    gbc.gridx = 1;
    cbFaction.setToolTipText(resourceMap.getString("BasicInfoView.cbFaction.tooltip"));
    add(cbFaction, gbc);
    setFieldSize(cbFaction, controlSize);
    cbFaction.addActionListener(this);
    gbc.gridx = 0;
    gbc.gridy++;
    add(createLabel(resourceMap.getString("BasicInfoView.txtSource.text"), labelSize), gbc);
    gbc.gridx = 1;
    setFieldSize(txtSource, controlSize);
    txtSource.setToolTipText(resourceMap.getString("BasicInfoView.txtSource.tooltip"));
    add(txtSource, gbc);
    txtSource.addFocusListener(this);
    gbc.gridx = 0;
    gbc.gridy++;
    add(createLabel(resourceMap.getString("BasicInfoView.cbTechBase.text"), labelSize), gbc);
    gbc.gridx = 1;
    setFieldSize(cbTechBase, controlSize);
    cbTechBase.setToolTipText(resourceMap.getString("BasicInfoView.cbTechBase.tooltip"));
    add(cbTechBase, gbc);
    cbTechBase.addActionListener(this);
    gbc.gridx = 0;
    gbc.gridy++;
    add(createLabel(resourceMap.getString("BasicInfoView.cbTechLevel.text"), labelSize), gbc);
    gbc.gridx = 1;
    setFieldSize(cbTechLevel, controlSize);
    cbTechLevel.setToolTipText(resourceMap.getString("BasicInfoView.cbTechLevel.tooltip"));
    add(cbTechLevel, gbc);
    cbTechLevel.addActionListener(this);
    refreshTechBase();
    gbc.gridx = 0;
    gbc.gridy++;
    add(createLabel(resourceMap.getString("BasicInfoView.txtManualBV.text"), labelSize), gbc);
    gbc.gridx = 1;
    setFieldSize(txtManualBV, controlSize);
    txtManualBV.setToolTipText(resourceMap.getString("BasicInfoView.txtManualBV.tooltip"));
    add(txtManualBV, gbc);
    txtManualBV.addFocusListener(this);
    txtMulId.setMinimum(-1);
    lblFaction.setVisible(CConfig.getBooleanParam(CConfig.TECH_SHOW_FACTION));
    cbFaction.setVisible(CConfig.getBooleanParam(CConfig.TECH_SHOW_FACTION));
}
Also used : EncodeControl(megamek.common.util.EncodeControl) ResourceBundle(java.util.ResourceBundle)

Example 38 with EncodeControl

use of megamek.common.util.EncodeControl in project megameklab by MegaMek.

the class FluffTab method initUi.

private void initUi() {
    // $NON-NLS-1$
    ResourceBundle resourceMap = ResourceBundle.getBundle("megameklab.resources.Tabs", new EncodeControl());
    Border border = BorderFactory.createLineBorder(Color.BLACK);
    setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
    JPanel panLeft = new JPanel();
    JPanel panRight = new JPanel();
    add(panLeft);
    if (!eSource.getEntity().hasETypeFlag(Entity.ETYPE_INFANTRY) || eSource.getEntity().hasETypeFlag(Entity.ETYPE_BATTLEARMOR)) {
        add(panRight);
    }
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.fill = GridBagConstraints.BOTH;
    gbc.insets = new Insets(5, 5, 5, 5);
    panLeft.setLayout(new GridBagLayout());
    panLeft.add(new JLabel(resourceMap.getString("FluffTab.txtCapabilities")), gbc);
    gbc.gridy++;
    txtCapabilities.setLineWrap(true);
    txtCapabilities.setWrapStyleWord(true);
    txtCapabilities.setBorder(border);
    txtCapabilities.setText(getFluff().getCapabilities());
    panLeft.add(txtCapabilities, gbc);
    txtCapabilities.addFocusListener(this);
    gbc.gridy++;
    panLeft.add(new JLabel(resourceMap.getString("FluffTab.txtOverview")), gbc);
    gbc.gridy++;
    txtOverview.setLineWrap(true);
    txtOverview.setWrapStyleWord(true);
    txtOverview.setText(getFluff().getOverview());
    txtOverview.setBorder(border);
    panLeft.add(txtOverview, gbc);
    txtOverview.addFocusListener(this);
    gbc.gridy++;
    panLeft.add(new JLabel(resourceMap.getString("FluffTab.txtDeployment")), gbc);
    gbc.gridy++;
    txtDeployment.setLineWrap(true);
    txtDeployment.setWrapStyleWord(true);
    txtDeployment.setBorder(border);
    txtDeployment.setText(getFluff().getDeployment());
    panLeft.add(txtDeployment, gbc);
    txtDeployment.addFocusListener(this);
    gbc.gridy++;
    panLeft.add(new JLabel(resourceMap.getString("FluffTab.txtHistory")), gbc);
    gbc.gridy++;
    txtHistory.setLineWrap(true);
    txtHistory.setWrapStyleWord(true);
    txtHistory.setBorder(border);
    txtHistory.setText(getFluff().getHistory());
    panLeft.add(txtHistory, gbc);
    txtHistory.addFocusListener(this);
    gbc.gridy++;
    panLeft.add(new JLabel(resourceMap.getString("FluffTab.txtNotes")), gbc);
    gbc.gridy++;
    txtNotes.setLineWrap(true);
    txtNotes.setWrapStyleWord(true);
    txtNotes.setBorder(border);
    txtNotes.setText(getFluff().getNotes());
    gbc.weighty = 1.0;
    panLeft.add(txtNotes, gbc);
    txtNotes.addFocusListener(this);
    panRight.setLayout(new GridBagLayout());
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    panRight.add(new JLabel(resourceMap.getString("FluffTab.txtManufacturer")), gbc);
    txtManufacturer.setText(getFluff().getManufacturer());
    gbc.gridx = 1;
    panRight.add(txtManufacturer, gbc);
    txtManufacturer.addFocusListener(this);
    gbc.gridy++;
    gbc.gridx = 0;
    panRight.add(new JLabel(resourceMap.getString("FluffTab.txtPrimaryFactory")), gbc);
    txtPrimaryFactory.setText(getFluff().getPrimaryFactory());
    gbc.gridx = 1;
    panRight.add(txtPrimaryFactory, gbc);
    txtPrimaryFactory.addFocusListener(this);
    gbc.gridy++;
    if (eSource.getEntity().hasETypeFlag(Entity.ETYPE_SMALL_CRAFT) || eSource.getEntity().hasETypeFlag(Entity.ETYPE_JUMPSHIP)) {
        gbc.gridx = 0;
        panRight.add(new JLabel(resourceMap.getString("FluffTab.txtUse")), gbc);
        gbc.gridx = 1;
        txtUse.setText(getFluff().getUse());
        panRight.add(txtUse, gbc);
        txtUse.addFocusListener(this);
        gbc.gridy++;
        gbc.gridx = 0;
        panRight.add(new JLabel(resourceMap.getString("FluffTab.txtLength")), gbc);
        gbc.gridx = 1;
        panRight.add(new JLabel(resourceMap.getString("FluffTab.txtWidth")), gbc);
        gbc.gridx = 2;
        panRight.add(new JLabel(resourceMap.getString("FluffTab.txtHeight")), gbc);
        gbc.gridy++;
        gbc.gridx = 0;
        txtLength.setText(getFluff().getLength());
        panRight.add(txtLength, gbc);
        txtLength.addFocusListener(this);
        gbc.gridx = 1;
        txtWidth.setText(getFluff().getWidth());
        panRight.add(txtWidth, gbc);
        txtWidth.addFocusListener(this);
        gbc.gridx = 2;
        txtHeight.setText(getFluff().getHeight());
        panRight.add(txtHeight, gbc);
        txtHeight.addFocusListener(this);
        gbc.gridy++;
    }
    gbc.gridx = 0;
    panRight.add(new JLabel(resourceMap.getString("FluffTab.System")), gbc);
    gbc.gridx = 1;
    panRight.add(new JLabel(resourceMap.getString("FluffTab.Manufacturer")), gbc);
    gbc.gridx = 2;
    panRight.add(new JLabel(resourceMap.getString("FluffTab.Model")), gbc);
    gbc.gridy++;
    for (EntityFluff.System system : EntityFluff.System.values()) {
        if ((system == EntityFluff.System.JUMPJET) && eSource.getEntity().hasETypeFlag(Entity.ETYPE_AERO)) {
            continue;
        }
        gbc.gridx = 0;
        panRight.add(new JLabel(resourceMap.getString("FluffTab.System." + system.toString())), gbc);
        gbc.gridx = 1;
        JTextField txt = new JTextField(12);
        txt.setText(getFluff().getSystemManufacturer(system));
        panRight.add(txt, gbc);
        txt.setName(system.name() + ":" + TAG_MANUFACTURER);
        txt.addFocusListener(this);
        gbc.gridx = 2;
        txt = new JTextField(12);
        txt.setText(getFluff().getSystemModel(system));
        panRight.add(txt, gbc);
        txt.setName(system.name() + ":" + TAG_MODEL);
        txt.addFocusListener(this);
        gbc.gridy++;
    }
    gbc.gridx = 0;
    gbc.weighty = 1.0;
    panRight.add(new JPanel(), gbc);
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) EncodeControl(megamek.common.util.EncodeControl) BoxLayout(javax.swing.BoxLayout) EntityFluff(megamek.common.EntityFluff) JLabel(javax.swing.JLabel) ResourceBundle(java.util.ResourceBundle) JTextField(javax.swing.JTextField) Border(javax.swing.border.Border)

Example 39 with EncodeControl

use of megamek.common.util.EncodeControl in project megameklab by MegaMek.

the class HeatSinkView method initUI.

private void initUI() {
    // $NON-NLS-1$
    ResourceBundle resourceMap = ResourceBundle.getBundle("megameklab.resources.Views", new EncodeControl());
    // $NON-NLS-1$
    mechDisplayNames = resourceMap.getString("HeatSinkView.mechNames.values").split(",");
    // $NON-NLS-1$
    aeroDisplayNames = resourceMap.getString("HeatSinkView.aeroNames.values").split(",");
    setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    // $NON-NLS-1$
    add(createLabel(resourceMap.getString("HeatSinkView.cbHSType.text"), labelSize), gbc);
    gbc.gridx = 1;
    gbc.gridwidth = 4;
    setFieldSize(cbHSType, controlSize);
    // $NON-NLS-1$
    cbHSType.setToolTipText(resourceMap.getString("HeatSinkView.cbHSType.tooltip"));
    add(cbHSType, gbc);
    cbHSType.addActionListener(this);
    spnCount.setModel(countModel);
    gbc.gridx = 0;
    gbc.gridy++;
    gbc.gridwidth = 1;
    // $NON-NLS-1$
    add(createLabel(resourceMap.getString("HeatSinkView.spnCount.text"), labelSize), gbc);
    gbc.gridx = 1;
    setFieldSize(spnCount.getEditor(), editorSize);
    // $NON-NLS-1$
    spnCount.setToolTipText(resourceMap.getString("HeatSinkView.spnCount.tooltip"));
    add(spnCount, gbc);
    spnCount.addChangeListener(this);
    gbc.gridx = 3;
    lblCritFreeText.setText(resourceMap.getString("HeatSinkView.lblCritFree.text"));
    add(lblCritFreeText, gbc);
    gbc.gridx = 4;
    // $NON-NLS-1$
    lblCritFreeCount.setToolTipText(resourceMap.getString("HeatSinkView.lblCritFree.tooltip"));
    add(lblCritFreeCount, gbc);
    spnBaseCount.setModel(baseCountModel);
    gbc.gridx = 0;
    gbc.gridy++;
    // $NON-NLS-1$
    lblBaseCount.setText(resourceMap.getString("HeatSinkView.spnBaseCount.text"));
    add(lblBaseCount, gbc);
    gbc.gridx = 1;
    setFieldSize(spnBaseCount.getEditor(), editorSize);
    // $NON-NLS-1$
    spnBaseCount.setToolTipText(resourceMap.getString("HeatSinkView.spnBaseCount.tooltip"));
    add(spnBaseCount, gbc);
    spnBaseCount.addChangeListener(this);
    spnPrototypeCount.setModel(prototypeCountModel);
    gbc.gridx = 0;
    gbc.gridy++;
    // $NON-NLS-1$
    lblPrototypeCount.setText(resourceMap.getString("HeatSinkView.spnPrototypeCount.text"));
    add(lblPrototypeCount, gbc);
    gbc.gridx = 1;
    setFieldSize(spnPrototypeCount.getEditor(), editorSize);
    // $NON-NLS-1$
    spnPrototypeCount.setToolTipText(resourceMap.getString("HeatSinkView.spnPrototypeCount.tooltip"));
    add(spnPrototypeCount, gbc);
    spnPrototypeCount.addChangeListener(this);
    gbc.gridx = 0;
    gbc.gridy++;
    lblWeightFreeText.setText(resourceMap.getString("HeatSinkView.lblWeightFree.text"));
    add(lblWeightFreeText, gbc);
    gbc.gridx = 1;
    // $NON-NLS-1$
    lblWeightFreeCount.setToolTipText(resourceMap.getString("HeatSinkView.lblWeightFree.tooltip"));
    add(lblWeightFreeCount, gbc);
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) EncodeControl(megamek.common.util.EncodeControl) ResourceBundle(java.util.ResourceBundle)

Example 40 with EncodeControl

use of megamek.common.util.EncodeControl in project megameklab by MegaMek.

the class CVChassisView method initUI.

private void initUI() {
    ResourceBundle resourceMap = ResourceBundle.getBundle("megameklab.resources.Views", new EncodeControl());
    turretNames = resourceMap.getString("CVChassisView.turrets.values").split(",");
    for (EntityMovementMode m : MOTIVE_TYPES) {
        motiveNames.put(m, 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;
    add(createLabel(resourceMap.getString("CVChassisView.spnTonnage.text"), labelSize), gbc);
    gbc.gridx = 1;
    gbc.gridy = 0;
    setFieldSize(spnTonnage, spinnerSize);
    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);
    gbc.gridy++;
    // $NON-NLS-1$
    chkTrailer.setText(resourceMap.getString("CVChassisView.chkTrailer.text"));
    gbc.gridx = 0;
    gbc.gridwidth = 2;
    // $NON-NLS-1$
    chkTrailer.setToolTipText(resourceMap.getString("CVChassisView.chkTrailer.tooltip"));
    chkTrailer.setHorizontalAlignment(SwingConstants.RIGHT);
    add(chkTrailer, gbc);
    chkTrailer.addActionListener(this);
    // $NON-NLS-1$
    chkControlSystems.setText(resourceMap.getString("CVChassisView.chkControlSystems.text"));
    gbc.gridx = 2;
    // $NON-NLS-1$
    chkControlSystems.setToolTipText(resourceMap.getString("CVChassisView.chkControlSystems.tooltip"));
    add(chkControlSystems, gbc);
    chkControlSystems.addActionListener(this);
    gbc.gridwidth = 1;
    gbc.gridy++;
    cbMotiveType.setModel(new DefaultComboBoxModel<>(MOTIVE_TYPES));
    gbc.gridx = 0;
    // $NON-NLS-1$
    add(createLabel(resourceMap.getString("CVChassisView.cbMotiveType.text"), labelSize), gbc);
    gbc.gridx = 1;
    gbc.gridwidth = 3;
    setFieldSize(cbMotiveType, controlSize);
    // $NON-NLS-1$
    cbMotiveType.setToolTipText(resourceMap.getString("CVChassisView.cbMotiveType.tooltip"));
    add(cbMotiveType, gbc);
    cbMotiveType.addActionListener(this);
    gbc.gridy++;
    gbc.gridx = 0;
    gbc.gridwidth = 1;
    // $NON-NLS-1$
    add(createLabel(resourceMap.getString("CVChassisView.cbEngine.text"), labelSize), gbc);
    gbc.gridx = 1;
    gbc.gridwidth = 3;
    setFieldSize(cbEngine, controlSize);
    // $NON-NLS-1$
    cbEngine.setToolTipText(resourceMap.getString("CVChassisView.cbEngine.tooltip"));
    add(cbEngine, gbc);
    cbEngine.addActionListener(this);
    gbc.gridy++;
    gbc.gridx = 0;
    gbc.gridwidth = 2;
    add(createLabel(resourceMap.getString("CVChassisView.spnExtraSeats.text"), labelSize), gbc);
    gbc.gridx = 2;
    gbc.gridwidth = 2;
    setFieldSize(spnExtraSeats, spinnerSize);
    spnExtraSeats.setToolTipText("CVChassisView.spnExtraSeats.tooltip");
    add(spnExtraSeats, gbc);
    spnExtraSeats.addChangeListener(this);
    gbc.gridy++;
    gbc.gridx = 0;
    gbc.gridwidth = 1;
    // $NON-NLS-1$
    add(createLabel(resourceMap.getString("CVChassisView.cbTurrets.text"), labelSize), gbc);
    gbc.gridx = 1;
    gbc.gridwidth = 3;
    setFieldSize(cbTurrets, controlSize);
    // $NON-NLS-1$
    cbTurrets.setToolTipText(resourceMap.getString("CVChassisView.cbTurrets.tooltip"));
    add(cbTurrets, gbc);
    cbTurrets.addActionListener(this);
    gbc.gridy++;
    gbc.gridx = 0;
    gbc.gridwidth = 3;
    // $NON-NLS-1$
    JLabel lbl = createLabel(resourceMap.getString("CVChassisView.spnTurretWt.text"), labelSize);
    add(lbl, gbc);
    gbc.gridx = 3;
    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.gridy++;
    gbc.gridx = 0;
    gbc.gridwidth = 3;
    // $NON-NLS-1$
    lbl = createLabel(resourceMap.getString("CVChassisView.spnTurret2Wt.text"), labelSize);
    add(lbl, gbc);
    gbc.gridx = 3;
    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);
    gbc.gridy++;
    // $NON-NLS-1$
    JButton btnResetChassis = new JButton(resourceMap.getString("CVChassisView.btnResetChassis.text"));
    btnResetChassis.setActionCommand(CMD_RESET_CHASSIS);
    gbc.gridx = 1;
    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);
}
Also used : EntityMovementMode(megamek.common.EntityMovementMode) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) EncodeControl(megamek.common.util.EncodeControl)

Aggregations

EncodeControl (megamek.common.util.EncodeControl)40 GridBagConstraints (java.awt.GridBagConstraints)36 GridBagLayout (java.awt.GridBagLayout)36 ResourceBundle (java.util.ResourceBundle)36 JLabel (javax.swing.JLabel)15 Insets (java.awt.Insets)10 JPanel (javax.swing.JPanel)5 Dimension (java.awt.Dimension)2 JScrollPane (javax.swing.JScrollPane)2 JSpinner (javax.swing.JSpinner)2 SpinnerNumberModel (javax.swing.SpinnerNumberModel)2 DefaultTableCellRenderer (javax.swing.table.DefaultTableCellRenderer)2 TableColumn (javax.swing.table.TableColumn)2 EntityMovementMode (megamek.common.EntityMovementMode)2 BayData (megamek.common.verifier.BayData)2 BorderLayout (java.awt.BorderLayout)1 GridLayout (java.awt.GridLayout)1 BoxLayout (javax.swing.BoxLayout)1 JButton (javax.swing.JButton)1 JTextField (javax.swing.JTextField)1