private void init() {
   viz = new VizThread(this, 50);
   viz.start();
   p = 0;
   a = 0;
   d = 0;
   addMouseListener(this);
   addMouseMotionListener(this);
   listeners = new Vector();
   this.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
 }
 // mouse handling stuff
 public void mouseClicked(MouseEvent e) {
   if (isEnabled()) {
     for (int i = 0; i < listeners.size(); i++) {
       ((ActionListener) listeners.elementAt(i))
           .actionPerformed(
               new AffectButtonActionEvent(this, actionCommand, 1, p, a, d, "no label"));
     }
     viz.clicked(5);
     System.out.println(p + "," + a + "," + d);
   }
 }
 public AffectButton3D(Face face) {
   this.face = face;
   osStyle = true;
   viz = new VizThread(this, 50);
   viz.start();
   p = 0;
   a = 0;
   d = 0;
   addMouseListener(this);
   addMouseWheelListener(this);
   addMouseMotionListener(this);
   listeners = new Vector();
   emotionEvents = new String[27];
   this.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
   /*
   emotionEvents[0]="-p-a-d";emotionEvents[9]= "  -a-d";emotionEvents[18]=" p-a-d";
   emotionEvents[1]="-p-a  ";emotionEvents[10]="  -a  ";emotionEvents[19]=" p-a  ";
   emotionEvents[2]="-p-a d";emotionEvents[11]="  -a d";emotionEvents[20]=" p-a d";
   emotionEvents[3]="-p  -d";emotionEvents[12]="    -d";emotionEvents[21]=" p  -d";
   emotionEvents[4]="-p    ";emotionEvents[13]="      ";emotionEvents[22]=" p    ";
   emotionEvents[5]="-p   d";emotionEvents[14]="     d";emotionEvents[23]=" p   d";
   emotionEvents[6]="-p a-d";emotionEvents[15]="   a-d";emotionEvents[24]=" p a-d";
   emotionEvents[7]="-p a  ";emotionEvents[16]="   a  ";emotionEvents[25]=" p a  ";
   emotionEvents[8]="-p a d";emotionEvents[17]="   a d";emotionEvents[26]=" p a d";
   */
   emotionEvents[0] = "miserable";
   emotionEvents[9] = "sleepy";
   emotionEvents[18] = "droopy";
   emotionEvents[1] = "bored-annoyed";
   emotionEvents[10] = "  -a  ";
   emotionEvents[19] = "satisfied";
   emotionEvents[2] = "frustrated";
   emotionEvents[11] = "  -a d";
   emotionEvents[20] = "relaxed";
   emotionEvents[3] = "sad";
   emotionEvents[12] = "    -d";
   emotionEvents[21] = "content";
   emotionEvents[4] = "worried";
   emotionEvents[13] = "neutral";
   emotionEvents[22] = "glad";
   emotionEvents[5] = "angry";
   emotionEvents[14] = "confident";
   emotionEvents[23] = "happy";
   emotionEvents[6] = "affraid";
   emotionEvents[15] = "astonished";
   emotionEvents[24] = "expecting";
   emotionEvents[7] = "mad";
   emotionEvents[16] = "   a  ";
   emotionEvents[25] = "happy-eager";
   emotionEvents[8] = "angry-mad";
   emotionEvents[17] = "   a d";
   emotionEvents[26] = "excited";
 }
 public void mouseClicked(MouseEvent e) {
   for (int i = 0; i < listeners.size(); i++) {
     ((ActionListener) listeners.elementAt(i))
         .actionPerformed(
             new AffectButtonActionEvent(
                 this,
                 actionCommand,
                 getEmotionId(p, a, d),
                 p,
                 a,
                 d,
                 emotionEvents[getEmotionId(p, a, d)]));
   }
   viz.clicked(5);
 }