/** * Converts SVG file name to PNG. */ public static String toPngName( String name ) { if ( isSvgName( name ) ) { name = name.substring( 0, name.length() - 4 ) + PNG_EXTENSION; } return name; }
/** * Load image from InputStream as bitmap image, or SVG image conversion to bitmap image. */ private static SwingUniversalImage loadImage( InputStream in, String filename ) { if ( !SvgSupport.isSvgName( filename ) ) { // bitmap image try { return new SwingUniversalImageBitmap( ImageIO.read( in ) ); } catch ( IOException e ) { throw new RuntimeException( e ); } } else { // svg image - need to convert to bitmap try { return new SwingUniversalImageSvg( SvgSupport.loadSvgImage( in ) ); } catch ( Exception ex ) { throw new RuntimeException( ex ); } } } }
resource = resource.substring( 0, resource.indexOf( ":" ) ) + resource.substring( resource.indexOf( "." ) ); if ( SvgSupport.isSvgEnabled() && ( SvgSupport.isSvgName( resource ) || SvgSupport.isPngName( resource ) ) ) { InputStream in = null; try {
/** * Load image from InputStream as bitmap image, or SVG image conversion to bitmap image. */ private static SwtUniversalImage loadImage( Display display, InputStream in, String filename ) { if ( !SvgSupport.isSvgName( filename ) ) { // bitmap image return new SwtUniversalImageBitmap( new Image( display, in ) ); } else { // svg image - need to convert to bitmap try { return new SwtUniversalImageSvg( SvgSupport.loadSvgImage( in ) ); } catch ( Exception ex ) { throw new RuntimeException( ex ); } } } }
if ( SvgSupport.isSvgEnabled() && SvgSupport.isSvgName( fileName ) ) { try { inputStream = new FileInputStream( fileName );
if ( SvgSupport.isSvgEnabled() && SvgSupport.isSvgName( fileName ) ) { try { inputStream = new FileInputStream( fileName );
if ( SvgSupport.isSvgEnabled() && SvgSupport.isSvgName( filename ) ) {
if ( SvgSupport.isSvgEnabled() && ( SvgSupport.isSvgName( resource ) || SvgSupport.isPngName( resource ) ) ) { InputStream in = null; try {