|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Track
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:
Track
must have a Widget
that can be retrieved via getWidget()
method. This returned
widget is used to display your track.setUp(TrackFrame, TrackGroup)
method, which is automatically called by the
track group to which your track belongs.getFrame()
, to interact with TrackFrame
surrounding your track.getTrackGroup()
to retrieve shared properties (e.g., TrackGroupProperty
, TrackWindow
, etc.) among tracks within the currnt track group.onChangeTrackGroupProperty(TrackGroupPropertyChange)
and
onChangeTrackWindow(TrackWindow)
to recieve changes on properties of the track group. These methods become
active only after setUp(TrackFrame, TrackGroup)
is called.The initialization process of tracks is as follows:
Track.TrackFactory.newInstance()
method.TrackGroup.addTrack(Track)
method to add your tracks.TrackGroup
automatically calls your setUp(TrackFrame, TrackGroup)
method on appropricate
timing, that is, when TrackFrame
and TrackGroup
are ready.onChangeTrackGroupProperty(TrackGroupPropertyChange)
and
onChangeTrackWindow(TrackWindow)
are activated.refresh()
is called in the TrackQueue
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 |
---|
void setUp(TrackFrame trackFrame, TrackGroup group)
TrackFrame
and TrackGroup
for this track become ready, that is, the
track is drawable. Override this method to write initialization codes for your tracks.
tracKFrame
- the TrackFrame
of this trackgroup
- the TrackGroup
of this trackboolean isInitialized()
setUp(TrackFrame, TrackGroup)
has already done.TrackInfo getTrackInfo()
void draw()
void refresh()
com.google.gwt.user.client.ui.Widget getWidget()
int getDefaultWindowHeight()
int getMinimumWindowHeight()
void onChangeTrackConfig(TrackConfigChange change)
config
- void setTrackGroup(TrackGroup trackGroup)
trackGroup
- mediator of this trackTrackGroup getTrackGroup()
String getTrackGroupProperty(String key, String defaultValue)
String getTrackGroupProperty(String key)
void setTrackGroupProperty(String key, String value)
void setFrame(TrackFrame frame)
frame
- a frame for this trackTrackFrame getFrame()
TrackConfig getConfig()
TrackConfig
panel. Override this method to return your own configuration panel
void setConfig(TrackConfig config)
String toXML()
void toXML(XMLWriter xmlWriter)
void loadView(TrackView.Track view)
view
- void saveProperties(CanonicalProperties saveData)
Properties
object
xmlWriter
- void restoreProperties(CanonicalProperties properties)
properties
- void onChangeTrackGroupProperty(TrackGroupPropertyChange change)
change
- void onChangeTrackHeight(int newHeight)
void beforeChangeTrackWindow(TrackWindow newWindow)
newWindow
- void onChangeTrackWindow(TrackWindow newWindow)
newWindow
- void onChange(TrackGroupPropertyChange change, TrackWindow newWindow)
TrackGroupPropertyChangeListener
onChange
in interface TrackGroupPropertyChangeListener
change
- property changes. null value means no property changenewWindow
- window changes. null value means no window changesvoid error(String string)
string
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |