Hi Marc,

   Utility bug 4730414

- Text2D setString() throws Texture illegal size Exception

is submitted for this problem.

It is cause by fixing bug 4416995 - Text2D.setString(String) restores
filter setting default values, in v1.3 release. In that fix
we're trying to perserve the Texture2D attributes which the user set
from getting Text2D.getAppearance().getTexture(). This is done
by setting imageComponent of Texture2D directly instead of
setting a new Texture2D object. But when the imageComponent
size differ from previous one, it causes problem.


One way to workaround this is to catch the Exception and
recreate a new Text2D. Another way is to modify the
Text2D utilities source code include in the distribution.
In the setString() method, we can invoke

getAppearance().setTexture(setupTexture(imageComponent))
(Note: this will break 4416995 unless we read all the
previous Texture2D attributes and copy to the new one.
That mean we have to set a lot of capabilities)

instead of

getAppearance().getTexture().setImage(0, imageComponent)

when the imageComponent size different from previous one.


Thanks for your bug report.

- Kelvin
--------------------
Java 3D Team
Sun Microsystems Inc.


Marc Palmer wrote:

> Hi,
>
> My code seems to be behaving differently / not working under Java3D 1.3
> whereas it was previously OK with Java3d 1.2
>
> The problem I am seeing is:
>
> When trying to change the text of a Text2D from within a behaviour (my
> fps counter) I get:
>
> Exception occurred during Behaviour execution:
> java.lang.IllegalArgumentException: Texture: illegal image size
>    at java.media.j3d.TextureRetained.checkImageSize(
> TexureRetained.javaL389)
>    ... stack trace goes on ...
>
> Any idea why? I already had to update my setCapability calls to add new
> capabilities required in Java3d 1.3 (like APPEARANCE_READ and
> TEXTURE_READ)
>
> ...but then it dies with the above, which doesn't -look- like something
> that is my fault.
>
> Any clues?
>
> Thanks
> Marc
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ W<A> ~~~~~
> (o) Wangjammer5 (Marc Palmer)
> ( ) Wangjammer7
>
> www.wangjammers.org = Java Consultants (Web|Smartcards|Crypto)
>
> =========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JAVA3D-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to