package simogl.gui;

import javax.swing.BorderFactory;
import javax.swing.border.BevelBorder;
import javax.swing.border.TitledBorder;
import org.jdesktop.layout.GroupLayout;
import org.jdesktop.layout.LayoutStyle;
import javax.swing.JLabel;

/**
* 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 InfoPanel extends javax.swing.JPanel {
	private JLabel labelTaxes;
	private JLabel labelInhabitants;
	private JLabel labelBuildingName;
	private static JLabel labelbuildingNameValue;
	private static JLabel labelInhabitantsValue;
	private static JLabel labelTaxesValue;
	private static JLabel labelRunCost;
	private static JLabel labelRunCostValue;

	public InfoPanel() {
		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), "Building Info", TitledBorder.LEADING, TitledBorder.TOP, new java.awt.Font("Dialog",1,16)));			
			this.setPreferredSize(new java.awt.Dimension(171, 114));
			this.setFont(new java.awt.Font("Dialog",0,20));

			labelInhabitants = new JLabel();
			labelInhabitants.setText("Inhabitants:");

			labelTaxes = new JLabel();
			labelTaxes.setText("Taxes:");
			{
				labelBuildingName = new JLabel();
				labelBuildingName.setText("Building:");
			}
			{
				labelbuildingNameValue = new JLabel();
				labelbuildingNameValue.setText("n/a");
			}
			{
				labelInhabitantsValue = new JLabel();
				labelInhabitantsValue.setText("n/a");
			}
			{
				labelTaxesValue = new JLabel();
				labelTaxesValue.setText("n/a");
			}
			{
				labelRunCost = new JLabel();
				labelRunCost.setText("Reg. Costs:");
			}
			{
				labelRunCostValue = new JLabel();
				labelRunCostValue.setText("n/a");
			}

				thisLayout.setHorizontalGroup(thisLayout.createSequentialGroup()
			    .add(thisLayout.createParallelGroup()
			        .add(GroupLayout.LEADING, labelBuildingName, GroupLayout.PREFERRED_SIZE, 74, GroupLayout.PREFERRED_SIZE)
			        .add(GroupLayout.LEADING, labelInhabitants, GroupLayout.PREFERRED_SIZE, 74, GroupLayout.PREFERRED_SIZE)
			        .add(GroupLayout.LEADING, labelTaxes, GroupLayout.PREFERRED_SIZE, 74, GroupLayout.PREFERRED_SIZE)
			        .add(GroupLayout.LEADING, labelRunCost, GroupLayout.PREFERRED_SIZE, 74, GroupLayout.PREFERRED_SIZE))
			    .addPreferredGap(LayoutStyle.RELATED)
			    .add(thisLayout.createParallelGroup()
			        .add(GroupLayout.LEADING, labelbuildingNameValue)
			        .add(GroupLayout.LEADING, labelInhabitantsValue)
			        .add(GroupLayout.LEADING, labelTaxesValue)
			        .add(GroupLayout.LEADING, labelRunCostValue))
			    .addContainerGap(63, 63));
				thisLayout.setVerticalGroup(thisLayout.createSequentialGroup()
			    .add(thisLayout.createParallelGroup()
			        .add(GroupLayout.BASELINE, labelBuildingName)
			        .add(GroupLayout.BASELINE, labelbuildingNameValue))
			    .addPreferredGap(LayoutStyle.RELATED)
			    .add(thisLayout.createParallelGroup()
			        .add(GroupLayout.BASELINE, labelInhabitants)
			        .add(GroupLayout.BASELINE, labelInhabitantsValue))
			    .addPreferredGap(LayoutStyle.RELATED)
			    .add(thisLayout.createParallelGroup()
			        .add(GroupLayout.BASELINE, labelTaxes)
			        .add(GroupLayout.BASELINE, labelTaxesValue))
			    .addPreferredGap(LayoutStyle.RELATED)
			    .add(thisLayout.createParallelGroup()
			        .add(GroupLayout.BASELINE, labelRunCost)
			        .add(GroupLayout.BASELINE, labelRunCostValue))
			    .add(7));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	/**
	 * Sets the label for the building name to the specified value
	 * @param label value for the building name label
	 */
	public static void setLabelBuildingName(String label)
	{
		labelbuildingNameValue.setText(label);
	}
	
	/**
	 * Sets the label for the inhabitants number to the specified value
	 * @param label value for the inhabitants label
	 */
	public static void setLabelInhabitants(String label)
	{
		labelInhabitantsValue.setText(label);
	}
	
	/**
	 * Sets the label for the taxes to the specified value
	 * @param label value for the taxes label
	 */
	public static void setLabelTaxes(String label)
	{
		labelTaxesValue.setText(label);
	}
	
	/**
	 * Sets the label for the running cost to the specified value
	 * @param label value for the running cost label
	 */
	public static void setLabelRunningCost(String label)
	{
		labelRunCostValue.setText(label);
	}
}
