Package org.biojava.bio.gui.sequence
Class SequenceViewerEvent
- java.lang.Object
-
- java.util.EventObject
-
- org.biojava.bio.gui.sequence.SequenceViewerEvent
-
- All Implemented Interfaces:
Serializable
public class SequenceViewerEvent extends EventObject
An event indicating that a mouse gesture was recognised within a widget that renders sequences.- Since:
- 1.2
- Author:
- Matthew Pocock
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description SequenceViewerEvent(Object source, Object target, int pos, MouseEvent mouseEvent, List path)
Construct a SequenceViewerEvent with the given source, target, mouseEvent and path.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MouseEvent
getMouseEvent()
Get the mouse event that caused this.List
getPath()
Get the list of SequenceRenderer instances that were passed through to produce this eventint
getPos()
Get the offset within the sequence - the symbol index.Object
getTarget()
Get the Object that was the target of the mouse gesture or null if the mouse is not gesturing over any recognizable rendered object.String
toString()
-
Methods inherited from class java.util.EventObject
getSource
-
-
-
-
Constructor Detail
-
SequenceViewerEvent
public SequenceViewerEvent(Object source, Object target, int pos, MouseEvent mouseEvent, List path)
Construct a SequenceViewerEvent with the given source, target, mouseEvent and path.- Parameters:
source
- the event source, presumably a GUI componenttarget
- an Object that is the target of the gesture - a feature, or {alignment, label, index} or some other structure, or null if there is no obvious targetpos
- the position (offset) within the sequencemouseEvent
- the MouseEvent that caused this event to be producedpath
- a List of SequenceRenderer instances passed through to reach this event source
-
-
Method Detail
-
getPath
public List getPath()
Get the list of SequenceRenderer instances that were passed through to produce this event- Returns:
- a List of SequenceRenderer instances
-
getTarget
public Object getTarget()
Get the Object that was the target of the mouse gesture or null if the mouse is not gesturing over any recognizable rendered object.- Returns:
- the Object gestured at by the mouse event
-
getPos
public int getPos()
Get the offset within the sequence - the symbol index. This is not guaranteed to be within the legal range of symbol indices.- Returns:
- the position of the gesture in sequence coordinates
-
getMouseEvent
public MouseEvent getMouseEvent()
Get the mouse event that caused this.- Returns:
- the MouseEvent that caused this gesture to be noticed
-
toString
public String toString()
- Overrides:
toString
in classEventObject
-
-