Search in sources :

Example 1 with ArmorAllocationView

use of megameklab.ui.generalUnit.ArmorAllocationView in project megameklab by MegaMek.

the class PMStructureTab method setUpPanels.

private void setUpPanels() {
    masterPanel = new JPanel(new GridBagLayout());
    panBasicInfo = new BasicInfoView(getProtomech().getConstructionTechAdvancement());
    panChassis = new PMChassisView(panBasicInfo);
    panArmor = new BAProtoArmorView(panBasicInfo);
    panMovement = new MovementView(panBasicInfo);
    panArmorAllocation = new ArmorAllocationView(panBasicInfo, Entity.ETYPE_PROTOMECH);
    panSummary = new PMSummaryView(eSource);
    GridBagConstraints gbc;
    panBasicInfo.setFromEntity(getProtomech());
    panChassis.setFromEntity(getProtomech());
    panArmor.setFromEntity(getProtomech());
    panMovement.setFromEntity(getProtomech());
    panArmorAllocation.setFromEntity(getProtomech());
    JPanel leftPanel = new JPanel();
    JPanel centerPanel = new JPanel();
    JPanel rightPanel = new JPanel();
    leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.Y_AXIS));
    centerPanel.setLayout(new BoxLayout(centerPanel, BoxLayout.Y_AXIS));
    rightPanel.setLayout(new BoxLayout(rightPanel, BoxLayout.Y_AXIS));
    leftPanel.add(panBasicInfo);
    leftPanel.add(Box.createVerticalStrut(11));
    leftPanel.add(panChassis);
    leftPanel.add(Box.createGlue());
    centerPanel.add(panArmor);
    centerPanel.add(panMovement);
    centerPanel.add(panSummary);
    centerPanel.add(Box.createVerticalGlue());
    rightPanel.add(panArmorAllocation);
    rightPanel.add(Box.createVerticalGlue());
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.fill = java.awt.GridBagConstraints.NONE;
    gbc.weightx = 0.0;
    gbc.weighty = 1.0;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    masterPanel.add(leftPanel, gbc);
    gbc.gridx = 1;
    masterPanel.add(centerPanel, gbc);
    gbc.gridx = 2;
    masterPanel.add(rightPanel, gbc);
    panBasicInfo.setBorder(BorderFactory.createTitledBorder("Basic Information"));
    panChassis.setBorder(BorderFactory.createTitledBorder("Chassis"));
    panMovement.setBorder(BorderFactory.createTitledBorder("Movement"));
    panArmor.setBorder(BorderFactory.createTitledBorder("Armor"));
    panSummary.setBorder(BorderFactory.createTitledBorder("Summary"));
    panArmorAllocation.setBorder(BorderFactory.createTitledBorder("Armor Allocation"));
}
Also used : JPanel(javax.swing.JPanel) BasicInfoView(megameklab.ui.generalUnit.BasicInfoView) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) BAProtoArmorView(megameklab.ui.generalUnit.BAProtoArmorView) BoxLayout(javax.swing.BoxLayout) ArmorAllocationView(megameklab.ui.generalUnit.ArmorAllocationView) MovementView(megameklab.ui.generalUnit.MovementView)

Aggregations

GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 BoxLayout (javax.swing.BoxLayout)1 JPanel (javax.swing.JPanel)1 ArmorAllocationView (megameklab.ui.generalUnit.ArmorAllocationView)1 BAProtoArmorView (megameklab.ui.generalUnit.BAProtoArmorView)1 BasicInfoView (megameklab.ui.generalUnit.BasicInfoView)1 MovementView (megameklab.ui.generalUnit.MovementView)1