/* * initialize the spheres */ public void initializeParam() { lightSetting(); for (int i = 0; i < 2; i++) { for (int j = 0; j < 5; j++) { for (int k = 0; k < 5; k++) { fingerCoor[i][j][k] = new Point3D(0, 0, -100); fingerNode[i][j][k] = new VisSphere(fingerSize); root.getChildren().add(fingerNode[i][j][k]); } fingerLine[i][j] = new PolyCylinder3D(getPoint3DArray(i, j), 5, Color.WHITE); root.getChildren().addAll(fingerLine[i][j].getLine()); } palmCoor[i] = new Point3D(0, 0, -100); palmNode[i] = new VisSphere(palmSize); palmLine[i] = new PolyCylinder3D(getPoint3DArray(i), 7, Color.WHITE); root.getChildren().addAll(palmLine[i].getLine()); root.getChildren().add(palmNode[i]); } // for better appearance, some nodes are hidden fingerNode[0][1][4].setVisible(false); fingerNode[0][2][4].setVisible(false); fingerNode[0][3][4].setVisible(false); fingerNode[1][1][4].setVisible(false); fingerNode[1][2][4].setVisible(false); fingerNode[1][3][4].setVisible(false); }
private Group makeGroup(Properties p) { Group group = new Group(); String id = p.getProperty("groupID"); String groupname = p.getProperty("groupname"); String description = p.getProperty("description"); group.setId(Integer.parseInt(id)); group.setName(groupname); group.setDescription(description); ArrayList<User> members = queryMembers(Integer.parseInt(id)); group.addMembers(members); return group; }
/* * initialize lights used in this app */ private void lightSetting() { // Creating Ambient Light AmbientLight ambient = new AmbientLight(); ambient.setColor(Color.rgb(0, 255, 0, 0.6)); // Creating Point Light PointLight point = new PointLight(); point.setColor(Color.rgb(255, 255, 255, 1)); point.setLayoutX(400); point.setLayoutY(100); point.setTranslateZ(-1100); root.getChildren().addAll(ambient, point); }
/* * add spheres by coordinates */ public void addSphere(Point3D coordinate, float size) { VisSphere sphere = new VisSphere(coordinate, size); root.getChildren().add(sphere); }