xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cameron McCormack <...@mcc.id.au>
Subject Re: Request public API to TimedElement
Date Fri, 21 Mar 2008 23:49:11 GMT
Hi Tonny.

Tonny Kohar:
> I would like to request public API access to the
> org.apache.batik.anim.timing.TimedElement.

I agree it would be useful to expose animation engine information from
the document.  I’m not sure what the ideal API would be, though.

> After briefly studying Batik code base, I think by simple doing the
> following will expose public TimedElement
> 
> - in org.apache.batik.dom.svg.SVGOMAnimationElement provide
>   * public SVGAnimationContext getSVGAnimationContext() {
>         return  ((SVGAnimationContext) getSVGContext())
>     }
> 
> - in org.apache.batik.dom.svg.SVGAnimationContext provide
>   * public TimedElement getTimedElement();
> 
> - in org.apache.batik.bridge.SVGAnimationElementBridge already provide
> the above getTimedElement()

Given that SVGAnimationElementBridge already exposes the TimedElement
through that method, I think we don’t need to add the first two methods
you propose.  You can just do, for example:

  SVGOMAnimateElement e = …;
  TimedElement te = 
      (SVGAnimationElementBridge) e.getSVGContext()).getTimedElement();

> I need to get access to the TimedElement, because currently I am
> creating SVG Animation Editor and need more information regarding the
> animation more than SVGAnimationElement provide (getStartTime(),
> getSimpleDuration).

Tonny Kohar:
> Sorry, almost forgot, I also would like to request public API for some
> attribute of TimedElement
> 
> - public TimingSpecifier[] getBeginTimes() {
> return beginTimes;
> }
> 
> - public TimingSpecifier[] getEndTimes() {
> return endTimes;
> }

I suspect that in the end you’ll need some more complex interface to the
animation engine (e.g. registering listeners for changes to the
timegraph, begin/end instance times being created/removed, etc.).

I am a little reluctant to make the existing classes more “public”,
since they’re not really designed for applications to use.  For example,
TimingSpecifier has public initialize()/deinitialize() methods, which
are really just for use by TimedElement.  

But if you don’t mind the interface possibly changing later, and if you
promise not to call initialize(), I can add these methods. :-)

Please do feel free to suggest a more complete/modular interface for
gaining access to timing information from the document.

-- 
Cameron McCormack, http://mcc.id.au/
	xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


Mime
View raw message