|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Canvas | +--AFLPgui.CutoffSlider
This class provides a way to manipulate a cutoff with the mouse. It should be told several important pieces of information, specifically the cutoff to display, the lanes to apply the cutoff too, the scale for coverting pixels to height, and the starting position of the cutoff. The cutoff will be displayed as a bar with arrows at positions corresponding to the levels of the cutoff. The cutoff can be changed by dragging the arrows or by clicking and having the arrows snap to the location. The class also provides a message that gives some info about the slider, normally what a cutoff was set to.
Inner classes inherited from class java.awt.Canvas |
java.awt.Canvas.AccessibleAWTCanvas |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
CutoffSlider()
Create a new cutoff slider. |
Method Summary | |
void |
addCutoffFunction(CutoffFunction ct)
Adds the specified CutoffFucntion to all of the lanes
known to this class. |
java.awt.Polygon |
createArrow()
Creates a polygon that is in the shape of the arrow used to indicate different levels. |
java.lang.String |
getMessage()
Gets a message describing the current state of the slider. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Handles the mouse clicks. |
void |
mouseDragged(java.awt.event.MouseEvent e)
If the mouse is over an arrow, it moves the associated function to the new location. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Unused |
void |
mouseExited(java.awt.event.MouseEvent e)
Unused |
void |
mouseMoved(java.awt.event.MouseEvent e)
Determines if the mouse is over an arrow or a blank spot. |
void |
mousePressed(java.awt.event.MouseEvent e)
Unused |
void |
mouseReleased(java.awt.event.MouseEvent e)
Unused |
int |
overType(int x,
int y)
Determines if the given point is in a blank area or in an arrow. |
void |
paint(java.awt.Graphics g)
Draws a bar with arrows at the different cutoff levels. |
void |
refresh()
Causes any changes in the underlying data to be shown on the screen. |
void |
setCutoff(Cutoff cutoff)
Sets the cutoff that this slider is based on. |
void |
setFunction(int pos,
int level)
Adjusts the cutoff function at level so that it's height
matches the height represented by pos . |
void |
setLanes(DataList lanes)
Sets the lanes known to the cutoff. |
void |
setScale(double scale)
Sets the scale for the cutoff slider. |
void |
setSize(double size)
This determines where the cutoff should be applied in the lanes. |
Methods inherited from class java.awt.Canvas |
addNotify, getAccessibleContext |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CutoffSlider()
setCutoff
method.Method Detail |
public void addCutoffFunction(CutoffFunction ct)
CutoffFucntion
to all of the lanes
known to this class. If a cutoff does not already exist at the
position this slider applies to, then a new cutoff is added. Otherwise,
the cutoff is replaced.ct
- the function to add.setSize(double)
,
setLanes(AFLPcore.DataList)
public void setCutoff(Cutoff cutoff)
cutoff
- the cutoff to usepublic void setSize(double size)
size
to the next cutoff.
This class will use this value when it adds new cutoffs to lanes.size
- the location in bp, where this cutoff should first apply.public java.lang.String getMessage()
public void paint(java.awt.Graphics g)
paint
in class java.awt.Canvas
public void setLanes(DataList lanes)
lanes
- the lanes to have their cutoffs modified by the slider.public void setScale(double scale)
scale
- the intensity per pixel.public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public int overType(int x, int y)
x
- the x positiony
- the y positionpublic void setFunction(int pos, int level)
level
so that it's height
matches the height represented by pos
. The function
is adjusted for all of the lanes defined. If a cutoff function does
not exist at the position of this slider, then a new cutoff is added.
Otherwise, the existing cutoff is replaced.pos
- the position, in pixels, to move the cutoff function tolevel
- specifies the part of the cutoff to adjust.setLanes(AFLPcore.DataList)
,
setSize(double)
public java.awt.Polygon createArrow()
public void refresh()
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |