72 lines
1.9 KiB
Plaintext
72 lines
1.9 KiB
Plaintext
|
|
/*
|
||
|
|
ICView.zob
|
||
|
|
*
|
||
|
|
* Copyright (c) 1999-2000, Ted Nelson and Tuomas Lukka
|
||
|
|
*
|
||
|
|
* 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 Tuomas Lukka
|
||
|
|
*/
|
||
|
|
package org.gzigzag;
|
||
|
|
import java.awt.*;
|
||
|
|
|
||
|
|
/** An integrated-circuit view. Currently we show only
|
||
|
|
* dimensions.
|
||
|
|
*/
|
||
|
|
|
||
|
|
public class ICView implements FlobView, ZOb {
|
||
|
|
public static final String rcsid = "$Id: ICView.zob,v 1.3 2000/11/07 12:38:27 ajk 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); }
|
||
|
|
|
||
|
|
STRUCTPARAMS {
|
||
|
|
}
|
||
|
|
|
||
|
|
public void raster(FlobSet into, FlobFactory fact, ZZCell view,
|
||
|
|
String[]vds, ZZCell accursed) {
|
||
|
|
Dimension d = into.getSize();
|
||
|
|
|
||
|
|
Dimension c = fact.getSize(null, 1);
|
||
|
|
int cw = c.width;
|
||
|
|
int ch = c.height;
|
||
|
|
|
||
|
|
ZZCell dimhead = ZZCursorReal.get(view.s("d.dims")).h("d.2");
|
||
|
|
|
||
|
|
fact.makeFlob(into, accursed, accursed, 1,
|
||
|
|
(d.width-cw) / 2, 0, 1, cw, ch);
|
||
|
|
int cury = ch+2;
|
||
|
|
p("ic loop");
|
||
|
|
for(ZZCell cur = dimhead; cur != null; ) {
|
||
|
|
if(accursed.s(cur.t()) != null ||
|
||
|
|
accursed.s(cur.t(),-1) != null) {
|
||
|
|
fact.makeFlob(into, cur, cur, 1, (d.width-cw) / 2,
|
||
|
|
cury, 1, cw, ch);
|
||
|
|
cury += ch+2;
|
||
|
|
}
|
||
|
|
cur = cur.s("d.2");
|
||
|
|
if(cur == dimhead) break;
|
||
|
|
p("ic "+cur);
|
||
|
|
}
|
||
|
|
p("Out of ic");
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
// vim: set syntax=java :
|