use of megameklab.com.ui.Vehicle.tabs.BuildTab in project megameklab by MegaMek.
the class BuildView method jMenuLoadComponent_actionPerformed.
private void jMenuLoadComponent_actionPerformed(int location, int selectedRow) {
Mounted eq = (Mounted) equipmentTable.getModel().getValueAt(selectedRow, CriticalTableModel.EQUIPMENT);
UnitUtil.changeMountStatus(getTank(), eq, location, -1, false);
try {
getTank().addEquipment(eq, location, false);
} catch (Exception ex) {
ex.printStackTrace();
}
// go back up to grandparent build tab and fire a full refresh.
((BuildTab) getParent().getParent()).refreshAll();
}
use of megameklab.com.ui.Vehicle.tabs.BuildTab in project megameklab by MegaMek.
the class MainUI method reloadTabs.
@Override
public void reloadTabs() {
masterPanel.removeAll();
configPane.removeAll();
masterPanel.setLayout(new BorderLayout());
statusbar = new StatusBar(this);
structureTab = new StructureTab(this);
equipmentTab = new EquipmentTab(this);
buildTab = new BuildTab(this, equipmentTab);
structureTab.addRefreshedListener(this);
equipmentTab.addRefreshedListener(this);
buildTab.addRefreshedListener(this);
previewTab = new PreviewTab(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