use of pcgen.gui2.tools.FlippingSplitPane in project pcgen by PCGen.
the class TemplateInfoTab method initComponents.
private void initComponents() {
FlippingSplitPane topPane = new FlippingSplitPane("TemplateTop");
setTopComponent(topPane);
setOrientation(VERTICAL_SPLIT);
JPanel availPanel = new JPanel(new BorderLayout());
FilterBar<CharacterFacade, TemplateFacade> bar = new FilterBar<>();
bar.addDisplayableFilter(new SearchFilterPanel());
//$NON-NLS-1$
qFilterButton.setText(LanguageBundle.getString("in_igQualFilter"));
bar.addDisplayableFilter(qFilterButton);
availPanel.add(bar, BorderLayout.NORTH);
availableTable.setDisplayableFilter(bar);
availableTable.setTreeCellRenderer(qualifiedRenderer);
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, TemplateFacade> filterBar = new FilterBar<>();
filterBar.addDisplayableFilter(new SearchFilterPanel());
selectedTable.setDisplayableFilter(filterBar);
selectedTable.setTreeCellRenderer(qualifiedRenderer);
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);
}
use of pcgen.gui2.tools.FlippingSplitPane in project pcgen by PCGen.
the class EquipCustomPanel method initComponents.
private void initComponents() {
JPanel upperPanel = new JPanel(new BorderLayout());
setTopComponent(upperPanel);
setOrientation(VERTICAL_SPLIT);
Box bannerBox = Box.createHorizontalBox();
bannerBox.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
bannerBox.add(Box.createHorizontalGlue());
JLabel baseItemLabel = new JLabel(LanguageBundle.getString("in_EqBuilder_BaseItem"));
FontManipulation.large(baseItemLabel);
bannerBox.add(baseItemLabel);
bannerBox.add(Box.createHorizontalStrut(5));
JLabel baseItemName = new JLabel(builder.getBaseItemName());
FontManipulation.large(baseItemName);
FontManipulation.title(baseItemName);
bannerBox.add(baseItemName);
if (validHeads.getSize() > 1) {
bannerBox.add(Box.createHorizontalStrut(45));
JLabel headLabel = new JLabel(LanguageBundle.getString("in_EqBuilder_Head"));
FontManipulation.large(headLabel);
bannerBox.add(headLabel);
bannerBox.add(Box.createHorizontalStrut(5));
Dimension prefDim = headCombo.getPreferredSize();
prefDim.width += 15;
headCombo.setMaximumSize(prefDim);
bannerBox.add(headCombo);
}
bannerBox.add(Box.createHorizontalGlue());
upperPanel.add(bannerBox, BorderLayout.NORTH);
FlippingSplitPane topPane = new FlippingSplitPane("equipCustTop");
upperPanel.add(topPane, BorderLayout.CENTER);
JPanel availPanel = new JPanel(new BorderLayout());
FilterBar<Object, EquipModFacade> bar = new FilterBar<>();
bar.addDisplayableFilter(new SearchFilterPanel());
availPanel.add(bar, BorderLayout.NORTH);
availableTable.setDisplayableFilter(bar);
availableTable.setTreeViewModel(availEqmodModelMap.get(currentHead));
availableTable.setTreeCellRenderer(renderer);
availPanel.add(new JScrollPane(availableTable), BorderLayout.CENTER);
Box box = Box.createHorizontalBox();
box.add(Box.createHorizontalGlue());
addButton.setHorizontalTextPosition(SwingConstants.LEADING);
addButton.setAction(addAction);
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());
Box equipButtonBox = Box.createHorizontalBox();
equipButtonBox.add(Box.createHorizontalGlue());
nameButton.setHorizontalTextPosition(SwingConstants.LEADING);
nameButton.setAction(nameAction);
equipButtonBox.add(nameButton);
equipButtonBox.add(Box.createHorizontalStrut(5));
spropButton.setHorizontalTextPosition(SwingConstants.LEADING);
spropButton.setAction(spropAction);
equipButtonBox.add(spropButton);
equipButtonBox.add(Box.createHorizontalStrut(5));
costButton.setHorizontalTextPosition(SwingConstants.LEADING);
costButton.setAction(costAction);
equipButtonBox.add(costButton);
equipButtonBox.add(Box.createHorizontalStrut(5));
weightButton.setHorizontalTextPosition(SwingConstants.LEADING);
weightButton.setAction(weightAction);
equipButtonBox.add(weightButton);
if (builder.isWeapon()) {
equipButtonBox.add(Box.createHorizontalStrut(5));
damageButton.setHorizontalTextPosition(SwingConstants.LEADING);
damageButton.setAction(damageAction);
equipButtonBox.add(damageButton);
}
// Only show size if it can be used
if (builder.isResizable()) {
JPanel sizePanel = new JPanel();
JLabel sizeLabel = new JLabel(LanguageBundle.getString("in_EqBuilder_Size"));
sizePanel.add(sizeLabel);
sizePanel.add(sizeCombo);
equipButtonBox.add(Box.createHorizontalStrut(5));
equipButtonBox.add(sizePanel);
}
equipButtonBox.add(Box.createHorizontalGlue());
equipButtonBox.setBorder(new EmptyBorder(5, 0, 0, 0));
selPanel.add(equipButtonBox, BorderLayout.NORTH);
selectedTable.setTreeViewModel(selectedEqmodModelMap.get(currentHead));
selectedTable.setTreeCellRenderer(renderer);
selPanel.add(new JScrollPane(selectedTable), BorderLayout.CENTER);
box = Box.createHorizontalBox();
removeButton.setHorizontalTextPosition(SwingConstants.TRAILING);
removeButton.setAction(removeAction);
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);
FlippingSplitPane bottomPane = new FlippingSplitPane("equipCustBottom");
bottomPane.setLeftComponent(equipModInfoPane);
bottomPane.setRightComponent(equipInfoPane);
setBottomComponent(bottomPane);
setResizeWeight(0.75);
}
Aggregations