apollo.gui.detailviewers.sequencealigner
Class AnnotationEditorMouseListener

java.lang.Object
  extended by javax.swing.event.MouseInputAdapter
      extended by apollo.gui.detailviewers.sequencealigner.AnnotationEditorMouseListener
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener, javax.swing.event.MouseInputListener

public class AnnotationEditorMouseListener
extends javax.swing.event.MouseInputAdapter

Class to handle mouse interactions for an annotation panel NOTE: It can be hard to keep track of what coordinate system you are working in. This should probably be cleaned up...


Field Summary
static int MIN_FEATURE_SIZE
           
 
Constructor Summary
AnnotationEditorMouseListener(MultiTierPanel panel, GuiCurationState curationState, MultiSequenceAlignerPanel mainPanel)
          Constructor
 
Method Summary
 AnnotationEditor getAnnotationEditor()
          Gets the annotation editor.
 BaseScrollable getScrollableObject()
          Gets the scrollable object that will be affected
 int getTier()
          Gets the current tier
 void mouseClicked(java.awt.event.MouseEvent e)
          Handles the mouse click events Middle mouse scrolls to where clicked Left mouse selects a feature Right mouse brings up popup menu
 void mouseDragged(java.awt.event.MouseEvent e)
          Handles the mouse drag events Left mouse dragging drags end of feature if drag type right or left boundary.
 void mouseMoved(java.awt.event.MouseEvent e)
          makes cursor hand if at the end of an exon using mouses position, does not change pos or tier variable
 void mousePressed(java.awt.event.MouseEvent e)
          Right mouse: highlight base.
 void mouseReleased(java.awt.event.MouseEvent e)
          If right mouse deselect base If end of feature drag notify AnnotationEditor (endRangeChange) and recalc translation end from start
static boolean notTooSmall(int start_pos, int end_pos)
          returns true if the distance between the two end points (inclusive) is greater than or equal to MIN_FEATURE_SIZE
static void recalcCDS(SeqFeatureI feature)
           
protected  void resetDragState()
           
 void scroll(int x, int y)
           
 void scrollLeft()
           
 void scrollRight()
           
 int selectHighPos()
           
 int selectLowPos()
           
 void setScrollableObject(BaseScrollable scrollableObject)
           
 
Methods inherited from class javax.swing.event.MouseInputAdapter
mouseEntered, mouseExited
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_FEATURE_SIZE

public static int MIN_FEATURE_SIZE
Constructor Detail

AnnotationEditorMouseListener

public AnnotationEditorMouseListener(MultiTierPanel panel,
                                     GuiCurationState curationState,
                                     MultiSequenceAlignerPanel mainPanel)
Constructor

Parameters:
panel -
curationState -
Method Detail

getAnnotationEditor

public AnnotationEditor getAnnotationEditor()
Gets the annotation editor.

Returns:
an annotation editor

getScrollableObject

public BaseScrollable getScrollableObject()
Gets the scrollable object that will be affected

Returns:

getTier

public int getTier()
Gets the current tier

Returns:

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Handles the mouse click events Middle mouse scrolls to where clicked Left mouse selects a feature Right mouse brings up popup menu

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Overrides:
mouseClicked in class javax.swing.event.MouseInputAdapter

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Handles the mouse drag events Left mouse dragging drags end of feature if drag type right or left boundary. DragType is figured in mousePressed TODO clean up!

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Overrides:
mouseDragged in class javax.swing.event.MouseInputAdapter

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
makes cursor hand if at the end of an exon using mouses position, does not change pos or tier variable

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Overrides:
mouseMoved in class javax.swing.event.MouseInputAdapter

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Right mouse: highlight base. Left mouse: figure dragType, dragFeature, dragStartPos, startDragTier

Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class javax.swing.event.MouseInputAdapter

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
If right mouse deselect base If end of feature drag notify AnnotationEditor (endRangeChange) and recalc translation end from start

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Overrides:
mouseReleased in class javax.swing.event.MouseInputAdapter

recalcCDS

public static void recalcCDS(SeqFeatureI feature)

resetDragState

protected void resetDragState()

selectHighPos

public int selectHighPos()

selectLowPos

public int selectLowPos()

setScrollableObject

public void setScrollableObject(BaseScrollable scrollableObject)

notTooSmall

public static boolean notTooSmall(int start_pos,
                                  int end_pos)
returns true if the distance between the two end points (inclusive) is greater than or equal to MIN_FEATURE_SIZE


scroll

public void scroll(int x,
                   int y)

scrollLeft

public void scrollLeft()

scrollRight

public void scrollRight()