public class CreateProductController extends Controller
Modifier and Type | Field and Description |
---|---|
private ProductDB |
database |
private ProductCreationObserver |
observer
The observer is informed when a new product is created
|
private CreateProductView |
view |
master
Constructor and Description |
---|
CreateProductController(ProductCreationObserver observer)
Creates the view to create a new product
|
Modifier and Type | Method and Description |
---|---|
void |
createProduct(java.lang.String productName,
Product.Unit productUnit,
double productLipids,
double productProteins,
double productCarbohydrates)
Creates a product and adds it in the database.
|
void |
notifyObserverWindowClosed() |
isHelpOpen, onHelpViewStatusChanged
private ProductCreationObserver observer
private ProductDB database
private CreateProductView view
public CreateProductController(ProductCreationObserver observer)
observer
- public void createProduct(java.lang.String productName, Product.Unit productUnit, double productLipids, double productProteins, double productCarbohydrates)
productName
- The name of the new productproductUnit
- The unit in which the product is measuredproductLipids
- Lipids contained in 100gproductProteins
- Proteins contained in 100gproductCarbohydrates
- Carbohydrates contained in 100gpublic void notifyObserverWindowClosed()