/** * @return Returns the imageCluster. */ public Image getImageCluster() { return imageCluster.getAsBitmapForSize( display, ConstUI.SMALL_ICON_SIZE, ConstUI.SMALL_ICON_SIZE ); }
private void disposeUniversalImages( Collection<SwtUniversalImage> c ) { for ( SwtUniversalImage image : c ) { image.dispose(); } }
/** * Loads an image from a location once. The second time, the image comes from a cache. Because of this, it's important * to never dispose of the image you get from here. (easy!) The images are automatically disposed when the application * ends. * * @param location the location of the image resource to load * @param width The height to resize the image to * @param height The width to resize the image to * @return the loaded image */ public Image getImage( String location, int width, int height ) { Image image = imageMap.get( location ); if ( image == null ) { SwtUniversalImage svg = SwtSvgImageUtil.getImage( display, location ); image = new Image( display, svg.getAsBitmapForSize( display, width, height ), SWT.IMAGE_COPY ); svg.dispose(); imageMap.put( location, image ); } return image; }
private Image loadAsResource( Display display, String location, int size ) { SwtUniversalImage img = SwtSvgImageUtil.getImageAsResource( display, location ); Image image; if ( size > 0 ) { image = new Image( display, img.getAsBitmapForSize( display, size, size ), SWT.IMAGE_COPY ); } else { image = new Image( display, img.getAsBitmap( display ), SWT.IMAGE_COPY ); } img.dispose(); return image; }
private Image loadAsResource( Display display, String location ) { SwtUniversalImage img = SwtSvgImageUtil.getImageAsResource( display, location ); Image image = new Image( display, img.getAsBitmap( display ), SWT.IMAGE_COPY ); img.dispose(); return image; }
/** * Method getAsBitmapForSize(..., angle) can't be called, because it returns bigger picture. */ public synchronized Image getAsBitmapForSize( Device device, int width, int height ) { checkDisposed(); String key = width + "x" + height; Image result = cache.get( key ); if ( result == null ) { result = renderSimple( device, width, height ); cache.put( key, result ); } return result; }
/** * Draw rotated image on double canvas size. It required against lost corners on rotate. */ public synchronized Image getAsBitmapForSize( Device device, int width, int height, double angleRadians ) { checkDisposed(); int angleDegree = (int) Math.round( Math.toDegrees( angleRadians ) ); while ( angleDegree < 0 ) { angleDegree += 360; } angleDegree %= 360; angleRadians = Math.toRadians( angleDegree ); String key = width + "x" + height + "/" + angleDegree; Image result = cache.get( key ); if ( result == null ) { result = renderRotated( device, width, height, angleRadians ); cache.put( key, result ); } return result; }
public void setShellImage( Shell shell, StepMetaInterface stepMetaInterface ) { try { String id = PluginRegistry.getInstance().getPluginId( StepPluginType.class, stepMetaInterface ); if ( getShell() != null && id != null ) { getShell().setImage( GUIResource.getInstance().getImagesSteps().get( id ).getAsBitmap( shell.getDisplay() ) ); } } catch ( Throwable e ) { // Ignore } }
/** * Loads an image from a location once. The second time, the image comes from a cache. Because of this, it's important * to never dispose of the image you get from here. (easy!) The images are automatically disposed when the application * ends. * * @param location the location of the image resource to load * @param classLoader the ClassLoader to use to locate resources * @param width The height to resize the image to * @param height The width to resize the image to * @return the loaded image */ public Image getImage( String location, ClassLoader classLoader, int width, int height ) { Image image = imageMap.get( location ); if ( image == null ) { SwtUniversalImage svg = SwtSvgImageUtil.getUniversalImage( display, classLoader, location ); image = new Image( display, svg.getAsBitmapForSize( display, width, height ), SWT.IMAGE_COPY ); svg.dispose(); imageMap.put( location, image ); } return image; }
/** * @deprecated Use getAsBitmapForSize() instead. */ @Deprecated public synchronized Image getAsBitmap( Device device ) { checkDisposed(); Image result = cache.get( "" ); if ( result == null ) { result = renderSimple( device ); cache.put( "", result ); } return result; }
/** * @return Returns the imageSlave. */ public Image getImageSlave() { return imageSlave.getAsBitmapForSize( display, ConstUI.SMALL_ICON_SIZE, ConstUI.SMALL_ICON_SIZE ); }
Image result = image.getAsBitmapForSize( d, width, height ); ImageLoader loader = new ImageLoader(); loader.data = new ImageData[] { result.getImageData() }; loader.save( out, SWT.IMAGE_PNG ); image.dispose();
@Override public synchronized void dispose() { super.dispose(); if ( !bitmap.isDisposed() ) { bitmap.dispose(); } }
/** * @return Returns the imageSlave. */ public Image getImageSlaveMedium() { return imageSlave.getAsBitmapForSize( display, ConstUI.MEDIUM_ICON_SIZE, ConstUI.MEDIUM_ICON_SIZE ); }
private Image getHadoopClusterImage( Display display ) { final SwtUniversalImage swtImage = SwtSvgImageUtil.getUniversalImage( display, getClass().getClassLoader(), "hadoop_clusters.svg" ); Image image = swtImage.getAsBitmapForSize( display, ConstUI.MEDIUM_ICON_SIZE, ConstUI.MEDIUM_ICON_SIZE ); display.addListener( SWT.Dispose, event -> swtImage.dispose() ); return image; } }
imageHop.dispose(); imageDisabledHop.dispose(); imageConnection.dispose(); imageConnectionTree.dispose(); imageAdd.dispose(); imageTable.dispose(); imagePreview.dispose(); imageSchema.dispose(); imageSynonym.dispose(); imageExploreDbSmall.dispose(); imageView.dispose(); imageLogoSmall.dispose(); imageKettleLogo.dispose(); imageBanner.dispose(); imageBol.dispose(); imageCalendar.dispose(); imageCluster.dispose(); imageSlave.dispose(); imageSlaveTree.dispose(); imageArrow.dispose(); imageFolder.dispose(); imageTransRepo.dispose(); imageJobRepo.dispose(); imageWizard.dispose(); imageCredits.dispose(); imageStart.dispose(); imageDummy.dispose(); imageMissing.dispose();
/** * @return Returns the imageSlaveTree. */ public Image getImageSlaveTree() { return imageSlaveTree.getAsBitmapForSize( display, ConstUI.MEDIUM_ICON_SIZE, ConstUI.MEDIUM_ICON_SIZE ); }
public void handleEvent( Event event ) { swtImage.dispose(); } } );
/** * @return Returns the imageHop. */ public Image getImageHopTree() { return imageHop.getAsBitmapForSize( display, ConstUI.MEDIUM_ICON_SIZE, ConstUI.MEDIUM_ICON_SIZE ); }
/** * @return Returns the imageStart. */ public Image getImageStart() { return imageStart.getAsBitmapForSize( display, ConstUI.ICON_SIZE, ConstUI.ICON_SIZE ); }