From 269257481bdc261d6f99cb43dac33c10c3b4e9e1 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Fri, 27 Apr 2007 15:32:12 +0000 Subject: [PATCH] Trouble with featureRenderers fixed --- src/MCview/AppletPDBCanvas.java | 17 +++++++++++------ src/MCview/AppletPDBViewer.java | 5 +++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/MCview/AppletPDBCanvas.java b/src/MCview/AppletPDBCanvas.java index c3ad10e..a61ecb2 100755 --- a/src/MCview/AppletPDBCanvas.java +++ b/src/MCview/AppletPDBCanvas.java @@ -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(); } diff --git a/src/MCview/AppletPDBViewer.java b/src/MCview/AppletPDBViewer.java index 916e920..b610122 100755 --- a/src/MCview/AppletPDBViewer.java +++ b/src/MCview/AppletPDBViewer.java @@ -24,8 +24,7 @@ import java.awt.event.*; import jalview.appletgui.*; import jalview.datamodel.*; import jalview.schemes.*; -import jalview.structure.StructureListener; -import jalview.structure.*; + public class AppletPDBViewer extends Frame implements ActionListener, ItemListener @@ -51,6 +50,8 @@ public class AppletPDBViewer add(pdbcanvas, BorderLayout.CENTER); + System.out.println(seq[0].getName()+" ASFA"); + StringBuffer title = new StringBuffer(seq[0].getName() + ":" + pdbcanvas.pdbentry.getFile()); -- 1.7.10.2