X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationPanel.java;h=32f9514ecb7a9d464a5055aa861c9065a2750e35;hb=9a05eeccaf18e0c82cd183f0b84a8be42bf181c7;hp=60d3e06065c5e0a2398a74255dd52a5d5253dbfd;hpb=f7bce11fb6036cd7f94e17c9f136970984a9402a;p=jalview.git diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 60d3e06..32f9514 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -93,6 +93,10 @@ public class AnnotationPanel extends JPanel implements MouseListener, boolean mouseDragging = false; boolean MAC = false; + + //for editing cursor + int cursorX = 0; + int cursorY = 0; /** * Creates a new AnnotationPanel object. @@ -454,15 +458,22 @@ public class AnnotationPanel extends JPanel implements MouseListener, } JPopupMenu pop = new JPopupMenu("Structure type"); - JMenuItem item = new JMenuItem(HELIX); - item.addActionListener(this); - pop.add(item); - item = new JMenuItem(SHEET); - item.addActionListener(this); - pop.add(item); - item = new JMenuItem(STEM); - item.addActionListener(this); - pop.add(item); + JMenuItem item; + /* + * Just display the needed structure options + */ + if(av.alignment.isNucleotide()==true){ + item = new JMenuItem(STEM); + item.addActionListener(this); + pop.add(item); + }else{ + item = new JMenuItem(HELIX); + item.addActionListener(this); + pop.add(item); + item = new JMenuItem(SHEET); + item.addActionListener(this); + pop.add(item); + } item = new JMenuItem(LABEL); item.addActionListener(this); pop.add(item); @@ -655,7 +666,35 @@ public class AnnotationPanel extends JPanel implements MouseListener, */ public void mouseClicked(MouseEvent evt) { + if(activeRow !=-1){ + AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation(); + AlignmentAnnotation anot = aa[activeRow]; + + if(anot.description.equals("secondary structure")){ + System.out.println(anot.description+" "+anot.getRNAStruc()); + } + } } + + public void drawCursor(Graphics graphics, SequenceI seq, int res, int x1, int y1) + { + int pady = av.charHeight / 5; + int charOffset = 0; + graphics.setColor(Color.black); + graphics.fillRect(x1, y1, av.charWidth, av.charHeight); + + if (av.validCharWidth) + { + graphics.setColor(Color.white); + + char s = seq.getCharAt(res); + + charOffset = (av.charWidth - fm.charWidth(s)) / 2; + graphics.drawString(String.valueOf(s), charOffset + x1, + (y1 + av.charHeight) - pady); + } + + } /** * DOCUMENT ME!