/** * Gets the closest monitor given an anchor and the subject area. * * @param area the subject area * @param anchor the anchor * @return the monitor closest to the edge of <code>area</code> defined by * <code>anchor</code> * @since 3.3 */ private Monitor getClosestMonitor(Rectangle area, Anchor anchor) { Point center; if (ANCHOR_GLOBAL == anchor) center= Geometry.centerPoint(area); else center= Geometry.centerPoint(Geometry.getExtrudedEdge(area, 0, anchor.getSWTFlag())); return getClosestMonitor(fSubjectControl.getDisplay(), Geometry.createRectangle(center, new Point(0, 0))); }
protected Point computePopupLocation() { if (popup == null || popup.isDisposed()) return null; LinkedPosition position = renameLinkedMode.getCurrentLinkedPosition(); if (position == null) return null; ISourceViewer viewer = editor.getInternalSourceViewer(); ITextViewerExtension5 viewer5 = (ITextViewerExtension5) viewer; int widgetOffset = viewer5.modelOffset2WidgetOffset(position.offset); StyledText textWidget = viewer.getTextWidget(); Point pos = textWidget.getLocationAtOffset(widgetOffset); Point pSize = getExtent(); pSize.y += HAH + 1; pos.x -= HAO; pos.y += textWidget.getLineHeight(widgetOffset); Point dPos = textWidget.toDisplay(pos); Rectangle displayBounds = textWidget.getDisplay().getClientArea(); Rectangle dPopupRect = Geometry.createRectangle(dPos, pSize); Geometry.moveInside(dPopupRect, displayBounds); return new Point(dPopupRect.x, dPopupRect.y); }
Geometry.createRectangle(LOCATIONS[0], pSize), Geometry.createRectangle(LOCATIONS[1], pSize), new Rectangle(LOCATIONS[2].x, LOCATIONS[2].y + HAH, pSize.x, pSize.y), Geometry.createRectangle(LOCATIONS[3], pSize), Geometry.createRectangle(LOCATIONS[4], pSize) }; final Rectangle MOUSE_MOVE_SOURCE= new Rectangle(1000000, 0, 0, 0);
Geometry.createRectangle(LOCATIONS[0], pSize), Geometry.createRectangle(LOCATIONS[1], pSize), new Rectangle(LOCATIONS[2].x, LOCATIONS[2].y + HAH, pSize.x, pSize.y), Geometry.createRectangle(LOCATIONS[3], pSize), Geometry.createRectangle(LOCATIONS[4], pSize) }; final Rectangle MOUSE_MOVE_SOURCE= new Rectangle(1000000, 0, 0, 0);
Point dPos= textWidget.toDisplay(pos); Rectangle displayBounds= textWidget.getDisplay().getClientArea(); Rectangle dPopupRect= Geometry.createRectangle(dPos, pSize); Geometry.moveInside(dPopupRect, displayBounds); return new Point(dPopupRect.x, dPopupRect.y); Rectangle dPopupRect= Geometry.createRectangle(dPos, pSize); Geometry.moveInside(dPopupRect, displayBounds); return new Point(dPopupRect.x, dPopupRect.y);
Point dPos= textWidget.toDisplay(pos); Rectangle displayBounds= textWidget.getDisplay().getClientArea(); Rectangle dPopupRect= Geometry.createRectangle(dPos, pSize); Geometry.moveInside(dPopupRect, displayBounds); return new Point(dPopupRect.x, dPopupRect.y); Rectangle dPopupRect= Geometry.createRectangle(dPos, pSize); Geometry.moveInside(dPopupRect, displayBounds); return new Point(dPopupRect.x, dPopupRect.y);
Point dPos= textWidget.toDisplay(pos); Rectangle displayBounds= textWidget.getDisplay().getClientArea(); Rectangle dPopupRect= Geometry.createRectangle(dPos, pSize); Geometry.moveInside(dPopupRect, displayBounds); return new Point(dPopupRect.x, dPopupRect.y); Rectangle dPopupRect= Geometry.createRectangle(dPos, pSize); Geometry.moveInside(dPopupRect, displayBounds); return new Point(dPopupRect.x, dPopupRect.y);
location= computeInformationControlLocation(subjectArea, size); Rectangle controlBounds= Geometry.createRectangle(location, size); cropToClosestMonitor(controlBounds); location= Geometry.getLocation(controlBounds);
location= computeInformationControlLocation(subjectArea, size); Rectangle controlBounds= Geometry.createRectangle(location, size); cropToClosestMonitor(controlBounds); location= Geometry.getLocation(controlBounds);
validateSelectionRange(widgetSelection); if (widgetSelection[0] >= 0) { fTextWidget.setBlockSelectionBounds(Geometry.createRectangle(startLocation, Geometry.subtract(endLocation, startLocation))); selectionChanged(startOffset, widgetLength);
validateSelectionRange(widgetSelection); if (widgetSelection[0] >= 0) { fTextWidget.setBlockSelectionBounds(Geometry.createRectangle(startLocation, Geometry.subtract(endLocation, startLocation))); selectionChanged(startOffset, widgetLength);