package simogl.gui;
import javax.swing.BorderFactory;
import javax.swing.JLabel;

import javax.swing.JPanel;
import javax.swing.border.BevelBorder;
import javax.swing.border.TitledBorder;

import org.jdesktop.layout.GroupLayout;
import org.jdesktop.layout.LayoutStyle;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class BalancePanel extends JPanel
{
	private JLabel labelIncome;
	private JLabel labelCosts;
	private JLabel labelDivider;
	private static JLabel labelBalanceValue;
	private static JLabel labelCostsValue;
	private static JLabel labelIncomeValue;
	private JLabel labelBalance;
	public BalancePanel()
	{
		super();
		this.setFocusable(false);
		initGUI();
	}
	
	private void initGUI() {
		try {
			GroupLayout thisLayout = new GroupLayout(this);
			this.setLayout(thisLayout);
			this.setBorder(BorderFactory.createTitledBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED), "Balance", TitledBorder.LEADING, TitledBorder.TOP, new java.awt.Font("Dialog",1,16)));
			this.setPreferredSize(new java.awt.Dimension(172, 103));
			{
				labelIncome = new JLabel();
				labelIncome.setText("Tax income: ");
			}
			{
				labelCosts = new JLabel();
				labelCosts.setText("Reg. costs: ");
			}
			{
				labelDivider = new JLabel();
				labelDivider.setText("====================");
			}
			{
				labelBalance = new JLabel();
				labelBalance.setText("Result: ");
			}
			{
				labelIncomeValue = new JLabel();
				labelIncomeValue.setText("0 (max. 0)");
			}
			{
				labelCostsValue = new JLabel();
				labelCostsValue.setText("0");
			}
			{
				labelBalanceValue = new JLabel();
				labelBalanceValue.setText("0");
			}
				thisLayout.setHorizontalGroup(thisLayout.createSequentialGroup()
			    .add(6)
			    .add(thisLayout.createParallelGroup()
			        .add(thisLayout.createSequentialGroup()
			            .add(thisLayout.createParallelGroup()
			                .add(GroupLayout.LEADING, labelIncome)
			                .add(GroupLayout.LEADING, thisLayout.createSequentialGroup()
			                    .add(labelCosts)
			                    .addPreferredGap(LayoutStyle.RELATED))
			                .add(GroupLayout.LEADING, thisLayout.createSequentialGroup()
			                    .add(labelBalance)
			                    .add(24)))
			            .addPreferredGap(LayoutStyle.RELATED)
			            .add(thisLayout.createParallelGroup()
			                .add(GroupLayout.LEADING, labelIncomeValue)
			                .add(GroupLayout.LEADING, thisLayout.createSequentialGroup()
			                    .add(labelCostsValue, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE)
			                    .add(20))
			                .add(GroupLayout.LEADING, thisLayout.createSequentialGroup()
			                    .add(labelBalanceValue, GroupLayout.PREFERRED_SIZE, 27, GroupLayout.PREFERRED_SIZE)
			                    .add(23)))
			            .addContainerGap(37, 37))
			        .add(GroupLayout.LEADING, labelDivider, GroupLayout.PREFERRED_SIZE, 154, GroupLayout.PREFERRED_SIZE)));
				thisLayout.setVerticalGroup(thisLayout.createSequentialGroup()
			    .add(thisLayout.createParallelGroup()
			        .add(GroupLayout.BASELINE, labelIncome)
			        .add(GroupLayout.BASELINE, labelIncomeValue))
			    .addPreferredGap(LayoutStyle.RELATED)
			    .add(thisLayout.createParallelGroup()
			        .add(GroupLayout.BASELINE, labelCosts)
			        .add(GroupLayout.BASELINE, labelCostsValue))
			    .addPreferredGap(LayoutStyle.RELATED)
			    .add(labelDivider, 0, 10, Short.MAX_VALUE)
			    .addPreferredGap(LayoutStyle.RELATED)
			    .add(thisLayout.createParallelGroup()
			        .add(GroupLayout.BASELINE, labelBalance)
			        .add(GroupLayout.BASELINE, labelBalanceValue)));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Returns the label containing the balance text
	 * @return text of the balance label
	 */
	public static String getLabelBalance()
	{
		return labelBalanceValue.getText();
	}

	/**
	 * Sets the label containing the balance value to the 
	 * specified text
	 * @param label new text for the balance label value
	 */
	public static void setLabelBalance(String label)
	{
		labelBalanceValue.setText(label);
	}

	/**
	 * Returns the label containing the costs text
	 * @return text of the costs label
	 */
	public static String getLabelCosts()
	{
		return labelCostsValue.getText();
	}

	/**
	 * Sets the label containing the costs value to the 
	 * specified text
	 * @param label new text for the costs label value
	 */
	public static void setLabelCosts(String label)
	{
		labelCostsValue.setText(label);
	}

	/**
	 * Returns the label containing the income text
	 * @return text of the income label
	 */
	public static String getLabelIncome()
	{
		return labelIncomeValue.getText();
	}
	
	/**
	 * Sets the label containing the income value to the 
	 * specified text
	 * @param label new text for the income label value
	 */
	public static void setLabelIncome(String label)
	{
		labelIncomeValue.setText(label);
	}
}
