/** * Detaches the echo BranchGroup from the ViewingPlatform if appropriate. */ private void detachEcho() { if (echoBranchGroup != null && echoBranchGroupAttached) { echoBranchGroup.detach() ; echoBranchGroupAttached = false ; } }
public void hide() { child.detach(); child.removeAllChildren(); shape = null; }
/** * Delete the child with the specified name from the scenegraph. * * @param name */ private void deletePointFromGeometry(final String name) { for (int i = 0; i < numChildren(); i++) { final BranchGroup bg = (BranchGroup) getChild(i); if (bg.getName().equals(name)) { bg.detach(); return; } } }
/** * Detach each BranchGraph from the Locale(s) */ public void detachAllGraphs() { int c = 0; try { for( int i=0; i<localeBGs.size(); i++) { int[] bgs = (int[])localeBGs.get(i); for(int j=0; j<bgs.length; j++) { SymbolTableData symbol = control.getSymbolTable().getBranchGraphRoot( bgs[j] ); ((BranchGroup)symbol.j3dNode).detach(); } } } catch( org.scijava.java3d.CapabilityNotSetException e ) { throw new org.scijava.java3d.CapabilityNotSetException( "Locale BranchGraphs MUST have ALLOW_DETACH capability set" ); } }
final void removeAllCubes() { // remove the old data final OrderedGroup og = getOrderedGroup(DETAIL_AXIS); for (int i = og.numChildren() - 1; i >= 0; i--) { final BranchGroup child = (BranchGroup) og.getChild(i); child.detach(); child.removeAllChildren(); } }
/** * Adds a new ViewPlatformBehavior to the ViewingPlatform */ void addViewPlatformBehavior(ViewPlatformBehavior behavior) { behavior.setViewingPlatform(this); if (behaviors == null) { behaviors = new BranchGroup(); behaviors.setCapability(BranchGroup.ALLOW_DETACH); behaviors.setCapability(BranchGroup.ALLOW_CHILDREN_READ); } // otherwise detach the BranchGroup so we can add to it else { behaviors.detach(); } behaviors.addChild(behavior); this.addChild(behaviors); }
/** * Removes the specified ViewPlatformBehavior */ void removeViewPlatformBehavior(ViewPlatformBehavior behavior) { // remove from the behaviors branch group if (behaviors != null) { behaviors.detach(); for (int i = 0; i < behaviors.numChildren(); i++) { if (behaviors.getChild(i) == behavior) { behavior.setViewingPlatform( null ); behaviors.removeChild(i); break; } } if (behaviors.numChildren() == 0) behaviors = null; else this.addChild(behaviors); } }