Search in sources :

Example 1 with EncodeControl

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

the class AerospaceCrewView method initUI.

public void initUI() {
    setLayout(new GridBagLayout());
    // $NON-NLS-1$
    ResourceBundle resourceMap = ResourceBundle.getBundle("megameklab.resources.Views", new EncodeControl());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    add(createLabel(resourceMap.getString("AerospaceCrewView.spnBaseCrew.text"), labelSize), gbc);
    gbc.gridx = 1;
    setFieldSize(spnBaseCrew, spinnerSize);
    add(spnBaseCrew, gbc);
    spnBaseCrew.setToolTipText(resourceMap.getString("AerospaceCrewView.spnBaseCrew.tooltip"));
    spnBaseCrew.addChangeListener(this);
    gbc.gridx = 0;
    gbc.gridy++;
    add(createLabel(resourceMap.getString("AerospaceCrewView.spnGunners.text"), labelSize), gbc);
    gbc.gridx = 1;
    setFieldSize(spnGunners, spinnerSize);
    add(spnGunners, gbc);
    spnGunners.setToolTipText(resourceMap.getString("AerospaceCrewView.spnGunners.tooltip"));
    spnGunners.addChangeListener(this);
    gbc.gridx = 0;
    gbc.gridy++;
    add(createLabel(resourceMap.getString("AerospaceCrewView.lblTotalCrew.text"), labelSize), gbc);
    gbc.gridx = 1;
    add(lblTotalCrew, gbc);
    lblTotalCrew.setToolTipText(resourceMap.getString("AerospaceCrewView.lblTotalCrew.tooltip"));
    lblTotalCrew.setHorizontalAlignment(JLabel.RIGHT);
    gbc.gridx = 0;
    gbc.gridy++;
    add(createLabel(resourceMap.getString("AerospaceCrewView.spnOfficers.text"), labelSize), gbc);
    gbc.gridx = 1;
    setFieldSize(spnOfficers, spinnerSize);
    spnOfficers.setToolTipText(resourceMap.getString("AerospaceCrewView.spnOfficers.tooltip"));
    add(spnOfficers, gbc);
    spnOfficers.addChangeListener(this);
    gbc.gridx = 0;
    gbc.gridy++;
    add(createLabel(resourceMap.getString("AerospaceCrewView.lblBayPersonnel.text"), labelSize), gbc);
    gbc.gridx = 1;
    add(lblBayPersonnel, gbc);
    lblBayPersonnel.setToolTipText(resourceMap.getString("AerospaceCrewView.lblBayPersonnel.tooltip"));
    lblBayPersonnel.setHorizontalAlignment(JLabel.RIGHT);
    gbc.gridx = 0;
    gbc.gridy++;
    add(createLabel(resourceMap.getString("AerospaceCrewView.spnPassengers.text"), labelSize), gbc);
    gbc.gridx = 1;
    setFieldSize(spnPassengers, spinnerSize);
    spnPassengers.setToolTipText(resourceMap.getString("AerospaceCrewView.spnPassengers.tooltip"));
    add(spnPassengers, gbc);
    spnPassengers.addChangeListener(this);
    gbc.gridx = 0;
    gbc.gridy++;
    add(createLabel(resourceMap.getString("AerospaceCrewView.spnMarines.text"), labelSize), gbc);
    gbc.gridx = 1;
    setFieldSize(spnMarines, spinnerSize);
    spnMarines.setToolTipText(resourceMap.getString("AerospaceCrewView.spnMarines.tooltip"));
    add(spnMarines, gbc);
    spnMarines.addChangeListener(this);
    gbc.gridx = 0;
    gbc.gridy++;
    lblBAMarines.setText(resourceMap.getString("AerospaceCrewView.spnBAMarines.text"));
    add(lblBAMarines, gbc);
    gbc.gridx = 1;
    setFieldSize(spnBAMarines, spinnerSize);
    spnBAMarines.setToolTipText(resourceMap.getString("AerospaceCrewView.spnBAMarines.tooltip"));
    add(spnBAMarines, gbc);
    spnBAMarines.addChangeListener(this);
    gbc.gridx = 2;
    gbc.gridy = 0;
    gbc.gridwidth = 2;
    add(new JLabel(resourceMap.getString("AerospaceCrewView.lblQuarters.text")), gbc);
    gbc.gridx = 2;
    gbc.gridy++;
    gbc.gridwidth = 1;
    add(createLabel(resourceMap.getString("AerospaceCrewView.spnQuartersFirstClass.text"), labelSize), gbc);
    gbc.gridx = 3;
    setFieldSize(spnQuartersFirstClass, spinnerSize);
    spnQuartersFirstClass.setToolTipText(resourceMap.getString("AerospaceCrewView.spnQuartersFirstClass.tooltip"));
    add(spnQuartersFirstClass, gbc);
    spnQuartersFirstClass.addChangeListener(this);
    gbc.gridx = 2;
    gbc.gridy++;
    add(createLabel(resourceMap.getString("AerospaceCrewView.spnQuartersStandard.text"), labelSize), gbc);
    gbc.gridx = 3;
    setFieldSize(spnQuartersStandard, spinnerSize);
    spnQuartersStandard.setToolTipText(resourceMap.getString("AerospaceCrewView.spnQuartersStandard.tooltip"));
    add(spnQuartersStandard, gbc);
    spnQuartersStandard.addChangeListener(this);
    gbc.gridx = 2;
    gbc.gridy++;
    add(createLabel(resourceMap.getString("AerospaceCrewView.spnQuartersSecondClass.text"), labelSize), gbc);
    gbc.gridx = 3;
    setFieldSize(spnQuartersSecondClass, spinnerSize);
    spnQuartersSecondClass.setToolTipText(resourceMap.getString("AerospaceCrewView.spnQuartersSecondClass.tooltip"));
    add(spnQuartersSecondClass, gbc);
    spnQuartersSecondClass.addChangeListener(this);
    gbc.gridx = 2;
    gbc.gridy++;
    add(createLabel(resourceMap.getString("AerospaceCrewView.spnQuartersSteerage.text"), labelSize), gbc);
    gbc.gridx = 3;
    setFieldSize(spnQuartersSteerage, spinnerSize);
    spnQuartersSteerage.setToolTipText(resourceMap.getString("AerospaceCrewView.spnQuartersSteerage.tooltip"));
    add(spnQuartersSteerage, gbc);
    spnQuartersSteerage.addChangeListener(this);
    gbc.gridx = 2;
    gbc.gridy++;
    gbc.gridwidth = 2;
    btnAssignQuarters.setText(resourceMap.getString("AerospaceCrewView.btnAssignQuarters.text"));
    btnAssignQuarters.setToolTipText(resourceMap.getString("AerospaceCrewView.btnAssignQuarters.tooltip"));
    add(btnAssignQuarters, gbc);
    btnAssignQuarters.addActionListener(this);
    gbc.gridx = 2;
    gbc.gridy++;
    gbc.gridwidth = 1;
    add(createLabel(resourceMap.getString("AerospaceCrewView.spnLifeBoats.text"), labelSize), gbc);
    gbc.gridx = 3;
    setFieldSize(spnLifeBoats, spinnerSize);
    spnLifeBoats.setToolTipText(resourceMap.getString("AerospaceCrewView.spnLifeBoats.tooltip"));
    add(spnLifeBoats, gbc);
    spnLifeBoats.addChangeListener(this);
    gbc.gridx = 2;
    gbc.gridy++;
    add(createLabel(resourceMap.getString("AerospaceCrewView.spnEscapePods.text"), labelSize), gbc);
    gbc.gridx = 3;
    setFieldSize(spnEscapePods, spinnerSize);
    spnEscapePods.setToolTipText(resourceMap.getString("AerospaceCrewView.spnEscapePods.tooltip"));
    add(spnEscapePods, gbc);
    spnEscapePods.addChangeListener(this);
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) EncodeControl(megamek.common.util.EncodeControl) JLabel(javax.swing.JLabel) ResourceBundle(java.util.ResourceBundle)

Example 2 with EncodeControl

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);
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) EncodeControl(megamek.common.util.EncodeControl) ResourceBundle(java.util.ResourceBundle)

Example 3 with EncodeControl

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

the class BAEnhancementView 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.anchor = GridBagConstraints.NORTHWEST;
    chkPartialWing.setText(resourceMap.getString("BAEnhancementView.chkPartialWing.text"));
    // $NON-NLS-1$
    chkPartialWing.setToolTipText(resourceMap.getString("BAEnhancementView.chkPartialWing.tooltip"));
    add(chkPartialWing, gbc);
    chkPartialWing.addActionListener(this);
    gbc.gridx++;
    chkJumpBooster.setText(resourceMap.getString("BAEnhancementView.chkJumpBooster.text"));
    // $NON-NLS-1$
    chkJumpBooster.setToolTipText(resourceMap.getString("BAEnhancementView.chkJumpBooster.tooltip"));
    add(chkJumpBooster, gbc);
    chkJumpBooster.addActionListener(this);
    gbc.gridx = 0;
    gbc.gridy++;
    chkMechJumpBooster.setText(resourceMap.getString("BAEnhancementView.chkMechJumpBooster.text"));
    // $NON-NLS-1$
    chkMechJumpBooster.setToolTipText(resourceMap.getString("BAEnhancementView.chkMechJumpBooster.tooltip"));
    add(chkMechJumpBooster, gbc);
    chkMechJumpBooster.addActionListener(this);
    gbc.gridx++;
    chkMyomerBooster.setText(resourceMap.getString("BAEnhancementView.chkMyomerBooster.text"));
    // $NON-NLS-1$
    chkMyomerBooster.setToolTipText(resourceMap.getString("BAEnhancementView.chkMyomerBooster.tooltip"));
    add(chkMyomerBooster, gbc);
    chkMyomerBooster.addActionListener(this);
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) EncodeControl(megamek.common.util.EncodeControl) ResourceBundle(java.util.ResourceBundle)

Example 4 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);
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) EncodeControl(megamek.common.util.EncodeControl) ResourceBundle(java.util.ResourceBundle)

Example 5 with EncodeControl

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

the class BasicInfoView method initUI.

private void initUI() {
    // $NON-NLS-1$
    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);
    // $NON-NLS-1$
    add(createLabel(resourceMap.getString("BasicInfoView.txtChassis.text"), labelSize), gbc);
    gbc.gridx = 1;
    gbc.gridy = 0;
    // $NON-NLS-1$
    txtChassis.setToolTipText(resourceMap.getString("BasicInfoView.txtChassis.tooltip"));
    add(txtChassis, gbc);
    setFieldSize(txtChassis, controlSize);
    txtChassis.addFocusListener(this);
    gbc.gridx = 0;
    gbc.gridy = 1;
    // $NON-NLS-1$
    add(createLabel(resourceMap.getString("BasicInfoView.txtModel.text"), labelSize), gbc);
    gbc.gridx = 1;
    gbc.gridy = 1;
    // $NON-NLS-1$
    txtModel.setToolTipText(resourceMap.getString("BasicInfoView.txtModel.tooltip"));
    add(txtModel, gbc);
    setFieldSize(txtModel, controlSize);
    txtModel.addFocusListener(this);
    gbc.gridx = 0;
    gbc.gridy = 2;
    // $NON-NLS-1$
    add(createLabel(resourceMap.getString("BasicInfoView.txtYear.text"), labelSize), gbc);
    gbc.gridx = 1;
    gbc.gridy = 2;
    add(txtYear, gbc);
    // $NON-NLS-1$
    txtYear.setToolTipText(resourceMap.getString("BasicInfoView.txtYear.tooltip"));
    setFieldSize(txtYear, controlSize);
    txtYear.setMaximum(9999);
    txtYear.addFocusListener(this);
    gbc.gridx = 0;
    gbc.gridy = 3;
    // $NON-NLS-1$
    lblFaction.setText(resourceMap.getString("BasicInfoView.cbFaction.text"));
    add(lblFaction, gbc);
    gbc.gridx = 1;
    gbc.gridy = 3;
    // $NON-NLS-1$
    cbFaction.setToolTipText(resourceMap.getString("BasicInfoView.cbFaction.tooltip"));
    add(cbFaction, gbc);
    setFieldSize(cbFaction, controlSize);
    cbFaction.addActionListener(this);
    gbc.gridx = 0;
    gbc.gridy = 4;
    // $NON-NLS-1$
    add(createLabel(resourceMap.getString("BasicInfoView.txtSource.text"), labelSize), gbc);
    gbc.gridx = 1;
    gbc.gridy = 4;
    setFieldSize(txtSource, controlSize);
    // $NON-NLS-1$
    txtSource.setToolTipText(resourceMap.getString("BasicInfoView.txtSource.tooltip"));
    add(txtSource, gbc);
    txtSource.addFocusListener(this);
    gbc.gridx = 0;
    gbc.gridy = 5;
    // $NON-NLS-1$
    add(createLabel(resourceMap.getString("BasicInfoView.cbTechBase.text"), labelSize), gbc);
    gbc.gridx = 1;
    gbc.gridy = 5;
    setFieldSize(cbTechBase, controlSize);
    // $NON-NLS-1$
    cbTechBase.setToolTipText(resourceMap.getString("BasicInfoView.cbTechBase.tooltip"));
    add(cbTechBase, gbc);
    cbTechBase.addActionListener(this);
    gbc.gridx = 0;
    gbc.gridy = 6;
    // $NON-NLS-1$
    add(createLabel(resourceMap.getString("BasicInfoView.cbTechLevel.text"), labelSize), gbc);
    gbc.gridx = 1;
    gbc.gridy = 6;
    setFieldSize(cbTechLevel, controlSize);
    // $NON-NLS-1$
    cbTechLevel.setToolTipText(resourceMap.getString("BasicInfoView.cbTechLevel.tooltip"));
    add(cbTechLevel, gbc);
    cbTechLevel.addActionListener(this);
    refreshTechBase();
    gbc.gridx = 0;
    gbc.gridy = 7;
    // $NON-NLS-1$
    add(createLabel(resourceMap.getString("BasicInfoView.txtManualBV.text"), labelSize), gbc);
    gbc.gridx = 1;
    gbc.gridy = 7;
    setFieldSize(txtManualBV, controlSize);
    // $NON-NLS-1$
    txtManualBV.setToolTipText(resourceMap.getString("BasicInfoView.txtManualBV.tooltip"));
    add(txtManualBV, gbc);
    txtManualBV.addFocusListener(this);
    if (CConfig.getBooleanParam(CConfig.TECH_SHOW_FACTION)) {
        lblFaction.setVisible(true);
        cbFaction.setVisible(true);
    } else {
        lblFaction.setVisible(false);
        cbFaction.setVisible(false);
    }
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) EncodeControl(megamek.common.util.EncodeControl) ResourceBundle(java.util.ResourceBundle)

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