From: gmungoc Date: Mon, 18 Jul 2016 13:10:40 +0000 (+0100) Subject: JAL-2015 restore check for null colour in paint() X-Git-Tag: Release_2_10_0~138^2^2~5 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=6316e3dec392d6bed2f20f02307b1d7edd34038a;p=jalview.git JAL-2015 restore check for null colour in paint() --- diff --git a/src/jalview/appletgui/FeatureSettings.java b/src/jalview/appletgui/FeatureSettings.java index bfac241..9733c86 100755 --- a/src/jalview/appletgui/FeatureSettings.java +++ b/src/jalview/appletgui/FeatureSettings.java @@ -763,28 +763,31 @@ public class FeatureSettings extends Panel implements ItemListener, public void paint(Graphics g) { Dimension d = getSize(); - if (col.isColourByLabel()) + if (col != null) { - g.setColor(Color.white); - g.fillRect(d.width / 2, 0, d.width / 2, d.height); - /* - * g.setColor(Color.black); Font f=g.getFont().deriveFont(9); - * g.setFont(f); - * - * // g.setFont(g.getFont().deriveFont( // - * AffineTransform.getScaleInstance( // - * width/g.getFontMetrics().stringWidth("Label"), // - * height/g.getFontMetrics().getHeight()))); g.drawString("Label", - * width/2, 0); - */ + if (col.isColourByLabel()) + { + g.setColor(Color.white); + g.fillRect(d.width / 2, 0, d.width / 2, d.height); + /* + * g.setColor(Color.black); Font f=g.getFont().deriveFont(9); + * g.setFont(f); + * + * // g.setFont(g.getFont().deriveFont( // + * AffineTransform.getScaleInstance( // + * width/g.getFontMetrics().stringWidth("Label"), // + * height/g.getFontMetrics().getHeight()))); g.drawString("Label", + * width/2, 0); + */ - } - else if (col.isGraduatedColour()) - { - Color maxCol = col.getMaxColour(); - g.setColor(maxCol); - g.fillRect(d.width / 2, 0, d.width / 2, d.height); + } + else if (col.isGraduatedColour()) + { + Color maxCol = col.getMaxColour(); + g.setColor(maxCol); + g.fillRect(d.width / 2, 0, d.width / 2, d.height); + } } if (hasLink)