|
|
@@ -19,12 +19,12 @@ import java.awt.GridBagConstraints;
|
|
|
|
|
|
@SuppressWarnings("serial")
|
|
|
@FieldDefaults(level=AccessLevel.PRIVATE, makeFinal=true)
|
|
|
-public class ElementSummaryPanel extends JPanel {
|
|
|
+public class ElementPanel extends JPanel {
|
|
|
ObservableListener<JPanel, Element> listener;
|
|
|
@Getter(AccessLevel.PACKAGE) JLabel lblProductName;
|
|
|
@Getter(AccessLevel.PACKAGE) JPanel panelIngredients;
|
|
|
|
|
|
- public ElementSummaryPanel(final Element element) {
|
|
|
+ public ElementPanel(final Element element) {
|
|
|
GridBagLayout gridBagLayout = new GridBagLayout();
|
|
|
gridBagLayout.columnWidths = new int[]{0, 0, 0};
|
|
|
gridBagLayout.rowHeights = new int[]{0, 0, 0};
|
|
|
@@ -51,7 +51,7 @@ public class ElementSummaryPanel extends JPanel {
|
|
|
|
|
|
listener = new ObservableListener<>(panelIngredients, (c, t) -> {
|
|
|
c.removeAll();
|
|
|
- element.getIngredients().stream().map(SummaryIngredientPanel::new).forEach(c::add);
|
|
|
+ element.getIngredients().stream().map(IngredientPanel::new).forEach(c::add);
|
|
|
});
|
|
|
listener.setObserved(element);
|
|
|
}
|