Search in sources :

Example 1 with BuildTab

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

Example 2 with BuildTab

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

Aggregations

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