org.utgenome.gwt.utgb.client.track.impl
Class TrackGroupPropertyImpl

java.lang.Object
  extended by org.utgenome.gwt.utgb.client.track.impl.TrackGroupPropertyImpl
All Implemented Interfaces:
TrackGroupProperty, TrackGroupPropertyWriter

public class TrackGroupPropertyImpl
extends Object
implements TrackGroupProperty, TrackGroupPropertyWriter

TrackGroupPropertyImpl is a set of (key, value) pairs shared within a TrackGroup Instead of directly access TrackGroupPropertyImpl, you must read and write values through the TrackGroupProperty and TrackGroupPropertyWriter, respectively. This indirection is necessary for broadcasting Track.onChangeTrackGroupProperty(TrackGroupPropertyChange) and Track.onChangeTrackWindow(TrackWindow) events to all tracks in a group.

Author:
leo

Constructor Summary
TrackGroupPropertyImpl(TrackGroup trackGroup)
           
 
Method Summary
 void addTrackGroupPropertyChangeListener(TrackGroupPropertyChangeListener listener)
           
 void apply(TrackGroupPropertyChange change)
          Apply the property changes to this writer
 void clear()
           
 String getProperty(String key)
          get a property value of a given key
 String getProperty(String key, String defaultValue)
          get a property value of a given key.
 TrackWindow getTrackWindow()
           
 Set<String> keySet()
           
protected  void notifyTheChange(TrackGroupPropertyChange change, TrackWindow newWindow)
          Notify the change to the track group and listeners
 void removeTrackGroupPropertyChangeListener(TrackGroupPropertyChangeListener listener)
           
 void scaleDownTrackWindow()
           
 void scaleUpTrackWindow()
           
 void scrollTrackWindow(double scrollPercentage)
           
 void setProperty(Map<String,String> property)
          Set a set of properties specified in the given Map of properties.
 void setProperty(Map<String,String> properties, TrackWindow newWindow)
           
 void setProperty(String key, String value)
          Set a property (key, value)
 void setProperyChangeNotifaction(boolean enable)
           
 void setTrackWindow(int startOnGenome, int endOnGenome)
          set a genome location displayed in the current TrackWindowImpl
 void setTrackWindow(TrackWindow newWindow)
           
 void setTrackWindowSize(int windowWidth)
           
static XMLWriter toXML(TrackWindow w, XMLWriter writer)
           
 void toXML(XMLWriter xmlWriter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrackGroupPropertyImpl

public TrackGroupPropertyImpl(TrackGroup trackGroup)
Method Detail

setProperyChangeNotifaction

public void setProperyChangeNotifaction(boolean enable)
Specified by:
setProperyChangeNotifaction in interface TrackGroupPropertyWriter

getProperty

public String getProperty(String key)
Description copied from interface: TrackGroupProperty
get a property value of a given key

Specified by:
getProperty in interface TrackGroupProperty
Returns:
a property value of a given key

getProperty

public String getProperty(String key,
                          String defaultValue)
Description copied from interface: TrackGroupProperty
get a property value of a given key. If the corresponding property is not found, return the default value

Specified by:
getProperty in interface TrackGroupProperty
Returns:
the property value of the key if it exists, otherwise return the defaultValue

getTrackWindow

public TrackWindow getTrackWindow()
Specified by:
getTrackWindow in interface TrackGroupProperty

clear

public void clear()

notifyTheChange

protected void notifyTheChange(TrackGroupPropertyChange change,
                               TrackWindow newWindow)
Notify the change to the track group and listeners

Parameters:
change -

setProperty

public void setProperty(String key,
                        String value)
Description copied from interface: TrackGroupPropertyWriter
Set a property (key, value)

Specified by:
setProperty in interface TrackGroupPropertyWriter

setProperty

public void setProperty(Map<String,String> property)
Description copied from interface: TrackGroupPropertyWriter
Set a set of properties specified in the given Map of properties. This method is useful when you have to set multiple property values at the same time before invoking onChangeTrackProperty events.

Specified by:
setProperty in interface TrackGroupPropertyWriter

setProperty

public void setProperty(Map<String,String> properties,
                        TrackWindow newWindow)
Specified by:
setProperty in interface TrackGroupPropertyWriter

setTrackWindow

public void setTrackWindow(int startOnGenome,
                           int endOnGenome)
Description copied from interface: TrackGroupPropertyWriter
set a genome location displayed in the current TrackWindowImpl

Specified by:
setTrackWindow in interface TrackGroupPropertyWriter

setTrackWindowSize

public void setTrackWindowSize(int windowWidth)
Specified by:
setTrackWindowSize in interface TrackGroupPropertyWriter

keySet

public Set<String> keySet()
Specified by:
keySet in interface TrackGroupProperty
Returns:
the key set of properties

setTrackWindow

public void setTrackWindow(TrackWindow newWindow)
Specified by:
setTrackWindow in interface TrackGroupPropertyWriter

apply

public void apply(TrackGroupPropertyChange change)
Description copied from interface: TrackGroupPropertyWriter
Apply the property changes to this writer

Specified by:
apply in interface TrackGroupPropertyWriter

addTrackGroupPropertyChangeListener

public void addTrackGroupPropertyChangeListener(TrackGroupPropertyChangeListener listener)

removeTrackGroupPropertyChangeListener

public void removeTrackGroupPropertyChangeListener(TrackGroupPropertyChangeListener listener)

toXML

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

toXML

public static XMLWriter toXML(TrackWindow w,
                              XMLWriter writer)

scrollTrackWindow

public void scrollTrackWindow(double scrollPercentage)
Specified by:
scrollTrackWindow in interface TrackGroupPropertyWriter

scaleDownTrackWindow

public void scaleDownTrackWindow()
Specified by:
scaleDownTrackWindow in interface TrackGroupPropertyWriter

scaleUpTrackWindow

public void scaleUpTrackWindow()
Specified by:
scaleUpTrackWindow in interface TrackGroupPropertyWriter


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