From bbc6f9aa881165c33675ca77489bef93d1505345 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Fri, 27 Apr 2007 14:42:27 +0000 Subject: [PATCH] Place new feature on top of existing features --- src/jalview/appletgui/FeatureRenderer.java | 52 +++++++++++++++++----------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/src/jalview/appletgui/FeatureRenderer.java b/src/jalview/appletgui/FeatureRenderer.java index b36fbfd..1061efd 100755 --- a/src/jalview/appletgui/FeatureRenderer.java +++ b/src/jalview/appletgui/FeatureRenderer.java @@ -88,14 +88,6 @@ public class FeatureRenderer static String lastFeatureGroupAdded; static String lastDescriptionAdded; - public boolean createNewFeatures(SequenceI[] sequences, - SequenceFeature[] features, - AlignmentPanel ap) - { - return amendFeatures(sequences, features, true, ap); - } - - int featureIndex = 0; boolean deleteFeature = false; Panel colourPanel; @@ -370,8 +362,6 @@ public class FeatureRenderer featureGroups = new Hashtable(); } - - col = colourPanel.getBackground(); setColour(lastFeatureAdded, col); @@ -383,6 +373,11 @@ public class FeatureRenderer } findAllFeatures(); + String [] tro = new String[renderOrder.length]; + tro[0] = renderOrder[renderOrder.length-1]; + System.arraycopy(renderOrder,0,tro,1,renderOrder.length-1); + renderOrder = tro; + return true; } else @@ -677,21 +672,19 @@ public class FeatureRenderer public Color getColour(String featureType) { - return (Color) featureColours.get(featureType); - } - - public void addNewFeature(String name, Color col) - { - - setColour(name, col); - if (av.featuresDisplayed == null) + if (!featureColours.containsKey(featureType)) { - av.featuresDisplayed = new Hashtable(); + jalview.schemes.UserColourScheme ucs = new + jalview.schemes.UserColourScheme(); + Color col = ucs.createColourFromName(featureType); + featureColours.put(featureType, col); + return col; } - - av.featuresDisplayed.put(name, "NOGROUP"); + else + return (Color) featureColours.get(featureType); } + public void setColour(String featureType, Color col) { featureColours.put(featureType, col); @@ -707,6 +700,23 @@ public class FeatureRenderer av.featuresDisplayed.clear(); } + /* if (visibleNew) + { + if (av.featuresDisplayed != null) + { + av.featuresDisplayed.clear(); + } + else + { + av.featuresDisplayed = new Hashtable(); + } + } + if (data == null) + { + return; + }*/ + + renderOrder = new String[data.length]; if (data.length > 0) -- 1.7.10.2