+
+ /**
+ * Try to ensure any references held are nulled
+ */
+ public void dispose()
+ {
+ av = null;
+ ap = null;
+ image = null;
+ fadedImage = null;
+ gg = null;
+ _mwl = null;
+
+ /*
+ * I created the renderer so I will dispose of it
+ */
+ if (renderer != null)
+ {
+ renderer.dispose();
+ }
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt)
+ {
+ // Respond to viewport range changes (e.g. alignment panel was scrolled)
+ // Both scrolling and resizing change viewport ranges: scrolling changes
+ // both start and end points, but resize only changes end values.
+ // Here we only want to fastpaint on a scroll, with resize using a normal
+ // paint, so scroll events are identified as changes to the horizontal or
+ // vertical start value.
+ if (evt.getPropertyName().equals(ViewportRanges.STARTRES))
+ {
+ fastPaint((int) evt.getNewValue() - (int) evt.getOldValue());
+ }
+ else if (evt.getPropertyName().equals(ViewportRanges.STARTRESANDSEQ))
+ {
+ fastPaint(((int[]) evt.getNewValue())[0]
+ - ((int[]) evt.getOldValue())[0]);
+ }
+ else if (evt.getPropertyName().equals(ViewportRanges.MOVE_VIEWPORT))
+ {
+ repaint();
+ }
+ }