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

java.lang.Object
  extended by org.utgenome.gwt.utgb.client.track.TrackBase
All Implemented Interfaces:
Track, TrackEntry, TrackGroupPropertyChangeListener
Direct Known Subclasses:
ChromosomeMapTrack, DBSelectTrack, GenomeTrack, GenomeTrackTextTest, KeywordSearchTrack, MiniBrowserTrack, NavigatorTrack, OldUTGBAddTrackTrack, OldUTGBPropertyTrack, OldUTGBTrack, OperationTrack, ParameterTrack, PropertyEditTrack, ReadTrack, RibbonRulerTrack, RulerTrack, SAMQueryTrack, SAMTrack, ScrollButtonTrack, SequenceRulerTrack, ToolBoxTrack, TrackGenTrack, TrackTreeTrack, URLQueryArgumentTrack, ValueSelectorTrack, ViewLoaderTrack, WIGTrack, WindowControlTrack

public abstract class TrackBase
extends Object
implements Track

TrackBase is a base class that supports to implement your own Tracks.

Author:
leo

Nested Class Summary
static class TrackBase.TrackFrameConfig
           
 
Nested classes/interfaces inherited from interface org.utgenome.gwt.utgb.client.track.Track
Track.TrackFactory
 
Field Summary
protected  TrackFrame _frame
           
protected  TrackGroup _trackGroup
           
protected  TrackInfo _trackInfo
           
 TrackBase.TrackFrameConfig frameConfig
           
 
Constructor Summary
TrackBase(String trackName)
           
TrackBase(TrackInfo trackInfo)
           
 
Method Summary
 void beforeChangeTrackWindow(TrackWindow newWindow)
          An event handler that will be invoked before the track window location change
 void draw()
          draw the track widget
 void error(String message)
          Report an error
 BrowserServiceAsync getBrowserService()
          Get the RPC service for communicating with the server
 String getClassName()
           
 TrackConfig getConfig()
          Get the TrackConfig panel.
 Coordinate getCoordinate()
          Get the current genome coordinate
 int getDefaultWindowHeight()
           
 TrackFrame getFrame()
          Get the frame of this track
 int getMinimumWindowHeight()
           
 String getName()
          Get the entry name
 TrackGroup getTrackGroup()
           
 String getTrackGroupProperty(String key)
           
 String getTrackGroupProperty(String key, String defaultValue)
           
 TrackInfo getTrackInfo()
           
 TrackWindow getTrackWindow()
           
 boolean isInitialized()
           
 boolean isTrack()
          Test whether this entry is Track or not.
 boolean isTrackGroup()
          Test whether this entry is TrackGroup or not
 void loadView(TrackView.Track view)
          load the track parameters from the view definition
 void onChange(TrackGroupPropertyChange change, TrackWindow newWindow)
          Handle change event.
 void onChangeTrackConfig(TrackConfigChange change)
          An event handler when some cofigurations of the track changes
 void onChangeTrackGroupProperty(TrackGroupPropertyChange change)
          An event handler when some properties shared within the track group has changed
 void onChangeTrackHeight(int newHeight)
           
 void onChangeTrackWindow(TrackWindow newWindow)
          An event handler when the track window location has changed
 void refresh()
          draw and resize the frame
 String resolvePropertyValues(String template)
          Substitute the query parameters in the given string with the actual values.
 void restoreProperties(CanonicalProperties properties)
          Override this method to restore internal state of the track
 void saveProperties(CanonicalProperties saveData)
          Override this method to save internal state of the track into a Properties object
 void setCenterOfTrackWindow(String chr, int start, int end)
           
 void setConfig(TrackConfig config)
           
 void setFrame(TrackFrame frame)
          Set the frame that wraps this track
 void setTrackGroup(TrackGroup trackGroup)
          set a mediator of this track
 void setTrackGroupProperty(String key, String value)
           
 void setUp(TrackFrame trackFrame, TrackGroup group)
          This method is invoked when TrackFrame and TrackGroup for this track become ready, that is, the track is drawable.
 TrackView.Track toView()
           
 String toXML()
           
 void toXML(XMLWriter xmlWriter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.utgenome.gwt.utgb.client.track.Track
getWidget
 

Field Detail

_trackGroup

protected TrackGroup _trackGroup

_frame

protected TrackFrame _frame

_trackInfo

protected final TrackInfo _trackInfo

frameConfig

public TrackBase.TrackFrameConfig frameConfig
Constructor Detail

TrackBase

public TrackBase(String trackName)

TrackBase

public TrackBase(TrackInfo trackInfo)
Method Detail

setUp

public void setUp(TrackFrame trackFrame,
                  TrackGroup group)
Description copied from interface: Track
This method is invoked when TrackFrame and TrackGroup for this track become ready, that is, the track is drawable. Override this method to write initialization codes for your tracks.

Specified by:
setUp in interface Track
group - the TrackGroup of this track

resolvePropertyValues

public String resolvePropertyValues(String template)
Substitute the query parameters in the given string with the actual values.

Parameters:
template -
Returns:

getTrackGroup

public TrackGroup getTrackGroup()
Specified by:
getTrackGroup in interface Track
Returns:
the mediator of this track

getTrackWindow

public TrackWindow getTrackWindow()

getTrackInfo

public TrackInfo getTrackInfo()
Specified by:
getTrackInfo in interface Track
Returns:
the information of the track

setTrackGroup

public void setTrackGroup(TrackGroup trackGroup)
Description copied from interface: Track
set a mediator of this track

Specified by:
setTrackGroup in interface Track
Parameters:
trackGroup - mediator of this track

getFrame

public TrackFrame getFrame()
Description copied from interface: Track
Get the frame of this track

Specified by:
getFrame in interface Track
Returns:
the frame of this track

setFrame

public void setFrame(TrackFrame frame)
Description copied from interface: Track
Set the frame that wraps this track

Specified by:
setFrame in interface Track
Parameters:
frame - a frame for this track

getDefaultWindowHeight

public int getDefaultWindowHeight()
Specified by:
getDefaultWindowHeight in interface Track
Returns:
default height of the track window

getMinimumWindowHeight

public int getMinimumWindowHeight()
Specified by:
getMinimumWindowHeight in interface Track
Returns:
minimum height of the track window

onChangeTrackGroupProperty

public void onChangeTrackGroupProperty(TrackGroupPropertyChange change)
Description copied from interface: Track
An event handler when some properties shared within the track group has changed

Specified by:
onChangeTrackGroupProperty in interface Track

beforeChangeTrackWindow

public void beforeChangeTrackWindow(TrackWindow newWindow)
Description copied from interface: Track
An event handler that will be invoked before the track window location change

Specified by:
beforeChangeTrackWindow in interface Track

onChangeTrackWindow

public void onChangeTrackWindow(TrackWindow newWindow)
Description copied from interface: Track
An event handler when the track window location has changed

Specified by:
onChangeTrackWindow in interface Track

onChange

public void onChange(TrackGroupPropertyChange change,
                     TrackWindow newWindow)
Description copied from interface: TrackGroupPropertyChangeListener
Handle change event.

Specified by:
onChange in interface Track
Specified by:
onChange in interface TrackGroupPropertyChangeListener
Parameters:
change - property changes. null value means no property change
newWindow - window changes. null value means no window changes

draw

public void draw()
Description copied from interface: Track
draw the track widget

Specified by:
draw in interface Track

refresh

public void refresh()
Description copied from interface: Track
draw and resize the frame

Specified by:
refresh in interface Track

getCoordinate

public Coordinate getCoordinate()
Get the current genome coordinate

Returns:

isInitialized

public boolean isInitialized()
Specified by:
isInitialized in interface Track
Returns:
true if Track.setUp(TrackFrame, TrackGroup) has already done.

onChangeTrackConfig

public void onChangeTrackConfig(TrackConfigChange change)
Description copied from interface: Track
An event handler when some cofigurations of the track changes

Specified by:
onChangeTrackConfig in interface Track

getConfig

public TrackConfig getConfig()
Description copied from interface: Track
Get the TrackConfig panel. Override this method to return your own configuration panel

Specified by:
getConfig in interface Track
Returns:

setConfig

public void setConfig(TrackConfig config)
Specified by:
setConfig in interface Track

getName

public String getName()
Description copied from interface: TrackEntry
Get the entry name

Specified by:
getName in interface TrackEntry
Returns:
the entry name

isTrack

public boolean isTrack()
Description copied from interface: TrackEntry
Test whether this entry is Track or not.

Specified by:
isTrack in interface TrackEntry
Returns:
true if this entry is Track, othewise false.

isTrackGroup

public boolean isTrackGroup()
Description copied from interface: TrackEntry
Test whether this entry is TrackGroup or not

Specified by:
isTrackGroup in interface TrackEntry
Returns:
true if this entyr is TrackGroup, otherwise false.

loadView

public void loadView(TrackView.Track view)
Description copied from interface: Track
load the track parameters from the view definition

Specified by:
loadView in interface Track

toView

public TrackView.Track toView()

toXML

public String toXML()
Specified by:
toXML in interface Track

toXML

public void toXML(XMLWriter xmlWriter)
Specified by:
toXML in interface Track

getClassName

public String getClassName()

saveProperties

public void saveProperties(CanonicalProperties saveData)
Override this method to save internal state of the track into a Properties object

Specified by:
saveProperties in interface Track
Parameters:
xmlWriter -

restoreProperties

public void restoreProperties(CanonicalProperties properties)
Override this method to restore internal state of the track

Specified by:
restoreProperties in interface Track
Parameters:
properties -

getTrackGroupProperty

public String getTrackGroupProperty(String key)
Specified by:
getTrackGroupProperty in interface Track

getTrackGroupProperty

public String getTrackGroupProperty(String key,
                                    String defaultValue)
Specified by:
getTrackGroupProperty in interface Track

setTrackGroupProperty

public void setTrackGroupProperty(String key,
                                  String value)
Specified by:
setTrackGroupProperty in interface Track

setCenterOfTrackWindow

public void setCenterOfTrackWindow(String chr,
                                   int start,
                                   int end)

getBrowserService

public BrowserServiceAsync getBrowserService()
Get the RPC service for communicating with the server

Returns:

onChangeTrackHeight

public void onChangeTrackHeight(int newHeight)
Specified by:
onChangeTrackHeight in interface Track

error

public void error(String message)
Description copied from interface: Track
Report an error

Specified by:
error in interface Track


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