From: amwaterhouse Date: Wed, 6 Jul 2005 12:18:25 +0000 (+0000) Subject: dont add null group X-Git-Tag: Release_2_01~24 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5fbe7c141f482121b3f7f04570ab84bf6203ebf6;p=jalview.git dont add null group --- diff --git a/src/jalview/appletgui/APopupMenu.java b/src/jalview/appletgui/APopupMenu.java index 42546f9..cf854b0 100755 --- a/src/jalview/appletgui/APopupMenu.java +++ b/src/jalview/appletgui/APopupMenu.java @@ -296,12 +296,15 @@ public class APopupMenu void refresh() { SequenceGroup sg = getGroup(); - SuperGroup superG = ap.av.alignment.getSuperGroup(sg); - if (superG != null) + if(sg!=null) { - superG.setSuperGroupProperties(sg); - } + SuperGroup superG = ap.av.alignment.getSuperGroup(sg); + if (superG != null) + { + superG.setSuperGroupProperties(sg); + } + } ap.seqPanel.seqCanvas.repaint(); } @@ -480,7 +483,8 @@ public class APopupMenu SequenceGroup sg = ap.av.getSelectionGroup(); // this method won't add a new group if it already exists - ap.av.alignment.addGroup(sg); + if(sg!=null) + ap.av.alignment.addGroup(sg); return sg; } diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index 5ff9ad9..705d407 100755 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -434,13 +434,15 @@ public class PopupMenu extends JPopupMenu void refresh() { SequenceGroup sg = getGroup(); - SuperGroup superG = ap.av.alignment.getSuperGroup(sg); - - if (superG != null) + if(sg!=null) { + SuperGroup superG = ap.av.alignment.getSuperGroup(sg); + + if (superG != null) + { superG.setSuperGroupProperties(sg); + } } - ap.seqPanel.repaint(); } @@ -724,9 +726,9 @@ public class PopupMenu extends JPopupMenu SequenceGroup getGroup() { SequenceGroup sg = ap.av.getSelectionGroup(); - - // this method won't add a new group if it already exists - ap.av.alignment.addGroup(sg); + // this method won't add a new group if it already exists + if(sg!=null) + ap.av.alignment.addGroup(sg); return sg; }