瀏覽代碼

Fixed some minor fullscreen things, still not working

hutattedonmyarm 12 年之前
父節點
當前提交
029cb3e239
共有 2 個檔案被更改,包括 42 行新增4 行删除
  1. 35
    1
      CubeControl/FullscreenWindow.java
  2. 7
    3
      CubeControl/Led3D.java

+ 35
- 1
CubeControl/FullscreenWindow.java 查看文件

@@ -1,3 +1,37 @@
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 35
 import com.sun.j3d.utils.universe.*;
2 36
 import javax.media.j3d.*;
3 37
 import java.awt.*;
@@ -38,7 +72,7 @@ public class FullscreenWindow extends JFrame {
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 78
 		cp.add(exitButton);

+ 7
- 3
CubeControl/Led3D.java 查看文件

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

Loading…
取消
儲存