Trouble with featureRenderers fixed
authoramwaterhouse <Andrew Waterhouse>
Fri, 27 Apr 2007 15:32:12 +0000 (15:32 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 27 Apr 2007 15:32:12 +0000 (15:32 +0000)
src/MCview/AppletPDBCanvas.java
src/MCview/AppletPDBViewer.java

index c3ad10e..a61ecb2 100755 (executable)
@@ -95,6 +95,9 @@ public class AppletPDBCanvas
 
     try{
       pdb = ssm.setMapping(seq, pdbentry.getFile(), protocol);
+
+      if(protocol.equals(jalview.io.AppletFormatAdapter.PASTE))
+       pdbentry.setFile("INLINE"+pdb.id);
       //if (fr!=null)
       //  fr.featuresAdded();
     }catch(Exception ex)
@@ -109,7 +112,7 @@ public class AppletPDBCanvas
 
     colourBySequence(ap.getSequenceRenderer(),
                      ap.av.getShowSequenceFeatures() ?
-                     ap.getFeatureRenderer() : null);
+                     fr : null);
 
     int max = -10;
     int maxchain = -1;
@@ -242,7 +245,7 @@ public class AppletPDBCanvas
     seqColoursReady = true;
     colourBySequence(ap.getSequenceRenderer(),
                                ap.av.getShowSequenceFeatures() ?
-                               ap.getFeatureRenderer() : null);
+                               fr : null);
     redrawneeded = true;
     repaint();
   }
@@ -497,18 +500,20 @@ public class AppletPDBCanvas
 
   // This method has been taken out of PDBChain to allow
   // Applet and Application specific sequence renderers to be used
-  void colourBySequence(SequenceRenderer sr, FeatureRenderer fr)
+  void colourBySequence(SequenceRenderer sr, FeatureRenderer seqcanvasfr)
   {
     StructureMapping[] mapping = ssm.getMapping(pdbentry.getFile());
 
     boolean showFeatures = false;
-    if (fr!=null)
+    if (seqcanvasfr!=null)
     {
       if (fr == null)
       {
         fr = new jalview.appletgui.FeatureRenderer(ap.av);
       }
-      fr.transferSettings(fr);
+
+      fr.transferSettings(seqcanvasfr);
+
       showFeatures = true;
     }
 
@@ -1159,7 +1164,7 @@ public class AppletPDBCanvas
     AlignmentPanel ap = (AlignmentPanel) source;
     colourBySequence(ap.getSequenceRenderer(),
                      ap.av.getShowSequenceFeatures() ?
-                     ap.getFeatureRenderer() : null);
+                     fr : null);
     redrawneeded = true;
     repaint();
   }
index 916e920..b610122 100755 (executable)
@@ -24,8 +24,7 @@ import java.awt.event.*;
 import jalview.appletgui.*;\r
 import jalview.datamodel.*;\r
 import jalview.schemes.*;\r
-import jalview.structure.StructureListener;\r
-import jalview.structure.*;\r
+\r
 \r
 public class AppletPDBViewer\r
     extends Frame implements ActionListener, ItemListener\r
@@ -51,6 +50,8 @@ public class AppletPDBViewer
 \r
     add(pdbcanvas, BorderLayout.CENTER);\r
 \r
+    System.out.println(seq[0].getName()+" ASFA");\r
+\r
     StringBuffer title = new StringBuffer(seq[0].getName()\r
                                           + ":"\r
                                           + pdbcanvas.pdbentry.getFile());\r