Package org.rstudio.core.client

Examples of org.rstudio.core.client.Size


   }
  
   @Override
   public void onPlotsZoomSizeChanged(PlotsZoomSizeChangedEvent event)
   {
      zoomWindowDefaultSize_ = new Size(event.getWidth(), event.getHeight());
   }
View Full Code Here


                                          items);
     
      // open the window
      satelliteManager_.openSatellite("review_changes",    
                                      params,
                                      new Size(1000,1200));
   }
View Full Code Here

   }
  
   @Handler
   public void onViewerZoom()
   {
      Size windowSize = ZoomUtils.getZoomWindowSize(
            display_.getViewerFrameSize(), zoomWindowDefaultSize_);

      // open and activate window
      NewWindowOptions options = new NewWindowOptions();
      options.setName("_rstudio_viewer_zoom");
View Full Code Here

                                   Operation doNotAcceptOperation,
                                   Operation acceptOperation)
   {
      super(title,
            contents,
            new Size(800, 1000));
     
      doNotAcceptOperation_ = doNotAcceptOperation;
      acceptOperation_ = acceptOperation ;
   }
View Full Code Here

      // by the satellite within the call to registerAsSatellite)
      if (params != null)
         satelliteParams_.put(name, params);
      // set size and position, if desired
      Size windowSize = adjustSize ?
            ScreenUtils.getAdjustedWindowSize(preferredSize) :
            preferredSize;
      NewWindowOptions options = new NewWindowOptions();
      if (position != null)
         options.setPosition(position);
View Full Code Here

   // if responding to a UI event, use openSatellite instead, since Chrome
   // permits window.open to reactivate windows in that context.
   public void forceReopenSatellite(final String name,
                                    final JavaScriptObject params)
   {
      Size preferredSize = null;
      Point preferredPos = null;
      for (ActiveSatellite satellite : satellites_)
      {
         if (satellite.getName().equals(name) &&
             !satellite.getWindow().isClosed())
         {
            // save the window's geometry so we can restore it after the window
            // is destroyed
            final WindowEx win = satellite.getWindow();
            Document doc = win.getDocument();
            preferredSize = new Size(doc.getClientWidth(), doc.getClientHeight());
            preferredPos = new Point(win.getLeft(), win.getTop());
            callNotifyPendingReactivate(win);

            // close the window
            try
            {
               win.close();
            }
            catch(Throwable e)
            {
            }
            break;
         }
      }  
     
      // didn't find an open window to reopen
      if (preferredSize == null)
         return;
     
      // open a new window with the same geometry as the one we just destroyed,
      // but with the newly supplied set of parameters
      final Size windowSize = preferredSize;
      final Point windowPos = preferredPos;
      openSatellite(name, params, windowSize, false, windowPos);
   }
View Full Code Here

      // add it to the dom (hidden)
      RootPanel.get().add(measureHTML, -2000, -2000);
     
      // insert the text (preformatted) and measure it
      measureHTML.setHTML(html);
      Size textSize = new Size(measureHTML.getOffsetWidth(),
                               measureHTML.getOffsetHeight());
      RootPanel.get().remove(measureHTML);
     
      // return the size
      return textSize;
View Full Code Here

                                          Size minimumSize,
                                          int contentPad,
                                          int clientMargin)
   {
      // add the padding
      contentSize = new Size(contentSize.width + contentPad,
                             contentSize.height + contentPad);
     
      // enforce the minimum (if specified)
      if (minimumSize != null)
      {
         contentSize = new Size(Math.max(contentSize.width, minimumSize.width),
                                Math.max(contentSize.height, minimumSize.height));
      }
     
      // maximum is client area - (margin * 2)
      Size maximumSize = new Size(Window.getClientWidth() - (clientMargin*2),
                                  Window.getClientHeight() - (clientMargin*2));
      int width = Math.min(contentSize.width, maximumSize.width);
      int height = Math.min(contentSize.height, maximumSize.height);
      return new Size(width, height);
   }
View Full Code Here

   {
      // line numbers
      final int LINE_NUMBERS_WIDTH = 100;

      // calculate the size of the text the adjust for line numbers
      Size textSize = DomMetrics.measureCode(code);
      textSize = new Size(textSize.width + LINE_NUMBERS_WIDTH,
                          textSize.height);

      // compute the editor size
      Size minimumSize = new Size(300, 200);
      Size editorSize = DomMetrics.adjustedElementSize(textSize,
                                                       minimumSize,
                                                       contentPad,
                                                       clientMargin);
      return editorSize;
   }
View Full Code Here

   {
      int chromeHeight = 100;
      String format = getResult().getFormatName();
      if (format.equals(RmdOutputFormat.OUTPUT_IOSLIDES_PRESENTATION) ||
          format.equals(RmdOutputFormat.OUTPUT_SLIDY_PRESENTATION))
         return new Size(1100, 900 + chromeHeight);
      if (format.endsWith(RmdOutputFormat.OUTPUT_REVEALJS_PRESENTATION))
         return new Size(960, 700 + chromeHeight);
     
      // default size (html_document and others)
      return new Size(1020, 1000 + chromeHeight);
   }
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.