1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
|
public class visionneuse extends Frame implements Printable, ActionListener, ItemListener, StdQTConstants, Errors { //supprimé : AdjustmentListener,
GridBagLayout gridbag;
GridBagConstraints constraint;
Frame fenprinc;
utilitaire utilitaire = new utilitaire();
Label numero;
String nom_video, chemin;
int numero_image;
Scrollbar bare_def;
QTCanvas video;
canvas2 image;
Panel sonogramme;
private QTPlayer myPlayer;
private Movie m;
float rate = 1;
QTFile qtfv;
Button play;
Vector resultat;
Thread threadimage;
int compteur = -2; ///numéro de l'image. -2 = ne pas afficher, -1= forcer l'affichage
.......
/************* zone d'affichage de l'image ************/
image = new canvas2();
image.setBackground(Color.white);
// image.setSize(200,200);
image.setVisible(true);
constraint.gridheight = 1;
constraint.weightx = 1;
constraint.gridwidth = GridBagConstraints.REMAINDER;
gridbag.setConstraints(image, constraint);
add(image);
/**************** panneau de boutons ***************/
Panel panneau = new Panel();
panneau.setBackground(Color.lightGray);
play = new Button(">");
play.setName("lecture");
play.addActionListener(this);
Button arret = new Button("stop");
arret.setName("arret");
arret.addActionListener(this);
Button recule = new Button("-");
recule.setName("recule");
recule.addActionListener(this);
Button avance = new Button("+");
avance.setName("avance");
avance.addActionListener(this);
panneau.add(play);
panneau.add(arret);
panneau.add(recule);
panneau.add(avance);
constraint.weighty = 1;
constraint.fill = GridBagConstraints.NONE;
// constraint.gridwidth = 1;
constraint.gridx = 0;
constraint.gridy = 2;
gridbag.setConstraints(panneau, constraint);
add(panneau);
/************* affichage numero d'image ************/
Panel num_image = new Panel();
num_image.setLayout(new GridLayout(1,2));
Label chaine = new Label("image qu'il faudra diviser par 24 :");
numero = new Label(""+ (numero_image/24) );
num_image.add(chaine);
num_image.add(numero);
num_image.add(chaine);
num_image.add(numero);
constraint.gridx = 0;
constraint.gridy++;
gridbag.setConstraints(num_image, constraint);
add(num_image);
//System.out.println(numero_image /24); |