Using the New Feature Of The Timeline Component"

From Documentation
m (Created page with '{{Template:Smalltalk_Author| |author=Gu Wei Xing, Software developer in NanTong of JiangSu province, China. |date=Sep 26, 2008 |version=Applicable to zk-timeline1.2_2. }} =Hi…')
 
 
(3 intermediate revisions by one other user not shown)
Line 53: Line 53:
 
The example:
 
The example:
  
<gflash width="900" height="500">http://docs.zkoss.org/images/8/86/ShowHideBubble.swf</gflash>
+
<gflash width="900" height="500">ShowHideBubble.swf</gflash>
 
 
  
 
=Pass center visible date in BandScrollEvent.=
 
=Pass center visible date in BandScrollEvent.=
Line 86: Line 85:
 
Here is the Example :
 
Here is the Example :
  
<gflash width="900" height="800">http://docs.zkoss.org/images/e/ee/CenterPosition.swf</gflash>
+
<gflash width="900" height="800">CenterPosition.swf</gflash>
 
 
  
 
=Dowload=
 
=Dowload=

Latest revision as of 06:55, 25 October 2010

DocumentationSmall Talks2008SeptemberUsing the New Feature Of The Timeline Component
Using the New Feature Of The Timeline Component

Author
Gu Wei Xing, Software developer in NanTong of JiangSu province, China.
Date
Sep 26, 2008
Version
Applicable to zk-timeline1.2_2.



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:

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.


Ruler.gif


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.