void drawTimeScaleLine( int height, double pixelsPerMs, long periodInMs ) { int log10 = (int) Math.log10( periodInMs ) + 1; int timeLineDistance = (int) Math.pow( 10, log10 - 1 ) / 2; int incrementUnit = Math.max( timeLineDistance, 1 ); for ( int time = timeLineDistance; time <= periodInMs; time += incrementUnit ) { int x = (int) ( time * pixelsPerMs ); getGc().setForeground( EColor.LIGHTGRAY ); getGc().drawLine( x, 0, x, height ); String marker = Integer.toString( time ); Point point = getGc().textExtent( marker ); getGc().setForeground( EColor.DARKGRAY ); getGc().drawText( marker, x - ( point.x / 2 ), 0, true ); } }
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.setLineWidth( linewidth + 1 ); if ( System.currentTimeMillis() % 2000 > 1000 ) { gc.setForeground( EColor.BACKGROUND ); gc.setLineStyle( ELineStyle.SOLID ); gc.drawRectangle( x + 1, y + 1, iconsize - 2, iconsize - 2 ); gc.setForeground( EColor.DARKGRAY ); gc.setLineStyle( ELineStyle.DOT ); 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.setForeground( EColor.BACKGROUND ); gc.setLineStyle( ELineStyle.DOT ); gc.drawRectangle( x + 1, y + 1, iconsize - 2, iconsize - 2 );
gc.setForeground( col ); gc.setLineStyle( linestyle ); gc.setLineWidth( activeLinewidth ); gc.setForeground( EColor.BLACK ); gc.setBackground( EColor.BACKGROUND ); gc.setLineStyle( ELineStyle.SOLID );
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; } }
Point to = endHopLocation; if ( endHopEntry == null ) { gc.setForeground( EColor.GRAY ); arrow = EImage.ARROW_DISABLED; } else { gc.setForeground( EColor.BLUE ); arrow = EImage.ARROW_DEFAULT; Point to = endHopEntry.getLocation(); if ( startHopEntry == null ) { gc.setForeground( EColor.GRAY ); arrow = EImage.ARROW_DISABLED; } else { gc.setForeground( EColor.BLUE ); arrow = EImage.ARROW_DEFAULT; gc.setForeground( EColor.RED ); Point n = noInputEntry.getLocation(); gc.drawLine( offset.x + n.x - 5, offset.y + n.y - 5, offset.x + n.x + iconsize + 5, offset.y gc.setForeground( EColor.BLACK ); Point screen = real2screen( drop_candidate.x, drop_candidate.y ); gc.drawRectangle( screen.x, screen.y, iconsize, iconsize );
gc.setForeground( EColor.RED ); } else if ( jobEntryCopy.isDeprecated() ) { gc.setForeground( EColor.DEPRECATED ); } else { gc.setForeground( EColor.CRYSTAL ); gc.setForeground( EColor.CRYSTAL ); Point textsize = new Point( gc.textExtent( "" + name ).x, gc.textExtent( "" + name ).y ); gc.setForeground( EColor.BLACK ); gc.drawText( name, xpos, ypos, true ); gc.setForeground( EColor.BLUE ); int iconX = ( x + iconsize ) - ( MINI_ICON_SIZE / 2 ); int iconY = y - ( MINI_ICON_SIZE / 2 ); areaOwners.add( new AreaOwner( AreaType.JOB_ENTRY_BUSY, iconX, iconY, MINI_ICON_SIZE, MINI_ICON_SIZE, offset, subject, jobEntryCopy ) ); } else { gc.setForeground( EColor.BLACK ); gc.setForeground( EColor.CRYSTAL ); gc.setBackground( EColor.CRYSTAL ); gc.setLineWidth( 1 ); gc.setForeground( EColor.WHITE ); gc.setForeground( EColor.CRYSTAL ); gc.setBackground( EColor.CRYSTAL );
gc.setForeground( EColor.GRAY ); gc.setBackground( EColor.BACKGROUND ); gc.setFont( EFont.GRAPH ); gc.setForeground( EColor.GRAY ); gc.setBackground( EColor.BACKGROUND ); gc.setFont( EFont.GRAPH ); gc.setForeground( EColor.RED ); gc.setBackground( EColor.BACKGROUND ); gc.setFont( EFont.GRAPH ); gc.setForeground( EColor.GRAY ); gc.drawText( Const.NVL( partitionSchema.getName(), "<no partition name>" ), point.x, point.y + textExtent.y + 3, true ); gc.drawStepIcon( x, y, stepMeta, magnification ); if ( stepError || stepMeta.isMissing() ) { gc.setForeground( EColor.RED ); } else if ( isDeprecated ) { gc.setForeground( EColor.DEPRECATED ); } else { gc.setForeground( EColor.CRYSTAL ); gc.setForeground( EColor.DEPRECATED ); } else { gc.setForeground( 0, 93, 166 ); gc.setForeground( EColor.BLACK );
gc.setForeground( col ); gc.setForeground( EColor.BLACK ); gc.setBackground( EColor.BACKGROUND ); gc.setLineStyle( ELineStyle.SOLID );
gc.setForeground( EColor.DARKGRAY ); gc.setBackground( EColor.LIGHTGRAY ); gc.setLineWidth( 1 ); int rowX = popupX + MINI_ICON_MARGIN; gc.setForeground( EColor.BLACK ); gc.setBackground( EColor.BACKGROUND );
Point to = endHopLocation; if ( endHopStep == null ) { gc.setForeground( EColor.GRAY ); arrow = EImage.ARROW_DISABLED; } else { gc.setForeground( EColor.BLUE ); arrow = EImage.ARROW_DEFAULT; Point to = endHopStep.getLocation(); if ( startHopStep == null ) { gc.setForeground( EColor.GRAY ); arrow = EImage.ARROW_DISABLED; } else { gc.setForeground( EColor.BLUE ); arrow = EImage.ARROW_DEFAULT; gc.setForeground( EColor.RED ); Point n = noInputStep.getLocation(); gc.drawLine( n.x - 5, n.y - 5, n.x + iconsize + 10, n.y + iconsize + 10 ); gc.setForeground( EColor.BLACK ); Point screen = real2screen( drop_candidate.x, drop_candidate.y ); gc.drawRectangle( screen.x, screen.y, iconsize, iconsize );
gc.setForeground( notePadMeta.getBorderColorRed(), notePadMeta.getBorderColorGreen(), notePadMeta .getBorderColorBlue() ); gc.setForeground( notePadMeta.getFontColorRed(), notePadMeta.getFontColorGreen(), notePadMeta .getFontColorBlue() ); gc.drawText( notePadMeta.getNote(), note.x + margin, note.y + margin, true );