|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jadex.swing.sequence.SequenceLayoutModel
This class is used to transform bp coordinate on the chromosome to the graphics coordinate, and the zoom and some layout processing.
Field Summary | |
protected java.util.List |
boxes
|
protected float |
distance
|
protected float |
height
|
protected int |
IS_LOW
|
protected int |
IS_UP
|
protected long |
totalBP
|
protected int |
totalLayers
|
protected float |
xPadding
|
protected float |
yPadding
|
protected int |
ZOOM_STEP
|
Constructor Summary | |
SequenceLayoutModel()
Creates new SequenceLayoutCalculator |
|
SequenceLayoutModel(int layer,
SequenceDisplay display)
Third constructor with a layer as a argument |
|
SequenceLayoutModel(SequenceDisplay display)
Second constructor with display as the argument |
Method Summary | |
protected float |
fromBpToX(long bp)
Transform from the bp on chromsome to the graphics coordinate system |
protected long |
fromXtoBp(float x)
The opposite method of the above method |
java.awt.Rectangle |
getBounds(org.jdom.Element sequence,
int layer,
boolean isOdd)
Calculate the positon of sequence element based on its positions on the chromosome |
protected int |
getBoxAboveY(float y)
Get the box just above or containing a given y |
protected int |
getBoxBelowY(float y)
Get the box just below or containing a given y |
protected int[] |
getBoxFromY(float x,
float y)
A helper to get the box number for a point |
org.jdom.Element |
getClosestElement(int x,
int y)
Get the sequence element by a point coordinate on the graphics |
protected java.util.List |
getElementsBetween(java.awt.Rectangle rect)
Get a list of sequence elements in a rectangele |
java.awt.Rectangle |
getGeneBounds(java.awt.Rectangle rect)
Get a gene bounds from it parent sequence's bounds |
MapRange |
getMapRange()
Get the currently displayed MapRange. |
long |
getMouseAt()
Get the current mouse position in bp unit |
java.awt.Rectangle |
getSequenceAndGeneBounds(org.jdom.Element sequence,
int layer,
boolean isOdd)
Calculte a bounds for a sequence elemement containing a gene |
void |
moveLeft()
Moving the current range to the left |
void |
moveRight()
Moving the current range to the right |
protected void |
outputSequenceList(java.util.List list)
An convient method to output a sequence element list |
protected void |
relayout()
Do some initialization layout calculation |
void |
reset()
Reset the maprange to the whole chromosome |
protected org.jdom.Element |
searchElement(int[] box,
long bp)
Find an element based on box number and base pain positin on the chromosome. |
void |
setMapRange(MapRange range)
Set the displayed MapRange. |
void |
setMouseAt(long p)
Set current mouse position in bp unit |
void |
setTotalBP(long total)
By setting total bp of chromosome, the rel and offset should be calculated. |
void |
zoom(java.awt.Rectangle rect)
Zoom in a specific rectangle |
void |
zoomIn()
Do zooming-in in the current range |
void |
zoomOut()
Do zooming-out in the current range |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected float xPadding
protected float yPadding
protected float distance
protected float height
protected final int ZOOM_STEP
protected int totalLayers
protected int IS_UP
protected int IS_LOW
protected long totalBP
protected java.util.List boxes
Constructor Detail |
public SequenceLayoutModel()
public SequenceLayoutModel(SequenceDisplay display)
display
- the container all sequence element should be drawed onpublic SequenceLayoutModel(int layer, SequenceDisplay display)
layer
- the total layer numberdisplay
- the container all sequence element should be drawn onMethod Detail |
protected void relayout()
public void setTotalBP(long total)
total
- the total bp of the displayed chromosome.public void setMapRange(MapRange range)
range
- the MapRange to be displayed.public MapRange getMapRange()
public java.awt.Rectangle getBounds(org.jdom.Element sequence, int layer, boolean isOdd)
sequence
- the calculated sequence element, should containing range informationlayer
- which layer from the root this element isisOdd
- check is the order number of the sequence is odd or evenpublic java.awt.Rectangle getSequenceAndGeneBounds(org.jdom.Element sequence, int layer, boolean isOdd)
sequence
- a sequence element with a gene elementlayer
- the layer number, should be on the toppublic java.awt.Rectangle getGeneBounds(java.awt.Rectangle rect)
rect
- the sequence, the gene's parent, boundsprotected float fromBpToX(long bp)
protected long fromXtoBp(float x)
public org.jdom.Element getClosestElement(int x, int y)
x
- x-coordinatey
- y-coordinate
& @return Element corresponding to the point (x, y)protected java.util.List getElementsBetween(java.awt.Rectangle rect)
x1
- the left endx2
- the right endbox
- the number of box to be checkedprotected int[] getBoxFromY(float x, float y)
y
- the y coordinate of the pointprotected int getBoxAboveY(float y)
y
- the y coordinateprotected int getBoxBelowY(float y)
y
- the y coordinateprotected org.jdom.Element searchElement(int[] box, long bp)
box
- the box numberbp
- the base pair position on the chromosomepublic void zoomIn()
public void zoomOut()
public void moveLeft()
public void moveRight()
public void reset()
public void zoom(java.awt.Rectangle rect)
public void setMouseAt(long p)
public long getMouseAt()
protected void outputSequenceList(java.util.List list)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |