X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FFeatureSettings.java;h=b7683390b8641e8b749728182630f066035103f0;hb=7544cc610aa35fd10e975598cc8fb2c97abe6bd9;hp=0963b310575470461cb778dcc12cc43978f3cb03;hpb=3730ef528b26ad0fc89a591ead2d44b90af86dfa;p=jalview.git diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index 0963b31..b768339 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, @@ -485,7 +491,7 @@ public class FeatureSettings extends JPanel @Override synchronized public void discoverAllFeatureData() { - Set allGroups = new HashSet(); + Set allGroups = new HashSet<>(); AlignmentI alignment = af.getViewport().getAlignment(); for (int i = 0; i < alignment.getHeight(); i++) @@ -557,12 +563,12 @@ public class FeatureSettings extends JPanel return; } resettingTable = true; - typeWidth = new Hashtable(); + typeWidth = new Hashtable<>(); // TODO: change avWidth calculation to 'per-sequence' average and use long // rather than float - Set displayableTypes = new HashSet(); - Set foundGroups = new HashSet(); + Set displayableTypes = new HashSet<>(); + Set foundGroups = new HashSet<>(); /* * determine which feature types may be visible depending on @@ -578,7 +584,7 @@ public class FeatureSettings extends JPanel * and keep track of which groups are visible */ Set groups = seq.getFeatures().getFeatureGroups(true); - Set visibleGroups = new HashSet(); + Set visibleGroups = new HashSet<>(); for (String group : groups) { if (group == null || checkGroupState(group)) @@ -1058,7 +1064,7 @@ public class FeatureSettings extends JPanel { if (fr.setFeaturePriority(data, visibleNew)) { - af.alignPanel.paintAlignment(true); + af.alignPanel.paintAlignment(true, true); } } @@ -1237,8 +1243,11 @@ public class FeatureSettings extends JPanel @Override public void stateChanged(ChangeEvent evt) { - fr.setTransparency((100 - transparency.getValue()) / 100f); - af.alignPanel.paintAlignment(true); + if (!inConstruction) + { + fr.setTransparency((100 - transparency.getValue()) / 100f); + af.alignPanel.paintAlignment(true,true); + } } });