3030import org .gitools .heatmap .decorator .impl .LinearDecorator ;
3131import org .gitools .matrix .filter .AnnotationFunction ;
3232import org .gitools .utils .formatter .HeatmapTextFormatter ;
33+ import org .gitools .utils .formatter .ITextFormatter ;
34+ import org .gitools .utils .formatter .ScientificHeatmapTextFormatter ;
3335
3436import javax .xml .bind .annotation .*;
3537import java .awt .*;
4143@ XmlRootElement
4244public class HeatmapDecoratorHeader extends HeatmapHeader {
4345
46+ public static final String PROPERTY_NUMERIC_FORMATTER = "numericFormatter" ;
4447 public enum LabelPositionEnum {
4548 leftOf ,
4649 rightOf ,
@@ -59,6 +62,9 @@ public enum LabelPositionEnum {
5962 @ XmlElement
6063 private List <String > annotationLabels ;
6164
65+
66+ private transient ITextFormatter numericFormatter = ScientificHeatmapTextFormatter .INSTANCE ;
67+
6268 @ XmlTransient
6369 private String sortLabel ;
6470
@@ -121,7 +127,7 @@ public void decorate(Decoration decoration, String identifier, String annotation
121127
122128 decorator .decorate (
123129 decoration ,
124- HeatmapTextFormatter . TWO_DECIMALS ,
130+ numericFormatter ,
125131 annotations ,
126132 annotations .getLayers ().get (annotation ),
127133 identifier );
@@ -202,6 +208,20 @@ public void setSortLabel(String label) {
202208
203209 }
204210
211+
212+ public ITextFormatter getNumericFormatter () {
213+ if (numericFormatter == null ) {
214+ return ScientificHeatmapTextFormatter .INSTANCE ;
215+ }
216+ return numericFormatter ;
217+ }
218+
219+ public void setNumericFormatter (ITextFormatter numericFormatter ) {
220+ this .numericFormatter = numericFormatter ;
221+ firePropertyChange (PROPERTY_NUMERIC_FORMATTER , null , numericFormatter );
222+ }
223+
224+
205225 @ Override
206226 public boolean isNumeric () {
207227 return true ;
0 commit comments