private void addEvents ( ) { if ( clusterEvents != null && clusterEvents . size ( ) > eventCounter ) { ClusterEvent ev = clusterEvents . get ( eventCounter ) ; eventCounter ++ ; JLabel eventMarker = new JLabel ( ev . getType ( ) . substring ( 0 , 1 ) ) ; eventMarker . setPreferredSize ( new Dimension ( 20 , y_offset_top ) ) ; eventMarker . setSize ( new Dimension ( 20 , y_offset_top ) ) ; eventMarker . setHorizontalAlignment ( javax . swing . SwingConstants . CENTER ) ; int x = ( int ) ( ev . getTimestamp ( ) / processFrequency / x_resolution ) ; eventMarker . setLocation ( x - 10 , 0 ) ; eventMarker . setToolTipText ( ev . getType ( ) + " at " + ev . getTimestamp ( ) + ": " + ev . getMessage ( ) ) ; eventPanel . add ( eventMarker ) ; eventLabelList . add ( eventMarker ) ; eventPanel . repaint ( ) ; } }
check if there are any new events in the event list and add them to the plot