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 Point getDeviceBounds() { org.eclipse.swt.graphics.Rectangle p = gc.getDevice().getBounds(); return new Point( p.width, p.height ); }
public Point getDeviceBounds() { org.eclipse.swt.graphics.Rectangle p = gc.getDevice().getBounds(); return new Point( p.width, p.height ); }
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(); } }
public void setTransform( float translationX, float translationY, int shadowsize, float magnification ) { if ( transform != null ) { // dispose of previous to prevent leaking of handles transform.dispose(); } transform = new Transform( gc.getDevice() ); transform.translate( translationX + shadowsize * magnification, translationY + shadowsize * magnification ); transform.scale( magnification, magnification ); gc.setTransform( transform ); currentMagnification = magnification; }
public void setTransform( float translationX, float translationY, int shadowsize, float magnification ) { if ( transform != null ) { // dispose of previous to prevent leaking of handles transform.dispose(); } transform = new Transform( gc.getDevice() ); transform.translate( translationX + shadowsize * magnification, translationY + shadowsize * magnification ); transform.scale( magnification, magnification ); gc.setTransform( transform ); currentMagnification = magnification; }
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 ); } }
public void drawJobEntryIcon( int x, int y, JobEntryCopy jobEntryCopy, float magnification ) { if ( jobEntryCopy == null ) { return; // Don't draw anything } SwtUniversalImage swtImage = null; int w = Math.round( iconsize * magnification ); int h = Math.round( iconsize * magnification ); if ( jobEntryCopy.isSpecial() ) { if ( jobEntryCopy.isStart() ) { swtImage = GUIResource.getInstance().getSwtImageStart(); } if ( jobEntryCopy.isDummy() ) { swtImage = GUIResource.getInstance().getSwtImageDummy(); } } else { String configId = jobEntryCopy.getEntry().getPluginId(); if ( configId != null ) { swtImage = GUIResource.getInstance().getImagesJobentries().get( configId ); } } if ( swtImage == null ) { return; } Image image = swtImage.getAsBitmapForSize( gc.getDevice(), w, h ); org.eclipse.swt.graphics.Rectangle bounds = image.getBounds(); gc.drawImage( image, 0, 0, bounds.width, bounds.height, x, y, iconsize, iconsize ); }
public void drawJobEntryIcon( int x, int y, JobEntryCopy jobEntryCopy, float magnification ) { if ( jobEntryCopy == null ) { return; // Don't draw anything } SwtUniversalImage swtImage = null; int w = Math.round( iconsize * magnification ); int h = Math.round( iconsize * magnification ); if ( jobEntryCopy.isSpecial() ) { if ( jobEntryCopy.isStart() ) { swtImage = GUIResource.getInstance().getSwtImageStart(); } if ( jobEntryCopy.isDummy() ) { swtImage = GUIResource.getInstance().getSwtImageDummy(); } } else { String configId = jobEntryCopy.getEntry().getPluginId(); if ( configId != null ) { swtImage = GUIResource.getInstance().getImagesJobentries().get( configId ); } } if ( jobEntryCopy.isMissing() ) { swtImage = GUIResource.getInstance().getSwtImageMissing(); } if ( swtImage == null ) { return; } Image image = swtImage.getAsBitmapForSize( gc.getDevice(), w, h ); org.eclipse.swt.graphics.Rectangle bounds = image.getBounds(); gc.drawImage( image, 0, 0, bounds.width, bounds.height, x, y, iconsize, iconsize ); }
@Override public Path createPath () { return new Path ( this.gc.getDevice () ); }
public static Font getAnyFontBoldItalic(GC gc) { if (fontBoldItalic == null || fontBoldItalic.isDisposed()) { FontData[] fontData = gc.getFont().getFontData(); for (FontData fd : fontData) { fd.setStyle(SWT.BOLD | SWT.ITALIC); } fontBoldItalic = new Font(gc.getDevice(), fontData); } return fontBoldItalic; }
@Override public void setBackground ( final RGB color ) { if ( color != null ) { this.gc.setBackground ( (Color)this.resourceManager.get ( ColorDescriptor.createFrom ( color ) ) ); } else { this.gc.setBackground ( this.gc.getDevice ().getSystemColor ( SWT.COLOR_WIDGET_BACKGROUND ) ); } }
@Override public void setForeground ( final RGB color ) { if ( color != null ) { this.gc.setForeground ( (Color)this.resourceManager.get ( ColorDescriptor.createFrom ( color ) ) ); } else { this.gc.setForeground ( this.gc.getDevice ().getSystemColor ( SWT.COLOR_WIDGET_FOREGROUND ) ); } }