package com.uvigo.mhp;

import com.uvigo.mhp.ui.*;
import java.awt.*;

public class Page extends HPanel
{
    private Course course;
    protected int preferredWidth=-1;
    protected int preferredHeight=-1;
    
    public Course getCourse()
    {
        return course;
    }
    
    public void setCourse(Course c)
    {
        course=c;
    }
    
    // Si la pagina se muestra en un contenedor del frontend, este metodo
    // permite definir el tamano para hacer scroll.
    public Dimension getPreferredSize()
    {
        if ((preferredWidth>0) && (preferredHeight>0))
            return new Dimension(preferredWidth, preferredHeight);
        else
            return new Dimension(720,576);
    }
    
    public int getPreferredWidth()
    {
        return preferredWidth;
    }
    
    public void setPreferredWidth(int m)
    {
        int old=preferredWidth;
        if (m!=old)
        {
            preferredWidth=m;
            firePropertyChange("preferredWidth", new Integer(old), new Integer(m));
        }
    }
    
    public int getPreferredHeight()
    {
        return preferredHeight;
    }
    
    public void setPreferredHeight(int m)
    {
        int old=preferredHeight;
        if (m!=old)
        {
            preferredHeight=m;
            firePropertyChange("preferredHeight", new Integer(old), new Integer(m));
        }
    }
  
}