org.utgenome.gwt.utgb.client.track
Class TrackWindow

java.lang.Object
  extended by org.utgenome.gwt.utgb.client.track.TrackWindow
All Implemented Interfaces:
Serializable, Comparable<TrackWindow>

public class TrackWindow
extends Object
implements Serializable, Comparable<TrackWindow>

TrackWindow manages a track-window size and a region on the genome displayed in the window. An instance of TrackWindow is immutable, so you can safely copy a reference of TrackWindow to preserve a current track window state.

Author:
leo
See Also:
Serialized Form

Constructor Summary
TrackWindow()
           
TrackWindow(int pixelWidth, int startIndexOnGenome, int endIndexOnGenome)
           
TrackWindow(TrackWindow other)
           
 
Method Summary
 int center()
           
 int compareTo(TrackWindow o)
           
 boolean contains(TrackWindow other)
           
 int convertToGenomePosition(int xOnWindow)
           
 int convertToPixelLength(int rangeOnGenome)
           
 int convertToPixelX(int indexOnGenome)
          calculate the X position (pixel address) in a track window of a given index on genome.
 double convertToPixelXDouble(int indexOnGenome)
           
 boolean equals(Object o)
           
 int getEndOnGenome()
           
 double getPixelLengthPerBase()
           
 int getPixelWidth()
           
 int getSequenceLength()
           
 int getStartOnGenome()
           
 int getViewEndOnGenome()
           
 int getViewStartOnGenome()
           
 int hashCode()
           
 boolean hasSameScaleWith(TrackWindow other)
           
 boolean isPositiveStrand()
           
 boolean isReverseStrand()
           
 TrackWindow mask(TrackWindow mask)
           
 TrackWindow newPixelWidthWindow(int pixelSize)
           
 TrackWindow newWindow(int newStartOnGenome, int newEndOnGenome)
           
 boolean overlapWith(GenomeRange g)
           
 boolean overlapWith(TrackWindow other)
           
 boolean sameRangeWith(TrackWindow window)
           
 TrackWindow scroll(int startDiff)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TrackWindow

public TrackWindow()

TrackWindow

public TrackWindow(int pixelWidth,
                   int startIndexOnGenome,
                   int endIndexOnGenome)

TrackWindow

public TrackWindow(TrackWindow other)
Method Detail

convertToPixelX

public int convertToPixelX(int indexOnGenome)
calculate the X position (pixel address) in a track window of a given index on genome.

Parameters:
indexOnGenome -
Returns:
relative X position in a window (0 origin).

convertToPixelXDouble

public double convertToPixelXDouble(int indexOnGenome)

convertToGenomePosition

public int convertToGenomePosition(int xOnWindow)
Parameters:
xOnWindow - calculate the genome index of a given x position in the current window
Returns:
genome position

convertToPixelLength

public int convertToPixelLength(int rangeOnGenome)

getPixelLengthPerBase

public double getPixelLengthPerBase()
Returns:
pixel length / (genome end - genome start);

getPixelWidth

public int getPixelWidth()
Returns:
the window size

getSequenceLength

public int getSequenceLength()
Returns:
the sequence width

getViewStartOnGenome

public int getViewStartOnGenome()

getViewEndOnGenome

public int getViewEndOnGenome()

getStartOnGenome

public int getStartOnGenome()
Returns:
start position on the genome currently displayed in the window

getEndOnGenome

public int getEndOnGenome()
Returns:
end position on the genome currently displayed in the window

sameRangeWith

public boolean sameRangeWith(TrackWindow window)

isReverseStrand

public boolean isReverseStrand()

isPositiveStrand

public boolean isPositiveStrand()

newWindow

public TrackWindow newWindow(int newStartOnGenome,
                             int newEndOnGenome)

scroll

public TrackWindow scroll(int startDiff)

newPixelWidthWindow

public TrackWindow newPixelWidthWindow(int pixelSize)

contains

public boolean contains(TrackWindow other)

overlapWith

public boolean overlapWith(GenomeRange g)

overlapWith

public boolean overlapWith(TrackWindow other)

hasSameScaleWith

public boolean hasSameScaleWith(TrackWindow other)

mask

public TrackWindow mask(TrackWindow mask)

compareTo

public int compareTo(TrackWindow o)
Specified by:
compareTo in interface Comparable<TrackWindow>

equals

public boolean equals(Object o)
Overrides:
equals in class Object

center

public int center()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2012 utgenome.org. All Rights Reserved.