Author: ruschein
Date: 2010-02-04 14:55:15 -0800 (Thu, 04 Feb 2010)
New Revision: 19195

Modified:
   corelibs/trunk/ding/src/ding/view/DGraphView.java
Log:
We use BufferedImage caching for NN images again.

Modified: corelibs/trunk/ding/src/ding/view/DGraphView.java
===================================================================
--- corelibs/trunk/ding/src/ding/view/DGraphView.java   2010-02-04 22:53:45 UTC 
(rev 19194)
+++ corelibs/trunk/ding/src/ding/view/DGraphView.java   2010-02-04 22:55:15 UTC 
(rev 19195)
@@ -307,8 +307,8 @@
         * 
         * This is used by a new nested network feature from 2.7.
         */
-       private byte[] snapshotImage;
-       
+       private BufferedImage snapshotImage;
+
        /**
         * Represents current snapshot is latest version or not.
         */
@@ -2605,22 +2605,16 @@
         * @return Image of this view.  It is always up-to-date.
         */
        TexturePaint getSnapshot(final double width, final double height) {
-               BufferedImage bufferedImage = null;
-
                if (!latest) {
                        // Need to update snapshot.
-                       bufferedImage =
+                       snapshotImage =
                                (BufferedImage)createImage(DEF_SNAPSHOT_SIZE, 
DEF_SNAPSHOT_SIZE, 1,
                                                           /* skipBackground = 
*/ true);
-                       snapshotImage = convertToCompressedImage(bufferedImage);
                        latest = true;
                }
 
-               if (bufferedImage == null)
-                       bufferedImage = convertToBufferedImage(snapshotImage);
-
                final Rectangle2D rect = new Rectangle2D.Double(-width / 2, 
-height / 2, width, height);
-               final TexturePaint texturePaint = new 
TexturePaint(bufferedImage, rect);
+               final TexturePaint texturePaint = new 
TexturePaint(snapshotImage, rect);
                return texturePaint;
        }
 

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to