You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Tonny Kohar <to...@gmail.com> on 2008/03/10 07:31:33 UTC

Request public API to TimedElement

Hi,

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

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()

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).

Or any other ways to get TimedElement or specially to get better
information regarding the animation element.

Regards
Tonny Kohar
-- 
Sketsa SVG Editor
imagine, design, create ...
http://www.kiyut.com

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


Re: Request public API to TimedElement

Posted by Tonny Kohar <to...@gmail.com>.
Hi,

Thanks for the public API. I will download it with svn and continue
experimenting.

Cheers
Tonny Kohar
-- 
Sketsa SVG Editor
imagine, design, create ...
http://www.kiyut.com

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


Re: Request public API to TimedElement

Posted by Cameron McCormack <ca...@mcc.id.au>.
Tonny Kohar:
> Side Note: If you might be interested, I develop the SVG Animation
> Editor is under Apache License 2.0, so it might interest to be
> included in Batik as well (no legal issues, since it is also Apache
> License 2.0), however there are some technical issue, some part is
> quite tight with Sketsa.

Oh, nice!

> However as for now I could separate the implementation in
> - Timeline component is stand alone component that only interact with
> Batik, no sketsa dependency
> - Sketsa wrapper layer (this has sketsa dependency)
> 
> Please visit the url below for more info
> http://blogs.kiyut.com/tonny/2007/12/06/svg-animation-editor-feedback/

Cool.  One of our Summer of Code students last year started working on
an animation viewer/editor interface for Batik, but it didn’t get beyond
preliminary stages.

It is in the patch attached to
https://issues.apache.org/bugzilla/show_bug.cgi?id=42741; you may or may
not find it useful for ideas about design or the document animation
information interface.

Anyway, of course it’d be awesome if your animation visualising
component could be integrated into Batik.  I think it would be a nice
debugging tool to have, in addition to the DOM Viewer window.

> However, I would much prefer, if possible the Bridge stuff is not
> exposed (IMHO this should be deeper down in layer) through package
> import. SVGOM.. stuff probably fine (although if possible it is also
> eliminated as well), but I think SVGOM.. is not possible to be
> elimated because SVG API does not provide enough public API.

Yeah, probably you are right.  But for now I’ve gone the easy route and
only added those two methods (getBeginInstanceTimes() and
getEndInstanceTimes()) on to TimedElement.

> I am thinking about exposing the public API as much as permissable, so
> people could experiment with the stuff first, and by experimenting I
> think people could finally thinking about better
> interface/framework/library.

Sure, good idea.

> I believe in get access to the things first, experiment, then the
> experience could be used to develop better interface. And get access
> is better than no access at all.
> 
> Just make sure, put the javadoc comment to indicate that this/that
> methods is volatile and should not be called and will
> change/deprecated,

Have done.

> And I will not call initiallze() method :)

:-)

Cameron

-- 
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


Re: Request public API to TimedElement

Posted by Tonny Kohar <to...@gmail.com>.
Hi,

On Sat, Mar 22, 2008 at 6:49 AM, Cameron McCormack <ca...@mcc.id.au> wrote:
>
> > 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.
>

Same here I also do not know the ideal API, currently I am still
experiment with various access to the underlying SVG Timing model
(based on Batik) to model a SVG Animation Editor. As you already know,
something is better hidden eg: TimingSpecifier has public
initialize()/deinitialize() since it is should not be called by the
external application. see the inline comment for more detail.

Side Note: If you might be interested, I develop the SVG Animation
Editor is under Apache License 2.0, so it might interest to be
included in Batik as well (no legal issues, since it is also Apache
License 2.0), however there are some technical issue, some part is
quite tight with Sketsa.

However as for now I could separate the implementation in
- Timeline component is stand alone component that only interact with
Batik, no sketsa dependency
- Sketsa wrapper layer (this has sketsa dependency)

Please visit the url below for more info
http://blogs.kiyut.com/tonny/2007/12/06/svg-animation-editor-feedback/

>
>  > 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();

Yup, your above code should be fine (finally I could get access to the
Timed Element :)

However, I would much prefer, if possible the Bridge stuff is not
exposed (IMHO this should be deeper down in layer) through package
import. SVGOM.. stuff probably fine (although if possible it is also
eliminated as well), but I think SVGOM.. is not possible to be
elimated because SVG API does not provide enough public API.

>  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.).

Yup you are correct, finally there will be a need for more public
interface to the animation engine.
But currently I think I can deal by listening to the DOM mutation event

>  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. :-)

Yup, I think it is fine to change the interface later for better suited model.

I am thinking about exposing the public API as much as permissable, so
people could experiment with the stuff first, and by experimenting I
think people could finally thinking about better
interface/framework/library.

I believe in get access to the things first, experiment, then the
experience could be used to develop better interface. And get access
is better than no access at all.

Just make sure, put the javadoc comment to indicate that this/that
methods is volatile and should not be called and will
change/deprecated,

And I will not call initiallze() method :)

Cheers
Tonny Kohar
-- 
Sketsa SVG Editor
imagine, design, create ...
http://www.kiyut.com

Re: Request public API to TimedElement

Posted by Cameron McCormack <ca...@mcc.id.au>.
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


Re: Request public API to TimedElement

Posted by Tonny Kohar <to...@gmail.com>.
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;
}


On Mon, Mar 10, 2008 at 1:31 PM, Tonny Kohar <to...@gmail.com> wrote:
> Hi,
>
>  I would like to request public API access to the
>  org.apache.batik.anim.timing.TimedElement.
>
>  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()
>
>  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).
>
>  Or any other ways to get TimedElement or specially to get better
>  information regarding the animation element.
>
>  Regards
>  Tonny Kohar
>  --
>  Sketsa SVG Editor
>  imagine, design, create ...
>  http://www.kiyut.com
>



-- 
Citra FX Photo Effects
imagine, design, create ...
http://www.kiyut.com

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