|
|
@@ -7,14 +7,20 @@ import java.awt.Insets;
|
|
|
|
|
|
import javax.swing.JLabel;
|
|
|
import javax.swing.JPanel;
|
|
|
+import javax.swing.JSeparator;
|
|
|
import javax.swing.JTextField;
|
|
|
import javax.swing.JTextPane;
|
|
|
|
|
|
import org.jdesktop.swingx.VerticalLayout;
|
|
|
+import org.leumasjaffe.recipe.model.Product;
|
|
|
+
|
|
|
+import lombok.AccessLevel;
|
|
|
+import lombok.experimental.FieldDefaults;
|
|
|
|
|
|
@SuppressWarnings("serial")
|
|
|
+@FieldDefaults(level=AccessLevel.PRIVATE, makeFinal=true)
|
|
|
public class SummaryPanel extends JPanel {
|
|
|
- JTextField txtTitle;
|
|
|
+ JPanel panelIngredients;
|
|
|
|
|
|
public SummaryPanel() {
|
|
|
GridBagLayout gridBagLayout = new GridBagLayout();
|
|
|
@@ -39,7 +45,7 @@ public class SummaryPanel extends JPanel {
|
|
|
gbl_panelHeader.rowWeights = new double[]{0.0, Double.MIN_VALUE};
|
|
|
panelHeader.setLayout(gbl_panelHeader);
|
|
|
|
|
|
- txtTitle = new JTextField();
|
|
|
+ JTextField txtTitle = new JTextField();
|
|
|
txtTitle.setText("Title");
|
|
|
GridBagConstraints gbc_txtTitle = new GridBagConstraints();
|
|
|
gbc_txtTitle.insets = new Insets(0, 0, 0, 5);
|
|
|
@@ -55,8 +61,7 @@ public class SummaryPanel extends JPanel {
|
|
|
gbc_lblDuration.gridy = 0;
|
|
|
panelHeader.add(lblDuration, gbc_lblDuration);
|
|
|
|
|
|
- JPanel panelIngredients = new JPanel();
|
|
|
- panelIngredients.setPreferredSize(new Dimension(200, 100));
|
|
|
+ panelIngredients = new JPanel();
|
|
|
GridBagConstraints gbc_panelIngredients = new GridBagConstraints();
|
|
|
gbc_panelIngredients.gridheight = 2;
|
|
|
gbc_panelIngredients.insets = new Insets(0, 0, 0, 5);
|
|
|
@@ -83,4 +88,9 @@ public class SummaryPanel extends JPanel {
|
|
|
gbc_txtpnDescription.gridy = 2;
|
|
|
add(txtpnDescription, gbc_txtpnDescription);
|
|
|
}
|
|
|
+
|
|
|
+ void addProduct(final Product comp) {
|
|
|
+ panelIngredients.add(new ProductSummaryPanel(comp));
|
|
|
+ panelIngredients.add(new JSeparator());
|
|
|
+ }
|
|
|
}
|