Simple single-color 8x8x8 LED Cube with AVRs
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

FullscreenWindow.java 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. public FullscreenWindow (cubeWorker cw, Canvas3D cv, Led3D ledview) {
  48. //Basic layout stuff
  49. this.setUndecorated(true);
  50. Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
  51. setSize(d);
  52. setLocation(0,0);
  53. cp.setLayout(null);
  54. setResizable(false);
  55. worker = cw;
  56. width = d.width;
  57. height = d.height;
  58. canvas = cv;
  59. led = ledview;
  60. exitButton = new JButton("Exit Fullscreen");
  61. exitButton.setBounds(width-150, height-25, 150, 25);
  62. exitButton.addActionListener(new ActionListener() {
  63. public void actionPerformed(ActionEvent evt) {
  64. dispose();
  65. led.leaveFullscreen();
  66. }
  67. });
  68. canvas.setBounds(0,0, width, height-30);
  69. cp.add(exitButton);
  70. cp.add(canvas);
  71. setVisible(true);
  72. }
  73. }