protected void drawRect( Rectangle rect ) { if ( rect == null ) { return; } gc.setLineStyle( ELineStyle.DASHDOT ); gc.setLineWidth( linewidth ); gc.setForeground( EColor.GRAY ); // PDI-2619: SWT on Windows doesn't cater for negative rect.width/height so handle here. Point s = real2screen( rect.x, rect.y ); if ( rect.width < 0 ) { s.x = s.x + rect.width; } if ( rect.height < 0 ) { s.y = s.y + rect.height; } gc.drawRectangle( s.x, s.y, Math.abs( rect.width ), Math.abs( rect.height ) ); gc.setLineStyle( ELineStyle.SOLID ); }
gc.setForeground( EColor.BACKGROUND ); gc.setLineStyle( ELineStyle.SOLID ); gc.drawRectangle( x + 1, y + 1, iconsize - 2, iconsize - 2 ); gc.drawRectangle( x + 1, y + 1, iconsize - 2, iconsize - 2 ); } else { gc.setForeground( EColor.DARKGRAY ); gc.setLineStyle( ELineStyle.SOLID ); gc.drawRectangle( x + 1, y + 1, iconsize - 2, iconsize - 2 ); gc.drawRectangle( x + 1, y + 1, iconsize - 2, iconsize - 2 );
private void drawDurations( List<MetricsDuration> durations, List<MetricsDrawArea> areas, double pixelsPerMs ) { // set top indent int y = 20; for ( MetricsDuration duration : durations ) { Long realDuration = duration.getEndDate().getTime() - duration.getDate().getTime(); // How many pixels does it take to drawn this duration? // int durationWidth = (int) ( realDuration * pixelsPerMs ); int x = 2 + (int) ( ( duration.getDate().getTime() - periodStart ) * pixelsPerMs ); getGc().setBackground( EColor.BACKGROUND ); getGc().setForeground( EColor.LIGHTBLUE ); getGc().fillGradientRectangle( x, y, durationWidth, barHeight, false ); getGc().setForeground( EColor.BLACK ); getGc().drawRectangle( x, y, durationWidth, barHeight ); areas.add( new MetricsDrawArea( new Rectangle( x, y, durationWidth, barHeight ), duration ) ); LoggingObjectInterface loggingObject = LoggingRegistry.getInstance().getLoggingObject( duration.getLogChannelId() ); String message = duration.getDescription() + " - " + loggingObject.getObjectName() + " : " + duration.getDuration() + "ms"; if ( duration.getCount() > 1 ) { message += " " + duration.getCount() + " calls, avg=" + ( duration.getDuration() / duration.getCount() ); } getGc().setFont( EFont.GRAPH ); getGc().textExtent( message ); getGc().drawText( message, x + 3, y + 4, true ); y += barHeight + 5; } }
gc.drawRectangle( point.x, point.y, textExtent.x, textExtent.y ); gc.drawText( nrInput, point.x + 1, point.y + 1 ); gc.drawRectangle( point.x, point.y, textExtent.x, textExtent.y ); gc.drawText( nrOutput, point.x + 1, point.y + 1 ); gc.drawRectangle( point.x, point.y, textExtent.x, textExtent.y ); gc.drawText( nrInput, point.x + 1, point.y + 1 );
gc.setForeground( EColor.BLACK ); Point screen = real2screen( drop_candidate.x, drop_candidate.y ); gc.drawRectangle( screen.x, screen.y, iconsize, iconsize );
gc.setForeground( EColor.BLACK ); Point screen = real2screen( drop_candidate.x, drop_candidate.y ); gc.drawRectangle( screen.x, screen.y, iconsize, iconsize );