/* The Time Ruler */
time_ruler = new RulerTime( time_model );
time_ruler_vport = new ViewportTime( time_model );
time_ruler_vport.setView( time_ruler );
time_ruler_panel = new ViewportTimePanel( time_ruler_vport );
if ( Parameters.HISTOGRAM_ZERO_ORIGIN )
time_ruler_panel.setBorderTitle( " Duration (seconds) ",
TitledBorder.RIGHT,
TitledBorder.BOTTOM,
Const.FONT, Color.red );
else
time_ruler_panel.setBorderTitle( " Time (seconds) ",
TitledBorder.RIGHT,
TitledBorder.BOTTOM,
Const.FONT, Color.red );
time_ruler_vport.initLeftMouseToZoom( false );
/*
Propagation of AdjustmentEvent originating from scroller:
scroller -----> time_model -----> viewport -----> view
adj time paint
viewport is between time_model and view because
viewport is what user sees.
*/
time_model.addTimeListener( time_ruler_vport );
/*
Since there is NOT a specific ViewportTime/ViewTimePanel
for RulerTime, so we need to set PreferredSize of RulerTime
here. Since CanvasTime's has its MaximumSize set to MAX,
CanvasTime's ViewportTimePanel will become space hungary.
As we want RulerTime to be fixed height during resize
of the top level window, So it becomes CRUCIAL to set
Preferred Height of RulerTime's ViewportTimePanel equal
to its Minimum Height and Maximum Height.
*/
Insets ruler_panel_insets = time_ruler_panel.getInsets();
int ruler_panel_height = ruler_panel_insets.top
+ time_ruler.getJComponentHeight()
+ ruler_panel_insets.bottom;
time_ruler_panel.setPreferredSize(
new Dimension( 100, ruler_panel_height ) );
/* The StatLine Canvas */
stat_canvas = new CanvasStatline( time_model,
buf4statboxes,
y_model, y_maps,
y_colnames );
stat_canvas_vport = new ViewportTimeYaxis( time_model,
y_model, y_tree );
stat_canvas_vport.setView( stat_canvas );
stat_canvas_panel = new ViewportTimePanel( stat_canvas_vport );
stat_canvas_panel.setBorderTitle( " Statistics ",
TitledBorder.RIGHT,
TitledBorder.TOP,
null, Color.blue );
stat_canvas_vport.initLeftMouseToZoom( true );