Anett Berger wrote:
> Hi Kelvin,
>
> I've got to apologize for my late answer.
> I'm using version 1.2.1_04.
> In the faq (http://www.j3d.org/faq/manipulating.html#detach) I read that I
> have to set allowances to the parents.
> And I thought that I found out that a Locale cannot be given the allowances
> read/write etc. its children and therefore I cannot remove or replace. And
> child.detach() didn't work too.


> I didn't understand this because there is a remove and a replace method for
> Locales.
> My solution with the additional level between the ContentBranch and the
> Locale works fine.
> Am I completely wrong?
>


There is an API Locale
  public void removeBranchGraph(BranchGroup branchGroup)

to remove branchGroup under it. Just set the BranchGroup.ALLOW_DETACH
capability bit on branchGroup should work.

Another API to use is  Locale
     public void replaceBranchGraph(BranchGroup oldGroup,
                            BranchGroup newGroup)
Again you need to set ALLOW_DETACH capability bit on oldGroup.

There may be bugs in v1.2.1 that you encounter to prevent
the normal operation of this function. Try upgrade to
Java3D v1.3 release to fix it.

Anyway the solution that you are using is OK.


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

>
>
>>Hi Anett,
>>
>>    Which version of Java3D are you using ?
>>
>>BranchGroup replace(), detach() should work in v1.3 release.
>>If it doesn't please send us a test case to investigate.
>>
>>Thanks.
>>
>>- Kelvin
>>-------------
>>Java 3D Team
>>Sun Microsystems Inc.
>>
>>
>>Anett Berger wrote:
>>
>>>This gives me a NullPointerException... (as like as "replace")
>>>
>>>I found a solution by adding/removing to/from an additional BranchGroup
>>>between the ContentBranches and the Locale. (It took a long time...)
>>>
>>>Thanks a lot!
>>>Netti
>>>
>>>
>>>
>>>>Hi,
>>>>
>>>>Try locale1.removeBranchGraph(contentBranch1) instead of
>>>>contentBranch1.detach()
>>>>
>>>>Cheers,
>>>>
>>>>Florin
>>>>
>>>>-----Urspr�ngliche Nachricht-----
>>>>Von: Anett Berger [mailto:[EMAIL PROTECTED]]
>>>>Gesendet: Donnerstag, 26. September 2002 13:31
>>>>An: [EMAIL PROTECTED]
>>>>Betreff: [JAVA3D] change ContentBranches
>>>>
>>>>
>>>>Hi,
>>>>
>>>>I'd like to replace a complete ContentBranch in a scene. (The user is
>>>>to
>>>>choose.)
>>>>
>>>>Pressing a button the new ContentBranch should appear and the old one
>>>>disapppear.
>>>>
>>>>I did the following:
>>>>
>>>>if (e.getSource() == button1) {
>>>>contentBranch1.detach(); //(capability is set)
>>>>locale1.addBranchGraph(contentBranch2);
>>>>}
>>>>
>>>>The new one is there and works but the old one doesn't disappear.
>>>>
>>>>Could anybody give me a hint? Or is this a complete wrong way?
>>>>
>>>>Thanks
>>>>Netti
>>>>
>>>
>>>
>>>
>>>--
>>>Werden Sie mit uns zum "OnlineStar 2002"! Jetzt GMX w�hlen -
>>>und tolle Preise absahnen! http://www.onlinestar.de
>>>
>>>
>>
> ===========================================================================
>
>>>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".
>>
>>
>
> --
> Werden Sie mit uns zum "OnlineStar 2002"! Jetzt GMX w�hlen -
> und tolle Preise absahnen! http://www.onlinestar.de
>
> ===========================================================================
> 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