Using the New Feature Of The Timeline Component

Gu Wei Xing, Software developer in NanTong of JiangSu province, China.
Sep 26, 2008

Version

Applicable to zk-timeline1.2_2.


1 . Hide or show the message bubble. It’s very simple.

  • Show the message bubble for a Bandinfo object.
  • 
    b1.setBubbleVisible(true);
    		
  • Hide the message bubble for a Bandinfo object.
  • 		
    b1.setBubbleVisible(false);
    		
  • Catch the OccurEventSelectEvent.
  • After hide the message bubble the OccurEventSelectEvent would be sent back when user click the title of a OccurEvent in a band.So you can catch this event like the following codes. First,you should implement an EventListener interface.

    
    public  class OccurEventSelectListener implements EventListener {
    	public boolean isAsap() {
    		return true;
    	}
    	public void onEvent(Event event) throws UiException {
    		OccurEventSelectEvent oese=(OccurEventSelectEvent)event;
    		//TODO: edit the next code by yourself.
    	System.out.println(oese.getOccurEvent().toString());
    	}
    }

    Second,new a OccurEventSelectListener and add this listener to the bandinfo object. That’a all.

    
    <zscript><![CDATA[
    	b1.addEventListener("onOccurEventSelect", new OccurEventSelectListener());
    	b2.addEventListener("onOccurEventSelect", new OccurEventSelectListener());
    ]]></zscript>
    		

    The example:

2 . Pass center visible date in BandScrollEvent.

This feature contribute by hengsin at users.sourceforge.net.Now the BandScrollEvent contains a “center” property.It point the current center date position to where the band scroll .

  • Implement an EventListener.
  • public class BandScrollListener implements EventListener {
        public boolean isAsap() {
            // TODO Auto-generated method stub
            return true;
        }    
        public void onEvent(Event event) {
            // TODO Auto-generated method stub
            BandScrollEvent e = (BandScrollEvent) event;
            //TODO: edit the next code by yourself.
            System.out.println("The center date is:"+e.getCenter());
        }
    }
  • Add a BandScrollListener to the band.
  • 	
    b1.addEventListener("onBandScroll",new BandScrollListener());
    		

Here is the Example :

Dowload

Summary

Hope you enjoy this component. I look forward to your feedback.

Gu Wei Xing is a software developer in NanTong of JiangSu province, China. He loves Java software development and Flash programming. He is also the host developer of the timeline project for ZK.forge.

Copyright © Gu Wei Xing. This article is licensed under GNU Free Documentation License.
Comments
 
Cary
2008-09-27

where the two XML?us_history.xml, bush_events.xml

Shashank Tiwari
2008-09-29

Congratulations! We announced the release on RIA Revolution. Here is the link to the story -- ZK Timeline 1.2.2 Released

Ryan
2008-09-30

To Cary :
You can create your own :D

<data>
    <event start="Jan 01 1849 00:00:00 GMT" title="Some thing" link="http://somewhere"></event>
</data>

 
 
Leave a Reply
 
Name (required)
Mail (will not be published) (required)
Website
(Case Insensitive)
Bold textItalic textUnderLine textSource CodeHorizontal rulerExternal Link
Post
Preview