public Point getRealPosition( Composite canvas, int x, int y ) { Point p = new Point( 0, 0 ); Composite follow = canvas; while ( follow != null ) { org.eclipse.swt.graphics.Point loc = follow.getLocation(); Point xy = new Point( loc.x, loc.y ); p.x += xy.x; p.y += xy.y; follow = follow.getParent(); } int offsetX = -16; int offsetY = -64; if ( Const.isOSX() ) { offsetX = -2; offsetY = -24; } p.x = x - p.x + offsetX; p.y = y - p.y + offsetY; return screen2real( p.x, p.y ); }
@Override public void mouseHover( MouseEvent e ) { boolean tip = true; boolean isDeprecated = false; toolTip.hide(); toolTip.setHideDelay( TOOLTIP_HIDE_DELAY_SHORT ); Point real = screen2real( e.x, e.y ); AreaOwner areaOwner = getVisibleAreaOwner( real.x, real.y ); if ( areaOwner != null && areaOwner.getAreaType() != null ) { switch ( areaOwner.getAreaType() ) { case STEP_ICON: StepMeta stepMeta = (StepMeta) areaOwner.getOwner(); isDeprecated = stepMeta.isDeprecated(); if ( !stepMeta.isMissing() && !mouseOverSteps.contains( stepMeta ) ) { addStepMouseOverDelayTimer( stepMeta ); redraw(); tip = false; } break; default: break; } } // Show a tool tip upon mouse-over of an object on the canvas if ( ( tip && !helpTip.isVisible() ) || isDeprecated ) { setToolTip( real.x, real.y, e.x, e.y ); } }
iconoffset = new Point( 0, 0 ); Point real = screen2real( e.x, e.y ); Point icon = new Point( real.x - iconoffset.x, real.y - iconoffset.y ); AreaOwner areaOwner = getVisibleAreaOwner( real.x, real.y ); Point realclick = screen2real( e.x, e.y ); if ( lastclick.x == realclick.x && lastclick.y == realclick.y ) {
clearSettings(); Point real = screen2real( e.x, e.y );
toolTip.setHideDelay( TOOLTIP_HIDE_DELAY_SHORT ); Point real = screen2real( e.x, e.y );
Point real = screen2real( e.x, e.y ); lastclick = new Point( real.x, real.y );