package gui.panels.agenda;

import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.JPanel;
import javax.swing.border.LineBorder;

@SuppressWarnings("serial")
public class InfoPane extends JPanel{
	
	private String festivalName;
	private String festivalInfo;
	private String actName;
	private String actInfo;	
	private InfoField upperPanel;
	private InfoField middlePanel;
	
	public InfoPane(String actName, String actInfo){
		
		this.festivalName = "Festival";
		this.festivalInfo = "Random Festival";
		this.actName = actName;
		this.actInfo = actInfo;
		this.setBackground(new Color(242,241,237));
		this.setBorder(new LineBorder(new Color(0, 0, 0), 1, true));
		this.setLayout(new GridBagLayout());
		this.setOpaque(false);
		this.setBackground(Color.WHITE);
		
		upperPanel = new InfoField(festivalName, festivalInfo);
		GridBagConstraints c = new GridBagConstraints();
        c.fill = GridBagConstraints.HORIZONTAL;
        c.anchor = GridBagConstraints.NORTH;
        c.insets = new Insets(0,20,0,20);
        c.gridx = 2;
        c.gridy = 0;
        c.weightx = 1.0;
        c.weighty = 0.0;   
		this.add(upperPanel,c);
		
		middlePanel = new InfoField(actName, actInfo);
		GridBagConstraints d = new GridBagConstraints();
		d = new GridBagConstraints();
		d.fill = GridBagConstraints.BOTH;
		d.insets = new Insets(0,20,0,20);
		d.gridx = 2;
        d.gridy = 1;    
        d.weightx = 1.0;
        d.weighty = 1.0;        
		this.add(middlePanel,d);
	}


	public void setMiddleText(String actName, String actInfo){
		
		middlePanel.setBorder(actName);
		middlePanel.setLabel(actInfo);
		
	}
}
