From: janengelhardt Date: Tue, 28 Jun 2011 12:00:27 +0000 (+0200) Subject: Further structure accessing feature X-Git-Tag: Jalview_2_9~576^2~32 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ecb2c593fb296f6908deb65492835fac476b2378;p=jalview.git Further structure accessing feature Change-Id: Iec6b7f74fad9e7701a2970c3d1287d6c7b595c38 --- diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index 9037008..ad07680 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -37,7 +37,7 @@ public class AlignmentAnnotation public boolean autoCalculated = false; public String annotationId; - + public SequenceI sequenceRef; /** DOCUMENT ME!! */ @@ -53,6 +53,8 @@ public class AlignmentAnnotation * RNA secondary structure contact positions */ public SequenceFeature[] _rnasecstr = null; + + public String rnaStructure; /** * Updates the _rnasecstr field Determines the positions that base pair and @@ -64,6 +66,8 @@ public class AlignmentAnnotation { _rnasecstr = Rna.GetBasePairs(RNAannot); Rna.HelixMap(_rnasecstr); + + setRNAStruc(RNAannot); if (_rnasecstr != null && _rnasecstr.length > 0) { @@ -73,7 +77,7 @@ public class AlignmentAnnotation } // System.out.println("featuregroup " + _rnasecstr[0].getFeatureGroup()); } - + public java.util.Hashtable sequenceMapping; /** DOCUMENT ME!! */ @@ -304,7 +308,15 @@ public class AlignmentAnnotation annotationId = this.hashCode() + ""; } - /** + public void setRNAStruc(String string) { + rnaStructure=string; +} + + public String getRNAStruc(){ + return rnaStructure; + } + +/** * Creates a new AlignmentAnnotation object. * * @param label diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index 6626016..b8c81ce 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -58,7 +58,7 @@ public class AnnotationLabels extends JPanel implements MouseListener, Image image; AlignmentPanel ap; - + AlignViewport av; boolean resizing = false; @@ -439,6 +439,7 @@ public class AnnotationLabels extends JPanel implements MouseListener, public void mouseClicked(MouseEvent evt) { AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation(); + if (SwingUtilities.isLeftMouseButton(evt)) { if (selectedRow > -1 && selectedRow < aa.length) @@ -494,6 +495,7 @@ public class AnnotationLabels extends JPanel implements MouseListener, JMenuItem item = new JMenuItem(ADDNEW); item.addActionListener(this); pop.add(item); + if (selectedRow < 0) { if (hasHiddenRows) diff --git a/src/jalview/gui/AppVarna.java b/src/jalview/gui/AppVarna.java index be101d0..d1772c7 100644 --- a/src/jalview/gui/AppVarna.java +++ b/src/jalview/gui/AppVarna.java @@ -55,25 +55,30 @@ public class AppVarna extends JInternalFrame // implements Runnable,SequenceStru initVarna(); } - public AppVarna(String seq,String name){ - vab = new AppVarnaBinding(seq); + public AppVarna(String seq,String struc,String name){ + vab = new AppVarnaBinding(seq,struc); name=this.name; initVarna(); } public void initVarna(){ + //TODO: Why is it not possible to include varnaPanel in the AppVarna-Jframe? //vab.setFinishedInit(false); - varnaPanel=vab.vp; - this.getContentPane().add(varnaPanel); - jalview.gui.Desktop.addInternalFrame(this,name,getBounds().width, getBounds().height); + varnaPanel=vab.get_varnaPanel(); + //varnaPanel.setVisible(true); + //getContentPane().setLayout(new BorderLayout()); + //getContentPane().add(varnaPanel, BorderLayout.CENTER); + //setVisible(true); + //jalview.gui.Desktop.addInternalFrame(this,name,getBounds().width, getBounds().height); showPanel(true); } public void showPanel(boolean show){ - //vab.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - //vab.pack(); - //vab.setVisible(show); - varnaPanel.setVisible(show); + vab.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + vab.pack(); + vab.setVisible(show); + + //varnaPanel.setVisible(show); } private boolean _started = false; diff --git a/src/jalview/gui/AppVarnaBinding.java b/src/jalview/gui/AppVarnaBinding.java index 389efd1..efc1546 100644 --- a/src/jalview/gui/AppVarnaBinding.java +++ b/src/jalview/gui/AppVarnaBinding.java @@ -130,9 +130,9 @@ public class AppVarnaBinding extends JFrame implements DropTargetListener, Inter initVarna(this.DEFAULT_SEQUENCE,this.DEFAULT_STRUCTURE1); } - public AppVarnaBinding(String seq){ + public AppVarnaBinding(String seq, String struc){ super("VARNA in Jalview"); - initVarna(seq,this.DEFAULT_STRUCTURE1); + initVarna(seq,struc); } @@ -140,13 +140,11 @@ public class AppVarnaBinding extends JFrame implements DropTargetListener, Inter private void initVarna(String seq, String str){ DefaultListModel dlm = new DefaultListModel(); - DefaultListSelectionModel m = new DefaultListSelectionModel(); m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); m.setLeadAnchorNotificationEnabled(false); - - _sideList = new ReorderableJList(); + _sideList = new ReorderableJList(); _sideList.setModel(dlm); _sideList.addMouseListener(this); _sideList.setSelectionModel(m); diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index dcf745b..8197688 100644 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -262,7 +262,16 @@ public class PopupMenu extends JPopupMenu //TODO: Something to check if it's an RNA //like: if(seq.getAnnotation()[0].annotations[0].secondaryStructure == 'S') final SequenceI seqI = seq.getDatasetSequence(); - //ap.getAlignment().get + AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation(); + + + //for(int i=0; i