use of megameklab.ui.generalUnit.BasicInfoView in project megameklab by MegaMek.
the class SVStructureTab method setupPanels.
private void setupPanels() {
masterPanel = new JPanel(new GridBagLayout());
panBasicInfo = new BasicInfoView(getSV().getConstructionTechAdvancement());
panChassis = new SVChassisView(panBasicInfo);
panMovement = new MovementView(panBasicInfo);
panFuel = new FuelView();
panSummary = new SVSummaryView(eSource);
panChassisMod = new SVChassisModView(panBasicInfo);
panCrew = new SVCrewView();
JPanel leftPanel = new JPanel();
JPanel midPanel = new JPanel();
JPanel rightPanel = new JPanel();
leftPanel.setLayout(new GridBagLayout());
midPanel.setLayout(new GridBagLayout());
rightPanel.setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.anchor = GridBagConstraints.WEST;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.insets = new Insets(5, 5, 5, 5);
gbc.gridwidth = 1;
gbc.gridx = 0;
gbc.gridy = 0;
leftPanel.add(panBasicInfo, gbc);
gbc.gridy++;
leftPanel.add(panChassis, gbc);
gbc.gridx = 1;
gbc.gridy = 0;
midPanel.add(panMovement, gbc);
gbc.gridy++;
midPanel.add(panFuel, gbc);
gbc.gridy++;
midPanel.add(panSummary, gbc);
gbc.gridx = 2;
gbc.gridy = 0;
rightPanel.add(panChassisMod, gbc);
gbc.gridy++;
rightPanel.add(panCrew, gbc);
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(midPanel, gbc);
gbc.gridx = 2;
masterPanel.add(rightPanel, gbc);
panBasicInfo.setBorder(BorderFactory.createTitledBorder("Basic Information"));
panChassis.setBorder(BorderFactory.createTitledBorder("Chassis"));
panMovement.setBorder(BorderFactory.createTitledBorder("Movement"));
panFuel.setBorder(BorderFactory.createTitledBorder("Fuel"));
panSummary.setBorder(BorderFactory.createTitledBorder("Summary"));
panChassisMod.setBorder(BorderFactory.createTitledBorder("Chassis Modifications"));
panCrew.setBorder(BorderFactory.createTitledBorder("Crew and Quarters"));
}
use of megameklab.ui.generalUnit.BasicInfoView in project megameklab by MegaMek.
the class BAStructureTab method setUpPanels.
public void setUpPanels() {
JPanel previewPanel = new JPanel();
previewPanel.setLayout(new BoxLayout(previewPanel, BoxLayout.Y_AXIS));
panelMekView = new MechViewPanel(450, 480, false);
panelTROView = new MechViewPanel(450, 480, false);
JTabbedPane panPreview = new JTabbedPane();
panPreview.addTab("Summary", panelMekView);
panPreview.addTab("TRO", panelTROView);
previewPanel.add(panPreview);
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);
}
use of megameklab.ui.generalUnit.BasicInfoView 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"));
}
Aggregations