@Override protected Point computeLocation(Rectangle subjectArea, Point controlSize, Anchor anchor) { MouseEvent event= getHoverEvent(); IAnnotationHover hover= getHover(event); boolean allowMouseExit= false; if (hover instanceof IAnnotationHoverExtension) { IAnnotationHoverExtension extension= (IAnnotationHoverExtension) hover; allowMouseExit= extension.canHandleMouseCursor(); } boolean hideOnMouseWheel= true; if (hover instanceof IAnnotationHoverExtension2) { IAnnotationHoverExtension2 extension= (IAnnotationHoverExtension2) hover; hideOnMouseWheel= !extension.canHandleMouseWheel(); } fHideOnMouseWheel= hideOnMouseWheel; if (allowMouseExit) { fAllowMouseExit= true; Control subjectControl= getSubjectControl(); // return a location that just overlaps the annotation on the bar if (anchor == AbstractInformationControlManager.ANCHOR_RIGHT) return subjectControl.toDisplay(subjectArea.x - 4, subjectArea.y - 2); else if (anchor == AbstractInformationControlManager.ANCHOR_LEFT) return subjectControl.toDisplay(subjectArea.x + subjectArea.width - controlSize.x + 4, subjectArea.y - 2); } fAllowMouseExit= false; return super.computeLocation(subjectArea, controlSize, anchor); }
@Override protected Point computeLocation(Rectangle subjectArea, Point controlSize, Anchor anchor) { MouseEvent event= getHoverEvent(); IAnnotationHover hover= getHover(event); boolean allowMouseExit= false; if (hover instanceof IAnnotationHoverExtension) { IAnnotationHoverExtension extension= (IAnnotationHoverExtension) hover; allowMouseExit= extension.canHandleMouseCursor(); } boolean hideOnMouseWheel= true; if (hover instanceof IAnnotationHoverExtension2) { IAnnotationHoverExtension2 extension= (IAnnotationHoverExtension2) hover; hideOnMouseWheel= !extension.canHandleMouseWheel(); } fHideOnMouseWheel= hideOnMouseWheel; if (allowMouseExit) { fAllowMouseExit= true; Control subjectControl= getSubjectControl(); // return a location that just overlaps the annotation on the bar if (anchor == AbstractInformationControlManager.ANCHOR_RIGHT) return subjectControl.toDisplay(subjectArea.x - 4, subjectArea.y - 2); else if (anchor == AbstractInformationControlManager.ANCHOR_LEFT) return subjectControl.toDisplay(subjectArea.x + subjectArea.width - controlSize.x + 4, subjectArea.y - 2); } fAllowMouseExit= false; return super.computeLocation(subjectArea, controlSize, anchor); }