boolean mouseDragging = false;
boolean MAC = false;
+
+ //for editing cursor
+ int cursorX = 0;
+ int cursorY = 0;
/**
* Creates a new AnnotationPanel object.
}
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);
*/
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!