Search in sources :

Example 1 with BuildTab

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();
}
Also used : BuildTab(megameklab.com.ui.Vehicle.tabs.BuildTab) Mounted(megamek.common.Mounted)

Example 2 with BuildTab

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();
}
Also used : BuildTab(megameklab.com.ui.Vehicle.tabs.BuildTab) BorderLayout(java.awt.BorderLayout) EquipmentTab(megameklab.com.ui.Vehicle.tabs.EquipmentTab) StructureTab(megameklab.com.ui.Vehicle.tabs.StructureTab) PreviewTab(megameklab.com.ui.Vehicle.tabs.PreviewTab)

Aggregations

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