Browse Source

Fixed background in fullscreen mode...

hutattedonmyarm 12 years ago
parent
commit
b0978982ef
1 changed files with 9 additions and 2 deletions
  1. 9
    2
      CubeControl/Led3D.java

+ 9
- 2
CubeControl/Led3D.java View File

99
 		beh3.setSchedulingBounds(boundBox);
99
 		beh3.setSchedulingBounds(boundBox);
100
 		transGroup.addChild(beh3);
100
 		transGroup.addChild(beh3);
101
 
101
 
102
+		
103
+		group.setCapability(BranchGroup.ALLOW_CHILDREN_READ);
104
+		group.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);
105
+		group.setCapability(BranchGroup.ALLOW_DETACH);
102
 		background = createBackground();
106
 		background = createBackground();
103
 		fullscreenBackground = createFullscreenBackground();
107
 		fullscreenBackground = createFullscreenBackground();
104
 		group.addChild(background);
108
 		group.addChild(background);
251
 	
255
 	
252
 	//create fullscreen background
256
 	//create fullscreen background
253
 	private Background createFullscreenBackground() {
257
 	private Background createFullscreenBackground() {
254
-		Background bg = new Background();
258
+		Background bg = new Background(0.0f, 0.0f, 1.0f);
255
 		int radius = Toolkit.getDefaultToolkit().getScreenSize().width;
259
 		int radius = Toolkit.getDefaultToolkit().getScreenSize().width;
256
 		bg.setApplicationBounds(new BoundingSphere(new Point3d(0.0, 0.0, 0.0), radius));
260
 		bg.setApplicationBounds(new BoundingSphere(new Point3d(0.0, 0.0, 0.0), radius));
257
 		return bg;
261
 		return bg;
259
 	}
263
 	}
260
 	
264
 	
261
 	public void enterFullscreen() {
265
 	public void enterFullscreen() {
266
+		group.detach();
262
 		if(group.indexOfChild(background) != -1){
267
 		if(group.indexOfChild(background) != -1){
263
 			group.removeChild(background);
268
 			group.removeChild(background);
264
 		}
269
 		}
265
 		group.addChild(fullscreenBackground);
270
 		group.addChild(fullscreenBackground);
271
+		universe.addBranchGraph(group);
266
 		
272
 		
267
 	}
273
 	}
268
 	
274
 	
269
 	public void leaveFullscreen() {
275
 	public void leaveFullscreen() {
276
+		group.detach();
270
 		if(group.indexOfChild(fullscreenBackground) != -1) {
277
 		if(group.indexOfChild(fullscreenBackground) != -1) {
271
 			group.removeChild(fullscreenBackground);
278
 			group.removeChild(fullscreenBackground);
272
 		}
279
 		}
273
-		
274
 		group.addChild(background);
280
 		group.addChild(background);
281
+		universe.addBranchGraph(group);
275
 		
282
 		
276
 	}
283
 	}
277
 }
284
 }

Loading…
Cancel
Save