Package org.rstudio.core.client

Examples of org.rstudio.core.client.Rectangle


      Document doc = win.getDocument();
      NodeList<Element> images = doc.getElementsByTagName("img");
      if (images.getLength() > 0)
      {
         ElementEx img = images.getItem(0).cast();
         return new Rectangle(img.getClientLeft(),
                              img.getClientTop(),
                              img.getClientWidth(),
                              img.getClientHeight());
      }
      else
      {
         return new Rectangle(0,0,0,0);
      }
   }
View Full Code Here


   public void highlightRows(int offset, int length)
   {
      historyTable_.clearSelection();
      historyTable_.setSelected(offset, length, true);

      Rectangle rect = historyTable_.getSelectionRect();
      if (rect == null)
         return;
      int height = scrollPanel_.getOffsetHeight();
      if (rect.getHeight() > height)
         scrollPanel_.setVerticalScrollPosition(rect.getTop());
      else
         scrollPanel_.setVerticalScrollPosition(
               rect.getTop() - (height - rect.getHeight())/2);
   }
View Full Code Here

            // hide gripper
            sizeEditor.setGripperVisible(false);
           
            // get the preview iframe rect
            ElementEx iframe = sizeEditor.getPreviewIFrame().<ElementEx>cast();
            final Rectangle viewerRect = new Rectangle(
                   iframe.getClientLeft(),
                   iframe.getClientTop(),
                   iframe.getClientWidth(),
                   iframe.getClientHeight()).inflate(-1);
           
View Full Code Here

   {
      // Inflate the bounds by 10 pixels to add a little air
      boundsToAvoid_ = selectionBounds.inflate(10);
      if (isShowing())
      {
         Rectangle screen = new Rectangle(0, 0,
                                          Window.getClientWidth(),
                                          Window.getClientHeight());

         Rectangle bounds = new Rectangle(getPopupLeft(),
                                          getPopupTop(),
                                          getOffsetWidth(),
                                          getOffsetHeight());

         // In case user moved the dialog off the screen
         bounds = bounds.attemptToMoveInto(screen, FailureMode.NO_CHANGE);

         // Now avoid the selected word
         move(bounds.avoidBounds(boundsToAvoid_, screen), true);
      }
   }
View Full Code Here

      setPopupPositionAndShow(new PositionCallback()
      {
         @Override
         public void setPosition(int offsetWidth, int offsetHeight)
         {
            Rectangle screen = new Rectangle(0, 0,
                                             Window.getClientWidth(),
                                             Window.getClientHeight());

            Rectangle bounds = screen.createCenteredRect(offsetWidth,
                                                         offsetHeight);

            move(bounds.avoidBounds(boundsToAvoid_, screen), false);

            onCompleted.execute();
         }
      });
   }
View Full Code Here

                  range.getStart().getRow(),
                  range.getStart().getColumn());
      ScreenCoordinates end = renderer.textToScreenCoordinates(
                  range.getEnd().getRow(),
                  range.getEnd().getColumn());
      return new Rectangle(start.getPageX(),
                           start.getPageY(),
                           end.getPageX() - start.getPageX(),
                           renderer.getLineHeight());
   }
View Full Code Here

      ScreenCoordinates start = renderer.textToScreenCoordinates(
            pos.getRow(),
            pos.getColumn());

      return new Rectangle(start.getPageX(), start.getPageY(),
                           (int) Math.round(renderer.getCharacterWidth()),
                           (int) (renderer.getLineHeight() * 0.8));
   }
View Full Code Here

                           (int) (renderer.getLineHeight() * 0.8));
   }

   public Rectangle getBounds()
   {
      return new Rectangle(
            widget_.getAbsoluteLeft(),
            widget_.getAbsoluteTop(),
            widget_.getOffsetWidth(),
            widget_.getOffsetHeight());
   }
View Full Code Here

         public void setPosition(int offsetWidth, int offsetHeight)
         {
            InputEditorPosition position =
               docDisplay_.createInputEditorPosition(
                                    completionPosition_.getPosition())
            Rectangle bounds = docDisplay_.getPositionBounds(position);
           
            int windowBottom = Window.getScrollTop() +
                               Window.getClientHeight() ;
            int cursorBottom = bounds.getBottom() ;
           
            // figure out whether we should show below (do this
            // only once so that we maintain the menu orientation
            // while filtering)
            if (showBelow_ == null)
               showBelow_ = windowBottom - cursorBottom >= offsetHeight;
           
            final int PAD = 3;
            if (showBelow_)
               setPopupPosition(bounds.getLeft(), cursorBottom + PAD) ;
            else
               setPopupPosition(bounds.getLeft(),
                                bounds.getTop() - offsetHeight) ;
         }
      });
   }
View Full Code Here

                  popup_.setMaxWidth(input_.getBounds().getWidth());
                  popup_.setPopupPositionAndShow(new PositionCallback()
                  {
                     public void setPosition(int offsetWidth, int offsetHeight)
                     {
                        Rectangle bounds = input_.getBounds();

                        int top = bounds.getTop() - offsetHeight;
                        if (top < 20)
                           top = bounds.getBottom();

                        popup_.selectLast();
                        popup_.setPopupPosition(bounds.getLeft() - 6, top);
                     }
                  });

                  popup_.addSelectionCommitHandler(new SelectionCommitHandler<String>()
                  {
View Full Code Here

TOP

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

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.