Package model

Examples of model.affichageCanvas


 
    /*CONTENEUR PLATEAU*/
   
   
    /*AFFICHAGE NEXT PIECE*/
    affichageCanvas nextPiece = new affichageCanvas();
   
    frame = new JFrame();
   
    /*INTERFACE*/
    Interface I = new Interface();
   
    /*EVENT BUTTON*/
    Button  option = new Button(60, 60, 470, 500);
    option.setIcon(new ImageIcon("img/optionB.png"));
    Button  pause = new Button(60, 60, 405, 500);
    pause.setIcon(new ImageIcon("img/pauseB.png"));
       
      pause.addActionListener(new pauseButtonListener());
      option.addActionListener(new optionButtonListener());
   
      /*EVENT CLAVIER*/
      p.setFocusable(true);
      p.requestFocus();
      p.addKeyListener(new pListener());
     
      /*EVENT SOURIS*/
      tet2.addMouseListener(new plateauListener());
     
    frame.setSize(WIDTH, HEIGHT);

    /*Composants de la fenetres*/
    contentW.add(word);
    frame.add(contentW);
    frame.add(score.contentS);
    frame.add(tet2);
    frame.add(nextPiece);
      frame.add(option);
      frame.add(pause);
      frame.add(p);
      frame.add(I);

 
      /* actions sur les boutons*/
     
      /*paramêtre de la fenetre */
    frame.setLocationRelativeTo(null);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setResizable(false);

      frame.setVisible(true);

    
      /*lancement des threads*/
    tet2.start();
    nextPiece.start();

    while(!myPlateau.isFull){
      pieceCurrent=false;
      myPlateau.setupCurrentPiece(p);
     
      while(!pieceCurrent){
        if(pauseBool == false){
          pieceCurrent=myPlateau.downCurrentPiece();
         
          // plateau jeu
          tet2.setBounds(50, 115, 199, 407);
          tet2.dessinePlateau(myPlateau);
          // nextPiece
         
          nextPiece.setBounds(360, 200, 60, 60);
          nextPiece.dessinePiece(np);
          try{
            Thread.sleep(500);
            }catch(InterruptedException e){}
        }
      }
View Full Code Here

TOP

Related Classes of model.affichageCanvas

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.