示例#1
0
 public void showState(int mousex, int mousey) {
   p = ((double) mousex - (double) getWidth() / (double) 2) / ((double) (getWidth() + 1) / 2.0);
   d = -((double) mousey - (double) getHeight() / (double) 2) / ((double) (getHeight() + 1) / 2.0);
   setXY(p, d);
   face.setEmotion(p, a, d, mousex, mousey);
   paint();
   this.getGraphics().drawLine(mousex - 3, mousey, mousex + 3, mousey);
   this.getGraphics().drawLine(mousex, mousey - 3, mousex, mousey + 3);
 }
示例#2
0
 public void mouseMoved(MouseEvent e) {
   if (isEnabled()) {
     setXY(
         ((double) e.getX() - (double) getWidth() / (double) 2)
             / ((double) (getWidth() + 1) / 2.0),
         -((double) e.getY() - (double) getHeight() / (double) 2)
             / ((double) (getHeight() + 1) / 2.0));
     face.setEmotion(p, a, d, e.getX(), e.getY());
   }
   paint();
 }
示例#3
0
 public void mouseExited(MouseEvent e) {
   in = false;
   down = false;
   paint();
 }
示例#4
0
 public void paint() {
   paint(this.getGraphics());
 }