Browse the code

 

Differences between 475 and 476 on /baggle-client/src/net/inouire.
Number of edited files: 2 (0 added, 0 deleted and 2 modified)
Revision 476

About 3 years and 10 months ago.

fixed #2839 animation de rotation de grille
Added file(s) Deleted file(s) Modified file(s)

 

Old New Code
68
68
    Color boardColor = ColorFactory.BROWN_BOARD;//0->marron, 1-> bleu , 2-> vert
69
69
        
70
70
    public BoardPanel(){
 
71
        
71
72
        this.S=Main.configuration.BOARD_WIDTH;
72
73
        setSize(400, 200);
73
74
        for(int k=0;k<4;k++){
462
463
        Main.mainFrame.roomPane.refreshCenter();
463
464
    }
464
465

                                        
 
466
    public void animateShuffle(){
 
467
        Thread s = new Thread() {
 
468
            @Override
 
469
            public void run() {
 
470
                try {
 
471
                    for(int k=0;k<180;k+=10){
 
472
                        rotation=k;
 
473
                        repaint();
 
474
                        sleep(20);
 
475
                    }
 
476
                    rotation = 0;
 
477
                    repaint();
 
478
                } catch (InterruptedException ex) {
 
479
                }finally{
 
480
                    repaint();
 
481
                }
 
482
            }
 
483
        };
 
484
        s.start();
 
485
    }
 
486
    
465
487
    @Override
466
488
    public void paintComponent(Graphics g) {
467
489
        Graphics2D g2 = (Graphics2D)g;
556
578
    public void setBoardSize(int width){
557
579
        this.S=width;
558
580
    }
 
581
    
559
582
    public int getBoardSize(){
560
583
        return S;
561
584
    }
562
585

                                        

 

Old New Code
28
28
import java.net.SocketAddress;
29
29
import java.net.UnknownHostException;
30
30
import java.util.HashMap;
31
 
import java.util.logging.Level;
32
 
import java.util.logging.Logger;
33
31
import javax.swing.JOptionPane;
34
32
import net.inouire.baggle.client.Language;
35
33
import net.inouire.baggle.client.Main;
403
401

                                        
404
402
        Main.mainFrame.roomPane.wordEntryPane.giveFocus();
405
403
        Main.mainFrame.roomPane.refreshCenter();
 
404
        
 
405
        Main.mainFrame.roomPane.boardPane.animateShuffle();
406
406
    }
407
407

                                        
408
408
    /**
409
409