|
|
@@ -16,6 +16,8 @@ import lombok.experimental.FieldDefaults;
|
|
|
|
|
|
import java.awt.GridBagLayout;
|
|
|
import java.awt.Insets;
|
|
|
+import java.util.Collection;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import javax.swing.JLabel;
|
|
|
import java.awt.GridBagConstraints;
|
|
|
@@ -32,7 +34,7 @@ public class ElementPanel extends JPanel {
|
|
|
|
|
|
public ElementPanel(final Element element, final ScaleFactor scale) {
|
|
|
controller = new ReplaceChildrenAction<>(
|
|
|
- Element::getIngredients, i -> new IngredientPanel(i, scale));
|
|
|
+ ElementPanel::getIngredients, i -> new IngredientPanel(i, scale));
|
|
|
GridBagLayout gridBagLayout = new GridBagLayout();
|
|
|
gridBagLayout.columnWidths = new int[]{0, 0, 0};
|
|
|
gridBagLayout.rowHeights = new int[]{0, 0, 0};
|
|
|
@@ -70,4 +72,9 @@ public class ElementPanel extends JPanel {
|
|
|
super.removeNotify();
|
|
|
ObserverDispatch.unsubscribeAll(childListener);
|
|
|
}
|
|
|
+
|
|
|
+ private static Collection<Ingredient> getIngredients(final Element elem) {
|
|
|
+ return elem.getIngredientsAsStream().filter(i -> !i.getName().endsWith("*"))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }
|
|
|
}
|