package beaform.gui;

import beaform.Ingredient;
import beaform.entities.Formula;

/**
 * This class represents a formula for use in a treeview
 *
 * @author steven
 *
 */
public class TreeViewFormula {
	private final Formula formula;
	private final String amount;

	public TreeViewFormula(final Formula formula) {
		this.formula = formula;
		this.amount = "";
	}

	public TreeViewFormula(final Ingredient ingredient) {
		this.formula = ingredient.getFormula();
		this.amount = ingredient.getAmount();
	}

	@Override
	public String toString() {
		return this.formula.getName();
	}

	public Formula getFormula() {
		return this.formula;
	}

	public String getAmount() {
		return this.amount;
	}

}

@@ -136,12 +136,14 @@
 tree
+ 
 view
+.
 %0A *%0A
@@ -157,14 +157,19 @@
 hor 
-s
+S
 teven
+ Post
 %0A *%0A
@@ -207,444 +207,1061 @@
 a %7B%0A
-%09private final Formula formula;%0A%09private final String amount;%0A%0A%09public TreeViewFormula(final Formula formula) %7B%0A%09%09this.formula = formula;%0A%09%09this.amount = %22%22;%0A%09%7D%0A%0A%09public TreeViewFormula(final Ingredient ingredient) %7B%0A%09%09this.formula = ingredient.getFormula();%0A%09%09this.amount = ingredient.getAmount();%0A%09%7D%0A%0A%09@Override%0A%09public String toString() %7B%0A%09%09return this.formula.getName();%0A%09%7D%0A%0A%09public Formula getFormula() %7B%0A%09%09return this.formula;%0A%09%7D%0A
+%0A%09/** The formula this object represents */%0A%09private final Formula formula;%0A%0A%09/** The amount of this formula in the total view of the tree */%0A%09private final String amount;%0A%0A%09/**%0A%09 * Constructor.%0A%09 *%0A%09 * @param formula The formula this object needs to represent%0A%09 */%0A%09public TreeViewFormula(final Formula formula) %7B%0A%09%09this.formula = formula;%0A%09%09this.amount = %22%22;%0A%09%7D%0A%0A%09/**%0A%09 * Constructor.%0A%09 *%0A%09 * @param ingredient The ingredient this object needs to represent%0A%09 */%0A%09public TreeViewFormula(final Ingredient ingredient) %7B%0A%09%09this.formula = ingredient.getFormula();%0A%09%09this.amount = ingredient.getAmount();%0A%09%7D%0A%0A%09/**%0A%09 * A toString implementation%0A%09 *%0A%09 * @return name of the formula this object represents%0A%09 */%0A%09@Override%0A%09public String toString() %7B%0A%09%09return this.formula.getName();%0A%09%7D%0A%0A%09/**%0A%09 * Getter for the formula that this object is representing.%0A%09 *%0A%09 * @return The formula this object is representing%0A%09 */%0A%09public Formula getFormula() %7B%0A%09%09return this.formula;%0A%09%7D%0A%0A%09/**%0A%09 * Getter for the amount of this formula in the whole.%0A%09 * @return the amount%0A%09 */
 %0A%09pu

Fix multiple PMD errors