ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seanfi...@apache.org
Subject svn commit: r1802351 - /ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/util/IconLoader.java
Date Wed, 19 Jul 2017 02:56:27 GMT
Author: seanfinan
Date: Wed Jul 19 02:56:26 2017
New Revision: 1802351

URL: http://svn.apache.org/viewvc?rev=1802351&view=rev
Log:
File to Stream swap

Modified:
    ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/util/IconLoader.java

Modified: ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/util/IconLoader.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/util/IconLoader.java?rev=1802351&r1=1802350&r2=1802351&view=diff
==============================================================================
--- ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/util/IconLoader.java (original)
+++ ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/util/IconLoader.java Wed Jul
19 02:56:26 2017
@@ -7,8 +7,8 @@ import javax.imageio.ImageIO;
 import javax.swing.*;
 import java.awt.*;
 import java.awt.image.BufferedImage;
-import java.io.File;
 import java.io.IOException;
+import java.io.InputStream;
 
 /**
  * @author SPF , chip-nlp
@@ -29,8 +29,8 @@ final public class IconLoader {
     */
    static public Icon loadIcon( final String filePath, final int iconSize ) {
       try {
-         final File imageFile = FileLocator.locateFile( filePath );
-         final Image image = ImageIO.read( imageFile );
+         final InputStream inputStream = FileLocator.getAsStream( filePath );
+         final Image image = ImageIO.read( inputStream );
          final BufferedImage scaleImage = new BufferedImage( iconSize, iconSize, BufferedImage.TYPE_INT_ARGB
);
          final Graphics g = scaleImage.createGraphics();
          g.drawImage( image, 0, 0, iconSize, iconSize, null );
@@ -47,8 +47,8 @@ final public class IconLoader {
     */
    static public Icon loadIcon( final String filePath ) {
       try {
-         final File imageFile = FileLocator.locateFile( filePath );
-         final Image image = ImageIO.read( imageFile );
+         final InputStream inputStream = FileLocator.getAsStream( filePath );
+         final Image image = ImageIO.read( inputStream );
          return new ImageIcon( image );
       } catch ( IOException ioE ) {
          LOGGER.warn( ioE.getMessage() );



Mime
View raw message