| 1 | /* |
| 2 | * Copyright (c) 2005 The PseudoQ Project. |
| 3 | * |
| 4 | * This file is part of PseudoQ. |
| 5 | * |
| 6 | * PseudoQ is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU Lesser General Public License as published by |
| 8 | * the Free Software Foundation; either version 2.1 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * PseudoQ is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU Lesser General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Lesser General Public License |
| 17 | * along with PseudoQ; if not, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | */ |
| 20 | |
| 21 | package net.sourceforge.pseudoq.gui; |
| 22 | |
| 23 | import java.awt.Color; |
| 24 | import java.awt.Dimension; |
| 25 | import java.awt.Graphics; |
| 26 | |
| 27 | /** |
| 28 | * GridPainter for LARGE type puzzles. |
| 29 | * @author <a href="http://sourceforge.net/users/stevensa">Andrew Stevens</a> |
| 30 | */ |
| 31 | public class LargeGridPainter extends AbstractGridPainter { |
| 32 | /** |
| 33 | * Creates a new instance of LargeGridPainter. |
| 34 | */ |
| 35 | public LargeGridPainter() { |
| 36 | } |
| 37 | |
| 38 | public void drawGrid(Graphics g) { |
| 39 | fillBox(g, 0, 0, 16, 16, Color.WHITE); |
| 40 | drawBox(g, 0, 0, 16, 16, 3, Color.BLACK); |
| 41 | drawLine(g, 4, 0, 4, 16, 3, Color.BLACK); |
| 42 | drawLine(g, 8, 0, 8, 16, 3, Color.BLACK); |
| 43 | drawLine(g, 12, 0, 12, 16, 3, Color.BLACK); |
| 44 | drawLine(g, 0, 4, 16, 4, 3, Color.BLACK); |
| 45 | drawLine(g, 0, 8, 16, 8, 3, Color.BLACK); |
| 46 | drawLine(g, 0, 12, 16, 12, 3, Color.BLACK); |
| 47 | drawLine(g, 1, 0, 1, 16, 1, Color.BLACK); |
| 48 | drawLine(g, 2, 0, 2, 16, 1, Color.BLACK); |
| 49 | drawLine(g, 3, 0, 3, 16, 1, Color.BLACK); |
| 50 | drawLine(g, 5, 0, 5, 16, 1, Color.BLACK); |
| 51 | drawLine(g, 6, 0, 6, 16, 1, Color.BLACK); |
| 52 | drawLine(g, 7, 0, 7, 16, 1, Color.BLACK); |
| 53 | drawLine(g, 9, 0, 9, 16, 1, Color.BLACK); |
| 54 | drawLine(g, 10, 0, 10, 16, 1, Color.BLACK); |
| 55 | drawLine(g, 11, 0, 11, 16, 1, Color.BLACK); |
| 56 | drawLine(g, 13, 0, 13, 16, 1, Color.BLACK); |
| 57 | drawLine(g, 14, 0, 14, 16, 1, Color.BLACK); |
| 58 | drawLine(g, 15, 0, 15, 16, 1, Color.BLACK); |
| 59 | drawLine(g, 0, 1, 16, 1, 1, Color.BLACK); |
| 60 | drawLine(g, 0, 2, 16, 2, 1, Color.BLACK); |
| 61 | drawLine(g, 0, 3, 16, 3, 1, Color.BLACK); |
| 62 | drawLine(g, 0, 5, 16, 5, 1, Color.BLACK); |
| 63 | drawLine(g, 0, 6, 16, 6, 1, Color.BLACK); |
| 64 | drawLine(g, 0, 7, 16, 7, 1, Color.BLACK); |
| 65 | drawLine(g, 0, 9, 16, 9, 1, Color.BLACK); |
| 66 | drawLine(g, 0, 10, 16, 10, 1, Color.BLACK); |
| 67 | drawLine(g, 0, 11, 16, 11, 1, Color.BLACK); |
| 68 | drawLine(g, 0, 13, 16, 13, 1, Color.BLACK); |
| 69 | drawLine(g, 0, 14, 16, 14, 1, Color.BLACK); |
| 70 | drawLine(g, 0, 15, 16, 15, 1, Color.BLACK); |
| 71 | } |
| 72 | |
| 73 | public Dimension getPreferredSize() { |
| 74 | int x = (2 * BORDER) + (16 * size); |
| 75 | return new Dimension(x, x); |
| 76 | } |
| 77 | |
| 78 | } |