Thanks Larry, What I decided to do at the end, is to override the clickHandler at a timeline level (not band level) by overriding the showBubble in the timeline's jsp page. This should work even if I have several pages (each page with one timeline), each timeline/page will trigger his owb overriden clickHandler.
As to the filters- I took your advice and will have a filter per band. On Apr 12, 11:38 pm, [email protected] wrote: > Hi, > > Sorry for the delay, I was away for the holiday. > > Comments are below. > > Regards, > > Larry > > On Apr 6, 5:31 am, ora <[email protected]> wrote: > > > > > Hi, > > > I understand your answer but my problem here is that I want to use a > > few filters in runtime. My code is going to look something like this > > 1. use the timeline.getBand(0).getEventPainter().setFilterMatcher to > > add MyFilter to ALL bands > > 2. MyFilter will go over a list of registered methods , the registered > > methods are something that the user adds to a specificbandand > > MyFilter will go over the filters that were registered for this > > specificbandand check whether the registered filters filter out the > > events > > > My solution was to have my filter do this work whereas the user simply > > registers his filter method to a specificband. > > If there is any way to register a few filters to the sameband, then > > this can also be a solution for me..... > > The above sounds fine. Only issue is that since you want your clients > to be able to register filters for a specificband, then you need to > have perbandfiltering--you'll need to register a separate filter > function perband. Each of those per-bandfilters can then call into a > common filtering object/system that you've written. > > On second thought, looking at the code just now, I think that the > context of the calls to the filterMatcher and the > showBubble function will both be the painter object. > > To test this, add a breakpoint inside the filterMatcher and bubble > function. > Inside function, look at the value of this._band._index > it may well be thebandnumber. > > > And another question regarding what you wrote above:"multiple bands > > can share one event source" - lets say my bands have different event > > sources - if I can find a way to reference the eventSource from the > > event and save on the eventSource its relevantbandthen it is also a > > solution- is this correct? > > I suppose, but then either: > a) you'd be creating additional eventSources just for the purpose of > being able to identify thebandfrom an event > or b) your solution would be limited to cases where eventSources are > only used for single bands. > Remember that event sources are expensive (in terms of space) since > they hold a copy of all the event data. > > Personally, I'd create one line fliters for eachbandthat merely call > into the common filter system with thebandnumber. > > > I assume I will have the same problem when trying to override the > > Timeline.OriginalEventPainter.prototype._showBubble only for a certain > > timeline/band, because the _showBubble has the event object which > > doesnt indicate the timeline orband, meaning you cannot have > > different behaviors of the "showBubble" perband/timeline (unless you > > track these via the eventId), right? > > I believe that you're right. But see about with regards to the context > (this) > > > Sorry for the long response, I hope I didnt confuse you too much.... > > > On Apr 5, 7:20 pm, Larry Kluger <[email protected]> wrote: > > > > Hi Ora, > > > > Events are often independent of bands (multiple bands can share one event > > > source). > > > > But filters areband-specific. So don't use a filterMatcher for several > > > bands, use a filterMatcher perband. That way you know whatbandyou're > > > filtering. > > > Of course, you can use a second function for common filtering tasks. Eg > > > > timeline.getBand(0).getEventPainter().setFilterMatcher(filterMatcher0); > > > timeline.getBand(1).getEventPainter().setFilterMatcher(filterMatcher1); > > > > function filterMatcher0 (evt) {return commonFilterMatcher(0,evt)} > > > function filterMatcher1 (evt) {return commonFilterMatcher(1,evt)} > > > > function commonFilterMatcher(band_index, evt) { > > > > do filtering here. Return true || false > > > > } > > > > Larry > > > > ________________________________ > > > From: ora <[email protected]> > > > To: SIMILE Widgets <[email protected]> > > > Sent: Sunday, April 5, 2009 1:58:23 AM > > > Subject:gettingabandor a timeline of an event > > > > Hi Everyone, > > > > I am trying to find a way to get thebandinformation and timeline > > > information from an event. > > > > For example, lets say I have a filterMatcher for several banda, and > > > now the event is passed to this filter and my filtering depends on the > > >bandthat that contains the event, therefore I want to know whichband > > > this event came from. I can obviously manage the filters and bands > > > somewhere, but I'd rather not, do you know of a way to get theband/ > > > timeline info from an event on run-time? > > > > Thanks > > > Ora --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "SIMILE Widgets" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/simile-widgets?hl=en -~----------~----~----~----~------~----~------~--~---
