1 /**
2  * Jin - a chess client for internet chess servers.
3  * More information is available at http://www.jinchess.com/.
4  * Copyright (C) 2002 Alexander Maryanovsky.
5  * All rights reserved.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
20  */
21 
22 package free.jin.board.fics;
23 
24 import free.jin.Game;
25 import free.jin.board.BoardManager;
26 import free.jin.board.BoardPanel;
27 
28 
29 /**
30  * Extends BoardPanel to provide freechess.org specific functionalities.
31  */
32 
33 public class FreechessBoardPanel extends BoardPanel{
34 
35 
36 
37   /**
38    * Creates a new <code>FreechessBoardPanel</code> with the given
39    * <code>BoardManager</code> and <code>Game</code>.
40    */
41 
FreechessBoardPanel(BoardManager boardManager, Game game)42   public FreechessBoardPanel(BoardManager boardManager, Game game){
43     super(boardManager, game);
44   }
45 
46 
47 
48   /**
49    * Overrides BoardPanel.createWhiteLabelText(Game) to return a freechess.org
50    * specific version.
51    */
52 
createWhiteLabelText(Game game)53   protected String createWhiteLabelText(Game game){
54     int rating = game.getWhiteRating();
55     String ratingString = (rating > 0) ? (" "+rating) : "";
56     return game.getWhiteName() + game.getWhiteTitles() + ratingString;
57   }
58 
59 
60 
61 
62   /**
63    * Overrides BoardPanel.createBlackLabelText(Game) to return a freechess.org
64    * specific version.
65    */
66 
createBlackLabelText(Game game)67   protected String createBlackLabelText(Game game){
68     int rating = game.getBlackRating();
69     String ratingString = (rating > 0) ? (" "+rating) : "";
70     return game.getBlackName() + game.getBlackTitles() + ratingString;
71   }
72 
73 
74 
75 }
76