Package org.rstudio.core.client

Examples of org.rstudio.core.client.Size


      {
         final int PADDING = 20;
  
         // calculate ideal heigh and width. try to be as large as possible
         // within the bounds of the current client size
         Size bounds = new Size(Window.getClientWidth() - PADDING,
                                Window.getClientHeight() - PADDING);
  
         float widthRatio = bounds.width / ((float)sourceFrameSize.width);
         float heightRatio = bounds.height / ((float)sourceFrameSize.height);
         float ratio = Math.min(widthRatio, heightRatio);
  
         // constrain initial width to between 300 and 1,200 pixels
         width = Math.max(300, (int) (ratio * sourceFrameSize.width));
         width = Math.min(1200, width);
        
         // constrain initial height to between 300 and 900 pixels
         height = Math.max(300, (int) (ratio * sourceFrameSize.height));
         height = Math.min(900, height);
      }
     
      return new Size(width, height);
   }
View Full Code Here


     
      // constrain height
      int height = Math.max(minSize.height, (int) (ratio * size.height));
      height = Math.min(maxSize.height, height);
     
      return new Size(width, height);
   }
View Full Code Here

TOP

Related Classes of org.rstudio.core.client.Size

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.