Package org.rstudio.core.client

Examples of org.rstudio.core.client.Point


         {
            Element el = inputPanel_.getElement();
            int x = event.getNativeEvent().getClientX();
            int y = event.getNativeEvent().getClientY();

            Point p = new Point(
                  x - el.getAbsoluteLeft(), y - el.getAbsoluteTop());

            showFeedbackAt(p);

            SelectionEvent.fire(LocatorPanel.this, p);
View Full Code Here


            tocAnchor.addClickHandler(new ClickHandler()
            {
               @Override
               public void onClick(ClickEvent event)
               {
                  Point relativePosition = DomUtils.getRelativePosition(
                        container_.getElement(),
                        diffFrame.getElement());
                  container_.setVerticalScrollPosition(relativePosition.getY());
               }
            });
            tocPanel_.add(tocAnchor);

            return true;
View Full Code Here

                  && event.getScreenY() == lastMouseMoveCoordinates_.getY())
            {
               return;
            }
         }
         lastMouseMoveCoordinates_ = new Point(event.getScreenX(),
                                               event.getScreenY());

         if (firstEvent_)
         {
            // Want to avoid the bug where the cursor happens to be positioned
View Full Code Here

         // We haven't gotten there yet--do nothing
      }
      else if (currentInputRow_ == row_ && inputColumn <= column_)
      {
         // Cursor position is inside the current chunk--nice!
         output_ = new Point(outputColumn + (column_ - inputColumn),
                             outputRow);
//         Debug.devlogf("exact: {0}, {1}", output_.getY(), output_.getX());
      }
      else
      {
//         Debug.devlog("slop");
         // We've gone past the cursor position; use the current insertion
         // point before we get any further away
         output_ = new Point(outputColumn, outputRow);
      }
   }
View Full Code Here

   // 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

   }-*/;

   public final Point getScrollPosition()
   {
      JsArrayInteger pos = getScrollPositionInternal();
      return new Point(pos.get(0), pos.get(1));
   }
View Full Code Here

         left += child.getOffsetLeft();
         top += child.getOffsetTop();
         child = child.getOffsetParent();
      }

      return new Point(left, top);
   }
View Full Code Here

      Date now = new Date();

      if (!isDoubleClick(event, now))
      {
         lastClickPos_ = new Point(event.getClientX(), event.getClientY());
         lastClickTime_ = now;
         return false;
      }
      else
      {
View Full Code Here

                        "height=" + height + "," +
                        "menubar=0,toolbar=0,location=" + loc + "," +
                        "status=0,scrollbars=1,resizable=1,directories=0";

      // open window at specific position if specified
      Point pos = options.getPosition();
      if (pos != null)
      {
         features += ",left=" + pos.x + ",top=" + pos.y;
      }
        
View Full Code Here

   private void openPdfUrl(final String url, final boolean synctex,
                           boolean restorePosition)
   {
      int width = 1070;
      int height = 1200;
      Point pos = null;
     
      // if there's a window open, restore the position when we're done
      if (restorePosition &&
          url.equals(lastSuccessfulPdfUrl_))
      {
         // if we don't have an active window, we'll use the hash stored when
         // the window closed
         if (haveActivePdfJsWindow())
            locationHash_ = pdfJsWindow_.getLocationHash();
         executeOnPdfLoad_ = createRestorePositionOperation();
      }
     
      // create the operation to load the PDF--we'll call this when the window
      // is finished opening, or immediately if there's already a window open
      Operation loadPdf = new Operation()
      {
         @Override
         public void execute()
         {
            pdfJsWindow_.openPdf(server_.getApplicationURL(url), 0, synctex);
            lastSuccessfulPdfUrl_ = url;
         }
      };

      // in the browser we need to close and reopen the window
      if (haveActivePdfJsWindow() && !Desktop.isDesktop())
      {
         width = pdfJsWindow_.getOuterWidth();
         height = pdfJsWindow_.getOuterHeight();
         pos = new Point(pdfJsWindow_.getLeft(), pdfJsWindow_.getTop());
         pdfJsWindow_.close();
         pdfJsWindow_ = null;
      }
     
      lastSuccessfulPdfUrl_ = null;
View Full Code Here

TOP

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

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.