Search in sources :

Example 1 with BuildTab

use of megameklab.com.ui.BattleArmor.tabs.BuildTab in project megameklab by MegaMek.

the class BuildView method mountEquipmentInLocation.

/**
 * When the user right-clicks on the equipment table, a context menu is
 * generated that his menu items for each possible location that is clicked.
 * When the location is clicked, this is the method that adds the selected
 * equipment to the desired location.
 *
 * @param location
 * @param selectedRow
 */
private void mountEquipmentInLocation(int location, int selectedRow) {
    Mounted eq = (Mounted) equipmentTable.getModel().getValueAt(selectedRow, CriticalTableModel.EQUIPMENT);
    try {
        eq.setBaMountLoc(location);
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    UnitUtil.changeMountStatus(getBattleArmor(), eq, BattleArmor.LOC_SQUAD, -1, false);
    // go back up to grandparent build tab and fire a full refresh.
    ((BuildTab) getParent().getParent()).refreshAll();
}
Also used : BuildTab(megameklab.com.ui.BattleArmor.tabs.BuildTab) Mounted(megamek.common.Mounted)

Example 2 with BuildTab

use of megameklab.com.ui.BattleArmor.tabs.BuildTab in project megameklab by MegaMek.

the class MainUI method reloadTabs.

@Override
public void reloadTabs() {
    masterPanel.removeAll();
    ConfigPane.removeAll();
    masterPanel.setLayout(new BorderLayout());
    structureTab = new StructureTab(this);
    equipTab = new EquipmentTab(this);
    statusbar = new StatusBar(this);
    buildTab = new BuildTab(this);
    structureTab.addRefreshedListener(this);
    equipTab.addRefreshedListener(this);
    buildTab.addRefreshedListener(this);
    ConfigPane.addTab("Structure/Armor", structureTab);
    ConfigPane.addTab("Equipment", equipTab);
    ConfigPane.addTab("Assign Criticals", buildTab);
    masterPanel.add(ConfigPane, BorderLayout.CENTER);
    masterPanel.add(statusbar, BorderLayout.SOUTH);
    refreshHeader();
    this.repaint();
}
Also used : BuildTab(megameklab.com.ui.BattleArmor.tabs.BuildTab) BorderLayout(java.awt.BorderLayout) EquipmentTab(megameklab.com.ui.BattleArmor.tabs.EquipmentTab) StructureTab(megameklab.com.ui.BattleArmor.tabs.StructureTab)

Aggregations

BuildTab (megameklab.com.ui.BattleArmor.tabs.BuildTab)2 BorderLayout (java.awt.BorderLayout)1 Mounted (megamek.common.Mounted)1 EquipmentTab (megameklab.com.ui.BattleArmor.tabs.EquipmentTab)1 StructureTab (megameklab.com.ui.BattleArmor.tabs.StructureTab)1