From: Jim Procter Date: Fri, 13 Oct 2017 16:27:57 +0000 (+0100) Subject: JAL-2777 noticed exception raised on construction of feature settings because transpa... X-Git-Tag: Release_2_10_3b1~107^2~5 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6efcc6b872e24abc34363d37577eac99a8756614;p=jalview.git JAL-2777 noticed exception raised on construction of feature settings because transparency slider 'setMax' triggers a repaint --- diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index 0963b31..151ae9b 100644 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@ -131,6 +131,11 @@ public class FeatureSettings extends JPanel private static final int MIN_WIDTH = 400; private static final int MIN_HEIGHT = 400; + + /** + * when true, constructor is still executing - so ignore UI events + */ + protected volatile boolean inConstruction = true; /** * Constructor @@ -303,6 +308,7 @@ public class FeatureSettings extends JPanel }; }); frame.setLayer(JLayeredPane.PALETTE_LAYER); + inConstruction = false; } protected void popupSort(final int selectedRow, final String type, @@ -1238,7 +1244,11 @@ public class FeatureSettings extends JPanel public void stateChanged(ChangeEvent evt) { fr.setTransparency((100 - transparency.getValue()) / 100f); + if (!inConstruction) + { + fr.setTransparency((100 - transparency.getValue()) / 100f); af.alignPanel.paintAlignment(true); + } } });