use of megameklab.com.ui.view.PatchworkArmorView in project megameklab by MegaMek.
the class StructureTab method setUpPanels.
private void setUpPanels() {
masterPanel = new JPanel(new GridBagLayout());
panBasicInfo = new BasicInfoView(getMech().getConstructionTechAdvancement());
panChassis = new MekChassisView(panBasicInfo);
panArmor = new MVFArmorView(panBasicInfo);
panMovement = new MovementView(panBasicInfo);
panHeat = new HeatSinkView(panBasicInfo);
panArmorAllocation = new ArmorAllocationView(panBasicInfo, Entity.ETYPE_MECH);
panPatchwork = new PatchworkArmorView(panBasicInfo);
panSummary = new SummaryView(eSource);
if (getMech().hasPatchworkArmor()) {
panArmorAllocation.showPatchwork(true);
} else {
panPatchwork.setVisible(false);
}
GridBagConstraints gbc;
panBasicInfo.setFromEntity(getMech());
panChassis.setFromEntity(getMech());
panArmor.setFromEntity(getMech());
panMovement.setFromEntity(getMech());
panHeat.setFromMech(getMech());
panArmorAllocation.setFromEntity(getMech());
panPatchwork.setFromEntity(getMech());
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.createVerticalStrut(11));
leftPanel.add(panHeat);
leftPanel.add(Box.createGlue());
centerPanel.add(panArmor);
centerPanel.add(panMovement);
centerPanel.add(panSummary);
centerPanel.add(Box.createVerticalGlue());
rightPanel.add(panArmorAllocation);
rightPanel.add(panPatchwork);
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"));
panHeat.setBorder(BorderFactory.createTitledBorder("Heat Sinks"));
panArmor.setBorder(BorderFactory.createTitledBorder("Armor"));
panSummary.setBorder(BorderFactory.createTitledBorder("Summary"));
panArmorAllocation.setBorder(BorderFactory.createTitledBorder("Armor Allocation"));
panPatchwork.setBorder(BorderFactory.createTitledBorder("Patchwork Armor"));
}
use of megameklab.com.ui.view.PatchworkArmorView in project megameklab by MegaMek.
the class StructureTab method setUpPanels.
private void setUpPanels() {
masterPanel = new JPanel(new GridBagLayout());
panInfo = new BasicInfoView(getAero().getConstructionTechAdvancement());
panChassis = new FighterChassisView(panInfo);
panArmor = new MVFArmorView(panInfo);
panMovement = new MovementView(panInfo);
panFuel = new AeroFuelView();
panHeat = new HeatSinkView(panInfo);
panArmorAllocation = new ArmorAllocationView(panInfo, Entity.ETYPE_AERO);
panPatchwork = new PatchworkArmorView(panInfo);
panSummary = new SummaryView(eSource);
if (getAero().hasPatchworkArmor()) {
panArmorAllocation.showPatchwork(true);
} else {
panPatchwork.setVisible(false);
}
GridBagConstraints gbc = new GridBagConstraints();
JPanel leftPanel = new JPanel();
JPanel midPanel = new JPanel();
JPanel rightPanel = new JPanel();
leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.Y_AXIS));
midPanel.setLayout(new BoxLayout(midPanel, BoxLayout.Y_AXIS));
rightPanel.setLayout(new BoxLayout(rightPanel, BoxLayout.Y_AXIS));
leftPanel.add(panInfo);
leftPanel.add(panChassis);
leftPanel.add(panHeat);
// leftPanel.add(Box.createGlue());
// leftPanel.add(Box.createVerticalGlue());
midPanel.add(panMovement);
midPanel.add(panFuel);
midPanel.add(panSummary);
midPanel.add(Box.createHorizontalStrut(300));
rightPanel.add(panArmor);
rightPanel.add(panArmorAllocation);
rightPanel.add(panPatchwork);
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);
panInfo.setBorder(BorderFactory.createTitledBorder("Basic Information"));
panChassis.setBorder(BorderFactory.createTitledBorder("Chassis"));
panMovement.setBorder(BorderFactory.createTitledBorder("Movement"));
panFuel.setBorder(BorderFactory.createTitledBorder("Fuel"));
panHeat.setBorder(BorderFactory.createTitledBorder("Heat Sinks"));
panArmor.setBorder(BorderFactory.createTitledBorder("Armor"));
panSummary.setBorder(BorderFactory.createTitledBorder("Summary"));
panArmorAllocation.setBorder(BorderFactory.createTitledBorder("Armor Allocation"));
panPatchwork.setBorder(BorderFactory.createTitledBorder("Patchwork Armor"));
}
use of megameklab.com.ui.view.PatchworkArmorView in project megameklab by MegaMek.
the class StructureTab method setUpPanels.
private void setUpPanels() {
masterPanel = new JPanel(new GridBagLayout());
panBasicInfo = new BasicInfoView(getTank().getConstructionTechAdvancement());
panChassis = new CVChassisView(panBasicInfo);
panArmor = new MVFArmorView(panBasicInfo);
panMovement = new MovementView(panBasicInfo);
panArmorAllocation = new ArmorAllocationView(panBasicInfo, Entity.ETYPE_TANK);
panPatchwork = new PatchworkArmorView(panBasicInfo);
panSummary = new SummaryView(eSource);
panTransport = new CVTransportView();
if (getTank().hasPatchworkArmor()) {
panArmorAllocation.showPatchwork(true);
} else {
panPatchwork.setVisible(false);
}
GridBagConstraints gbc;
panBasicInfo.setFromEntity(getTank());
panChassis.setFromEntity(getTank());
panMovement.setFromEntity(getTank());
panArmor.setFromEntity(getTank());
panArmorAllocation.setFromEntity(getTank());
panPatchwork.setFromEntity(getTank());
panTransport.setFromEntity(getTank());
gbc = new GridBagConstraints();
JPanel leftPanel = new JPanel();
JPanel midPanel = new JPanel();
JPanel rightPanel = new JPanel();
leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.Y_AXIS));
midPanel.setLayout(new BoxLayout(midPanel, BoxLayout.Y_AXIS));
rightPanel.setLayout(new BoxLayout(rightPanel, BoxLayout.Y_AXIS));
leftPanel.add(panBasicInfo);
leftPanel.add(Box.createVerticalStrut(6));
leftPanel.add(panChassis);
leftPanel.add(Box.createVerticalStrut(6));
leftPanel.add(panMovement);
leftPanel.add(Box.createGlue());
midPanel.add(panArmor);
midPanel.add(panTransport);
midPanel.add(panSummary);
midPanel.add(Box.createVerticalGlue());
rightPanel.add(panArmorAllocation);
rightPanel.add(panPatchwork);
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"));
panArmor.setBorder(BorderFactory.createTitledBorder("Armor"));
panSummary.setBorder(BorderFactory.createTitledBorder("Summary"));
panArmorAllocation.setBorder(BorderFactory.createTitledBorder("Armor Allocation"));
panPatchwork.setBorder(BorderFactory.createTitledBorder("Patchwork Armor"));
panTransport.setBorder(BorderFactory.createTitledBorder("Transport"));
}
Aggregations