123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- package Application1.Pages;
-
- import java.awt.Color;
- import java.awt.Desktop;
- import java.awt.FlowLayout;
- import java.awt.Font;
- import java.awt.GridLayout;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.io.File;
- import java.io.IOException;
-
- import javax.swing.JButton;
- import javax.swing.JPanel;
- import javax.swing.border.*;
-
- import Application1.PathVar;
- import Application1.TextPanel;
-
- public class Page7 extends JPanel {
- public Page7(int taillePolice, Border bordure) {
-
-
- //Initialitsation
- PathVar path = new PathVar();
- TextPanel cadran1;
- JPanel cadran2;
-
- Font f = new Font("Serif", Font.BOLD, 15);
-
- JButton BoutonGlovePie = new JButton("Lancer GLovePie");
- BoutonGlovePie.setFont(f);
- BoutonGlovePie.setForeground(Color.BLACK);
- BoutonGlovePie.setBackground(Color.LIGHT_GRAY);
-
- JButton BoutonTrinus = new JButton("Lancer Trinus");
- BoutonTrinus.setFont(f);
- BoutonTrinus.setForeground(Color.BLACK);
- BoutonTrinus.setBackground(Color.LIGHT_GRAY);
-
- JButton BoutonRevit = new JButton("Lancer Revit");
- BoutonRevit.setFont(f);
- BoutonRevit.setForeground(Color.BLACK);
- BoutonRevit.setBackground(Color.LIGHT_GRAY);
-
- JButton BoutonInternet = new JButton("Lancer AutoDesk View");
- BoutonInternet.setFont(f);
- BoutonInternet.setForeground(Color.BLACK);
- BoutonInternet.setBackground(Color.LIGHT_GRAY);
-
- JButton BoutonClavier = new JButton ("Lancer le clavier Virtuel");
- BoutonClavier.setFont(f);
- BoutonClavier.setForeground(Color.BLACK);
- BoutonClavier.setBackground(Color.LIGHT_GRAY);
-
- GridLayout grid= new GridLayout(2,2);
- FlowLayout flow = new FlowLayout();
- grid.setHgap(10);
- grid.setVgap(10);
- setLayout(grid);
-
- //Cadran 1
- cadran1 = new TextPanel(taillePolice);
- cadran1.AjouterParagraph(" \n");
- cadran1.AjouterParagraph(" Le système est prêt à être utilisé! \n");
- cadran1.AjouterParagraph(" \n");
- cadran1.AjouterParagraph(" Les logiciels suivant sont bien installés sur la machine : \n ");
- cadran1.AjouterParagraph(" * GlovePie \n");
- cadran1.AjouterParagraph(" * Trinus \n");
- cadran1.AjouterParagraph(" La WiiMote est reliée en Bluetooth à l'ordinateur! \n");
- cadran1.AjouterParagraph(" \n");
- cadran1.AjouterParagraph(" Les différents boutons ci-dessous vous permettent de lancer tous les outils nécessaires. \n");
- cadran1.AjouterParagraph(" \n");
- cadran1.setEditable(false);
- cadran1.setBorder(bordure);
-
- //Cadran 2
- cadran2 = new JPanel();
- cadran2.setLayout(flow);
- cadran2.add(BoutonGlovePie);
- cadran2.add(BoutonTrinus);
- cadran2.add(BoutonRevit);
- cadran2.add(BoutonInternet);
- cadran2.add(BoutonClavier);
-
- //Gestion Boutons
-
- BoutonGlovePie.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent event) {
- //Lancement du panneau de configuration
- File file = new File("External_Software/Glovepie/WiimoteScripts/WiimoteScript.PIE");
- java.awt.Desktop desktop = Desktop.getDesktop();
-
- try {
-
- desktop.open(file);
-
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
-
- }
- }
- }
- );
-
- BoutonTrinus.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent event) {
- try {
-
- path.readPathFile();
- File file = new File(path.getPathTrinus());
- java.awt.Desktop desktop = Desktop.getDesktop();
- desktop.open(file);
- } catch (IOException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
-
-
-
-
-
-
-
- }
- });
- BoutonRevit.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent event) {
- try {
- path.readPathFile();
- File file = new File(path.getPathRevit());
- java.awt.Desktop desktop = Desktop.getDesktop();
- desktop.open(file);
- } catch (IOException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
-
-
-
-
-
-
-
- }
- });
-
- BoutonInternet.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent event) {
- //Lancement du panneau de configuration
-
- Runtime rt = Runtime.getRuntime();
- try {
- rt.exec(new String[] {"cmd.exe","/c","start","https://viewer.autodesk.com/"});
-
- }catch (IOException e) {
- e.printStackTrace();
- }
-
- }
- });
-
- BoutonClavier.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent event) {
- //Lancement du panneau de configuration
-
- Runtime rt = Runtime.getRuntime();
- try {
- rt.exec(new String[] {"cmd.exe","/c","start","osk"});
-
- }catch (IOException e) {
- e.printStackTrace();
- }
-
- }
- });
-
-
-
-
-
-
-
-
- //Ajout Cadran
- add(cadran1);
- add(cadran2);
-
-
-
-
- }
-
- }
|