use of megameklab.com.ui.Aero.tabs.BuildTab in project megameklab by MegaMek.
the class BuildView method jMenuLoadComponent_actionPerformed.
/**
* 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 jMenuLoadComponent_actionPerformed(int location, int selectedRow) {
Mounted eq = (Mounted) equipmentTable.getModel().getValueAt(selectedRow, CriticalTableModel.EQUIPMENT);
try {
getAero().addEquipment(eq, location, false);
} catch (Exception ex) {
ex.printStackTrace();
}
UnitUtil.changeMountStatus(getAero(), eq, location, -1, false);
// go back up to grandparent build tab and fire a full refresh.
((BuildTab) getParent().getParent()).refreshAll();
}
use of megameklab.com.ui.Aero.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);
previewTab = new PreviewTab(this);
statusbar = new StatusBar(this);
equipmentTab = new EquipmentTab(this);
buildTab = new BuildTab(this, equipmentTab);
structureTab.addRefreshedListener(this);
equipmentTab.addRefreshedListener(this);
buildTab.addRefreshedListener(this);
statusbar.addRefreshedListener(this);
configPane.addTab("Structure/Armor", structureTab);
configPane.addTab("Equipment", equipmentTab);
configPane.addTab("Assign Criticals", buildTab);
configPane.addTab("Preview", previewTab);
masterPanel.add(configPane, BorderLayout.CENTER);
masterPanel.add(statusbar, BorderLayout.SOUTH);
refreshHeader();
this.repaint();
}
Aggregations