|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.utgenome.gwt.utgb.client.track.TrackGroup
public class TrackGroup
A TrackGroup
manages a set of tracks. You can create a track group with several tracks by using
addTrack(Track)
method. Every TrackGroup
can have several child TrackGroup
s. For example,
when a TrackGroup
A has a set of tracks [T1, T2, T3], and another TrackGroup B consists of [T4, T5],
addTrackGroup(TrackGroup)
to the TrackGroup
A yields a nested track group: [T1, T2, T3, [T4, T5]].
Broadcasts to this track group are send to all tracks in this group, including T1, T2, T3 and the track group B([T4,
T5]). However, T4 and T5 do not recieve this broadcast message directly, since it is subsumed in
onParentTrackGroupPropertyChange(TrackGroupPropertyChange)
and
onParentTrackWindowChange(TrackWindow)
method in the track group B. So, whether bypassing
broadcast messages into child tracks or not depends on your TrackGroup
implementation. In the default
implementation of TrackGroup
(i.e. TrackGroupBase
),
onParentTrackGroupPropertyChange(TrackGroupPropertyChange)
and
onParentTrackWindowChange(TrackWindow)
methods just ignore such broadcast messages from the parent
group.
In order to recieve broadcast messages from the parent group, override
onParentTrackGroupPropertyChange(TrackGroupPropertyChange)
or
onParentTrackWindowChange(TrackWindow)
methods as follows:
public void onParentTrackGroupPropertyChange(TrackGroupPropertyChange change)
{
change.apply(getPropertyWriter());
}
public void onParentTrackWindowChange(TrackWindow newWindow)
{
getPropertyWriter().setTrackWindow(newWindow);
}
Changes to the TrackGroupPropertyWriter
are automatically broadcasted to tracks in the group.
TrackGroup
has another important role to localize broadcast message within a TrackGroup
. For example,
a broadcast message within the TrackGroup
B is send to the track T4 and T5 only; tracks T1, T2, and T3 do not
recieve this localized broadcast message.
When you want to use common variables shared within a track group, extend TrackGroup
class and put these
variables as field parameters of this extention.
Nested Class Summary | |
---|---|
static class |
HasFactory.TrackGroupFactory
|
Field Summary | |
---|---|
protected TrackLayoutManager |
_layoutManager
|
protected boolean |
_notifyResize
|
protected TrackGroup |
_parentTrackGroup
|
protected ArrayList<TrackUpdateListener> |
_trackEventListenerList
|
protected ArrayList<TrackGroup> |
_trackGroupList
|
protected String |
_trackGroupName
|
protected TrackGroupPropertyImpl |
_trackGroupProperty
|
protected ArrayList<Track> |
_trackList
|
Constructor Summary | |
---|---|
TrackGroup(String trackGroupName)
|
Method Summary | |
---|---|
void |
addTrack(Track track)
Add a new track to this group. |
void |
addTrackGroup(TrackGroup trackGroup)
Add a track group as a child of this track group. |
void |
addTrackGroupPropertyChangeListener(TrackGroupPropertyChangeListener listener)
Add a TrackGroupPropertyChangeListener |
void |
addTrackUpdateListener(TrackUpdateListener listener)
Add a TrackUpdateListener |
void |
broadcastChange(TrackGroupPropertyChange change,
TrackWindow newWindow)
Broadcast the property change to all of the tracks in this track group. |
void |
broadCastScrollTrackWindow(double scrollPercentage)
|
void |
broadCastWindowSizeChange(int scaleDiff)
|
void |
clear()
|
int |
compareTo(TrackGroup o)
|
static TrackGroup |
createTrackGroup(TrackView view)
Create a track group from a given TrackView |
static HasFactory.TrackGroupFactory |
factory()
|
List<Track> |
getAllTrackList()
Get the list of tracks containd in this group, including tracks within the sub groups. |
BrowserServiceAsync |
getBrowserService()
|
protected String |
getClassName()
|
int |
getHeight()
|
String |
getName()
Get the entry name |
TrackGroup |
getParentTrackGroup()
Return the current parent trackgroup. |
String |
getProperty(String key)
|
String |
getProperty(String key,
String defaultValue)
|
TrackGroupProperty |
getPropertyReader()
Get the TrackGroupProperty of this track group |
TrackGroupPropertyWriter |
getPropertyWriter()
Get the TrackGroupPropertyWriter of this track group. |
TrackGroup |
getRootTrackGroup()
Get the root TrackGroup |
List<TrackEntry> |
getTrackEntryList()
Get the list of TrackEntry s, including both of Track and TrackGroup . |
List<TrackGroup> |
getTrackGroupList()
Get the list of track groups containd in this group, excluding track groups within the sub groups. |
String |
getTrackGroupName()
|
int |
getTrackIndex(Track track)
Return the index of the given track in the group. |
List<Track> |
getTrackList()
Get the list of tracks containd in this group, excluding tracks within the sub groups. |
TrackWindow |
getTrackWindow()
Get the TrackWindow of this track group |
void |
insertTrack(Track track,
int beforeIndex)
Insert a new track before the specified index |
boolean |
isTrack()
Test whether this entry is Track or not. |
boolean |
isTrackGroup()
Test whether this entry is TrackGroup or not |
void |
notifyResize()
Notify the change of the inner track widget size to this group |
void |
onParentChange(TrackGroupPropertyChange change,
TrackWindow newWindow)
|
void |
onParentTrackGroupPropertyChange(TrackGroupPropertyChange change)
An event handler when the TrackGroupProperty of the parent group has changed. |
void |
onParentTrackWindowChange(TrackWindow newWindow)
An event handler when the TrackWindow of this group has changed. |
void |
redrawAll()
Redraw all child tracks, including tracks within the sub groups. |
protected void |
removeParentTrackGroup()
|
void |
removeTrack(Track track)
Remove the specified track from this group. |
void |
removeTrackGroup(TrackGroup trackGroup)
Removed the specified track group and its belonging tracks from this group. |
void |
removeTrackGroupPropertyChangeListener(TrackGroupPropertyChangeListener listener)
Remove the specified TrackGroupPropertyChangeListener |
void |
removeTrackUpdateListener(TrackUpdateListener listener)
Remove the specified TrackUpdateListener |
protected void |
setParentTrackGroup(TrackGroup parentTrackGroup)
|
void |
setResizeNotification(boolean enable)
enable/disable notification of track frame resizes |
void |
setTrackGroupName(String newTrackGroupName)
|
protected void |
setTrackGroupProperty(TrackGroupProperty trackGroupProperty)
|
protected void |
setTrackGroupProperty(TrackGroupPropertyImpl trackGroupProperty)
|
void |
setTrackLayoutManager(TrackLayoutManager layout)
|
void |
setTrackWindow(TrackWindow newWindow)
Set the track window (window size, start on genome, end on genome) at once |
void |
setTrackWindowLocation(int startOnGenome,
int endOnGenome)
Set the window location on the genome. |
void |
setTrackWindowWidth(int windowWidth)
Set the width of the track window of this group. |
protected void |
storeInternalProperties(Properties saveData)
Save (store) the internal properties of this track group into the given Properties |
void |
toXML(XMLWriter xmlWriter)
Output the state of this track group into XMLWriter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ArrayList<Track> _trackList
protected ArrayList<TrackGroup> _trackGroupList
protected TrackGroupPropertyImpl _trackGroupProperty
protected ArrayList<TrackUpdateListener> _trackEventListenerList
protected TrackLayoutManager _layoutManager
protected TrackGroup _parentTrackGroup
protected String _trackGroupName
protected boolean _notifyResize
Constructor Detail |
---|
public TrackGroup(String trackGroupName)
Method Detail |
---|
public static HasFactory.TrackGroupFactory factory()
public void clear()
public void addTrack(Track track)
track
- public void insertTrack(Track track, int beforeIndex)
track
- beforeIndex
- public void addTrackGroup(TrackGroup trackGroup)
TrackUpdateListener
s added to the parent track group are propagated to the inserted trackGroup.
trackGroup
- public void broadcastChange(TrackGroupPropertyChange change, TrackWindow newWindow)
change
- changes of track propertiespublic void broadCastScrollTrackWindow(double scrollPercentage)
public void broadCastWindowSizeChange(int scaleDiff)
public TrackGroupProperty getPropertyReader()
TrackGroupProperty
of this track group
public String getProperty(String key, String defaultValue)
public String getProperty(String key)
public TrackGroupPropertyWriter getPropertyWriter()
TrackGroupPropertyWriter
of this track group. Any modification via the setter methods in the
TrackGroupPropertyWriter
will be broadcasted to this group via
#onParentTrackGroupPropertyChange(TrackGroupProperty)
.
public List<TrackGroup> getTrackGroupList()
public List<Track> getTrackList()
public List<Track> getAllTrackList()
public TrackWindow getTrackWindow()
TrackWindow
of this track group
public void onParentChange(TrackGroupPropertyChange change, TrackWindow newWindow)
public void onParentTrackWindowChange(TrackWindow newWindow)
TrackWindow
of this group has changed. Override this method to implement your
own event handler for this track group.
newWindow
- public void onParentTrackGroupPropertyChange(TrackGroupPropertyChange change)
TrackGroupProperty
of the parent group has changed. Override this method to
implement your own event handler for this track group.
change
- public void redrawAll()
public void removeTrack(Track track)
track
- public void removeTrackGroup(TrackGroup trackGroup)
TrackUpdateListener
s propagated to the removed track group will be removed.
trackGroup
- public void setTrackWindowLocation(int startOnGenome, int endOnGenome)
onParentTrackWindowChange(TrackWindow)
method.
startOnGenome
- endOnGenome
- public void setTrackWindowWidth(int windowWidth)
onParentTrackWindowChange(TrackWindow)
.
windowWidth
- public void addTrackUpdateListener(TrackUpdateListener listener)
TrackUpdateListener
listener
- public void removeTrackUpdateListener(TrackUpdateListener listener)
TrackUpdateListener
listener
- public int getTrackIndex(Track track)
track
-
public void setTrackWindow(TrackWindow newWindow)
newWindow
- public TrackGroup getParentTrackGroup()
protected void setParentTrackGroup(TrackGroup parentTrackGroup)
public void notifyResize()
public void setResizeNotification(boolean enable)
notify
- true to enable, false to disablepublic int getHeight()
public void setTrackLayoutManager(TrackLayoutManager layout)
public String getTrackGroupName()
public void setTrackGroupName(String newTrackGroupName)
protected void setTrackGroupProperty(TrackGroupPropertyImpl trackGroupProperty)
public String getName()
TrackEntry
getName
in interface TrackEntry
public boolean isTrack()
TrackEntry
Track
or not.
isTrack
in interface TrackEntry
Track
, othewise false.public boolean isTrackGroup()
TrackEntry
TrackGroup
or not
isTrackGroup
in interface TrackEntry
TrackGroup
, otherwise false.public List<TrackEntry> getTrackEntryList()
TrackEntry
s, including both of Track
and TrackGroup
.
public void addTrackGroupPropertyChangeListener(TrackGroupPropertyChangeListener listener)
TrackGroupPropertyChangeListener
listener
- public void removeTrackGroupPropertyChangeListener(TrackGroupPropertyChangeListener listener)
TrackGroupPropertyChangeListener
listener
- public TrackGroup getRootTrackGroup()
TrackGroup
protected String getClassName()
protected void removeParentTrackGroup()
public int compareTo(TrackGroup o)
compareTo
in interface Comparable<TrackGroup>
Comparable.compareTo(Object)
protected void setTrackGroupProperty(TrackGroupProperty trackGroupProperty)
public void toXML(XMLWriter xmlWriter)
XMLWriter
xmlWriter
- protected void storeInternalProperties(Properties saveData)
Properties
saveData
- public static TrackGroup createTrackGroup(TrackView view) throws UTGBClientException
TrackView
view
-
UTGBClientException
public BrowserServiceAsync getBrowserService()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |