public void paintControl( PaintEvent event ) { if ( image != null ) { event.gc.drawImage( image, 0, 0 ); } } } );
public void paintControl( PaintEvent event ) { if ( image != null && !image.isDisposed() ) { event.gc.drawImage( image, 0, 0 ); } } } );
public void drawImage( String location, ClassLoader classLoader, int x, int y ) { Image img = SwtSvgImageUtil.getImage( PropsUI.getDisplay(), classLoader, location, Math.round( small_icon_size * currentMagnification ), Math.round( small_icon_size * currentMagnification ) ); if ( img != null ) { Rectangle bounds = img.getBounds(); gc.drawImage( img, 0, 0, bounds.width, bounds.height, x, y, small_icon_size, small_icon_size ); } }
public void drawImage( String location, ClassLoader classLoader, int x, int y ) { Image img = SwtSvgImageUtil.getImage( PropsUI.getDisplay(), classLoader, location, Math.round( small_icon_size * currentMagnification ), Math.round( small_icon_size * currentMagnification ) ); if ( img != null ) { Rectangle bounds = img.getBounds(); gc.drawImage( img, 0, 0, bounds.width, bounds.height, x, y, small_icon_size, small_icon_size ); } }
public void drawImage( EImage image, int x, int y, float magnification, double angle ) { Image img = getNativeImage( image ).getAsBitmapForSize( gc.getDevice(), Math.round( small_icon_size * magnification ), Math.round( small_icon_size * magnification ), angle ); if ( img != null ) { Rectangle bounds = img.getBounds(); int hx = Math.round( bounds.width / magnification ); int hy = Math.round( bounds.height / magnification ); gc.drawImage( img, 0, 0, bounds.width, bounds.height, x - hx / 2, y - hy / 2, hx, hy ); } }
@Override public void drawImage( EImage image, int x, int y, float magnification, double angle ) { Image img = getNativeImage( image ).getAsBitmapForSize( gc.getDevice(), Math.round( small_icon_size * magnification ), Math.round( small_icon_size * magnification ), angle ); if ( img != null ) { Rectangle bounds = img.getBounds(); int hx = Math.round( bounds.width / magnification ); int hy = Math.round( bounds.height / magnification ); gc.drawImage( img, 0, 0, bounds.width, bounds.height, x - hx / 2, y - hy / 2, hx, hy ); } }
public void drawStepIcon( int x, int y, StepMeta stepMeta, float magnification ) { String steptype = stepMeta.getStepID(); Image im = images.get( steptype ).getAsBitmapForSize( gc.getDevice(), Math.round( iconsize * magnification ), Math.round( iconsize * magnification ) ); if ( im != null ) { // Draw the icon! org.eclipse.swt.graphics.Rectangle bounds = im.getBounds(); gc.drawImage( im, 0, 0, bounds.width, bounds.height, x, y, iconsize, iconsize ); } }
public void drawImage( EImage image, int x, int y, int width, int height, float magnification ) { Image img = getNativeImage( image ).getAsBitmapForSize( gc.getDevice(), Math.round( width * magnification ), Math.round( height * magnification ) ); if ( img != null ) { Rectangle bounds = img.getBounds(); gc.drawImage( img, 0, 0, bounds.width, bounds.height, x, y, width, height ); } }
public void drawImage( EImage image, int x, int y, int width, int height, float magnification ) { Image img = getNativeImage( image ).getAsBitmapForSize( gc.getDevice(), Math.round( width * magnification ), Math.round( height * magnification ) ); if ( img != null ) { Rectangle bounds = img.getBounds(); gc.drawImage( img, 0, 0, bounds.width, bounds.height, x, y, width, height ); } }
public void drawImage( EImage image, int x, int y, float magnification ) { Image img = getNativeImage( image ).getAsBitmapForSize( gc.getDevice(), Math.round( small_icon_size * magnification ), Math.round( small_icon_size * magnification ) ); if ( img != null ) { Rectangle bounds = img.getBounds(); gc.drawImage( img, 0, 0, bounds.width, bounds.height, x, y, small_icon_size, small_icon_size ); } }
public void drawImage( EImage image, int x, int y, float magnification ) { Image img = getNativeImage( image ).getAsBitmapForSize( gc.getDevice(), Math.round( small_icon_size * magnification ), Math.round( small_icon_size * magnification ) ); if ( img != null ) { Rectangle bounds = img.getBounds(); gc.drawImage( img, 0, 0, bounds.width, bounds.height, x, y, small_icon_size, small_icon_size ); } }
@Override public void drawImage( BufferedImage image, int x, int y ) { ImageData imageData = ImageUtil.convertToSWT( image ); Image swtImage = new Image( gc.getDevice(), imageData ); gc.drawImage( swtImage, x, y ); swtImage.dispose(); } }
@Override public void drawImage( BufferedImage image, int x, int y ) { ImageData imageData = ImageUtil.convertToSWT( image ); Image swtImage = new Image( gc.getDevice(), imageData ); gc.drawImage( swtImage, x, y ); swtImage.dispose(); } }
@Override protected Image renderSimple( Device device, int width, int height ) { int xsize = bitmap.getBounds().width; int ysize = bitmap.getBounds().height; Image result = new Image( device, width, height ); GC gc = new GC( result ); gc.drawImage( bitmap, 0, 0, xsize, ysize, 0, 0, width, height ); gc.dispose(); return result; }
public void drawStepIcon( int x, int y, StepMeta stepMeta, float magnification ) { String steptype = stepMeta.getStepID(); Image im = null; if ( stepMeta.isMissing() ) { im = GUIResource.getInstance().getImageMissing(); } else if ( stepMeta.isDeprecated() ) { im = GUIResource.getInstance().getImageDeprecated(); } else { im = images.get( steptype ).getAsBitmapForSize( gc.getDevice(), Math.round( iconsize * magnification ), Math.round( iconsize * magnification ) ); } if ( im != null ) { // Draw the icon! org.eclipse.swt.graphics.Rectangle bounds = im.getBounds(); gc.drawImage( im, 0, 0, bounds.width, bounds.height, x, y, iconsize, iconsize ); } }
private void drawVersionWarning( GC gc, Display display ) { gc.setBackground( versionWarningBackgroundColor ); gc.setForeground( new Color( display, 65, 65, 65 ) ); // gc.fillRectangle(290, 231, 367, 49); // gc.drawRectangle(290, 231, 367, 49); gc.drawImage( exclamation_image, 304, 243 ); gc.setFont( devWarningFont ); gc.drawText( BaseMessages.getString( PKG, "SplashDialog.DevelopmentWarning" ), 335, 241, true ); }
public void paintControl( PaintEvent e ) { Point area = getArea(); if ( area.x == 0 || area.y == 0 ) { return; // nothing to do! } Display disp = shell.getDisplay(); Image img = getTransformationImage( disp, area.x, area.y, magnification ); e.gc.drawImage( img, 0, 0 ); if ( transMeta.nrSteps() == 0 ) { e.gc.setForeground( GUIResource.getInstance().getColorCrystalTextPentaho() ); e.gc.setFont( GUIResource.getInstance().getFontMedium() ); Image pentahoImage = GUIResource.getInstance().getImageTransCanvas(); int leftPosition = ( area.x - pentahoImage.getBounds().width ) / 2; int topPosition = ( area.y - pentahoImage.getBounds().height ) / 2; e.gc.drawImage( pentahoImage, leftPosition, topPosition ); } img.dispose(); // spoon.setShellText(); }
@Override protected Image renderRotated( Device device, int width, int height, double angleRadians ) { Image result = new Image( device, width * 2, height * 2 ); GC gc = new GC( result ); int bw = bitmap.getBounds().width; int bh = bitmap.getBounds().height; Transform affineTransform = new Transform( device ); affineTransform.translate( width, height ); affineTransform.rotate( (float) Math.toDegrees( angleRadians ) ); affineTransform.scale( (float) 1.0 * width / bw, (float) 1.0 * height / bh ); gc.setTransform( affineTransform ); gc.drawImage( bitmap, 0, 0, bw, bh, -bw / 2, -bh / 2, bw, bh ); gc.dispose(); return result; } }
public void paintControl( PaintEvent e ) { Point area = getArea(); if ( area.x == 0 || area.y == 0 ) { return; // nothing to do! } Display disp = shell.getDisplay(); Image img = getJobImage( disp, area.x, area.y, magnification ); e.gc.drawImage( img, 0, 0 ); if ( jobMeta.nrJobEntries() == 0 ) { e.gc.setForeground( GUIResource.getInstance().getColorCrystalTextPentaho() ); e.gc.setBackground( GUIResource.getInstance().getColorBackground() ); e.gc.setFont( GUIResource.getInstance().getFontMedium() ); Image pentahoImage = GUIResource.getInstance().getImageJobCanvas(); int leftPosition = ( area.x - pentahoImage.getBounds().width ) / 2; int topPosition = ( area.y - pentahoImage.getBounds().height ) / 2; e.gc.drawImage( pentahoImage, leftPosition, topPosition ); } img.dispose(); }
public void paintControl( PaintEvent event ) { if ( jobGraph.job != null && ( jobGraph.job.isFinished() || jobGraph.job.isStopped() ) ) { refreshImage( event.gc ); if ( image != null && !image.isDisposed() ) { event.gc.drawImage( image, 0, 0 ); } } else { Rectangle bounds = canvas.getBounds(); if ( bounds.width <= 0 || bounds.height <= 0 ) { return; } event.gc.setForeground( GUIResource.getInstance().getColorWhite() ); event.gc.setBackground( GUIResource.getInstance().getColorWhite() ); event.gc.fillRectangle( new Rectangle( 0, 0, bounds.width, bounds.height ) ); event.gc.setForeground( GUIResource.getInstance().getColorBlack() ); String metricsMessage = BaseMessages.getString( PKG, "JobMetricsDelegate.JobIsNotRunning.Message" ); org.eclipse.swt.graphics.Point extent = event.gc.textExtent( metricsMessage ); event.gc.drawText( metricsMessage, ( bounds.width - extent.x ) / 2, ( bounds.height - extent.y ) / 2 ); } } } );