*/
public static void main(String[] argv) {
Debug.init();
boolean Dchum = false;
ArgParser ap = new ArgParser("MakeToc");
ap.add("absolute",
"Use absolute paths in A.TOC - Use for multiple RPF Directories");
ap.add("boundary", "Maximum frames on a boundary edge (Default 200)", 1);
ap.add("dchum", "DCHUM files are included.");
ap.add("log", "Pathname of log file to list A.TOC creation output.", 1);
ap.add("output",
"Path to directory to place A.TOC file. (Default is current directory)",
1);
ap.add("producer",
"The producer of the frames (Default DMAAC). Five letter code.",
1);
ap.add("verbose", "Print out progress");
ap.add("extraverbose", "Print out ALL progress");
ap.add("nw",
"Don't put up swing progress window (Use this if you are getting weird exceptions)");
ap.add("paths",
"Space separated paths to RPF directory or directories. Should be last. If more than one directory is listed, then absolute paths are used in the A.TOC file.",
ArgParser.TO_END);
if (!ap.parse(argv)) {
ap.printUsage();
System.exit(0);
}
String outputFile = "." + File.separator
+ RpfTocHandler.RPF_TOC_FILE_NAME;
String arg[];
arg = ap.getArgValues("output");
if (arg != null) {
outputFile = arg[0] + File.separator
+ RpfTocHandler.RPF_TOC_FILE_NAME;
}
arg = ap.getArgValues("log");
if (arg != null) {
String logfile = arg[0];
Debug.directOutput(logfile, false, true);
Debug.output("MakeToc: Creating log at " + logfile + " at "
+ java.util.Calendar.getInstance().getTime());
}
arg = ap.getArgValues("dchum");
if (arg != null) {
Dchum = true;
}
arg = ap.getArgValues("verbose");
if (arg != null) {
Debug.put("maketoc");
}
arg = ap.getArgValues("extraverbose");
if (arg != null) {
Debug.put("maketoc");
Debug.put("maketocdetail");
}
String[] paths = null;
arg = ap.getArgValues("paths");
if (arg != null) {
paths = arg;
} else {
paths = ap.getRest();
}
if (paths == null || paths.length == 0) {
Debug.output("MakeToc: need a path to start searching for RPF frames.");
System.exit(0);
}
MakeToc mt = new MakeToc();
// If the -nw argument was not used, add a progress gauge.
arg = ap.getArgValues("nw");
if (arg == null) {
try {
mt.addProgressListener(new com.bbn.openmap.gui.ProgressListenerGauge("RPF A.TOC File Creation"));
} catch (RuntimeException re) {
}
}
boolean argFlagged = false;
arg = ap.getArgValues("absolute");
if (arg != null) {
argFlagged = true;
}
arg = ap.getArgValues("producer");
if (arg != null) {
mt.setProducer(arg[0]);
}
if (paths.length > 1 || argFlagged) {
Debug.output("MakeToc: creating A.TOC with absolute path names.");
mt.setRelativeFramePaths(false);
}
arg = ap.getArgValues("boundary");
int max_side = DEFAULT_MAX_SIDE;
if (arg != null) {
try {
max_side = Integer.parseInt(arg[0]);
if (max_side <= DEFAULT_MAX_SIDE) {