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 specific band and
> MyFilter will go over the filters that were registered for this
> specific band and 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 specific band.
> If there is any way to register a few filters to the same band, 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 specific band, then you need to
have per band filtering--you'll need to register a separate filter
function per band. Each of those per-band filters 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 the band number.



> 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 relevant band then 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 the band from 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 each band that merely call
into the common filter system with the band number.

> 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 or band , meaning you cannot have
> different behaviors of the "showBubble" per band/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 are band-specific. So don't use a filterMatcher for several 
> > bands, use a filterMatcher per band. That way you know what band you'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: getting a band or a timeline of an event
>
> > Hi Everyone,
>
> > I am trying to find a way to get the band information 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
> > band that that contains the event, therefore I want to know which band
> > 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 the band/
> > 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to