Search in sources :

Example 1 with BAChassisView

use of megameklab.com.ui.view.BAChassisView in project megameklab by MegaMek.

the class StructureTab method setUpPanels.

public void setUpPanels() {
    JPanel previewPanel = new JPanel();
    previewPanel.setLayout(new BoxLayout(previewPanel, BoxLayout.Y_AXIS));
    panelMekView = new MechViewPanel(450, 480, false);
    // mekViewScrollPane.setMinimumSize(new java.awt.Dimension(450, 550));
    // mekViewScrollPane.setMaximumSize(new java.awt.Dimension(450, 550));
    // mekViewScrollPane.setPreferredSize(new java.awt.Dimension(450, 550));
    previewPanel.add(panelMekView);
    JPanel leftPanel = new JPanel();
    leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.Y_AXIS));
    JPanel rightPanel = new JPanel();
    rightPanel.setLayout(new BoxLayout(rightPanel, BoxLayout.Y_AXIS));
    panBasicInfo = new BasicInfoView(getBattleArmor().getConstructionTechAdvancement());
    panChassis = new BAChassisView(panBasicInfo);
    panMovement = new MovementView(panBasicInfo);
    panArmor = new BAProtoArmorView(panBasicInfo);
    JPanel manipPanel = new JPanel(new GridBagLayout());
    panEnhancements = new BAEnhancementView(panBasicInfo);
    GridBagConstraints gbc = new GridBagConstraints();
    Dimension comboSize = new Dimension(250, 25);
    gbc.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.fill = GridBagConstraints.NONE;
    manipPanel.add(createLabel("Left Arm:", labelSize), gbc);
    gbc.gridy = 1;
    manipPanel.add(createLabel("Right Arm:", labelSize), gbc);
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.gridx = 1;
    gbc.gridy = 0;
    manipPanel.add(leftManipSelect, gbc);
    gbc.gridy = 1;
    manipPanel.add(rightManipSelect, gbc);
    setFieldSize(leftManipSelect, comboSize);
    setFieldSize(rightManipSelect, comboSize);
    panBasicInfo.setBorder(BorderFactory.createTitledBorder("Basic Information"));
    panChassis.setBorder(BorderFactory.createTitledBorder("Chassis"));
    panMovement.setBorder(BorderFactory.createTitledBorder("Movement"));
    panArmor.setBorder(BorderFactory.createTitledBorder("Armor"));
    // weaponView.setBorder(BorderFactory.createTitledBorder("Weapon Selection"));
    manipPanel.setBorder(BorderFactory.createTitledBorder("Manipulators"));
    panEnhancements.setBorder(BorderFactory.createTitledBorder("Enhancements"));
    leftPanel.add(panBasicInfo);
    leftPanel.add(panChassis);
    leftPanel.add(panMovement);
    leftPanel.add(panArmor);
    // leftPanel.add(Box.createVerticalGlue());
    rightPanel.add(Box.createVerticalStrut(5));
    rightPanel.add(previewPanel);
    rightPanel.add(panEnhancements);
    rightPanel.add(manipPanel);
    setLayout(new GridBagLayout());
    gbc = new GridBagConstraints();
    gbc.insets = new Insets(0, 30, 0, 30);
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.anchor = GridBagConstraints.NORTH;
    gbc.fill = java.awt.GridBagConstraints.NONE;
    gbc.weightx = 0.0;
    gbc.weighty = 0;
    add(leftPanel, gbc);
    gbc.gridx = 1;
    add(rightPanel, gbc);
}
Also used : JPanel(javax.swing.JPanel) BasicInfoView(megameklab.com.ui.view.BasicInfoView) BAEnhancementView(megameklab.com.ui.view.BAEnhancementView) GridBagConstraints(java.awt.GridBagConstraints) BAChassisView(megameklab.com.ui.view.BAChassisView) Insets(java.awt.Insets) BAProtoArmorView(megameklab.com.ui.view.BAProtoArmorView) GridBagLayout(java.awt.GridBagLayout) BoxLayout(javax.swing.BoxLayout) MechViewPanel(megamek.client.ui.swing.MechViewPanel) Dimension(java.awt.Dimension) MovementView(megameklab.com.ui.view.MovementView)

Aggregations

Dimension (java.awt.Dimension)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 Insets (java.awt.Insets)1 BoxLayout (javax.swing.BoxLayout)1 JPanel (javax.swing.JPanel)1 MechViewPanel (megamek.client.ui.swing.MechViewPanel)1 BAChassisView (megameklab.com.ui.view.BAChassisView)1 BAEnhancementView (megameklab.com.ui.view.BAEnhancementView)1 BAProtoArmorView (megameklab.com.ui.view.BAProtoArmorView)1 BasicInfoView (megameklab.com.ui.view.BasicInfoView)1 MovementView (megameklab.com.ui.view.MovementView)1