Package javax.media.j3d

Examples of javax.media.j3d.Link


        }
        clonedShape.setAppearance(clonedAppearance);
      }
      return clonedShape;
    } else if (node instanceof Link) {
      Link clonedLink = (Link)node.cloneNode(true);
      // Force duplication of shared groups too
      SharedGroup sharedGroup = clonedLink.getSharedGroup();
      if (sharedGroup != null) {
        SharedGroup clonedSharedGroup = clonedSharedGroups.get(sharedGroup);
        if (clonedSharedGroup == null) {
          clonedSharedGroup = (SharedGroup)cloneNode(sharedGroup, clonedSharedGroups);
          clonedSharedGroups.put(sharedGroup, clonedSharedGroup);         
        }
        clonedLink.setSharedGroup(clonedSharedGroup);
      }
      return clonedLink;
    } else {
      Node clonedNode = node.cloneNode(true);
      if (node instanceof Group) {
View Full Code Here


        floor.setCapability(Shape3D.ALLOW_APPEARANCE_READ);
        floor.setCapability(Shape3D.ALLOW_APPEARANCE_WRITE);
        floor.setPickable(true);
        addChild(floor);

        addChild(new Link(hex.depth() > 0?shafts[1]:shafts[0]));
       
        setUserData(new Coords(c));
        ypos = 0;
        addText(""+c.getBoardNum(), new Color3f(GUIPreferences.getInstance().getMapTextColor()));
        final Point3d hexLoc = BoardModel.getHexLocation(c, h.floor());
View Full Code Here

      for (int j=0; j<columns; j++)
      {
        tfArray[i][j] = new Transform3D();
        tfArray[i][j].setTranslation(new Vector3f(i*columnStep-2.0f,j*0.1f-0.5f,-j*rowStep));
        tgArray[i][j] = new TransformGroup(tfArray[i][j]);
        tgArray[i][j].addChild(new Link(sgSphere));
        theScene.addChild(tgArray[i][j]);
      }
    }


View Full Code Here

      for (int j=0; j<columns; j++)
      {
        tfArray[i][j] = new Transform3D();
        tfArray[i][j].setTranslation(new Vector3f(i*columnStep-2.0f,j*0.1f-0.5f,-j*rowStep));
        tgArray[i][j] = new TransformGroup(tfArray[i][j]);
        tgArray[i][j].addChild(new Link(sgSphere));
        theScene.addChild(tgArray[i][j]);
      }
    }


View Full Code Here

/* 188 */       while (new File(tempFileName).exists()) {
/* 189 */         if (storedRefList.get(tempFileName) != null)
/*     */         {
/* 192 */           SharedGroup storedGroup = (SharedGroup)storedRefList.get(tempFileName);
/*     */
/* 194 */           Link newLink = new Link(storedGroup);
/* 195 */           s.addChild(newLink);
/*     */         }
/*     */         else
/*     */         {
/* 199 */           J3dLwoParser objParser = new J3dLwoParser(tempFileName, debugVals);
/*     */
/* 201 */           objParser.createJava3dGeometry();
/* 202 */           TransformGroup t = new TransformGroup();
/* 203 */           SharedGroup newSharedGroup = new SharedGroup();
/* 204 */           storedRefList.put(tempFileName, newSharedGroup);
/* 205 */           newSharedGroup.addChild(t);
/* 206 */           Link newLink = new Link(newSharedGroup);
/* 207 */           s.addChild(newLink);
/* 208 */           if (objParser.getJava3dShapeList() != null) {
/* 209 */             Enumeration e = objParser.getJava3dShapeList().elements();
/*     */
/* 211 */             while (e.hasMoreElements()) {
/* 212 */               t.addChild((Shape3D)e.nextElement());
/*     */             }
/*     */           }
/*     */         }
/* 216 */         fileNum++;
/* 217 */         String fileNumString = String.valueOf(fileNum);
/* 218 */         if (fileNum < 10)
/* 219 */           fileNumString = "00" + fileNumString;
/* 220 */         else if (fileNum < 100)
/* 221 */           fileNumString = "0" + fileNumString;
/* 222 */         tempFileName = fileNameBase + fileNumString + ".lwo";
/*     */       }
/* 224 */       this.behaviors = null;
/* 225 */       if (loadBehaviors != 0) {
/* 226 */         createSwitchBehavior(s);
/*     */       }
/* 228 */       this.geometryGroup = s;
/*     */     }
/*     */     else {
/* 231 */       this.geometryGroup = new Group();
/* 232 */       if (storedRefList.get(this.fileName) != null)
/*     */       {
/* 234 */         SharedGroup storedGroup = (SharedGroup)storedRefList.get(this.fileName);
/*     */
/* 236 */         Link newLink = new Link(storedGroup);
/* 237 */         this.geometryGroup.addChild(newLink);
/*     */       }
/*     */       else
/*     */       {
/* 241 */         J3dLwoParser objParser = new J3dLwoParser(this.fileName, debugVals);
/*     */
/* 243 */         objParser.createJava3dGeometry();
/* 244 */         TransformGroup t = new TransformGroup();
/* 245 */         if (objParser.getJava3dShapeList() != null) {
/* 246 */           Enumeration e = objParser.getJava3dShapeList().elements();
/* 247 */           while (e.hasMoreElements()) {
/* 248 */             t.addChild((Shape3D)e.nextElement());
/*     */           }
/*     */         }
/* 251 */         SharedGroup newSharedGroup = new SharedGroup();
/* 252 */         newSharedGroup.addChild(t);
/* 253 */         Link newLink = new Link(newSharedGroup);
/* 254 */         this.geometryGroup.addChild(newLink);
/* 255 */         storedRefList.put(this.fileName, newSharedGroup);
/*     */       }
/*     */     }
/*     */   }
View Full Code Here

/* 89 */     ((Link)this.node).setSharedGroup((SharedGroup)this.sharedGroupSymbol.j3dNode);
/* 90 */     super.buildGraph();
/*    */   }
/*    */
/*    */   protected SceneGraphObject createNode() {
/* 94 */     return new Link();
/*    */   }
View Full Code Here

TOP

Related Classes of javax.media.j3d.Link

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.