No Description
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.

Page7.java 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. package Application1.Pages;
  2. import java.awt.Color;
  3. import java.awt.Desktop;
  4. import java.awt.FlowLayout;
  5. import java.awt.Font;
  6. import java.awt.GridLayout;
  7. import java.awt.event.ActionEvent;
  8. import java.awt.event.ActionListener;
  9. import java.io.File;
  10. import java.io.IOException;
  11. import javax.swing.JButton;
  12. import javax.swing.JPanel;
  13. import javax.swing.border.*;
  14. import Application1.PathVar;
  15. import Application1.TextPanel;
  16. public class Page7 extends JPanel {
  17. public Page7(int taillePolice, Border bordure) {
  18. //Initialitsation
  19. PathVar path = new PathVar();
  20. TextPanel cadran1;
  21. JPanel cadran2;
  22. Font f = new Font("Serif", Font.BOLD, 15);
  23. JButton BoutonGlovePie = new JButton("Lancer GLovePie");
  24. BoutonGlovePie.setFont(f);
  25. BoutonGlovePie.setForeground(Color.BLACK);
  26. BoutonGlovePie.setBackground(Color.LIGHT_GRAY);
  27. JButton BoutonTrinus = new JButton("Lancer Trinus");
  28. BoutonTrinus.setFont(f);
  29. BoutonTrinus.setForeground(Color.BLACK);
  30. BoutonTrinus.setBackground(Color.LIGHT_GRAY);
  31. JButton BoutonRevit = new JButton("Lancer Revit");
  32. BoutonRevit.setFont(f);
  33. BoutonRevit.setForeground(Color.BLACK);
  34. BoutonRevit.setBackground(Color.LIGHT_GRAY);
  35. JButton BoutonInternet = new JButton("Lancer AutoDesk View");
  36. BoutonInternet.setFont(f);
  37. BoutonInternet.setForeground(Color.BLACK);
  38. BoutonInternet.setBackground(Color.LIGHT_GRAY);
  39. JButton BoutonClavier = new JButton ("Lancer le clavier Virtuel");
  40. BoutonClavier.setFont(f);
  41. BoutonClavier.setForeground(Color.BLACK);
  42. BoutonClavier.setBackground(Color.LIGHT_GRAY);
  43. GridLayout grid= new GridLayout(2,2);
  44. FlowLayout flow = new FlowLayout();
  45. grid.setHgap(10);
  46. grid.setVgap(10);
  47. setLayout(grid);
  48. //Cadran 1
  49. cadran1 = new TextPanel(taillePolice);
  50. cadran1.AjouterParagraph(" \n");
  51. cadran1.AjouterParagraph(" Le système est prêt à être utilisé! \n");
  52. cadran1.AjouterParagraph(" \n");
  53. cadran1.AjouterParagraph(" Les logiciels suivant sont bien installés sur la machine : \n ");
  54. cadran1.AjouterParagraph(" * GlovePie \n");
  55. cadran1.AjouterParagraph(" * Trinus \n");
  56. cadran1.AjouterParagraph(" La WiiMote est reliée en Bluetooth à l'ordinateur! \n");
  57. cadran1.AjouterParagraph(" \n");
  58. cadran1.AjouterParagraph(" Les différents boutons ci-dessous vous permettent de lancer tous les outils nécessaires. \n");
  59. cadran1.AjouterParagraph(" \n");
  60. cadran1.setEditable(false);
  61. cadran1.setBorder(bordure);
  62. //Cadran 2
  63. cadran2 = new JPanel();
  64. cadran2.setLayout(flow);
  65. cadran2.add(BoutonGlovePie);
  66. cadran2.add(BoutonTrinus);
  67. cadran2.add(BoutonRevit);
  68. cadran2.add(BoutonInternet);
  69. cadran2.add(BoutonClavier);
  70. //Gestion Boutons
  71. BoutonGlovePie.addActionListener(new ActionListener() {
  72. public void actionPerformed(ActionEvent event) {
  73. //Lancement du panneau de configuration
  74. File file = new File("External_Software/Glovepie/WiimoteScripts/WiimoteScript.PIE");
  75. java.awt.Desktop desktop = Desktop.getDesktop();
  76. try {
  77. desktop.open(file);
  78. } catch (IOException e) {
  79. // TODO Auto-generated catch block
  80. e.printStackTrace();
  81. }
  82. }
  83. }
  84. );
  85. BoutonTrinus.addActionListener(new ActionListener() {
  86. public void actionPerformed(ActionEvent event) {
  87. try {
  88. path.readPathFile();
  89. File file = new File(path.getPathTrinus());
  90. java.awt.Desktop desktop = Desktop.getDesktop();
  91. desktop.open(file);
  92. } catch (IOException e1) {
  93. // TODO Auto-generated catch block
  94. e1.printStackTrace();
  95. }
  96. }
  97. });
  98. BoutonRevit.addActionListener(new ActionListener() {
  99. public void actionPerformed(ActionEvent event) {
  100. try {
  101. path.readPathFile();
  102. File file = new File(path.getPathRevit());
  103. java.awt.Desktop desktop = Desktop.getDesktop();
  104. desktop.open(file);
  105. } catch (IOException e1) {
  106. // TODO Auto-generated catch block
  107. e1.printStackTrace();
  108. }
  109. }
  110. });
  111. BoutonInternet.addActionListener(new ActionListener() {
  112. public void actionPerformed(ActionEvent event) {
  113. //Lancement du panneau de configuration
  114. Runtime rt = Runtime.getRuntime();
  115. try {
  116. rt.exec(new String[] {"cmd.exe","/c","start","https://viewer.autodesk.com/"});
  117. }catch (IOException e) {
  118. e.printStackTrace();
  119. }
  120. }
  121. });
  122. BoutonClavier.addActionListener(new ActionListener() {
  123. public void actionPerformed(ActionEvent event) {
  124. //Lancement du panneau de configuration
  125. Runtime rt = Runtime.getRuntime();
  126. try {
  127. rt.exec(new String[] {"cmd.exe","/c","start","osk"});
  128. }catch (IOException e) {
  129. e.printStackTrace();
  130. }
  131. }
  132. });
  133. //Ajout Cadran
  134. add(cadran1);
  135. add(cadran2);
  136. }
  137. }