JAL-1645 source formatting and organise imports
[jalview.git] / src / jalview / viewmodel / seqfeatures / FeatureRendererModel.java
index c7cee04..bedbaf5 100644 (file)
@@ -119,8 +119,7 @@ public abstract class FeatureRendererModel implements
     }
     if (!fdi.isRegistered(featureType))
     {
-      pushFeatureType(Arrays.asList(new String[]
-      { featureType }));
+      pushFeatureType(Arrays.asList(new String[] { featureType }));
     }
     fdi.setVisible(featureType);
   }
@@ -163,7 +162,7 @@ public abstract class FeatureRendererModel implements
     types.toArray(neworder);
     if (renderOrder != null)
     {
-      System.arraycopy(neworder,0,neworder,renderOrder.length,ts);
+      System.arraycopy(neworder, 0, neworder, renderOrder.length, ts);
       System.arraycopy(renderOrder, 0, neworder, 0, renderOrder.length);
     }
     renderOrder = neworder;
@@ -186,8 +185,7 @@ public abstract class FeatureRendererModel implements
   protected final byte[] normaliseScore(SequenceFeature sequenceFeature)
   {
     float[] mm = ((float[][]) minmax.get(sequenceFeature.type))[0];
-    final byte[] r = new byte[]
-    { 0, (byte) 255 };
+    final byte[] r = new byte[] { 0, (byte) 255 };
     if (mm != null)
     {
       if (r[0] != 0 || mm[0] < 0.0)
@@ -247,12 +245,6 @@ public abstract class FeatureRendererModel implements
     ArrayList<SequenceFeature> tmp = new ArrayList<SequenceFeature>();
     SequenceFeature[] features = sequence.getSequenceFeatures();
 
-    while (features == null && sequence.getDatasetSequence() != null)
-    {
-      sequence = sequence.getDatasetSequence();
-      features = sequence.getSequenceFeatures();
-    }
-
     if (features != null)
     {
       for (int i = 0; i < features.length; i++)
@@ -329,9 +321,7 @@ public abstract class FeatureRendererModel implements
     for (int i = 0; i < alignment.getHeight(); i++)
     {
       SequenceI asq = alignment.getSequenceAt(i);
-      SequenceI dasq = asq.getDatasetSequence();
-      SequenceFeature[] features = dasq != null ? dasq
-              .getSequenceFeatures() : asq.getSequenceFeatures();
+      SequenceFeature[] features = asq.getSequenceFeatures();
 
       if (features == null)
       {
@@ -377,20 +367,19 @@ public abstract class FeatureRendererModel implements
         {
           allfeatures.add(features[index].getType());
         }
-        if (features[index].score != Float.NaN)
+        if (!Float.isNaN(features[index].score))
         {
           int nonpos = features[index].getBegin() >= 1 ? 0 : 1;
           float[][] mm = (float[][]) minmax.get(features[index].getType());
           if (mm == null)
           {
-            mm = new float[][]
-            { null, null };
+            mm = new float[][] { null, null };
             minmax.put(features[index].getType(), mm);
           }
           if (mm[nonpos] == null)
           {
-            mm[nonpos] = new float[]
-            { features[index].score, features[index].score };
+            mm[nonpos] = new float[] { features[index].score,
+                features[index].score };
 
           }
           else
@@ -441,8 +430,7 @@ public abstract class FeatureRendererModel implements
         {
           if (initOrders)
           {
-            setOrder(oldRender[j], (1 - (1 + (float) j)
-                    / oldRender.length));
+            setOrder(oldRender[j], (1 - (1 + (float) j) / oldRender.length));
           }
           if (allfeatures.contains(oldRender[j]))
           {
@@ -778,8 +766,7 @@ public abstract class FeatureRendererModel implements
   {
     if (renderOrder == null)
     {
-      return Arrays.asList(new String[]
-      {});
+      return Arrays.asList(new String[] {});
     }
     return Arrays.asList(renderOrder);
   }