1 /** 2 * The chess framework library. 3 * More information is available at http://www.jinchess.com/. 4 * Copyright (C) 2002 Alexander Maryanovsky. 5 * All rights reserved. 6 * 7 * The chess framework library is free software; you can redistribute 8 * it and/or modify it under the terms of the GNU Lesser General Public License 9 * as published by the Free Software Foundation; either version 2 of the 10 * License, or (at your option) any later version. 11 * 12 * The chess framework library is distributed in the hope that it will 13 * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 15 * General Public License for more details. 16 * 17 * You should have received a copy of the GNU Lesser General Public License 18 * along with the chess framework library; 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.chess; 23 24 import java.awt.Component; 25 import java.awt.Graphics; 26 import java.awt.Rectangle; 27 28 29 /** 30 * The default PiecePainter implementation used in JBoard. 31 * This PiecePainter supports the pieces in all wild variants defined in the 32 * free.chess package and all its subpackages. This class currently uses 33 * <code>free.chess.EboardVectorPiecePainter</code> to paint the pieces, but 34 * this is an implementation detail which you should not rely on. The artwork 35 * belongs solely to the author(s) of eboard. For additional information see 36 * <A HREF="http://eboard.sourceforge.net/">the eboard website</A> 37 */ 38 39 public class DefaultPiecePainter implements PiecePainter{ 40 41 42 43 /** 44 * The delegate. 45 */ 46 47 private PiecePainter delegate = new EboardVectorPiecePainter(); 48 49 50 51 /** 52 * Since <code>DefaultPiecePainter</code> is immutable, simply returns 53 * </code>this</code>. 54 */ 55 freshInstance()56 public PiecePainter freshInstance(){ 57 return this; 58 } 59 60 61 62 /** 63 * Paints the piece. 64 */ 65 paintPiece(Piece piece, Graphics g, Component component, Rectangle rect, boolean shaded)66 public void paintPiece(Piece piece, Graphics g, Component component, Rectangle rect, boolean shaded){ 67 delegate.paintPiece(piece, g, component, rect, shaded); 68 } 69 70 71 72 } 73