use of javax.swing.JPanel in project pcgen by PCGen.
the class DomainInfoTab method initComponents.
private void initComponents() {
setOrientation(VERTICAL_SPLIT);
deityTable.setTreeCellRenderer(qualifiedRenderer);
JPanel panel = new JPanel(new BorderLayout());
FilterBar<Object, DeityFacade> bar = new FilterBar<>();
bar.addDisplayableFilter(new SearchFilterPanel());
//$NON-NLS-1$
qDeityButton.setText(LanguageBundle.getString("in_igQualFilter"));
bar.addDisplayableFilter(qDeityButton);
deityTable.setDisplayableFilter(bar);
panel.add(bar, BorderLayout.NORTH);
ListSelectionModel selectionModel = deityTable.getSelectionModel();
selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
panel.add(new JScrollPane(deityTable), BorderLayout.CENTER);
Box box = Box.createHorizontalBox();
box.add(Box.createHorizontalGlue());
//$NON-NLS-1$
box.add(new JLabel(LanguageBundle.getString("in_domDeityLabel")));
box.add(Box.createHorizontalStrut(5));
box.add(selectedDeity);
box.add(Box.createHorizontalStrut(5));
box.add(selectDeity);
box.add(Box.createHorizontalGlue());
panel.add(box, BorderLayout.SOUTH);
FlippingSplitPane splitPane = new FlippingSplitPane("DomainTop");
splitPane.setLeftComponent(panel);
panel = new JPanel(new BorderLayout());
FilterBar<CharacterFacade, DomainFacade> dbar = new FilterBar<>();
dbar.addDisplayableFilter(new SearchFilterPanel());
//$NON-NLS-1$
qDomainButton.setText(LanguageBundle.getString("in_igQualFilter"));
dbar.addDisplayableFilter(qDomainButton);
domainFilter = dbar;
panel.add(dbar, BorderLayout.NORTH);
selectionModel = domainTable.getSelectionModel();
selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
domainTable.setAutoCreateColumnsFromModel(false);
domainTable.setColumnModel(createDomainColumnModel());
JScrollPane scrollPane = TableUtils.createCheckBoxSelectionPane(domainTable, domainRowHeaderTable);
panel.add(scrollPane, BorderLayout.CENTER);
box = Box.createHorizontalBox();
box.add(Box.createHorizontalGlue());
//$NON-NLS-1$
box.add(new JLabel(LanguageBundle.getString("in_domRemainDomLabel")));
box.add(Box.createHorizontalStrut(5));
box.add(selectedDomain);
box.add(Box.createHorizontalGlue());
panel.add(box, BorderLayout.SOUTH);
splitPane.setRightComponent(panel);
setTopComponent(splitPane);
splitPane = new FlippingSplitPane("DomainBottom");
splitPane.setLeftComponent(deityInfo);
splitPane.setRightComponent(domainInfo);
setBottomComponent(splitPane);
setResizeWeight(0.65);
}
use of javax.swing.JPanel in project pcgen by PCGen.
the class EquipInfoTab method initComponents.
private void initComponents() {
FontManipulation.small(newSetButton);
newSetButton.setMargin(new Insets(0, 0, 0, 0));
FontManipulation.small(removeSetButton);
removeSetButton.setMargin(new Insets(0, 0, 0, 0));
//$NON-NLS-1$
exportTemplateButton.setText(LanguageBundle.getString("in_equipExportTemplate"));
//$NON-NLS-1$
viewBrowserButton.setText(LanguageBundle.getString("in_equipViewBrowser"));
//$NON-NLS-1$
exportFileButton.setText(LanguageBundle.getString("in_equipExportFile"));
//$NON-NLS-1$
setNoteButton.setText(LanguageBundle.getString("in_equipSetNote"));
setOrientation(HORIZONTAL_SPLIT);
FlippingSplitPane splitPane = new FlippingSplitPane(VERTICAL_SPLIT, "EquipMain");
JPanel panel = new JPanel(new BorderLayout());
Box bar = Box.createHorizontalBox();
bar.add(Box.createHorizontalStrut(5));
//$NON-NLS-1$
bar.add(new JLabel(LanguageBundle.getString("in_equipView")));
bar.add(Box.createHorizontalStrut(5));
bar.add(equipViewBox);
bar.add(Box.createHorizontalStrut(5));
tableFilter = new SearchFilterPanel();
bar.add(tableFilter.getFilterComponent());
bar.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0));
panel.add(bar, BorderLayout.NORTH);
equipmentTable.setAutoCreateColumnsFromModel(false);
equipmentTable.setColumnModel(createEquipmentColumnModel());
equipmentTable.setAutoCreateRowSorter(true);
panel.add(new JScrollPane(equipmentTable), BorderLayout.CENTER);
Box buttonsBox = Box.createHorizontalBox();
buttonsBox.add(Box.createHorizontalGlue());
equipButton.setHorizontalTextPosition(SwingConstants.LEADING);
buttonsBox.add(equipButton);
buttonsBox.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));
panel.add(buttonsBox, BorderLayout.SOUTH);
splitPane.setTopComponent(panel);
splitPane.setBottomComponent(infoPane);
setLeftComponent(splitPane);
panel = new JPanel(new BorderLayout());
Box equipPane = Box.createVerticalBox();
Box box = Box.createHorizontalBox();
box.add(Box.createHorizontalGlue());
//$NON-NLS-1$
box.add(new JLabel(LanguageBundle.getString("in_equipSetLabel")));
box.add(Box.createHorizontalStrut(3));
box.add(equipSetBox);
box.add(Box.createHorizontalStrut(3));
box.add(newSetButton);
box.add(Box.createHorizontalStrut(3));
box.add(removeSetButton);
box.add(Box.createHorizontalGlue());
//$NON-NLS-1$
box.add(new JLabel(LanguageBundle.getString("in_equipWeightLabel")));
box.add(Box.createHorizontalStrut(5));
box.add(weightLabel);
box.add(Box.createHorizontalGlue());
//$NON-NLS-1$
box.add(new JLabel(LanguageBundle.getString("in_equipLoadLabel")));
box.add(Box.createHorizontalStrut(5));
box.add(loadLabel);
// box.add(Box.createHorizontalGlue());
// box.add(new JLabel("Limit:"));
box.add(Box.createHorizontalStrut(5));
box.add(limitLabel);
box.add(Box.createHorizontalGlue());
equipPane.add(Box.createVerticalStrut(3));
equipPane.add(box);
equipPane.add(Box.createVerticalStrut(3));
box = Box.createHorizontalBox();
box.add(exportTemplateButton);
exportTemplateButton.setEnabled(false);
box.add(Box.createHorizontalStrut(3));
box.add(viewBrowserButton);
viewBrowserButton.setEnabled(false);
box.add(Box.createHorizontalStrut(3));
box.add(exportFileButton);
exportFileButton.setEnabled(false);
box.add(Box.createHorizontalStrut(3));
box.add(setNoteButton);
setNoteButton.setEnabled(false);
box.add(Box.createHorizontalStrut(3));
box.add(expandAllButton);
box.add(Box.createHorizontalStrut(3));
box.add(collapseAllButton);
equipPane.add(box);
equipPane.add(Box.createVerticalStrut(3));
panel.add(equipPane, BorderLayout.NORTH);
EquipmentModel.initializeTreeTable(equipmentSetTable);
panel.add(new JScrollPane(equipmentSetTable), BorderLayout.CENTER);
Box selPanelbuttonsBox = Box.createHorizontalBox();
selPanelbuttonsBox.add(Box.createHorizontalStrut(3));
selPanelbuttonsBox.add(unequipButton);
selPanelbuttonsBox.add(Box.createHorizontalStrut(3));
selPanelbuttonsBox.add(unequipAllButton);
selPanelbuttonsBox.add(Box.createHorizontalStrut(3));
selPanelbuttonsBox.add(moveUpButton);
selPanelbuttonsBox.add(Box.createHorizontalStrut(3));
selPanelbuttonsBox.add(moveDownButton);
selPanelbuttonsBox.add(Box.createHorizontalGlue());
selPanelbuttonsBox.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));
panel.add(selPanelbuttonsBox, BorderLayout.SOUTH);
setRightComponent(panel);
}
use of javax.swing.JPanel 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 javax.swing.JPanel in project pcgen by PCGen.
the class SummaryInfoTab method initMiddlePanel.
private void initMiddlePanel(JPanel middlePanel) {
middlePanel.setLayout(new GridLayout(2, 1));
JPanel statsPanel = new JPanel();
//$NON-NLS-1$
setPanelTitle(statsPanel, LanguageBundle.getString("in_sumAbilityScores"));
statsPanel.setLayout(new BoxLayout(statsPanel, BoxLayout.Y_AXIS));
StatTableModel.initializeTable(statsTable);
JScrollPane pane = new JScrollPane(statsTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER) {
@Override
public Dimension getMaximumSize() {
//This prevents the scroll pane from taking up more space than it needs.
return super.getPreferredSize();
}
};
pane.setBorder(BorderFactory.createEmptyBorder());
JPanel statsBox = new JPanel();
statsBox.setLayout(new BoxLayout(statsBox, BoxLayout.X_AXIS));
statsBox.add(Box.createHorizontalGlue());
statsBox.add(pane);
statsBox.add(Box.createHorizontalGlue());
statsPanel.add(statsBox);
JPanel statTotalPanel = new JPanel();
statTotalPanel.setLayout(new BoxLayout(statTotalPanel, BoxLayout.X_AXIS));
//this makes box layout use the statTotalPanel to distribute extra space
statTotalPanel.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
statTotalPanel.add(Box.createHorizontalGlue());
FontManipulation.title(statTotalLabel);
statTotalPanel.add(statTotalLabel);
statTotalPanel.add(statTotal);
FontManipulation.title(modTotalLabel);
statTotalPanel.add(modTotalLabel);
statTotalPanel.add(modTotal);
statTotalPanel.add(Box.createHorizontalGlue());
//$NON-NLS-1$
generateRollsButton.setText(LanguageBundle.getString("in_sumGenerate_Rolls"));
statTotalPanel.add(generateRollsButton);
//$NON-NLS-1$
rollMethodButton.setText(LanguageBundle.getString("in_sumRoll_Method"));
statTotalPanel.add(Box.createRigidArea(new Dimension(5, 0)));
statTotalPanel.add(rollMethodButton);
statTotalPanel.add(Box.createHorizontalGlue());
statsPanel.add(statTotalPanel);
middlePanel.add(statsPanel);
InfoPaneHandler.initializeEditorPane(infoPane);
pane = new JScrollPane(infoPane);
//$NON-NLS-1$
setPanelTitle(pane, LanguageBundle.getString("in_sumStats"));
middlePanel.add(pane);
}
use of javax.swing.JPanel in project pcgen by PCGen.
the class TempBonusInfoTab method initComponents.
private void initComponents() {
FlippingSplitPane topPane = new FlippingSplitPane("TempBonusTop");
setTopComponent(topPane);
setOrientation(VERTICAL_SPLIT);
JPanel availPanel = new JPanel(new BorderLayout());
FilterBar<CharacterFacade, TempBonusFacade> bar = new FilterBar<>();
bar.addDisplayableFilter(new SearchFilterPanel());
availPanel.add(bar, BorderLayout.NORTH);
availableTable.setDisplayableFilter(bar);
availableTable.setTreeCellRenderer(tempBonusRenderer);
availPanel.add(new JScrollPane(availableTable), BorderLayout.CENTER);
Box box = Box.createHorizontalBox();
box.add(Box.createHorizontalGlue());
addButton.setHorizontalTextPosition(SwingConstants.LEADING);
box.add(addButton);
box.add(Box.createHorizontalStrut(5));
box.setBorder(new EmptyBorder(0, 0, 5, 0));
availPanel.add(box, BorderLayout.SOUTH);
topPane.setLeftComponent(availPanel);
JPanel selPanel = new JPanel(new BorderLayout());
FilterBar<CharacterFacade, TempBonusFacade> filterBar = new FilterBar<>();
filterBar.addDisplayableFilter(new SearchFilterPanel());
selectedTable.setDisplayableFilter(filterBar);
selectedTable.setTreeCellRenderer(tempBonusRenderer);
selPanel.add(new JScrollPane(selectedTable), BorderLayout.CENTER);
box = Box.createHorizontalBox();
box.add(Box.createHorizontalStrut(5));
box.add(removeButton);
box.add(Box.createHorizontalGlue());
box.setBorder(new EmptyBorder(0, 0, 5, 0));
selPanel.add(box, BorderLayout.SOUTH);
topPane.setRightComponent(selPanel);
setBottomComponent(infoPane);
setResizeWeight(0.75);
}
Aggregations