package kz.cafe.admin.panels;

import com.vaadin.*;

public class Dimension implements java.io.Serializable{
   private static final long serialVersionUID = -8489880506316386655L;
   
   
   public final int iWidth;
   public final int iHeight;
   
   
   public Dimension(int iWidth, int iHeight){
      this.iWidth = iWidth;
      this.iHeight = iHeight;
   }
   
   
   
   
   
   public static Dimension getFull(Application application){

      int iHeight = 1280;
      int iWidth = 1024;

      iHeight = (int) application.getMainWindow().getHeight();
      iWidth  = (int) application.getMainWindow().getWidth();
      
      return new Dimension(iWidth, iHeight);
   }

   
   


   public static Dimension get80(Application application){
      Dimension dim = getFull(application);
      return new Dimension(dim.iWidth * 8 / 10, dim.iHeight * 8 / 10);
   }





   public static Dimension get50(Application application){
      Dimension dim = getFull(application);
      return new Dimension(dim.iWidth / 2, dim.iHeight / 2);
   }
}
