Simple single-color 8x8x8 LED Cube with AVRs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FullscreenWindow.java 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. * This class is responsible for displaying the 3D View of our Cube in fullscreen mode.
  26. *
  27. * @author Thomas Buck
  28. * @author Max Nuding
  29. * @author Felix Bäder
  30. * @version 1.0
  31. */
  32. import com.sun.j3d.utils.universe.*;
  33. import javax.media.j3d.*;
  34. import java.awt.*;
  35. import java.awt.event.*;
  36. import javax.swing.*;
  37. import javax.swing.event.*;
  38. import java.io.File;
  39. public class FullscreenWindow extends JFrame {
  40. private Container cp = getContentPane();
  41. private cubeWorker worker;
  42. private JButton exitButton;
  43. private Canvas3D canvas;
  44. private Led3D led;
  45. private int width;
  46. private int height;
  47. private Frame frame;
  48. public FullscreenWindow (cubeWorker cw, Canvas3D cv, Led3D ledview, Frame f) {
  49. //Basic layout stuff
  50. this.setUndecorated(true);
  51. Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
  52. setSize(d);
  53. setLocation(0,0);
  54. cp.setLayout(null);
  55. setResizable(false);
  56. worker = cw;
  57. width = d.width;
  58. height = d.height;
  59. canvas = cv;
  60. led = ledview;
  61. frame = f;
  62. exitButton = new JButton("Exit Fullscreen");
  63. exitButton.setBounds(width-150, height-25, 150, 25);
  64. exitButton.addActionListener(new ActionListener() {
  65. public void actionPerformed(ActionEvent evt) {
  66. dispose();
  67. frame.ledView.leaveFullscreen();
  68. }
  69. });
  70. canvas.setBounds(0,0, width, height-30);
  71. cp.add(exitButton);
  72. cp.add(canvas);
  73. setVisible(true);
  74. }
  75. }