X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FFeatureSettings.java;h=f8298266d5c92bca22f32c72d379b30bd2851dd6;hb=d69ea8f1997771890b44e4b332a7ca84fe6f0893;hp=b642fb3924f7f9396f105d28bbc192d779a7b2df;hpb=f441357783f32298b738d32d5c87000ac0e33768;p=jalview.git diff --git a/src/jalview/appletgui/FeatureSettings.java b/src/jalview/appletgui/FeatureSettings.java index b642fb3..f829826 100755 --- a/src/jalview/appletgui/FeatureSettings.java +++ b/src/jalview/appletgui/FeatureSettings.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -104,9 +104,10 @@ public class FeatureSettings extends Panel implements ItemListener, } frame = new Frame(); frame.add(this); - int height = featurePanel.getComponentCount()*50 +30; + int height = featurePanel.getComponentCount()*50 +60; - height = Math.max(100, height); + + height = Math.max(200, height); height = Math.min(400, height); jalview.bin.JalviewLite.addFrame(frame, "Feature Settings", 280, @@ -117,6 +118,8 @@ public class FeatureSettings extends Panel implements ItemListener, { g.setColor(Color.black); g.drawString("No Features added to this alignment!!", 10, 20); + g.drawString("(Features can be added from searches or", 10, 40); + g.drawString("from Jalview / GFF features files)", 10, 60); } void setTableData() @@ -374,7 +377,9 @@ public class FeatureSettings extends Panel implements ItemListener, selectedCheck = (MyCheckbox)evt.getSource(); - if ( fr.featureLinks.containsKey(selectedCheck.getLabel() ) ) + if(fr.featureLinks!=null + && fr.featureLinks.containsKey(selectedCheck.getLabel() ) + ) { if(evt.getX()>selectedCheck.stringWidth+20) { @@ -401,8 +406,9 @@ public class FeatureSettings extends Panel implements ItemListener, int height = evt.getY()+evt.getComponent().getLocation().y; - if(height > this.getSize().height) + if(height > featurePanel.getSize().height) { + comp = featurePanel.getComponent(featurePanel.getComponentCount()-1); } else if(height < 0) @@ -451,7 +457,8 @@ public class FeatureSettings extends Panel implements ItemListener, { MyCheckbox check = (MyCheckbox) evt.getSource(); - if (fr.featureLinks.containsKey(check.getLabel())) + if (fr.featureLinks!=null + && fr.featureLinks.containsKey(check.getLabel())) { if (evt.getX() > check.stringWidth + 20) { @@ -487,6 +494,7 @@ public class FeatureSettings extends Panel implements ItemListener, public MyCheckbox(String label, boolean checked, boolean haslink) { super(label, checked); + FontMetrics fm = av.nullFrame.getFontMetrics(av.nullFrame.getFont()); stringWidth = fm.stringWidth(label); this.hasLink = haslink;