-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtimeline-bundle.js
2835 lines (2808 loc) · 118 KB
/
timeline-bundle.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* band.js */
Timeline._Band=function(B,G,C){if(B.autoWidth&&typeof G.width=="string"){G.width=G.width.indexOf("%")>-1?0:parseInt(G.width);
}this._timeline=B;
this._bandInfo=G;
this._index=C;
this._locale=("locale" in G)?G.locale:Timeline.getDefaultLocale();
this._timeZone=("timeZone" in G)?G.timeZone:0;
this._labeller=("labeller" in G)?G.labeller:(("createLabeller" in B.getUnit())?B.getUnit().createLabeller(this._locale,this._timeZone):new Timeline.GregorianDateLabeller(this._locale,this._timeZone));
this._theme=G.theme;
this._zoomIndex=("zoomIndex" in G)?G.zoomIndex:0;
this._zoomSteps=("zoomSteps" in G)?G.zoomSteps:null;
this._dragging=false;
this._changing=false;
this._originalScrollSpeed=5;
this._scrollSpeed=this._originalScrollSpeed;
this._onScrollListeners=[];
var A=this;
this._syncWithBand=null;
this._syncWithBandHandler=function(H){A._onHighlightBandScroll();
};
this._selectorListener=function(H){A._onHighlightBandScroll();
};
var E=this._timeline.getDocument().createElement("div");
E.className="timeline-band-input";
this._timeline.addDiv(E);
this._keyboardInput=document.createElement("input");
this._keyboardInput.type="text";
E.appendChild(this._keyboardInput);
SimileAjax.DOM.registerEventWithObject(this._keyboardInput,"keydown",this,"_onKeyDown");
SimileAjax.DOM.registerEventWithObject(this._keyboardInput,"keyup",this,"_onKeyUp");
this._div=this._timeline.getDocument().createElement("div");
this._div.id="timeline-band-"+C;
this._div.className="timeline-band timeline-band-"+C;
this._timeline.addDiv(this._div);
SimileAjax.DOM.registerEventWithObject(this._div,"mousedown",this,"_onMouseDown");
SimileAjax.DOM.registerEventWithObject(this._div,"mousemove",this,"_onMouseMove");
SimileAjax.DOM.registerEventWithObject(this._div,"mouseup",this,"_onMouseUp");
SimileAjax.DOM.registerEventWithObject(this._div,"mouseout",this,"_onMouseOut");
SimileAjax.DOM.registerEventWithObject(this._div,"dblclick",this,"_onDblClick");
var F=this._theme!=null?this._theme.mouseWheel:"scroll";
if(F==="zoom"||F==="scroll"||this._zoomSteps){if(SimileAjax.Platform.browser.isFirefox){SimileAjax.DOM.registerEventWithObject(this._div,"DOMMouseScroll",this,"_onMouseScroll");
}else{SimileAjax.DOM.registerEventWithObject(this._div,"mousewheel",this,"_onMouseScroll");
}}this._innerDiv=this._timeline.getDocument().createElement("div");
this._innerDiv.className="timeline-band-inner";
this._div.appendChild(this._innerDiv);
this._ether=G.ether;
G.ether.initialize(this,B);
this._etherPainter=G.etherPainter;
G.etherPainter.initialize(this,B);
this._eventSource=G.eventSource;
if(this._eventSource){this._eventListener={onAddMany:function(){A._onAddMany();
},onClear:function(){A._onClear();
}};
this._eventSource.addListener(this._eventListener);
}this._eventPainter=G.eventPainter;
this._eventTracksNeeded=0;
this._eventTrackIncrement=0;
G.eventPainter.initialize(this,B);
this._decorators=("decorators" in G)?G.decorators:[];
for(var D=0;
D<this._decorators.length;
D++){this._decorators[D].initialize(this,B);
}};
Timeline._Band.SCROLL_MULTIPLES=5;
Timeline._Band.prototype.dispose=function(){this.closeBubble();
if(this._eventSource){this._eventSource.removeListener(this._eventListener);
this._eventListener=null;
this._eventSource=null;
}this._timeline=null;
this._bandInfo=null;
this._labeller=null;
this._ether=null;
this._etherPainter=null;
this._eventPainter=null;
this._decorators=null;
this._onScrollListeners=null;
this._syncWithBandHandler=null;
this._selectorListener=null;
this._div=null;
this._innerDiv=null;
this._keyboardInput=null;
};
Timeline._Band.prototype.addOnScrollListener=function(A){this._onScrollListeners.push(A);
};
Timeline._Band.prototype.removeOnScrollListener=function(B){for(var A=0;
A<this._onScrollListeners.length;
A++){if(this._onScrollListeners[A]==B){this._onScrollListeners.splice(A,1);
break;
}}};
Timeline._Band.prototype.setSyncWithBand=function(B,A){if(this._syncWithBand){this._syncWithBand.removeOnScrollListener(this._syncWithBandHandler);
}this._syncWithBand=B;
this._syncWithBand.addOnScrollListener(this._syncWithBandHandler);
this._highlight=A;
this._positionHighlight();
};
Timeline._Band.prototype.getLocale=function(){return this._locale;
};
Timeline._Band.prototype.getTimeZone=function(){return this._timeZone;
};
Timeline._Band.prototype.getLabeller=function(){return this._labeller;
};
Timeline._Band.prototype.getIndex=function(){return this._index;
};
Timeline._Band.prototype.getEther=function(){return this._ether;
};
Timeline._Band.prototype.getEtherPainter=function(){return this._etherPainter;
};
Timeline._Band.prototype.getEventSource=function(){return this._eventSource;
};
Timeline._Band.prototype.getEventPainter=function(){return this._eventPainter;
};
Timeline._Band.prototype.getTimeline=function(){return this._timeline;
};
Timeline._Band.prototype.updateEventTrackInfo=function(A,B){this._eventTrackIncrement=B;
if(A>this._eventTracksNeeded){this._eventTracksNeeded=A;
}};
Timeline._Band.prototype.checkAutoWidth=function(){if(!this._timeline.autoWidth){return ;
}var C=this._eventPainter.getType()=="overview";
var A=C?this._theme.event.overviewTrack.autoWidthMargin:this._theme.event.track.autoWidthMargin;
var B=Math.ceil((this._eventTracksNeeded+A)*this._eventTrackIncrement);
B+=C?this._theme.event.overviewTrack.offset:this._theme.event.track.offset;
var D=this._bandInfo;
if(B!=D.width){D.width=B;
}};
Timeline._Band.prototype.layout=function(){this.paint();
};
Timeline._Band.prototype.paint=function(){this._etherPainter.paint();
this._paintDecorators();
this._paintEvents();
};
Timeline._Band.prototype.softLayout=function(){this.softPaint();
};
Timeline._Band.prototype.softPaint=function(){this._etherPainter.softPaint();
this._softPaintDecorators();
this._softPaintEvents();
};
Timeline._Band.prototype.setBandShiftAndWidth=function(A,D){var C=this._keyboardInput.parentNode;
var B=A+Math.floor(D/2);
if(this._timeline.isHorizontal()){this._div.style.top=A+"px";
this._div.style.height=D+"px";
C.style.top=B+"px";
C.style.left="-1em";
}else{this._div.style.left=A+"px";
this._div.style.width=D+"px";
C.style.left=B+"px";
C.style.top="-1em";
}};
Timeline._Band.prototype.getViewWidth=function(){if(this._timeline.isHorizontal()){return this._div.offsetHeight;
}else{return this._div.offsetWidth;
}};
Timeline._Band.prototype.setViewLength=function(A){this._viewLength=A;
this._recenterDiv();
this._onChanging();
};
Timeline._Band.prototype.getViewLength=function(){return this._viewLength;
};
Timeline._Band.prototype.getTotalViewLength=function(){return Timeline._Band.SCROLL_MULTIPLES*this._viewLength;
};
Timeline._Band.prototype.getViewOffset=function(){return this._viewOffset;
};
Timeline._Band.prototype.getMinDate=function(){return this._ether.pixelOffsetToDate(this._viewOffset);
};
Timeline._Band.prototype.getMaxDate=function(){return this._ether.pixelOffsetToDate(this._viewOffset+Timeline._Band.SCROLL_MULTIPLES*this._viewLength);
};
Timeline._Band.prototype.getMinVisibleDate=function(){return this._ether.pixelOffsetToDate(0);
};
Timeline._Band.prototype.getMinVisibleDateAfterDelta=function(A){return this._ether.pixelOffsetToDate(A);
};
Timeline._Band.prototype.getMaxVisibleDate=function(){return this._ether.pixelOffsetToDate(this._viewLength);
};
Timeline._Band.prototype.getMaxVisibleDateAfterDelta=function(A){return this._ether.pixelOffsetToDate(this._viewLength+A);
};
Timeline._Band.prototype.getCenterVisibleDate=function(){return this._ether.pixelOffsetToDate(this._viewLength/2);
};
Timeline._Band.prototype.setMinVisibleDate=function(A){if(!this._changing){this._moveEther(Math.round(-this._ether.dateToPixelOffset(A)));
}};
Timeline._Band.prototype.setMaxVisibleDate=function(A){if(!this._changing){this._moveEther(Math.round(this._viewLength-this._ether.dateToPixelOffset(A)));
}};
Timeline._Band.prototype.setCenterVisibleDate=function(A){if(!this._changing){this._moveEther(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(A)));
}};
Timeline._Band.prototype.dateToPixelOffset=function(A){return this._ether.dateToPixelOffset(A)-this._viewOffset;
};
Timeline._Band.prototype.pixelOffsetToDate=function(A){return this._ether.pixelOffsetToDate(A+this._viewOffset);
};
Timeline._Band.prototype.createLayerDiv=function(C,A){var D=this._timeline.getDocument().createElement("div");
D.className="timeline-band-layer"+(typeof A=="string"?(" "+A):"");
D.style.zIndex=C;
this._innerDiv.appendChild(D);
var B=this._timeline.getDocument().createElement("div");
B.className="timeline-band-layer-inner";
if(SimileAjax.Platform.browser.isIE){B.style.cursor="move";
}else{B.style.cursor="-moz-grab";
}D.appendChild(B);
return B;
};
Timeline._Band.prototype.removeLayerDiv=function(A){this._innerDiv.removeChild(A.parentNode);
};
Timeline._Band.prototype.scrollToCenter=function(A,C){var B=this._ether.dateToPixelOffset(A);
if(B<-this._viewLength/2){this.setCenterVisibleDate(this.pixelOffsetToDate(B+this._viewLength));
}else{if(B>3*this._viewLength/2){this.setCenterVisibleDate(this.pixelOffsetToDate(B-this._viewLength));
}}this._autoScroll(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(A)),C);
};
Timeline._Band.prototype.showBubbleForEvent=function(C){var A=this.getEventSource().getEvent(C);
if(A){var B=this;
this.scrollToCenter(A.getStart(),function(){B._eventPainter.showBubble(A);
});
}};
Timeline._Band.prototype.zoom=function(C,A,F,E){if(!this._zoomSteps){return ;
}A+=this._viewOffset;
var D=this._ether.pixelOffsetToDate(A);
var B=this._ether.zoom(C);
this._etherPainter.zoom(B);
this._moveEther(Math.round(-this._ether.dateToPixelOffset(D)));
this._moveEther(A);
};
Timeline._Band.prototype._onMouseDown=function(B,A,C){this.closeBubble();
this._dragging=true;
this._dragX=A.clientX;
this._dragY=A.clientY;
};
Timeline._Band.prototype._onMouseMove=function(D,A,E){if(this._dragging){var C=A.clientX-this._dragX;
var B=A.clientY-this._dragY;
this._dragX=A.clientX;
this._dragY=A.clientY;
this._moveEther(this._timeline.isHorizontal()?C:B);
this._positionHighlight();
}};
Timeline._Band.prototype._onMouseUp=function(B,A,C){this._dragging=false;
this._keyboardInput.focus();
};
Timeline._Band.prototype._onMouseOut=function(C,B,D){var A=SimileAjax.DOM.getEventRelativeCoordinates(B,C);
A.x+=this._viewOffset;
if(A.x<0||A.x>C.offsetWidth||A.y<0||A.y>C.offsetHeight){this._dragging=false;
}};
Timeline._Band.prototype._onMouseScroll=function(G,H,B){var A=new Date();
A=A.getTime();
if(!this._lastScrollTime||((A-this._lastScrollTime)>50)){this._lastScrollTime=A;
var I=0;
if(H.wheelDelta){I=H.wheelDelta/120;
}else{if(H.detail){I=-H.detail/3;
}}var F=this._theme.mouseWheel;
if(this._zoomSteps||F==="zoom"){var E=SimileAjax.DOM.getEventRelativeCoordinates(H,G);
if(I!=0){var D;
if(I>0){D=true;
}if(I<0){D=false;
}this._timeline.zoom(D,E.x,E.y,G);
}}else{if(F==="scroll"){var C=50*(I<0?-1:1);
this._moveEther(C);
}}}if(H.stopPropagation){H.stopPropagation();
}H.cancelBubble=true;
if(H.preventDefault){H.preventDefault();
}H.returnValue=false;
};
Timeline._Band.prototype._onDblClick=function(C,B,E){var A=SimileAjax.DOM.getEventRelativeCoordinates(B,C);
var D=A.x-(this._viewLength/2-this._viewOffset);
this._autoScroll(-D);
};
Timeline._Band.prototype._onKeyDown=function(B,A,C){if(!this._dragging){switch(A.keyCode){case 27:break;
case 37:case 38:this._scrollSpeed=Math.min(50,Math.abs(this._scrollSpeed*1.05));
this._moveEther(this._scrollSpeed);
break;
case 39:case 40:this._scrollSpeed=-Math.min(50,Math.abs(this._scrollSpeed*1.05));
this._moveEther(this._scrollSpeed);
break;
default:return true;
}this.closeBubble();
SimileAjax.DOM.cancelEvent(A);
return false;
}return true;
};
Timeline._Band.prototype._onKeyUp=function(B,A,C){if(!this._dragging){this._scrollSpeed=this._originalScrollSpeed;
switch(A.keyCode){case 35:this.setCenterVisibleDate(this._eventSource.getLatestDate());
break;
case 36:this.setCenterVisibleDate(this._eventSource.getEarliestDate());
break;
case 33:this._autoScroll(this._timeline.getPixelLength());
break;
case 34:this._autoScroll(-this._timeline.getPixelLength());
break;
default:return true;
}this.closeBubble();
SimileAjax.DOM.cancelEvent(A);
return false;
}return true;
};
Timeline._Band.prototype._autoScroll=function(D,C){var A=this;
var B=SimileAjax.Graphics.createAnimation(function(E,F){A._moveEther(F);
},0,D,1000,C);
B.run();
};
Timeline._Band.prototype._moveEther=function(A){this.closeBubble();
if(!this._timeline.shiftOK(this._index,A)){return ;
}this._viewOffset+=A;
this._ether.shiftPixels(-A);
if(this._timeline.isHorizontal()){this._div.style.left=this._viewOffset+"px";
}else{this._div.style.top=this._viewOffset+"px";
}if(this._viewOffset>-this._viewLength*0.5||this._viewOffset<-this._viewLength*(Timeline._Band.SCROLL_MULTIPLES-1.5)){this._recenterDiv();
}else{this.softLayout();
}this._onChanging();
};
Timeline._Band.prototype._onChanging=function(){this._changing=true;
this._fireOnScroll();
this._setSyncWithBandDate();
this._changing=false;
};
Timeline._Band.prototype.busy=function(){return(this._changing);
};
Timeline._Band.prototype._fireOnScroll=function(){for(var A=0;
A<this._onScrollListeners.length;
A++){this._onScrollListeners[A](this);
}};
Timeline._Band.prototype._setSyncWithBandDate=function(){if(this._syncWithBand){var A=this._ether.pixelOffsetToDate(this.getViewLength()/2);
this._syncWithBand.setCenterVisibleDate(A);
}};
Timeline._Band.prototype._onHighlightBandScroll=function(){if(this._syncWithBand){var A=this._syncWithBand.getCenterVisibleDate();
var B=this._ether.dateToPixelOffset(A);
this._moveEther(Math.round(this._viewLength/2-B));
if(this._highlight){this._etherPainter.setHighlight(this._syncWithBand.getMinVisibleDate(),this._syncWithBand.getMaxVisibleDate());
}}};
Timeline._Band.prototype._onAddMany=function(){this._paintEvents();
};
Timeline._Band.prototype._onClear=function(){this._paintEvents();
};
Timeline._Band.prototype._positionHighlight=function(){if(this._syncWithBand){var A=this._syncWithBand.getMinVisibleDate();
var B=this._syncWithBand.getMaxVisibleDate();
if(this._highlight){this._etherPainter.setHighlight(A,B);
}}};
Timeline._Band.prototype._recenterDiv=function(){this._viewOffset=-this._viewLength*(Timeline._Band.SCROLL_MULTIPLES-1)/2;
if(this._timeline.isHorizontal()){this._div.style.left=this._viewOffset+"px";
this._div.style.width=(Timeline._Band.SCROLL_MULTIPLES*this._viewLength)+"px";
}else{this._div.style.top=this._viewOffset+"px";
this._div.style.height=(Timeline._Band.SCROLL_MULTIPLES*this._viewLength)+"px";
}this.layout();
};
Timeline._Band.prototype._paintEvents=function(){this._eventPainter.paint();
};
Timeline._Band.prototype._softPaintEvents=function(){this._eventPainter.softPaint();
};
Timeline._Band.prototype._paintDecorators=function(){for(var A=0;
A<this._decorators.length;
A++){this._decorators[A].paint();
}};
Timeline._Band.prototype._softPaintDecorators=function(){for(var A=0;
A<this._decorators.length;
A++){this._decorators[A].softPaint();
}};
Timeline._Band.prototype.closeBubble=function(){SimileAjax.WindowManager.cancelPopups();
};
/* compact-painter.js */
Timeline.CompactEventPainter=function(A){this._params=A;
this._onSelectListeners=[];
this._filterMatcher=null;
this._highlightMatcher=null;
this._frc=null;
this._eventIdToElmt={};
};
Timeline.CompactEventPainter.prototype.initialize=function(B,A){this._band=B;
this._timeline=A;
this._backLayer=null;
this._eventLayer=null;
this._lineLayer=null;
this._highlightLayer=null;
this._eventIdToElmt=null;
};
Timeline.CompactEventPainter.prototype.addOnSelectListener=function(A){this._onSelectListeners.push(A);
};
Timeline.CompactEventPainter.prototype.removeOnSelectListener=function(B){for(var A=0;
A<this._onSelectListeners.length;
A++){if(this._onSelectListeners[A]==B){this._onSelectListeners.splice(A,1);
break;
}}};
Timeline.CompactEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher;
};
Timeline.CompactEventPainter.prototype.setFilterMatcher=function(A){this._filterMatcher=A;
};
Timeline.CompactEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher;
};
Timeline.CompactEventPainter.prototype.setHighlightMatcher=function(A){this._highlightMatcher=A;
};
Timeline.CompactEventPainter.prototype.paint=function(){var N=this._band.getEventSource();
if(N==null){return ;
}this._eventIdToElmt={};
this._prepareForPainting();
var O=this._params.theme;
var L=O.event;
var G={trackOffset:"trackOffset" in this._params?this._params.trackOffset:10,trackHeight:"trackHeight" in this._params?this._params.trackHeight:10,tapeHeight:O.event.tape.height,tapeBottomMargin:"tapeBottomMargin" in this._params?this._params.tapeBottomMargin:2,labelBottomMargin:"labelBottomMargin" in this._params?this._params.labelBottomMargin:5,labelRightMargin:"labelRightMargin" in this._params?this._params.labelRightMargin:5,defaultIcon:L.instant.icon,defaultIconWidth:L.instant.iconWidth,defaultIconHeight:L.instant.iconHeight,customIconWidth:"iconWidth" in this._params?this._params.iconWidth:L.instant.iconWidth,customIconHeight:"iconHeight" in this._params?this._params.iconHeight:L.instant.iconHeight,iconLabelGap:"iconLabelGap" in this._params?this._params.iconLabelGap:2,iconBottomMargin:"iconBottomMargin" in this._params?this._params.iconBottomMargin:2};
if("compositeIcon" in this._params){G.compositeIcon=this._params.compositeIcon;
G.compositeIconWidth=this._params.compositeIconWidth||G.customIconWidth;
G.compositeIconHeight=this._params.compositeIconHeight||G.customIconHeight;
}else{G.compositeIcon=G.defaultIcon;
G.compositeIconWidth=G.defaultIconWidth;
G.compositeIconHeight=G.defaultIconHeight;
}G.defaultStackIcon="icon" in this._params.stackConcurrentPreciseInstantEvents?this._params.stackConcurrentPreciseInstantEvents.icon:G.defaultIcon;
G.defaultStackIconWidth="iconWidth" in this._params.stackConcurrentPreciseInstantEvents?this._params.stackConcurrentPreciseInstantEvents.iconWidth:G.defaultIconWidth;
G.defaultStackIconHeight="iconHeight" in this._params.stackConcurrentPreciseInstantEvents?this._params.stackConcurrentPreciseInstantEvents.iconHeight:G.defaultIconHeight;
var B=this._band.getMinDate();
var D=this._band.getMaxDate();
var R=(this._filterMatcher!=null)?this._filterMatcher:function(S){return true;
};
var Q=(this._highlightMatcher!=null)?this._highlightMatcher:function(S){return -1;
};
var F=N.getEventIterator(B,D);
var H="stackConcurrentPreciseInstantEvents" in this._params&&typeof this._params.stackConcurrentPreciseInstantEvents=="object";
var P="collapseConcurrentPreciseInstantEvents" in this._params&&this._params.collapseConcurrentPreciseInstantEvents;
if(P||H){var M=[];
var A=null;
while(F.hasNext()){var E=F.next();
if(R(E)){if(!E.isInstant()||E.isImprecise()){this.paintEvent(E,G,this._params.theme,Q(E));
}else{if(A!=null&&A.getStart().getTime()==E.getStart().getTime()){M[M.length-1].push(E);
}else{M.push([E]);
A=E;
}}}}for(var J=0;
J<M.length;
J++){var K=M[J];
if(K.length==1){this.paintEvent(K[0],G,this._params.theme,Q(E));
}else{var C=-1;
for(var I=0;
C<0&&I<K.length;
I++){C=Q(K[I]);
}if(H){this.paintStackedPreciseInstantEvents(K,G,this._params.theme,C);
}else{this.paintCompositePreciseInstantEvents(K,G,this._params.theme,C);
}}}}else{while(F.hasNext()){var E=F.next();
if(R(E)){this.paintEvent(E,G,this._params.theme,Q(E));
}}}this._highlightLayer.style.display="block";
this._lineLayer.style.display="block";
this._eventLayer.style.display="block";
};
Timeline.CompactEventPainter.prototype.softPaint=function(){};
Timeline.CompactEventPainter.prototype._prepareForPainting=function(){var B=this._band;
if(this._backLayer==null){this._backLayer=this._band.createLayerDiv(0,"timeline-band-events");
this._backLayer.style.visibility="hidden";
var A=document.createElement("span");
A.className="timeline-event-label";
this._backLayer.appendChild(A);
this._frc=SimileAjax.Graphics.getFontRenderingContext(A);
}this._frc.update();
this._tracks=[];
if(this._highlightLayer!=null){B.removeLayerDiv(this._highlightLayer);
}this._highlightLayer=B.createLayerDiv(105,"timeline-band-highlights");
this._highlightLayer.style.display="none";
if(this._lineLayer!=null){B.removeLayerDiv(this._lineLayer);
}this._lineLayer=B.createLayerDiv(110,"timeline-band-lines");
this._lineLayer.style.display="none";
if(this._eventLayer!=null){B.removeLayerDiv(this._eventLayer);
}this._eventLayer=B.createLayerDiv(115,"timeline-band-events");
this._eventLayer.style.display="none";
};
Timeline.CompactEventPainter.prototype.paintEvent=function(B,C,D,A){if(B.isInstant()){this.paintInstantEvent(B,C,D,A);
}else{this.paintDurationEvent(B,C,D,A);
}};
Timeline.CompactEventPainter.prototype.paintInstantEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseInstantEvent(B,C,D,A);
}else{this.paintPreciseInstantEvent(B,C,D,A);
}};
Timeline.CompactEventPainter.prototype.paintDurationEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseDurationEvent(B,C,D,A);
}else{this.paintPreciseDurationEvent(B,C,D,A);
}};
Timeline.CompactEventPainter.prototype.paintPreciseInstantEvent=function(H,F,B,A){var C={tooltip:H.getProperty("tooltip")||H.getText()};
var E={url:H.getIcon()};
if(E.url==null){E.url=F.defaultIcon;
E.width=F.defaultIconWidth;
E.height=F.defaultIconHeight;
E.className="timeline-event-icon-default";
}else{E.width=H.getProperty("iconWidth")||F.customIconWidth;
E.height=H.getProperty("iconHeight")||F.customIconHeight;
}var J={text:H.getText(),color:H.getTextColor()||H.getColor(),className:H.getClassName()};
var G=this.paintTapeIconLabel(H.getStart(),C,null,E,J,F,B,A);
var I=this;
var D=function(L,K,M){return I._onClickInstantEvent(G.iconElmtData.elmt,K,H);
};
SimileAjax.DOM.registerEvent(G.iconElmtData.elmt,"mousedown",D);
SimileAjax.DOM.registerEvent(G.labelElmtData.elmt,"mousedown",D);
this._eventIdToElmt[H.getID()]=G.iconElmtData.elmt;
};
Timeline.CompactEventPainter.prototype.paintCompositePreciseInstantEvents=function(J,H,D,B){var K=J[0];
var A=[];
for(var C=0;
C<J.length;
C++){A.push(J[C].getProperty("tooltip")||J[C].getText());
}var E={tooltip:A.join("; ")};
var G={url:H.compositeIcon,width:H.compositeIconWidth,height:H.compositeIconHeight,className:"timeline-event-icon-composite"};
var M={text:String.substitute(this._params.compositeEventLabelTemplate,[J.length])};
var I=this.paintTapeIconLabel(K.getStart(),E,null,G,M,H,D,B);
var L=this;
var F=function(O,N,P){return L._onClickMultiplePreciseInstantEvent(I.iconElmtData.elmt,N,J);
};
SimileAjax.DOM.registerEvent(I.iconElmtData.elmt,"mousedown",F);
SimileAjax.DOM.registerEvent(I.labelElmtData.elmt,"mousedown",F);
for(var C=0;
C<J.length;
C++){this._eventIdToElmt[J[C].getID()]=I.iconElmtData.elmt;
}};
Timeline.CompactEventPainter.prototype.paintStackedPreciseInstantEvents=function(T,j,c,E){var S="limit" in this._params.stackConcurrentPreciseInstantEvents?this._params.stackConcurrentPreciseInstantEvents.limit:10;
var G="moreMessageTemplate" in this._params.stackConcurrentPreciseInstantEvents?this._params.stackConcurrentPreciseInstantEvents.moreMessageTemplate:"%0 More Events";
var Q=S<=T.length-2;
var B=this._band;
var L=function(i){return Math.round(B.dateToPixelOffset(i));
};
var O=function(i){var r={url:i.getIcon()};
if(r.url==null){r.url=j.defaultStackIcon;
r.width=j.defaultStackIconWidth;
r.height=j.defaultStackIconHeight;
r.className="timeline-event-icon-stack timeline-event-icon-default";
}else{r.width=i.getProperty("iconWidth")||j.customIconWidth;
r.height=i.getProperty("iconHeight")||j.customIconHeight;
r.className="timeline-event-icon-stack";
}return r;
};
var C=O(T[0]);
var V=5;
var D=0;
var g=0;
var p=0;
var U=0;
var l=[];
for(var n=0;
n<T.length&&(!Q||n<S);
n++){var b=T[n];
var a=b.getText();
var X=O(b);
var W=this._frc.computeSize(a);
var K={text:a,iconData:X,labelSize:W,iconLeft:C.width+n*V-X.width};
K.labelLeft=C.width+n*V+j.iconLabelGap;
K.top=p;
l.push(K);
D=Math.min(D,K.iconLeft);
p+=W.height;
g=Math.max(g,K.labelLeft+W.width);
U=Math.max(U,K.top+X.height);
}if(Q){var e=String.substitute(G,[T.length-S]);
var H=this._frc.computeSize(e);
var J=C.width+(S-1)*V+j.iconLabelGap;
var m=p;
p+=H.height;
g=Math.max(g,J+H.width);
}g+=j.labelRightMargin;
p+=j.labelBottomMargin;
U+=j.iconBottomMargin;
var F=L(T[0].getStart());
var Y=[];
var N=Math.ceil(Math.max(U,p)/j.trackHeight);
var M=C.width+(T.length-1)*V;
for(var n=0;
n<N;
n++){Y.push({start:D,end:M});
}var f=Math.ceil(p/j.trackHeight);
for(var n=0;
n<f;
n++){var P=Y[n];
P.end=Math.max(P.end,g);
}var k=this._fitTracks(F,Y);
var Z=k*j.trackHeight+j.trackOffset;
var q=this._timeline.getDocument().createElement("div");
q.className="timeline-event-icon-stack";
q.style.position="absolute";
q.style.overflow="visible";
q.style.left=F+"px";
q.style.top=Z+"px";
q.style.width=M+"px";
q.style.height=U+"px";
q.innerHTML="<div style='position: relative'></div>";
this._eventLayer.appendChild(q);
var I=this;
var R=function(r){try{var w=parseInt(this.getAttribute("index"));
var u=q.firstChild.childNodes;
for(var s=0;
s<u.length;
s++){var v=u[s];
if(s==w){v.style.zIndex=u.length;
}else{v.style.zIndex=u.length-s;
}}}catch(t){}};
var d=function(u){var w=l[u];
var r=T[u];
var i=r.getProperty("tooltip")||r.getText();
var v=I._paintEventLabel({tooltip:i},{text:w.text},F+w.labelLeft,Z+w.top,w.labelSize.width,w.labelSize.height,c);
v.elmt.setAttribute("index",u);
v.elmt.onmouseover=R;
var t=SimileAjax.Graphics.createTranslucentImage(w.iconData.url);
var s=I._timeline.getDocument().createElement("div");
s.className="timeline-event-icon"+("className" in w.iconData?(" "+w.iconData.className):"");
s.style.left=w.iconLeft+"px";
s.style.top=w.top+"px";
s.style.zIndex=(l.length-u);
s.appendChild(t);
s.setAttribute("index",u);
s.onmouseover=R;
q.firstChild.appendChild(s);
var x=function(z,y,AA){return I._onClickInstantEvent(v.elmt,y,r);
};
SimileAjax.DOM.registerEvent(s,"mousedown",x);
SimileAjax.DOM.registerEvent(v.elmt,"mousedown",x);
I._eventIdToElmt[r.getID()]=s;
};
for(var n=0;
n<l.length;
n++){d(n);
}if(Q){var o=T.slice(S);
var A=this._paintEventLabel({tooltip:e},{text:e},F+J,Z+m,H.width,H.height,c);
var h=function(r,i,s){return I._onClickMultiplePreciseInstantEvent(A.elmt,i,o);
};
SimileAjax.DOM.registerEvent(A.elmt,"mousedown",h);
for(var n=0;
n<o.length;
n++){this._eventIdToElmt[o[n].getID()]=A.elmt;
}}};
Timeline.CompactEventPainter.prototype.paintImpreciseInstantEvent=function(I,G,B,A){var C={tooltip:I.getProperty("tooltip")||I.getText()};
var E={start:I.getStart(),end:I.getEnd(),latestStart:I.getLatestStart(),earliestEnd:I.getEarliestEnd(),isInstant:true};
var F={url:I.getIcon()};
if(F.url==null){F=null;
}else{F.width=I.getProperty("iconWidth")||G.customIconWidth;
F.height=I.getProperty("iconHeight")||G.customIconHeight;
}var K={text:I.getText(),color:I.getTextColor()||I.getColor(),className:I.getClassName()};
var H=this.paintTapeIconLabel(I.getStart(),C,E,F,K,G,B,A);
var J=this;
var D=F!=null?function(M,L,N){return J._onClickInstantEvent(H.iconElmtData.elmt,L,I);
}:function(M,L,N){return J._onClickInstantEvent(H.labelElmtData.elmt,L,I);
};
SimileAjax.DOM.registerEvent(H.labelElmtData.elmt,"mousedown",D);
SimileAjax.DOM.registerEvent(H.impreciseTapeElmtData.elmt,"mousedown",D);
if(F!=null){SimileAjax.DOM.registerEvent(H.iconElmtData.elmt,"mousedown",D);
this._eventIdToElmt[I.getID()]=H.iconElmtData.elmt;
}else{this._eventIdToElmt[I.getID()]=H.labelElmtData.elmt;
}};
Timeline.CompactEventPainter.prototype.paintPreciseDurationEvent=function(I,G,B,A){var C={tooltip:I.getProperty("tooltip")||I.getText()};
var E={start:I.getStart(),end:I.getEnd(),isInstant:false};
var F={url:I.getIcon()};
if(F.url==null){F=null;
}else{F.width=I.getProperty("iconWidth")||G.customIconWidth;
F.height=I.getProperty("iconHeight")||G.customIconHeight;
}var K={text:I.getText(),color:I.getTextColor()||I.getColor(),className:I.getClassName()};
var H=this.paintTapeIconLabel(I.getLatestStart(),C,E,F,K,G,B,A);
var J=this;
var D=F!=null?function(M,L,N){return J._onClickInstantEvent(H.iconElmtData.elmt,L,I);
}:function(M,L,N){return J._onClickInstantEvent(H.labelElmtData.elmt,L,I);
};
SimileAjax.DOM.registerEvent(H.labelElmtData.elmt,"mousedown",D);
SimileAjax.DOM.registerEvent(H.tapeElmtData.elmt,"mousedown",D);
if(F!=null){SimileAjax.DOM.registerEvent(H.iconElmtData.elmt,"mousedown",D);
this._eventIdToElmt[I.getID()]=H.iconElmtData.elmt;
}else{this._eventIdToElmt[I.getID()]=H.labelElmtData.elmt;
}};
Timeline.CompactEventPainter.prototype.paintImpreciseDurationEvent=function(I,G,B,A){var C={tooltip:I.getProperty("tooltip")||I.getText()};
var E={start:I.getStart(),end:I.getEnd(),latestStart:I.getLatestStart(),earliestEnd:I.getEarliestEnd(),isInstant:false};
var F={url:I.getIcon()};
if(F.url==null){F=null;
}else{F.width=I.getProperty("iconWidth")||G.customIconWidth;
F.height=I.getProperty("iconHeight")||G.customIconHeight;
}var K={text:I.getText(),color:I.getTextColor()||I.getColor(),className:I.getClassName()};
var H=this.paintTapeIconLabel(I.getLatestStart(),C,E,F,K,G,B,A);
var J=this;
var D=F!=null?function(M,L,N){return J._onClickInstantEvent(H.iconElmtData.elmt,L,I);
}:function(M,L,N){return J._onClickInstantEvent(H.labelElmtData.elmt,L,I);
};
SimileAjax.DOM.registerEvent(H.labelElmtData.elmt,"mousedown",D);
SimileAjax.DOM.registerEvent(H.tapeElmtData.elmt,"mousedown",D);
if(F!=null){SimileAjax.DOM.registerEvent(H.iconElmtData.elmt,"mousedown",D);
this._eventIdToElmt[I.getID()]=H.iconElmtData.elmt;
}else{this._eventIdToElmt[I.getID()]=H.labelElmtData.elmt;
}};
Timeline.CompactEventPainter.prototype.paintTapeIconLabel=function(V,O,S,I,a,X,c,Z){var R=this._band;
var F=function(e){return Math.round(R.dateToPixelOffset(e));
};
var d=F(V);
var W=[];
var b=0;
var B=0;
var C=0;
if(S!=null){b=X.tapeHeight+X.tapeBottomMargin;
B=Math.ceil(X.tapeHeight/X.trackHeight);
var A=F(S.end)-d;
var L=F(S.start)-d;
for(var Q=0;
Q<B;
Q++){W.push({start:L,end:A});
}C=X.trackHeight-(b%X.tapeHeight);
}var N=0;
var U=0;
if(I!=null){if("iconAlign" in I&&I.iconAlign=="center"){N=-Math.floor(I.width/2);
}U=N+I.width+X.iconLabelGap;
if(B>0){W[B-1].end=Math.max(W[B-1].end,U);
}var E=I.height+X.iconBottomMargin+C;
while(E>0){W.push({start:N,end:U});
E-=X.trackHeight;
}}var P=a.text;
var H=this._frc.computeSize(P);
var M=H.height+X.labelBottomMargin+C;
var J=U+H.width+X.labelRightMargin;
if(B>0){W[B-1].end=Math.max(W[B-1].end,J);
}for(var Y=0;
M>0;
Y++){if(B+Y<W.length){var T=W[B+Y];
T.end=J;
}else{W.push({start:0,end:J});
}M-=X.trackHeight;
}var G=this._fitTracks(d,W);
var K=G*X.trackHeight+X.trackOffset;
var D={};
D.labelElmtData=this._paintEventLabel(O,a,d+U,K+b,H.width,H.height,c);
if(S!=null){if("latestStart" in S||"earliestEnd" in S){D.impreciseTapeElmtData=this._paintEventTape(O,S,X.tapeHeight,K,F(S.start),F(S.end),c.event.duration.impreciseColor,c.event.duration.impreciseOpacity,X,c);
}if(!S.isInstant&&"start" in S&&"end" in S){D.tapeElmtData=this._paintEventTape(O,S,X.tapeHeight,K,d,F("earliestEnd" in S?S.earliestEnd:S.end),S.color,100,X,c);
}}if(I!=null){D.iconElmtData=this._paintEventIcon(O,I,K+b,d+N,X,c);
}return D;
};
Timeline.CompactEventPainter.prototype._fitTracks=function(F,C){var H;
for(H=0;
H<this._tracks.length;
H++){var E=true;
for(var B=0;
B<C.length&&(H+B)<this._tracks.length;
B++){var G=this._tracks[H+B];
var A=C[B];
if(F+A.start<G){E=false;
break;
}}if(E){break;
}}for(var D=0;
D<C.length;
D++){this._tracks[H+D]=F+C[D].end;
}return H;
};
Timeline.CompactEventPainter.prototype._paintEventIcon=function(C,D,H,G,E,F){var B=SimileAjax.Graphics.createTranslucentImage(D.url);
var A=this._timeline.getDocument().createElement("div");
A.className="timeline-event-icon"+("className" in D?(" "+D.className):"");
A.style.left=G+"px";
A.style.top=H+"px";
A.appendChild(B);
if("tooltip" in C&&typeof C.tooltip=="string"){A.title=C.tooltip;
}this._eventLayer.appendChild(A);
return{left:G,top:H,width:E.iconWidth,height:E.iconHeight,elmt:A};
};
Timeline.CompactEventPainter.prototype._paintEventLabel=function(E,I,C,F,A,G,D){var H=this._timeline.getDocument();
var B=H.createElement("div");
B.className="timeline-event-label";
B.style.left=C+"px";
B.style.width=(A+1)+"px";
B.style.top=F+"px";
B.innerHTML=I.text;
if("tooltip" in E&&typeof E.tooltip=="string"){B.title=E.tooltip;
}if("color" in I&&typeof I.color=="string"){B.style.color=I.color;
}if("className" in I&&typeof I.className=="string"){B.className+=" "+I.className;
}this._eventLayer.appendChild(B);
return{left:C,top:F,width:A,height:G,elmt:B};
};
Timeline.CompactEventPainter.prototype._paintEventTape=function(G,H,K,J,D,A,E,C,I,F){var B=A-D;
var L=this._timeline.getDocument().createElement("div");
L.className="timeline-event-tape";
L.style.left=D+"px";
L.style.top=J+"px";
L.style.width=B+"px";
L.style.height=K+"px";
if("tooltip" in G&&typeof G.tooltip=="string"){L.title=G.tooltip;
}if(E!=null&&typeof H.color=="string"){L.style.backgroundColor=E;
}if("backgroundImage" in H&&typeof H.backgroundImage=="string"){L.style.backgroundImage="url("+backgroundImage+")";
L.style.backgroundRepeat=("backgroundRepeat" in H&&typeof H.backgroundRepeat=="string")?H.backgroundRepeat:"repeat";
}SimileAjax.Graphics.setOpacity(L,C);
if("className" in H&&typeof H.className=="string"){L.className+=" "+H.className;
}this._eventLayer.appendChild(L);
return{left:D,top:J,width:B,height:K,elmt:L};
};
Timeline.CompactEventPainter.prototype._createHighlightDiv=function(A,C,E){if(A>=0){var D=this._timeline.getDocument();
var G=E.event;
var B=G.highlightColors[Math.min(A,G.highlightColors.length-1)];
var F=D.createElement("div");
F.style.position="absolute";
F.style.overflow="hidden";
F.style.left=(C.left-2)+"px";
F.style.width=(C.width+4)+"px";
F.style.top=(C.top-2)+"px";
F.style.height=(C.height+4)+"px";
this._highlightLayer.appendChild(F);
}};
Timeline.CompactEventPainter.prototype._onClickMultiplePreciseInstantEvent=function(E,A,B){var F=SimileAjax.DOM.getPageCoordinates(E);
this._showBubble(F.left+Math.ceil(E.offsetWidth/2),F.top+Math.ceil(E.offsetHeight/2),B);
var D=[];
for(var C=0;
C<B.length;
C++){D.push(B[C].getID());
}this._fireOnSelect(D);
A.cancelBubble=true;
SimileAjax.DOM.cancelEvent(A);
return false;
};
Timeline.CompactEventPainter.prototype._onClickInstantEvent=function(C,A,B){var D=SimileAjax.DOM.getPageCoordinates(C);
this._showBubble(D.left+Math.ceil(C.offsetWidth/2),D.top+Math.ceil(C.offsetHeight/2),[B]);
this._fireOnSelect([B.getID()]);
A.cancelBubble=true;
SimileAjax.DOM.cancelEvent(A);
return false;
};
Timeline.CompactEventPainter.prototype._onClickDurationEvent=function(F,B,C){if("pageX" in B){var A=B.pageX;
var E=B.pageY;
}else{var D=SimileAjax.DOM.getPageCoordinates(F);
var A=B.offsetX+D.left;
var E=B.offsetY+D.top;
}this._showBubble(A,E,[C]);
this._fireOnSelect([C.getID()]);
B.cancelBubble=true;
SimileAjax.DOM.cancelEvent(B);
return false;
};
Timeline.CompactEventPainter.prototype.showBubble=function(A){var B=this._eventIdToElmt[A.getID()];
if(B){var C=SimileAjax.DOM.getPageCoordinates(B);
this._showBubble(C.left+B.offsetWidth/2,C.top+B.offsetHeight/2,[A]);
}};
Timeline.CompactEventPainter.prototype._showBubble=function(A,F,B){var E=document.createElement("div");
B=("fillInfoBubble" in B)?[B]:B;
for(var D=0;
D<B.length;
D++){var C=document.createElement("div");
E.appendChild(C);
B[D].fillInfoBubble(C,this._params.theme,this._band.getLabeller());
}SimileAjax.WindowManager.cancelPopups();
SimileAjax.Graphics.createBubbleForContentAndPoint(E,A,F,this._params.theme.event.bubble.width);
};
Timeline.CompactEventPainter.prototype._fireOnSelect=function(B){for(var A=0;
A<this._onSelectListeners.length;
A++){this._onSelectListeners[A](B);
}};
/* decorators.js */
Timeline.SpanHighlightDecorator=function(A){this._unit=A.unit!=null?A.unit:SimileAjax.NativeDateUnit;
this._startDate=(typeof A.startDate=="string")?this._unit.parseFromObject(A.startDate):A.startDate;
this._endDate=(typeof A.endDate=="string")?this._unit.parseFromObject(A.endDate):A.endDate;
this._startLabel=A.startLabel!=null?A.startLabel:"";
this._endLabel=A.endLabel!=null?A.endLabel:"";
this._color=A.color;
this._cssClass=A.cssClass!=null?A.cssClass:null;
this._opacity=A.opacity!=null?A.opacity:100;
this._zIndex=(A.inFront!=null&&A.inFront)?113:10;
};
Timeline.SpanHighlightDecorator.prototype.initialize=function(B,A){this._band=B;
this._timeline=A;
this._layerDiv=null;
};
Timeline.SpanHighlightDecorator.prototype.paint=function(){if(this._layerDiv!=null){this._band.removeLayerDiv(this._layerDiv);
}this._layerDiv=this._band.createLayerDiv(this._zIndex);
this._layerDiv.setAttribute("name","span-highlight-decorator");
this._layerDiv.style.display="none";
var E=this._band.getMinDate();
var A=this._band.getMaxDate();
if(this._unit.compare(this._startDate,A)<0&&this._unit.compare(this._endDate,E)>0){E=this._unit.later(E,this._startDate);
A=this._unit.earlier(A,this._endDate);
var F=this._band.dateToPixelOffset(E);
var I=this._band.dateToPixelOffset(A);
var H=this._timeline.getDocument();
var K=function(){var L=H.createElement("table");
L.insertRow(0).insertCell(0);
return L;
};
var B=H.createElement("div");
B.className="timeline-highlight-decorator";
if(this._cssClass){B.className+=" "+this._cssClass;
}if(this._color!=null){B.style.backgroundColor=this._color;
}if(this._opacity<100){SimileAjax.Graphics.setOpacity(B,this._opacity);
}this._layerDiv.appendChild(B);
var J=K();
J.className="timeline-highlight-label timeline-highlight-label-start";
var C=J.rows[0].cells[0];
C.innerHTML=this._startLabel;
if(this._cssClass){C.className="label_"+this._cssClass;
}this._layerDiv.appendChild(J);
var G=K();
G.className="timeline-highlight-label timeline-highlight-label-end";
var D=G.rows[0].cells[0];
D.innerHTML=this._endLabel;
if(this._cssClass){D.className="label_"+this._cssClass;
}this._layerDiv.appendChild(G);
if(this._timeline.isHorizontal()){B.style.left=F+"px";
B.style.width=(I-F)+"px";
J.style.right=(this._band.getTotalViewLength()-F)+"px";
J.style.width=(this._startLabel.length)+"em";
G.style.left=I+"px";
G.style.width=(this._endLabel.length)+"em";
}else{B.style.top=F+"px";
B.style.height=(I-F)+"px";
J.style.bottom=F+"px";
J.style.height="1.5px";
G.style.top=I+"px";
G.style.height="1.5px";
}}this._layerDiv.style.display="block";
};
Timeline.SpanHighlightDecorator.prototype.softPaint=function(){};
Timeline.PointHighlightDecorator=function(A){this._unit=A.unit!=null?A.unit:SimileAjax.NativeDateUnit;
this._date=(typeof A.date=="string")?this._unit.parseFromObject(A.date):A.date;
this._width=A.width!=null?A.width:10;
this._color=A.color;
this._cssClass=A.cssClass!=null?A.cssClass:"";
this._opacity=A.opacity!=null?A.opacity:100;
};
Timeline.PointHighlightDecorator.prototype.initialize=function(B,A){this._band=B;
this._timeline=A;
this._layerDiv=null;
};
Timeline.PointHighlightDecorator.prototype.paint=function(){if(this._layerDiv!=null){this._band.removeLayerDiv(this._layerDiv);
}this._layerDiv=this._band.createLayerDiv(10);
this._layerDiv.setAttribute("name","span-highlight-decorator");
this._layerDiv.style.display="none";
var C=this._band.getMinDate();
var E=this._band.getMaxDate();
if(this._unit.compare(this._date,E)<0&&this._unit.compare(this._date,C)>0){var A=this._band.dateToPixelOffset(this._date);
var B=A-Math.round(this._width/2);
var D=this._timeline.getDocument();
var F=D.createElement("div");
F.className="timeline-highlight-point-decorator";
F.className+=" "+this._cssClass;
if(this._color!=null){F.style.backgroundColor=this._color;
}if(this._opacity<100){SimileAjax.Graphics.setOpacity(F,this._opacity);
}this._layerDiv.appendChild(F);
if(this._timeline.isHorizontal()){F.style.left=B+"px";
F.style.width=this._width;
}else{F.style.top=B+"px";
F.style.height=this._width;
}}this._layerDiv.style.display="block";
};
Timeline.PointHighlightDecorator.prototype.softPaint=function(){};
/* detailed-painter.js */
Timeline.DetailedEventPainter=function(A){this._params=A;
this._onSelectListeners=[];
this._filterMatcher=null;
this._highlightMatcher=null;
this._frc=null;
this._eventIdToElmt={};
};
Timeline.DetailedEventPainter.prototype.initialize=function(B,A){this._band=B;
this._timeline=A;
this._backLayer=null;
this._eventLayer=null;
this._lineLayer=null;
this._highlightLayer=null;
this._eventIdToElmt=null;
};
Timeline.DetailedEventPainter.prototype.getType=function(){return"detailed";
};
Timeline.DetailedEventPainter.prototype.addOnSelectListener=function(A){this._onSelectListeners.push(A);
};
Timeline.DetailedEventPainter.prototype.removeOnSelectListener=function(B){for(var A=0;
A<this._onSelectListeners.length;
A++){if(this._onSelectListeners[A]==B){this._onSelectListeners.splice(A,1);
break;
}}};
Timeline.DetailedEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher;
};
Timeline.DetailedEventPainter.prototype.setFilterMatcher=function(A){this._filterMatcher=A;
};
Timeline.DetailedEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher;
};
Timeline.DetailedEventPainter.prototype.setHighlightMatcher=function(A){this._highlightMatcher=A;
};
Timeline.DetailedEventPainter.prototype.paint=function(){var C=this._band.getEventSource();
if(C==null){return ;
}this._eventIdToElmt={};
this._prepareForPainting();
var I=this._params.theme.event;
var G=Math.max(I.track.height,this._frc.getLineHeight());
var F={trackOffset:Math.round(this._band.getViewWidth()/2-G/2),trackHeight:G,trackGap:I.track.gap,trackIncrement:G+I.track.gap,icon:I.instant.icon,iconWidth:I.instant.iconWidth,iconHeight:I.instant.iconHeight,labelWidth:I.label.width};
var D=this._band.getMinDate();
var B=this._band.getMaxDate();
var J=(this._filterMatcher!=null)?this._filterMatcher:function(K){return true;
};
var A=(this._highlightMatcher!=null)?this._highlightMatcher:function(K){return -1;
};
var E=C.getEventReverseIterator(D,B);
while(E.hasNext()){var H=E.next();
if(J(H)){this.paintEvent(H,F,this._params.theme,A(H));
}}this._highlightLayer.style.display="block";
this._lineLayer.style.display="block";
this._eventLayer.style.display="block";
this._band.updateEventTrackInfo(this._lowerTracks.length+this._upperTracks.length,F.trackIncrement);
};
Timeline.DetailedEventPainter.prototype.softPaint=function(){};
Timeline.DetailedEventPainter.prototype._prepareForPainting=function(){var B=this._band;
if(this._backLayer==null){this._backLayer=this._band.createLayerDiv(0,"timeline-band-events");
this._backLayer.style.visibility="hidden";
var A=document.createElement("span");
A.className="timeline-event-label";
this._backLayer.appendChild(A);
this._frc=SimileAjax.Graphics.getFontRenderingContext(A);
}this._frc.update();
this._lowerTracks=[];
this._upperTracks=[];
if(this._highlightLayer!=null){B.removeLayerDiv(this._highlightLayer);
}this._highlightLayer=B.createLayerDiv(105,"timeline-band-highlights");
this._highlightLayer.style.display="none";
if(this._lineLayer!=null){B.removeLayerDiv(this._lineLayer);
}this._lineLayer=B.createLayerDiv(110,"timeline-band-lines");
this._lineLayer.style.display="none";
if(this._eventLayer!=null){B.removeLayerDiv(this._eventLayer);
}this._eventLayer=B.createLayerDiv(110,"timeline-band-events");
this._eventLayer.style.display="none";
};
Timeline.DetailedEventPainter.prototype.paintEvent=function(B,C,D,A){if(B.isInstant()){this.paintInstantEvent(B,C,D,A);
}else{this.paintDurationEvent(B,C,D,A);
}};
Timeline.DetailedEventPainter.prototype.paintInstantEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseInstantEvent(B,C,D,A);
}else{this.paintPreciseInstantEvent(B,C,D,A);