+ // Paint the track points on top
+ int pointsPainted = 1;
+ try
+ {
+ pointsPainted = paintPoints(g);
+ }
+ catch (NullPointerException npe) { // ignore, probably due to data being changed during drawing
+ }
+
+ // free g
+ g.dispose();
+
+ // Zoom to fit if no points found
+ if (pointsPainted <= 0 && _checkBounds) {
+ zoomToFit();
+ _recalculate = true;
+ repaint();
+ }
+ _checkBounds = false;
+ // enable / disable transparency slider
+ _transparencySlider.setEnabled(showMap);
+ }
+
+
+ /**
+ * Paint the points using the given graphics object
+ * @param inG Graphics object to use for painting
+ * @return number of points painted, if any
+ */
+ private int paintPoints(Graphics inG)
+ {
+ // Set up colours
+ final Color pointColour = Config.getColourScheme().getColour(ColourScheme.IDX_POINT);
+ final Color rangeColour = Config.getColourScheme().getColour(ColourScheme.IDX_SELECTION);
+ final Color currentColour = Config.getColourScheme().getColour(ColourScheme.IDX_PRIMARY);
+ final Color secondColour = Config.getColourScheme().getColour(ColourScheme.IDX_SECONDARY);
+ final Color textColour = Config.getColourScheme().getColour(ColourScheme.IDX_TEXT);
+