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();
}
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();
}
Aggregations