The problem:

When setting the "fill" attribute on an "animate" element, the value when
dumped to my XML/SVG file  gets represented as:
        style="fill:freeze;"
instead of...
        fill="freeze"
like I expect.

I reasoned that this could be happening because 'fill' is an attribute
common to shapes and text that is commonly placed in a composite 'style'
attribute... and therefore the reason that the 'fill' attribute is tossed
into the 'style' attribute.

My simple workaround (i.e., hack) is to create a 'set' element that begins
when the fade-in 'animate' completes.  This just feels wrong, and I don't
know where to go next.  If possible, I would like to avoid using javascript
to solve this problem.


My code:

I'm using the following excerpt of code to create a fade-in animation for a
tooltip...

    private static Element createTipAnimation( Document d, String id, 
        String from, String to, String when, String duration )
    {
        Element e = d.createElement( "animate" );
        if ( id != null )
        {
            e.setAttribute( "id", id );
        }
        e.setAttribute( "attributeName", "opacity" );
        e.setAttribute( "from", from );
        e.setAttribute( "to", to );
        e.setAttribute( "fill", "freeze" );
        e.setAttribute( "begin", when );
        e.setAttribute( "dur", duration );

        return e;
    }


I use this method from another place in the code...

    //...
        SVGGraphics2D g; // g is assigned somewhere else...
        Element tip = g.getTopLevelGroup( false );
        Document        d = g.getDOMFactory( );
        String  _toolId; // _toolId is assigned somewhere else...
    //...
        //fade tool tip in...
        Element fadeIn = createTipAnimation( d, "temp", "0", "0.8",
            _toolId + ".mouseover+1s", "1s", _toolId + ".mouseout" );

        tip.appendChild( fadeIn );
    //...

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to