Browse Source

Fixed some minor fullscreen things, still not working

hutattedonmyarm 12 years ago
parent
commit
029cb3e239
2 changed files with 42 additions and 4 deletions
  1. 35
    1
      CubeControl/FullscreenWindow.java
  2. 7
    3
      CubeControl/Led3D.java

+ 35
- 1
CubeControl/FullscreenWindow.java View File

1
+/*
2
+ * FullscreenWindow.java
3
+ *
4
+ *
5
+ * Copyright 2011 Thomas Buck <xythobuz@me.com>
6
+ * Copyright 2011 Max Nuding <max.nuding@gmail.com>
7
+ * Copyright 2011 Felix Bäder <baeder.felix@gmail.com>
8
+ *
9
+ * This file is part of LED-Cube.
10
+ *
11
+ * LED-Cube is free software: you can redistribute it and/or modify
12
+ * it under the terms of the GNU General Public License as published by
13
+ * the Free Software Foundation, either version 3 of the License, or
14
+ * (at your option) any later version.
15
+ *
16
+ * LED-Cube is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ * GNU General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU General Public License
22
+ * along with LED-Cube. If not, see <http://www.gnu.org/licenses/>.
23
+ */
24
+
25
+/**
26
+ * This class is responsible for displaying the 3D View of our Cube in fullscreen mode.
27
+ * 
28
+ * @author Thomas Buck
29
+ * @author Max Nuding
30
+ * @author Felix Bäder
31
+ * @version 1.0
32
+ */
33
+
34
+
1
 import com.sun.j3d.utils.universe.*;
35
 import com.sun.j3d.utils.universe.*;
2
 import javax.media.j3d.*;
36
 import javax.media.j3d.*;
3
 import java.awt.*;
37
 import java.awt.*;
38
 			}
72
 			}
39
 		});
73
 		});
40
 		
74
 		
41
-		canvas.setBounds(0,0, width, height-50);
75
+		canvas.setBounds(0,0, width, height-30);
42
 
76
 
43
 		
77
 		
44
 		cp.add(exitButton);
78
 		cp.add(exitButton);

+ 7
- 3
CubeControl/Led3D.java View File

259
 	}
259
 	}
260
 	
260
 	
261
 	public void enterFullscreen() {
261
 	public void enterFullscreen() {
262
-
263
-		group.removeChild(background);
262
+		if(group.indexOfChild(background) != -1){
263
+			group.removeChild(background);
264
+		}
264
 		group.addChild(fullscreenBackground);
265
 		group.addChild(fullscreenBackground);
265
 		
266
 		
266
 	}
267
 	}
267
 	
268
 	
268
 	public void leaveFullscreen() {
269
 	public void leaveFullscreen() {
269
-		group.removeChild(fullscreenBackground);
270
+		if(group.indexOfChild(fullscreenBackground) != -1) {
271
+			group.removeChild(fullscreenBackground);
272
+		}
273
+		
270
 		group.addChild(background);
274
 		group.addChild(background);
271
 		
275
 		
272
 	}
276
 	}

Loading…
Cancel
Save