/* Actions.java * * Copyright (c) 2000, Benjamin Fallenstein * * 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 Benjamin Fallenstein */ package org.zaubertrank; import org.gzigzag.*; /** Primitive actions for the Zaubertrank applitude. */ public class Actions { public static final String rcsid = "$Id: Actions.java,v 1.1 2002/10/07 12:37:35 tuukkah Exp $"; public static boolean dbg = false; static final void p(String s) { if(dbg) System.out.println(s); } static final void pa(String s) { System.out.println(s); } static ZZCell getDim(ZZCell any, String id) { return getDim(any.getSpace(), id); } static ZZCell getDim(ZZSpace sp, String id) { ZZCell c = ZZDefaultSpace.findOnSystemlist(sp, "DimLists", false); c = c.s("d.1"); if(c.t().equals(id)) return c; ZZCell res = c.findText("d.2", 1, id); if(res == null) { res = c.N("d.2", -1); res.setText(id); } return res; } static void setDims(ZZCell win, String[] id) { ZZSpace sp = win.getSpace(); ZZCell[] cells = new ZZCell[id.length]; for(int i=0; i