/* SCCS %W%---%G%--%U% */ // Copyright: Copyright (c) 1997 University of Southern California Brain Project. // Copyright: This software may be freely copied provided the toplevel // Copyright: COPYRIGHT file is included with each such copy. // Copyright: Email nsl@java.usc.edu. package nslj.src.nsls.struct; import tcl.lang.*; import java.util.*; import nslj.src.lang.*; import nslj.src.system.*; import nslj.src.display.*; import nslj.src.cmd.*; public class NslFrameCommand implements Command { private Interp tclInterp; // nsl frame options static final private String createOpts[] = { "configure", }; static final private String createSw[] = { "-title", "-rows", "-column", "-x0", "-y0", "-width", "-height", "-font", "-background", "-foreground", "-freq", }; public void cmdProc(Interp interp, TclObject argv[]) throws TclException { tclInterp = interp; if (argv.length < 2) { echo("wrong # args: should be \""+argv[0]+"\" configure ?params?"); } else { int index; index = TclIndex.get(tclInterp, argv[1], createOpts, "option", 0); switch (index) { case 0: /* * the following code implements the configure command */ int ind, x0, y0, width, height, freq; String name =argv[0].toString(); NslCommandData nd = (NslCommandData)interp.getAssocData(name); NslDisplaySystem ds = (NslDisplaySystem)nd.getData(); if (ds==null) { echo("Display "+argv[0].toString()+" no longer exist"); } NslFrame frame = ds.frame; if (frame == null) { echo("Frame "+argv[0].toString()+" no longer exist"); } for (int i=2;i