use of pcgen.facade.core.EquipModFacade in project pcgen by PCGen.
the class EquipmentBuilderFacadeImpl method refreshAvailList.
private void refreshAvailList() {
List<String> aFilter = equip.typeList();
for (EquipmentHead head : equipHeads) {
List<EquipModFacade> newEqMods = new ArrayList<>();
for (EquipmentModifier aEqMod : Globals.getContext().getReferenceContext().getConstructedCDOMObjects(EquipmentModifier.class)) {
if (equip.isVisible(character, aEqMod, head.isPrimary(), View.VISIBLE_DISPLAY)) {
if (aEqMod.isType("ALL")) {
newEqMods.add(aEqMod);
} else {
for (String aType : aFilter) {
if (aEqMod.isType(aType)) {
newEqMods.add(aEqMod);
break;
}
}
}
}
}
availListMap.get(head).updateContents(newEqMods);
}
}
use of pcgen.facade.core.EquipModFacade 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