org.utgenome.gwt.utgb.client.track
Interface Track

All Superinterfaces:
TrackEntry, TrackGroupPropertyChangeListener
All Known Implementing Classes:
BEDTrack, ChromosomeMapTrack, CSEGTrack, DASTrack, DBSelectTrack, DebugToolBoxTrack, GenomeTrack, GenomeTrackTextTest, KeywordSearchTrack, MiniBrowserTrack, NavigatorTrack, OldUTGBAddTrackTrack, OldUTGBPropertyTrack, OldUTGBRulerTrack, OldUTGBTrack, OperationTrack, ParameterTrack, PropertyEditTrack, ReadTrack, RefSeqTrack, RibbonRulerTrack, RulerTrack, SAMQueryTrack, SAMTrack, ScaleBarTrack, ScrollButtonTrack, SequenceRulerTrack, ToolBoxTrack, TrackBase, TrackGenTrack, TrackTreeTrack, URLQueryArgumentTrack, ValueSelectorTrack, ViewLoaderTrack, WIGGraphCanvasTrack, WIGTrack, WindowControlTrack

public interface Track
extends TrackEntry, TrackGroupPropertyChangeListener

Track is an interface for implementing your own track. Rather than directly implements this interface, it might be better to start with extending TrackBase class, which already implements several naive methods such as setTrackGroup(TrackGroup) , getTrackGroup(), etc.

Tips to implement your own track:

The initialization process of tracks is as follows:

  1. Create an instance of your track using a public consutructor of your track or Track.TrackFactory.newInstance() method.
  2. Call the TrackGroup.addTrack(Track) method to add your tracks.
  3. TrackGroup automatically calls your setUp(TrackFrame, TrackGroup) method on appropricate timing, that is, when TrackFrame and TrackGroup are ready.
  4. After the setup, onChangeTrackGroupProperty(TrackGroupPropertyChange) and onChangeTrackWindow(TrackWindow) are activated.
  5. refresh() is called in the TrackQueue

Author:
leo

Nested Class Summary
static class Track.TrackFactory
          TrackFactory helps to create new Track instance, which can be used to defer its instantiation.
 
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 string)
          Report an error
 TrackConfig getConfig()
          Get the TrackConfig panel.
 int getDefaultWindowHeight()
           
 TrackFrame getFrame()
          Get the frame of this track
 int getMinimumWindowHeight()
           
 TrackGroup getTrackGroup()
           
 String getTrackGroupProperty(String key)
           
 String getTrackGroupProperty(String key, String defaultValue)
           
 TrackInfo getTrackInfo()
           
 com.google.gwt.user.client.ui.Widget getWidget()
           
 boolean isInitialized()
           
 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
 void restoreProperties(CanonicalProperties properties)
          Override this method to restore internal state of this track
 void saveProperties(CanonicalProperties saveData)
          Override this method to save internal state of this track into a Properties object
 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.
 String toXML()
           
 void toXML(XMLWriter xmlWriter)
           
 
Methods inherited from interface org.utgenome.gwt.utgb.client.track.TrackEntry
getName, isTrack, isTrackGroup
 

Method Detail

setUp

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. Override this method to write initialization codes for your tracks.

Parameters:
tracKFrame - the TrackFrame of this track
group - the TrackGroup of this track

isInitialized

boolean isInitialized()
Returns:
true if setUp(TrackFrame, TrackGroup) has already done.

getTrackInfo

TrackInfo getTrackInfo()
Returns:
the information of the track

draw

void draw()
draw the track widget


refresh

void refresh()
draw and resize the frame


getWidget

com.google.gwt.user.client.ui.Widget getWidget()
Returns:
the track widget

getDefaultWindowHeight

int getDefaultWindowHeight()
Returns:
default height of the track window

getMinimumWindowHeight

int getMinimumWindowHeight()
Returns:
minimum height of the track window

onChangeTrackConfig

void onChangeTrackConfig(TrackConfigChange change)
An event handler when some cofigurations of the track changes

Parameters:
config -

setTrackGroup

void setTrackGroup(TrackGroup trackGroup)
set a mediator of this track

Parameters:
trackGroup - mediator of this track

getTrackGroup

TrackGroup getTrackGroup()
Returns:
the mediator of this track

getTrackGroupProperty

String getTrackGroupProperty(String key,
                             String defaultValue)

getTrackGroupProperty

String getTrackGroupProperty(String key)

setTrackGroupProperty

void setTrackGroupProperty(String key,
                           String value)

setFrame

void setFrame(TrackFrame frame)
Set the frame that wraps this track

Parameters:
frame - a frame for this track

getFrame

TrackFrame getFrame()
Get the frame of this track

Returns:
the frame of this track

getConfig

TrackConfig getConfig()
Get the TrackConfig panel. Override this method to return your own configuration panel

Returns:

setConfig

void setConfig(TrackConfig config)

toXML

String toXML()

toXML

void toXML(XMLWriter xmlWriter)

loadView

void loadView(TrackView.Track view)
load the track parameters from the view definition

Parameters:
view -

saveProperties

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

Parameters:
xmlWriter -

restoreProperties

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

Parameters:
properties -

onChangeTrackGroupProperty

void onChangeTrackGroupProperty(TrackGroupPropertyChange change)
An event handler when some properties shared within the track group has changed

Parameters:
change -

onChangeTrackHeight

void onChangeTrackHeight(int newHeight)

beforeChangeTrackWindow

void beforeChangeTrackWindow(TrackWindow newWindow)
An event handler that will be invoked before the track window location change

Parameters:
newWindow -

onChangeTrackWindow

void onChangeTrackWindow(TrackWindow newWindow)
An event handler when the track window location has changed

Parameters:
newWindow -

onChange

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

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

error

void error(String string)
Report an error

Parameters:
string -


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