From b7dea79ce5faa87647ff182cde4b84d607bac62a Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Fri, 24 Mar 2006 15:25:09 +0000 Subject: [PATCH] ZSort no longer static --- src/MCview/AppletPDBCanvas.java | 8 ++++++-- src/MCview/Zsort.java | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/MCview/AppletPDBCanvas.java b/src/MCview/AppletPDBCanvas.java index dc4cf0b..2a452b2 100755 --- a/src/MCview/AppletPDBCanvas.java +++ b/src/MCview/AppletPDBCanvas.java @@ -516,11 +516,15 @@ public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotion } + Zsort zsort; public void drawScene(Graphics g) { + if (zbuffer) + { + if(zsort ==null) + zsort = new Zsort(); - if (zbuffer) { - Zsort.Zsort(visiblebonds); + zsort.Zsort(visiblebonds); } diff --git a/src/MCview/Zsort.java b/src/MCview/Zsort.java index 1e7ac41..c54a3ff 100755 --- a/src/MCview/Zsort.java +++ b/src/MCview/Zsort.java @@ -22,11 +22,11 @@ import java.util.*; public class Zsort { - public static void Zsort(Vector bonds) { + public void Zsort(Vector bonds) { sort(bonds, 0, bonds.size() - 1); } - public static void sort(Vector bonds, int p, int r) { + public void sort(Vector bonds, int p, int r) { int q; if (p < r) { @@ -36,7 +36,7 @@ public class Zsort { } } - private static int partition(Vector bonds, int p, int r) { + private int partition(Vector bonds, int p, int r) { float x = ((Bond) bonds.elementAt(p)).start[2]; int i = p - 1; int j = r + 1; -- 1.7.10.2