Browse Source

Fullscreen now working

hutattedonmyarm 13 years ago
parent
commit
c71bfbbc61
3 changed files with 34 additions and 88 deletions
  1. 33
    1
      CubeControl/Frame.java
  2. 0
    86
      CubeControl/FullscreenWindow.java
  3. 1
    1
      CubeControl/makefile

+ 33
- 1
CubeControl/Frame.java View File

@@ -77,6 +77,7 @@ public class Frame extends JFrame implements ListSelectionListener {
77 77
 	private JButton frameDuration = new JButton();
78 78
     private JButton fullScreenButton = new JButton();
79 79
 	private JButton playAnimation = new JButton();
80
+	private JButton exitButton;
80 81
 	// Ende Attribute
81 82
 
82 83
 	public cubeWorker worker = new cubeWorker();
@@ -369,6 +370,16 @@ public class Frame extends JFrame implements ListSelectionListener {
369 370
 			}
370 371
 		});
371 372
 
373
+		exitButton = new JButton("Exit Fullscreen");
374
+		exitButton.setBounds(Toolkit.getDefaultToolkit().getScreenSize().width-300, Toolkit.getDefaultToolkit().getScreenSize().height-80, 150, 25);
375
+		cp.add(exitButton);
376
+		exitButton.addActionListener(new ActionListener() {
377
+			public void actionPerformed(ActionEvent evt) {
378
+				exitFullscreen();
379
+			}
380
+		});
381
+
382
+
372 383
 		playAnimation.setText("Play");
373 384
 		playAnimation.setBounds(344, 390, 147, 25);
374 385
 		playAnimation.setFont(new Font("Dialog", Font.PLAIN, 13));
@@ -576,9 +587,30 @@ public class Frame extends JFrame implements ListSelectionListener {
576 587
 	
577 588
 	public void enterFullscreen(ActionEvent evt) {
578 589
 		ledView.enterFullscreen();
579
-		FullscreenWindow fw = new FullscreenWindow(worker, cubeCanvas, ledView, this);
590
+		//FullscreenWindow fw = new FullscreenWindow(worker, cubeCanvas, ledView, this);
591
+		setLocation(0,0);
592
+		setSize(700, 700);
593
+		int w = Toolkit.getDefaultToolkit().getScreenSize().width;
594
+		int h = Toolkit.getDefaultToolkit().getScreenSize().height;
595
+		System.out.println(w);
596
+		System.out.println(h);
597
+		setSize(w-5, h-30);
598
+		//setSize(Toolkit.getDefaultToolkit().getScreenSize().width, Toolkit.getDefaultToolkit().getScreenSize().height);
599
+		//Y U NO WORK????
600
+		cubeCanvas.setBounds(0,0,Toolkit.getDefaultToolkit().getScreenSize().width-5, Toolkit.getDefaultToolkit().getScreenSize().height-80);
580 601
 	
581 602
 	}
603
+	public void exitFullscreen(){
604
+	//661, 440
605
+	setLocation(0,0);
606
+		setSize(661, 440);
607
+		ledView.leaveFullscreen();
608
+		cubeCanvas.setBounds(8,8, 250,250);
609
+		Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
610
+		int x = (d.width - getSize().width) / 2;
611
+		int y = (d.height - getSize().height) / 2;
612
+		setLocation(x, y);
613
+	}
582 614
 	
583 615
 	public void editA_ActionPerformed(ActionEvent evt) {
584 616
 

+ 0
- 86
CubeControl/FullscreenWindow.java View File

@@ -1,86 +0,0 @@
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
-
35
-import com.sun.j3d.utils.universe.*;
36
-import javax.media.j3d.*;
37
-import java.awt.*;
38
-import java.awt.event.*;
39
-import javax.swing.*;
40
-import javax.swing.event.*;
41
-import java.io.File;
42
-
43
-public class FullscreenWindow extends JFrame {
44
-	private Container cp = getContentPane();
45
-	private cubeWorker worker;
46
-	private JButton exitButton;
47
-	private Canvas3D canvas;
48
-	private Led3D led;
49
-	private int width;
50
-	private int height;
51
-	private Frame frame;
52
-	
53
-	public FullscreenWindow (cubeWorker cw, Canvas3D cv, Led3D ledview, Frame f) {
54
-		//Basic layout stuff
55
-		this.setUndecorated(true);
56
-		Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
57
-		setSize(d);
58
-		setLocation(0,0);
59
-		cp.setLayout(null);
60
-		setResizable(false);
61
-		
62
-		worker = cw;
63
-		width = d.width;
64
-		height = d.height;
65
-		canvas = cv;
66
-		led = ledview;
67
-		frame = f;
68
-		exitButton = new JButton("Exit Fullscreen");
69
-		exitButton.setBounds(width-150, height-25, 150, 25);
70
-		exitButton.addActionListener(new ActionListener() {
71
-			public void actionPerformed(ActionEvent evt) {
72
-				dispose();
73
-				frame.ledView.leaveFullscreen();
74
-			}
75
-		});
76
-		
77
-		canvas.setBounds(0,0, width, height-30);
78
-
79
-		
80
-		cp.add(exitButton);
81
-		cp.add(canvas);
82
-		
83
-		setVisible(true);
84
-	}
85
-
86
-}

+ 1
- 1
CubeControl/makefile View File

@@ -16,7 +16,7 @@ endif
16 16
 
17 17
 # All java files to be compiled
18 18
 # List so it works as target
19
-JAVAFILES = HelperUtility.java AnimationUtility.java Animation.java AFrame.java cubeWorker.java layerEditFrame.java Led3D.java Frame.java FullscreenWindow.java
19
+JAVAFILES = HelperUtility.java AnimationUtility.java Animation.java AFrame.java cubeWorker.java layerEditFrame.java Led3D.java Frame.java
20 20
 
21 21
 # --------------------------------------
22 22
 

Loading…
Cancel
Save