use of javax.swing.JScrollPane in project pcgen by PCGen.
the class PreferencesDialog method getCenter.
@Override
protected JComponent getCenter() {
jSplitPane1 = new FlippingSplitPane();
prefsTree = new javax.swing.JTree();
prefsTree.setRootVisible(false);
prefsTree.setShowsRootHandles(true);
cardLayout = new CardLayout();
prefsPane = new JPanel(cardLayout);
prefsPane.add(new JPanel(), EMPTY);
addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent e) {
close();
}
});
jSplitPane1.setLeftComponent(new JScrollPane(prefsTree, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED));
prefsTree.addTreeSelectionListener(evt -> PrefsTreeActionPerformed());
jSplitPane1.setRightComponent(prefsPane);
return jSplitPane1;
}
use of javax.swing.JScrollPane in project pcgen by PCGen.
the class InfoCharacterDetails method getScrollPane.
/**
* Get the scroll pane
* @return scroll pane
*/
public JScrollPane getScrollPane() {
JScrollPane scrollPane = new JScrollPane();
mainOutput.setCaretPosition(0);
scrollPane.setViewportView(mainOutput);
return scrollPane;
}
use of javax.swing.JScrollPane in project pcgen by PCGen.
the class SpellBooksTab method initComponents.
private void initComponents() {
availableTable.setTreeCellRenderer(spellRenderer);
selectedTable.setTreeCellRenderer(spellRenderer);
selectedTable.setRowSorter(new SortableTableRowSorter() {
@Override
public SortableTableModel getModel() {
return (SortableTableModel) selectedTable.getModel();
}
});
selectedTable.getRowSorter().toggleSortOrder(0);
FilterBar<CharacterFacade, SuperNode> filterBar = new FilterBar<>();
filterBar.addDisplayableFilter(new SearchFilterPanel());
//$NON-NLS-1$
qFilterButton.setText(LanguageBundle.getString("in_igQualFilter"));
filterBar.addDisplayableFilter(qFilterButton);
FlippingSplitPane upperPane = new FlippingSplitPane("SpellBooksTop");
JPanel availPanel = FilterUtilities.configureFilteredTreeViewPane(availableTable, filterBar);
Box box = Box.createVerticalBox();
box.add(Box.createVerticalStrut(5));
{
Box hbox = Box.createHorizontalBox();
hbox.add(Box.createHorizontalStrut(5));
hbox.add(new JLabel(LanguageBundle.getString("InfoSpells.set.auto.book")));
hbox.add(Box.createHorizontalGlue());
box.add(hbox);
}
box.add(Box.createVerticalStrut(5));
{
Box hbox = Box.createHorizontalBox();
hbox.add(Box.createHorizontalStrut(5));
hbox.add(defaultBookCombo);
hbox.add(Box.createHorizontalGlue());
hbox.add(Box.createHorizontalStrut(5));
hbox.add(addButton);
hbox.add(Box.createHorizontalStrut(5));
box.add(hbox);
}
box.add(Box.createVerticalStrut(5));
availPanel.add(box, BorderLayout.SOUTH);
upperPane.setLeftComponent(availPanel);
box = Box.createVerticalBox();
box.add(new JScrollPane(selectedTable));
box.add(Box.createVerticalStrut(5));
{
Box hbox = Box.createHorizontalBox();
hbox.add(Box.createHorizontalStrut(5));
hbox.add(removeButton);
hbox.add(Box.createHorizontalGlue());
box.add(hbox);
}
box.add(Box.createVerticalStrut(5));
upperPane.setRightComponent(box);
upperPane.setResizeWeight(0);
setTopComponent(upperPane);
FlippingSplitPane bottomPane = new FlippingSplitPane("SpellBooksBottom");
bottomPane.setLeftComponent(spellsPane);
bottomPane.setRightComponent(classPane);
setBottomComponent(bottomPane);
setOrientation(VERTICAL_SPLIT);
}
use of javax.swing.JScrollPane in project pcgen by PCGen.
the class SpellsKnownTab method initComponents.
private void initComponents() {
availableTable.setTreeCellRenderer(spellRenderer);
selectedTable.setTreeCellRenderer(spellRenderer);
selectedTable.setRowSorter(new SortableTableRowSorter() {
@Override
public SortableTableModel getModel() {
return (SortableTableModel) selectedTable.getModel();
}
});
selectedTable.getRowSorter().toggleSortOrder(0);
FilterBar<CharacterFacade, SuperNode> filterBar = new FilterBar<>();
filterBar.addDisplayableFilter(new SearchFilterPanel());
//$NON-NLS-1$
qFilterButton.setText(LanguageBundle.getString("in_igQualFilter"));
filterBar.addDisplayableFilter(qFilterButton);
FlippingSplitPane upperPane = new FlippingSplitPane("SpellsKnownTop");
JPanel availPanel = FilterUtilities.configureFilteredTreeViewPane(availableTable, filterBar);
Box box = Box.createVerticalBox();
box.add(Box.createVerticalStrut(2));
{
Box hbox = Box.createHorizontalBox();
hbox.add(Box.createHorizontalStrut(5));
hbox.add(autoKnownBox);
hbox.add(Box.createHorizontalGlue());
box.add(hbox);
}
//box.add(Box.createVerticalStrut(2));
{
Box hbox = Box.createHorizontalBox();
hbox.add(Box.createHorizontalStrut(5));
hbox.add(slotsBox);
hbox.add(Box.createHorizontalGlue());
hbox.add(Box.createHorizontalStrut(10));
hbox.add(addButton);
hbox.add(Box.createHorizontalStrut(5));
box.add(hbox);
}
box.add(Box.createVerticalStrut(5));
availPanel.add(box, BorderLayout.SOUTH);
upperPane.setLeftComponent(availPanel);
box = Box.createVerticalBox();
box.add(new JScrollPane(selectedTable));
box.add(Box.createVerticalStrut(4));
{
Box hbox = Box.createHorizontalBox();
hbox.add(Box.createHorizontalStrut(5));
hbox.add(removeButton);
hbox.add(Box.createHorizontalStrut(10));
JButton spellSheetButton = new JButton(LanguageBundle.getString("InfoSpells.select.spellsheet"));
spellSheetButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
selectSpellSheetButton();
}
});
hbox.add(spellSheetButton);
hbox.add(Box.createHorizontalStrut(3));
String text = PCGenSettings.getSelectedSpellSheet();
if (text != null) {
text = new File(text).getName();
}
spellSheetField.setEditable(false);
spellSheetField.setText(text);
spellSheetField.setToolTipText(text);
hbox.add(spellSheetField);
hbox.add(Box.createHorizontalStrut(3));
previewSpellsButton = new JButton(Icons.PrintPreview16.getImageIcon());
hbox.add(previewSpellsButton);
hbox.add(Box.createHorizontalStrut(3));
exportSpellsButton = new JButton(Icons.Print16.getImageIcon());
hbox.add(exportSpellsButton);
hbox.add(Box.createHorizontalStrut(5));
box.add(hbox);
}
box.add(Box.createVerticalStrut(5));
upperPane.setRightComponent(box);
upperPane.setResizeWeight(0);
setTopComponent(upperPane);
FlippingSplitPane bottomPane = new FlippingSplitPane("SpellsKnownBottom");
bottomPane.setLeftComponent(spellsPane);
bottomPane.setRightComponent(classPane);
setBottomComponent(bottomPane);
setOrientation(VERTICAL_SPLIT);
}
use of javax.swing.JScrollPane in project pcgen by PCGen.
the class SpellsPreparedTab method initComponents.
private void initComponents() {
availableTable.setTreeCellRenderer(spellRenderer);
selectedTable.setTreeCellRenderer(spellRenderer);
selectedTable.setRowSorter(new SortableTableRowSorter() {
@Override
public SortableTableModel getModel() {
return (SortableTableModel) selectedTable.getModel();
}
});
selectedTable.getRowSorter().toggleSortOrder(0);
FilterBar<CharacterFacade, SuperNode> filterBar = new FilterBar<>();
filterBar.addDisplayableFilter(new SearchFilterPanel());
//$NON-NLS-1$
qFilterButton.setText(LanguageBundle.getString("in_igQualFilter"));
filterBar.addDisplayableFilter(qFilterButton);
FlippingSplitPane upperPane = new FlippingSplitPane("SpellsPreparedTop");
JPanel availPanel = FilterUtilities.configureFilteredTreeViewPane(availableTable, filterBar);
Box box = Box.createVerticalBox();
box.add(Box.createVerticalStrut(5));
{
Box hbox = Box.createHorizontalBox();
addMMSpellButton.setHorizontalTextPosition(SwingConstants.LEADING);
hbox.add(addMMSpellButton);
box.add(hbox);
}
box.add(Box.createVerticalStrut(2));
{
Box hbox = Box.createHorizontalBox();
hbox.add(Box.createHorizontalStrut(5));
hbox.add(slotsBox);
hbox.add(Box.createHorizontalGlue());
hbox.add(Box.createHorizontalStrut(10));
hbox.add(addSpellButton);
hbox.add(Box.createHorizontalStrut(5));
box.add(hbox);
}
box.add(Box.createVerticalStrut(5));
availPanel.add(box, BorderLayout.SOUTH);
upperPane.setLeftComponent(availPanel);
box = Box.createVerticalBox();
box.add(new JScrollPane(selectedTable));
box.add(Box.createVerticalStrut(4));
{
Box hbox = Box.createHorizontalBox();
hbox.add(Box.createHorizontalStrut(5));
hbox.add(removeSpellButton);
hbox.add(Box.createHorizontalStrut(10));
hbox.add(new JLabel(LanguageBundle.getString("InfoPreparedSpells.preparedList")));
hbox.add(Box.createHorizontalStrut(3));
hbox.add(spellListField);
hbox.add(Box.createHorizontalStrut(3));
hbox.add(addSpellListButton);
hbox.add(Box.createHorizontalStrut(3));
hbox.add(removeSpellListButton);
hbox.add(Box.createHorizontalStrut(5));
box.add(hbox);
}
box.add(Box.createVerticalStrut(5));
upperPane.setRightComponent(box);
upperPane.setResizeWeight(0);
setTopComponent(upperPane);
FlippingSplitPane bottomPane = new FlippingSplitPane("SpellsPreparedBottom");
bottomPane.setLeftComponent(spellsPane);
bottomPane.setRightComponent(classPane);
setBottomComponent(bottomPane);
setOrientation(VERTICAL_SPLIT);
}
Aggregations