use of java.awt.GridBagConstraints in project pcgen by PCGen.
the class SummaryInfoTab method resetBasicsPanel.
private void resetBasicsPanel() {
basicsPanel.removeAll();
GridBagConstraints gbc = new GridBagConstraints();
{
//$NON-NLS-1$
JLabel label = createLabel("in_sumName");
gbc.anchor = java.awt.GridBagConstraints.WEST;
gbc.insets = new Insets(0, 0, 3, 0);
basicsPanel.add(label, gbc);
//$NON-NLS-1$
random.setText(LanguageBundle.getString("in_randomButton"));
random.setMargin(new Insets(0, 0, 0, 0));
gbc.insets = new Insets(0, 2, 3, 2);
basicsPanel.add(random, gbc);
gbc.insets = new Insets(0, 0, 3, 2);
gbc.gridwidth = GridBagConstraints.REMAINDER;
gbc.fill = GridBagConstraints.BOTH;
gbc.weightx = 1.0;
basicsPanel.add(characterNameField, gbc);
}
Insets insets = new Insets(0, 0, 3, 2);
Font labelFont = null;
//$NON-NLS-1$
addGridBagLayer(basicsPanel, labelFont, insets, "in_sumCharType", characterTypeComboBox);
//$NON-NLS-1$
addGridBagLayer(basicsPanel, labelFont, insets, "in_sumPlayer", playerNameField);
//$NON-NLS-1$
addGridBagLayer(basicsPanel, labelFont, insets, "in_sumTabLabel", tabLabelField);
if (genderComboBox.getModel().getSize() != 0) {
//$NON-NLS-1$
addGridBagLayer(basicsPanel, labelFont, insets, "in_sumGender", genderComboBox);
}
if (handsComboBox.getModel().getSize() != 0) {
//$NON-NLS-1$
addGridBagLayer(basicsPanel, labelFont, insets, "in_sumHanded", handsComboBox);
}
if (alignmentComboBox.getModel().getSize() != 0) {
//$NON-NLS-1$
addGridBagLayer(basicsPanel, labelFont, insets, "in_sumAlignment", alignmentComboBox);
}
if (deityComboBox.getModel().getSize() != 0) {
//$NON-NLS-1$
addGridBagLayer(basicsPanel, labelFont, insets, "in_domDeityLabel", deityComboBox);
}
gbc = new GridBagConstraints();
gbc.gridwidth = GridBagConstraints.REMAINDER;
gbc.fill = GridBagConstraints.BOTH;
gbc.weighty = 1;
gbc.insets = new Insets(6, 2, 2, 2);
langScroll = new JScrollPane(languageTable);
basicsPanel.add(langScroll, gbc);
basicsPanel.revalidate();
}
use of java.awt.GridBagConstraints in project pcgen by PCGen.
the class SkillInfoTab method initComponents.
private void initComponents() {
setOrientation(VERTICAL_SPLIT);
setResizeWeight(0.70);
JSpinner spinner = new JSpinner();
//$NON-NLS-1$
spinner.setEditor(new JSpinner.NumberEditor(spinner, "#0.#"));
skillTable.setDefaultRenderer(Float.class, new SpinnerRenderer(spinner));
skillTable.setDefaultRenderer(Integer.class, new TableCellUtilities.AlignRenderer(SwingConstants.CENTER));
skillTable.setDefaultRenderer(String.class, new TableCellUtilities.AlignRenderer(SwingConstants.CENTER));
skillTable.setRowHeight(26);
FilterBar<CharacterFacade, SkillFacade> filterBar = new FilterBar<>();
filterBar.addDisplayableFilter(new SearchFilterPanel());
//$NON-NLS-1$
cFilterButton.setText(LanguageBundle.getString("in_classString"));
cFilterButton.setEnabled(false);
filterBar.addDisplayableFilter(cFilterButton);
//$NON-NLS-1$
trainedFilterButton.setText(LanguageBundle.getString("in_trained"));
trainedFilterButton.setEnabled(false);
filterBar.addDisplayableFilter(trainedFilterButton);
JPanel availPanel = FilterUtilities.configureFilteredTreeViewPane(skillTable, filterBar);
availPanel.setPreferredSize(new Dimension(650, 300));
JScrollPane tableScrollPane;
JPanel tablePanel = new JPanel(new GridBagLayout());
GridBagConstraints constraints = new GridBagConstraints();
constraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
constraints.fill = java.awt.GridBagConstraints.BOTH;
constraints.weightx = 1.0;
constraints.ipady = 0;
constraints.weighty = 1.0;
SkillPointTableModel.initializeTable(skillpointTable);
tableScrollPane = new JScrollPane(skillpointTable);
tablePanel.add(tableScrollPane, constraints);
htmlPane.setOpaque(false);
htmlPane.setEditable(false);
htmlPane.setFocusable(false);
//$NON-NLS-1$
htmlPane.setContentType("text/html");
skillFilterBox.setRenderer(new DefaultListCellRenderer());
JScrollPane selScrollPane = new JScrollPane(htmlPane);
JPanel skillPanel = new JPanel(new BorderLayout());
skillPanel.add(skillFilterBox, BorderLayout.NORTH);
skillPanel.add(selScrollPane, BorderLayout.CENTER);
selScrollPane.setPreferredSize(new Dimension(530, 300));
FlippingSplitPane topPane = new FlippingSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, availPanel, skillPanel, "SkillTop");
setTopComponent(topPane);
FlippingSplitPane bottomPane = new FlippingSplitPane(JSplitPane.HORIZONTAL_SPLIT, "SkillBottom");
bottomPane.setLeftComponent(tablePanel);
tablePanel.setPreferredSize(new Dimension(650, 100));
bottomPane.setRightComponent(infoPane);
infoPane.setPreferredSize(new Dimension(530, 100));
setBottomComponent(bottomPane);
}
use of java.awt.GridBagConstraints in project pcgen by PCGen.
the class SummaryInfoTab method initLevelPanel.
private void initLevelPanel(JPanel panel) {
panel.setLayout(new GridBagLayout());
//$NON-NLS-1$
JLabel addLabel = createLabel("in_sumAddLevels");
//$NON-NLS-1$
JLabel removeLabel = createLabel("in_sumRemoveLevels");
JLabel darrowLabel = new JLabel(Icons.button_arrow_down.getImageIcon());
JLabel uarrowLabel = new JLabel(Icons.button_arrow_up.getImageIcon());
addLevelsButton.setMargin(new Insets(0, 8, 0, 8));
addLevelsField.setValue(1);
addLevelsField.setHorizontalAlignment(SwingConstants.RIGHT);
removeLevelsButton.setMargin(new Insets(0, 8, 0, 8));
removeLevelsField.setValue(1);
removeLevelsField.setHorizontalAlignment(SwingConstants.RIGHT);
GridBagConstraints gbc1 = new GridBagConstraints();
GridBagConstraints gbc2 = new GridBagConstraints();
gbc1.weightx = gbc2.weightx = 0.5;
gbc1.insets = new Insets(1, 0, 1, 0);
gbc2.insets = new Insets(1, 0, 1, 0);
gbc2.gridwidth = GridBagConstraints.REMAINDER;
panel.add(addLabel, gbc1);
panel.add(removeLabel, gbc2);
gbc1.ipadx = 30;
panel.add(addLevelsField, gbc1);
gbc2.ipadx = 30;
panel.add(removeLevelsField, gbc2);
gbc1.ipadx = 0;
panel.add(addLevelsButton, gbc1);
gbc2.ipadx = 0;
panel.add(removeLevelsButton, gbc2);
panel.add(darrowLabel, gbc1);
panel.add(uarrowLabel, gbc2);
ClassLevelTableModel.initializeTable(classLevelTable);
gbc2.weightx = 0;
gbc2.weighty = 1;
gbc2.fill = GridBagConstraints.BOTH;
panel.add(new JScrollPane(classLevelTable), gbc2);
}
use of java.awt.GridBagConstraints in project pcgen by PCGen.
the class PortraitInfoPane method initComponents.
private void initComponents() {
JPanel panel = new JPanel(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
Utility.buildConstraints(gbc, 0, 0, 2, 1, 0, 0);
panel.add(new JLabel(LanguageBundle.getString("in_largePortrait")), gbc);
Utility.buildConstraints(gbc, 0, 1, 2, 1, 0, 0);
panel.add(portraitPane, gbc);
Utility.buildConstraints(gbc, 0, 2, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.EAST);
panel.add(loadButton, gbc);
Utility.buildConstraints(gbc, 1, 2, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
panel.add(clearButton, gbc);
Utility.buildConstraints(gbc, 2, 1, 1, 1, 0, 0, GridBagConstraints.VERTICAL, GridBagConstraints.CENTER);
zoomSlider.setInverted(true);
zoomSlider.setPreferredSize(new Dimension(20, 10));
panel.add(zoomSlider, gbc);
Utility.buildConstraints(gbc, 3, 0, 1, 1, 0, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);
panel.add(new JLabel(LanguageBundle.getString("in_thumbnailPortrait")), gbc);
Utility.buildConstraints(gbc, 3, 1, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTH);
panel.add(tnPane, gbc);
this.setViewportView(panel);
}
use of java.awt.GridBagConstraints in project pcgen by PCGen.
the class RunConvertPanel method setupDisplay.
/**
* @see pcgen.gui2.converter.panel.ConvertSubPanel#setupDisplay(javax.swing.JPanel, pcgen.cdom.base.CDOMObject)
*/
@Override
public void setupDisplay(JPanel panel, CDOMObject pc) {
panel.setLayout(new GridBagLayout());
JLabel introLabel = new JLabel("Conversion in progress");
GridBagConstraints gbc = new GridBagConstraints();
Utility.buildRelativeConstraints(gbc, GridBagConstraints.REMAINDER, 1, 1.0, 0);
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.insets = new Insets(0, 10, 5, 10);
panel.add(introLabel, gbc);
JLabel explainLabel = new JLabel("<html>The LST data is being converted. In the log, " + "LSTERROR rows are errors that need to be manually corrected in the source data. " + "LSTWARN rows indicate changes the converter is making. " + "See " + changeLogFile.getAbsolutePath() + " for a log of all data changes.</html>");
explainLabel.setFocusable(true);
Utility.buildRelativeConstraints(gbc, GridBagConstraints.REMAINDER, 1, 1.0, 0);
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.insets = new Insets(0, 10, 5, 10);
panel.add(explainLabel, gbc);
progressBar = getProgressBar();
Dimension d = progressBar.getPreferredSize();
d.width = 400;
progressBar.setPreferredSize(d);
progressBar.setStringPainted(true);
Utility.buildRelativeConstraints(gbc, GridBagConstraints.REMAINDER, 1, 1.0, 0);
gbc.fill = GridBagConstraints.HORIZONTAL;
panel.add(progressBar, gbc);
messageAreaContainer = new JScrollPane(getMessageArea());
Utility.buildRelativeConstraints(gbc, GridBagConstraints.REMAINDER, GridBagConstraints.REMAINDER, 1.0, 1.0);
gbc.fill = GridBagConstraints.BOTH;
panel.add(messageAreaContainer, gbc);
panel.setPreferredSize(new Dimension(800, 500));
}
Aggregations