/* SokobanCellView.java * * Copyright (c) 2002, Ayse Cirakoglu * * You may use and distribute under the terms of either the GNU Lesser * General Public License, either version 2 of the license or, * at your choice, any later version. Alternatively, you may use and * distribute under the terms of the XPL. * * See the LICENSE.lgpl and LICENSE.xpl files for the specific terms of * the licenses. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the README * file for more details. * */ /* * Written by Ayse Cirakoglu */ package org.gzigzag; import java.util.*; import java.awt.*; /** A simple cell factory that gives the cells as one-line strings. * Variable length is possible. */ public class SokobanCellView extends CellFlobFactory1 { public static final String rcsid = "$Id: SokobanCellView.java,v 1.1.2.1 2002/10/31 17:05:20 benja Exp $"; public static boolean dbg = false; private static void p(String s) { if(dbg) ZZLogger.log(s); } private static void pa(String s) { ZZLogger.log(s); } public Flob makeFlob(FlobSet into, ZZCell c, ZZCell handleCell, float fract, int x, int y, int d, int w, int h) { //System.out.println("makeFlob called"); int scale = getScale(fract); Font f = fon(scale); FontMetrics fm = fonmet(scale); SokobanFlob cf = new SokobanFlob(x, y, d, w, h, handleCell, c, c.getText(), f, fm, into.window); cf.bg = bg; cf.xoffs = margins[0]; cf.yoffs = margins[1]; addSolidColors(into, cf, cf); into.add(cf); return cf; } } // vim: set syntax=java :