# # # patch "contrib/monotree/GXLViewer.java" # from [eb18a81fdf7578826b6d3d60a6dc11d249dffce4] # to [70b94b679c9d2a877d8eab9964b2c537e41426b7] # # patch "contrib/monotree/Log2Gxl.java" # from [2052bf045a5db5665b9baa5e9eaa6e91895d55c7] # to [ee9add8ee061c514cf272a150c5cb152f527f187] # # patch "contrib/monotree/Makefile" # from [e8406db78d4b42065b774d4ca259e25ac6765cef] # to [61e224323a0830ae488c0e7b72c47d5e528e62c5] # # patch "contrib/monotree/Monotone.java" # from [635d14051fad2e14b1a3bbf0072233c1f4376908] # to [6d75d8c42c435cf9b103b630dd20631c3264f77f] # ============================================================ --- contrib/monotree/GXLViewer.java eb18a81fdf7578826b6d3d60a6dc11d249dffce4 +++ contrib/monotree/GXLViewer.java 70b94b679c9d2a877d8eab9964b2c537e41426b7 @@ -6,59 +6,67 @@ * I.e., do what you like, but keep copyright and there's NO WARRANTY. */ -import java.awt.*; -import java.awt.event.*; -import java.io.*; -import javax.swing.*; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.FlowLayout; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.SystemColor; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.LineNumberReader; import java.util.List; -import javax.swing.tree.*; -import javax.swing.event.*; -import java.awt.SystemColor; +import java.util.logging.Logger; + +import javax.swing.*; import javax.swing.border.LineBorder; +import javax.swing.event.TreeSelectionEvent; +import javax.swing.event.TreeSelectionListener; import javax.swing.filechooser.FileFilter; -import java.util.logging.Logger; -import java.util.logging.Level; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeModel; +import net.sourceforge.gxl.GXLAttr; +import net.sourceforge.gxl.GXLDocument; +import net.sourceforge.gxl.GXLNode; +import net.sourceforge.gxl.GXLSet; +import net.sourceforge.gxl.GXLString; + +import org.apache.batik.bridge.ScriptingEnvironment; +import org.apache.batik.bridge.UpdateManager; +import org.apache.batik.dom.svg.SAXSVGDocumentFactory; +import org.apache.batik.script.Interpreter; import org.apache.batik.swing.JSVGCanvas; -import org.apache.batik.swing.svg.JSVGComponent; import org.apache.batik.swing.JSVGScrollPane; import org.apache.batik.swing.gvt.GVTTreeRendererAdapter; import org.apache.batik.swing.gvt.GVTTreeRendererEvent; -import org.apache.batik.swing.svg.SVGDocumentLoaderAdapter; -import org.apache.batik.swing.svg.SVGDocumentLoaderEvent; import org.apache.batik.swing.svg.GVTTreeBuilderAdapter; import org.apache.batik.swing.svg.GVTTreeBuilderEvent; -import org.apache.batik.dom.svg.SAXSVGDocumentFactory; -import org.apache.batik.util.XMLResourceDescriptor; +import org.apache.batik.swing.svg.JSVGComponent; +import org.apache.batik.swing.svg.LinkActivationEvent; import org.apache.batik.swing.svg.LinkActivationListener; +import org.apache.batik.swing.svg.SVGDocumentLoaderAdapter; +import org.apache.batik.swing.svg.SVGDocumentLoaderEvent; import org.apache.batik.swing.svg.SVGUserAgentGUIAdapter; -import org.apache.batik.swing.svg.LinkActivationEvent; -import org.apache.batik.util.ParsedURL; -import org.apache.batik.bridge.UpdateManager; -import org.apache.batik.bridge.ScriptingEnvironment; -import org.apache.batik.script.Interpreter; -import org.w3c.dom.svg.SVGDocument; +import org.apache.batik.util.XMLResourceDescriptor; import org.w3c.dom.Element; +import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.w3c.dom.Text; -import org.w3c.dom.Node; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.EventListener; import org.w3c.dom.events.Event; +import org.w3c.dom.events.EventListener; +import org.w3c.dom.events.EventTarget; import org.w3c.dom.events.MouseEvent; +import org.w3c.dom.svg.SVGDocument; -import net.sourceforge.gxl.GXLDocument; -import net.sourceforge.gxl.GXLGraph; -import net.sourceforge.gxl.GXLNode; -import net.sourceforge.gxl.GXLEdge; -import net.sourceforge.gxl.GXLString; -import net.sourceforge.gxl.GXLSet; -import net.sourceforge.gxl.GXLAttr; -import net.sourceforge.gxl.GXLInt; -import net.sourceforge.gxl.GXLTup; -import net.sourceforge.gxl.GXL; -import net.sourceforge.gxl.GXLValue; - /** * Somewhat misnamed class to provide a simple GUI against a monotone database * NOTE: This class requires the Batick SVG library from the Apache project http://xml.apache.org @@ -507,7 +515,7 @@ public class GXLViewer { } /** - * File filter which only displays monotone .db files + * File filter which only displays monotone .mtn files * Note: It actually displays all files which end in .db */ private class MonotoneFileFilter extends FileFilter { @@ -516,11 +524,11 @@ public class GXLViewer { * Return true for directories and monotone database files * * @param file the file to test - * @return true if the file is a directory or ends in .db + * @return true if the file is a directory or ends in .mtn */ public boolean accept(File file) { if(file.isDirectory()) return true; - return file.getName().endsWith(".db"); + return file.getName().endsWith(".mtn"); } /** ============================================================ --- contrib/monotree/Log2Gxl.java 2052bf045a5db5665b9baa5e9eaa6e91895d55c7 +++ contrib/monotree/Log2Gxl.java ee9add8ee061c514cf272a150c5cb152f527f187 @@ -7,33 +7,29 @@ * I.e., do what you like, but keep copyright and there's NO WARRANTY. */ -import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; import java.io.InputStream; -import java.io.FileInputStream; import java.io.InputStreamReader; +import java.io.LineNumberReader; import java.io.OutputStream; -import java.io.Reader; -import java.io.Writer; -import java.io.IOException; -import java.io.LineNumberReader; -import java.util.Map; +import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; -import java.util.Properties; import java.util.List; -import java.util.ArrayList; -import java.util.Arrays; +import java.util.Map; +import java.util.Properties; +import java.util.logging.Level; import java.util.logging.Logger; -import java.util.logging.Level; + +import net.sourceforge.gxl.GXL; +import net.sourceforge.gxl.GXLAttr; import net.sourceforge.gxl.GXLDocument; +import net.sourceforge.gxl.GXLEdge; import net.sourceforge.gxl.GXLGraph; import net.sourceforge.gxl.GXLNode; -import net.sourceforge.gxl.GXLEdge; -import net.sourceforge.gxl.GXLString; import net.sourceforge.gxl.GXLSet; -import net.sourceforge.gxl.GXLAttr; -import net.sourceforge.gxl.GXLInt; -import net.sourceforge.gxl.GXLTup; -import net.sourceforge.gxl.GXL; +import net.sourceforge.gxl.GXLString; /** * Simple filter to convert a monotone log output into a GXL graph @@ -60,10 +56,10 @@ public class Log2Gxl extends Thread { * @param argv command line arguments, --colorfile to specify a file mapping authors to colors */ public static void main(String argv[]) throws IOException,IllegalStateException,InterruptedException { - logger.setLevel(Level.FINEST); - Log2Gxl processor=new Log2Gxl(); - processor.start(argv); - processor.join(); + logger.setLevel(Level.FINEST); + Log2Gxl processor=new Log2Gxl(); + processor.start(argv); + processor.join(); } /** @@ -75,9 +71,9 @@ public class Log2Gxl extends Thread { * @throws IllegalStateException if the prefix doesn't match the input line */ private String readLine(String prefix) throws IOException,IllegalStateException { - String line=source.readLine(); - if(line==null) throw new IOException(source.getLineNumber()+": Unexpected end of input"); - if(!line.startsWith(prefix)) throw new IllegalStateException(source.getLineNumber()+": Expected ["+prefix+"], got ["+line+"]"); + String line=source.readLine(); + if(line==null) throw new IOException(source.getLineNumber()+": Unexpected end of input"); + if(!line.startsWith(prefix)) throw new IllegalStateException(source.getLineNumber()+": Expected ["+prefix+"], got ["+line+"]"); return line; } @@ -86,10 +82,10 @@ public class Log2Gxl extends Thread { * This is used to allow incremental construction of attributes during log entry parsing */ private void commitNode() { - // All dot specific stuff has now been moved into the gxl2dot stylesheet - // Leave this method in as it may be useful in the future again + // All dot specific stuff has now been moved into the gxl2dot stylesheet + // Leave this method in as it may be useful in the future again - currentNode=null; + currentNode=null; } @@ -99,14 +95,14 @@ public class Log2Gxl extends Thread { * @throws IllegalStateException if the header lines aren't as expected */ private void parseHeader() throws IOException,IllegalStateException { - parseRevision(); - parseAncestors(); + parseRevision(); + parseAncestors(); parseAuthors(); - String line=lookahead(); - if(line.startsWith("Date:")) parseDates(); + String line=lookahead(); + if(line.startsWith("Date:")) parseDates(); parseBranches(); - line=lookahead(); - if(line.startsWith("Tag:")) parseTags(); + line=lookahead(); + if(line.startsWith("Tag:")) parseTags(); } /** @@ -115,9 +111,9 @@ public class Log2Gxl extends Thread { * @throws IllegalStateException if the header lines aren't as expected */ private void parseAuthors() throws IOException,IllegalStateException { - parseAuthor(); - String line=lookahead(); - if(line.startsWith("Author:")) parseAuthors(); + parseAuthor(); + String line=lookahead(); + if(line.startsWith("Author:")) parseAuthors(); } /** @@ -126,9 +122,9 @@ public class Log2Gxl extends Thread { * @throws IllegalStateException if the header lines aren't as expected */ private void parseTags() throws IOException,IllegalStateException { - parseTag(); - String line=lookahead(); - if(line.startsWith("Tag:")) parseTags(); + parseTag(); + String line=lookahead(); + if(line.startsWith("Tag:")) parseTags(); } /** @@ -137,9 +133,9 @@ public class Log2Gxl extends Thread { * @throws IllegalStateException if the header lines aren't as expected */ private void parseDates() throws IOException,IllegalStateException { - parseDate(); - String line=lookahead(); - if(line.startsWith("Date:")) parseDates(); + parseDate(); + String line=lookahead(); + if(line.startsWith("Date:")) parseDates(); } /** @@ -148,9 +144,9 @@ public class Log2Gxl extends Thread { * @throws IllegalStateException if the header lines aren't as expected */ private void parseBranches() throws IOException,IllegalStateException { - parseBranch(); - String line=lookahead(); - if(line.startsWith("Branch:")) parseBranches(); + parseBranch(); + String line=lookahead(); + if(line.startsWith("Branch:")) parseBranches(); } /** @@ -159,9 +155,9 @@ public class Log2Gxl extends Thread { * @throws IllegalStateException if the header lines aren't as expected */ private void parseDate() throws IOException,IllegalStateException { - String line=readLine("Date:"); - String date=line.substring("Date:".length()+1); - if(!simpleGXL) addToAttributeSet("Dates",date); + String line=readLine("Date:"); + String date=line.substring("Date:".length()+1); + if(!simpleGXL) addToAttributeSet("Dates",date); } /** @@ -170,13 +166,13 @@ public class Log2Gxl extends Thread { * @throws IllegalStateException if the header lines aren't as expected */ private void parseRevision() throws IOException,IllegalStateException { - String line=readLine("Revision:"); - - revision=line.substring("Revision:".length()+1); - currentNode=nodes.get(revision); - if(currentNode==null) { - currentNode=createDefaultNode(revision); - } + String line=readLine("Revision:"); + + revision=line.substring("Revision:".length()+1); + currentNode=nodes.get(revision); + if(currentNode==null) { + currentNode=createDefaultNode(revision); + } } /** @@ -198,7 +194,7 @@ public class Log2Gxl extends Thread { * @throws IllegalStateException if the header lines aren't as expected */ private void parseAncestors() throws IOException,IllegalStateException { - parseAncestor(); + parseAncestor(); String line=lookahead(); if(line.startsWith("Ancestor:")) parseAncestors(); } @@ -210,13 +206,13 @@ public class Log2Gxl extends Thread { * @return a new GXLNode with the specified id and some useful default attributes */ private GXLNode createDefaultNode(String id) { - GXLNode node=new GXLNode(id); - // GXL Schema support. Commented out until I understand it a bit better - // node.setType("MonotoneRevisionGraphSchema.gxl#RevisionNode"); + GXLNode node=new GXLNode(id); + // GXL Schema support. Commented out until I understand it a bit better + // node.setType("MonotoneRevisionGraphSchema.gxl#RevisionNode"); - graph.add(node); - nodes.put(id,node); - return node; + graph.add(node); + nodes.put(id,node); + return node; } /** @@ -225,19 +221,19 @@ public class Log2Gxl extends Thread { * @throws IllegalStateException if the header lines aren't as expected */ private void parseAncestor() throws IOException,IllegalStateException { - String line=readLine("Ancestor:"); - String ancestor=line.substring("Ancestor:".length()+1); - if(ancestor.length()!=0) { - GXLNode ancestorNode=nodes.get(ancestor); - if(ancestorNode==null) { - ancestorNode=createDefaultNode(ancestor); - } - GXLEdge edge=new GXLEdge(ancestorNode,currentNode); - // GXL Schema support. Commented out until I understand it a bit better + String line=readLine("Ancestor:"); + String ancestor=line.substring("Ancestor:".length()+1); + if(ancestor.length()!=0) { + GXLNode ancestorNode=nodes.get(ancestor); + if(ancestorNode==null) { + ancestorNode=createDefaultNode(ancestor); + } + GXLEdge edge=new GXLEdge(ancestorNode,currentNode); + // GXL Schema support. Commented out until I understand it a bit better //edge.setType("MonotoneRevisionGraphSchema.gxl#AncestorEdge"); - edge.setDirected(true); - graph.add(edge); - } + edge.setDirected(true); + graph.add(edge); + } } /** @@ -248,13 +244,13 @@ public class Log2Gxl extends Thread { * @param item the item to add to the attribute set */ private void addToAttributeSet(String attrName,String item) { - GXLAttr attrSet=currentNode.getAttr(attrName); - if(attrSet==null) { - currentNode.setAttr(attrName,new GXLSet()); - attrSet=currentNode.getAttr(attrName); - } - GXLSet value=(GXLSet)attrSet.getValue(); - value.add(new GXLString(item)); + GXLAttr attrSet=currentNode.getAttr(attrName); + if(attrSet==null) { + currentNode.setAttr(attrName,new GXLSet()); + attrSet=currentNode.getAttr(attrName); + } + GXLSet value=(GXLSet)attrSet.getValue(); + value.add(new GXLString(item)); } /** @@ -264,19 +260,19 @@ public class Log2Gxl extends Thread { */ private void parseAuthor() throws IOException,IllegalStateException { String line=readLine("Author:"); - String author=line.substring("Author:".length()+1); - if(author.length()!=0) { - addToAttributeSet("Authors",author); + String author=line.substring("Author:".length()+1); + if(author.length()!=0) { + addToAttributeSet("Authors",author); if(colorAuthors) { - String color=highlightColorMap.get(author); - if(color==null) { - color=colors[highlightColorMap.size()]; - highlightColorMap.put(author,color); - } - currentNode.setAttr("AuthorColor",new GXLString(color)); - } - } + String color=highlightColorMap.get(author); + if(color==null) { + color=colors[highlightColorMap.size()]; + highlightColorMap.put(author,color); + } + currentNode.setAttr("AuthorColor",new GXLString(color)); + } + } } /** @@ -285,20 +281,20 @@ public class Log2Gxl extends Thread { * @throws IllegalStateException if the header lines aren't as expected */ private void parseBranch() throws IOException,IllegalStateException { - String line=readLine("Branch:"); - String branch=line.substring("Branch:".length()+1); - if(branch.length()!=0) { - addToAttributeSet("Branches",branch); + String line=readLine("Branch:"); + String branch=line.substring("Branch:".length()+1); + if(branch.length()!=0) { + addToAttributeSet("Branches",branch); if(colorBranches) { - String color=highlightColorMap.get(branch); - if(color==null) { - color=colors[highlightColorMap.size()]; - highlightColorMap.put(branch,color); - } - currentNode.setAttr("BranchColor",new GXLString(color)); - } - } + String color=highlightColorMap.get(branch); + if(color==null) { + color=colors[highlightColorMap.size()]; + highlightColorMap.put(branch,color); + } + currentNode.setAttr("BranchColor",new GXLString(color)); + } + } } /** @@ -307,11 +303,11 @@ public class Log2Gxl extends Thread { * @throws IllegalStateException if the header lines aren't as expected */ private void parseTag() throws IOException,IllegalStateException { - String line=readLine("Tag:"); - String tag=line.substring("Tag:".length()+1); - if(tag.length()!=0) { - addToAttributeSet("Tags",tag); - } + String line=readLine("Tag:"); + String tag=line.substring("Tag:".length()+1); + if(tag.length()!=0) { + addToAttributeSet("Tags",tag); + } } /** @@ -320,9 +316,9 @@ public class Log2Gxl extends Thread { * @throws IOException if there is a read error on the input stream or the input stream runs dry * @throws IllegalStateException if the header lines aren't as expected */ - private void parseDeletedFiles() throws IOException,IllegalStateException { - String files=readFileBlock("Deleted files:"); - if(!simpleGXL) currentNode.setAttr("Deleted files",new GXLString(files)); + private void parseDeletedEntries() throws IOException,IllegalStateException { + String entries=readFileBlock("Deleted entries:"); + if(!simpleGXL) currentNode.setAttr("Deleted entries",new GXLString(entries)); } /** @@ -332,19 +328,30 @@ public class Log2Gxl extends Thread { * @throws IllegalStateException if the header lines aren't as expected */ private void parseAddedFiles() throws IOException,IllegalStateException { - String files=readFileBlock("Added files:"); - if(!simpleGXL) currentNode.setAttr("Added files",new GXLString(files)); + String files=readFileBlock("Added files:"); + if(!simpleGXL) currentNode.setAttr("Added files",new GXLString(files)); } /** + * Parse the added directories section of a log entry from a monotone log output + * Optionally pass the list of files to GXL (Don't do this is you're using dot as dxl2dot chokes on it) + * @throws IOException if there is a read error on the input stream or the input stream runs dry + * @throws IllegalStateException if the header lines aren't as expected + */ + private void parseAddedDirectories() throws IOException,IllegalStateException { + String dirs=readFileBlock("Added directories:"); + if(!simpleGXL) currentNode.setAttr("Added directories",new GXLString(dirs)); + } + + /** * Parse the renamed files section of a log entry from a monotone log output * Optionally pass the list of files to GXL (Don't do this is you're using dot as dxl2dot chokes on it) * @throws IOException if there is a read error on the input stream or the input stream runs dry * @throws IllegalStateException if the header lines aren't as expected */ - private void parseRenamedFiles() throws IOException,IllegalStateException { - String files=readFileBlock("Renamed files:"); - if(!simpleGXL) currentNode.setAttr("Renamed files",new GXLString(files)); + private void parseRenamedEntries() throws IOException,IllegalStateException { + String entries=readFileBlock("Renamed entries:"); + if(!simpleGXL) currentNode.setAttr("Renamed entries",new GXLString(entries)); } /** @@ -354,8 +361,8 @@ public class Log2Gxl extends Thread { * @throws IllegalStateException if the header lines aren't as expected */ private void parseRenamedDirectories() throws IOException,IllegalStateException { - String files=readFileBlock("Renamed directories:"); - if(!simpleGXL) currentNode.setAttr("Renamed directories",new GXLString(files)); + String files=readFileBlock("Renamed directories:"); + if(!simpleGXL) currentNode.setAttr("Renamed directories",new GXLString(files)); } @@ -364,21 +371,21 @@ public class Log2Gxl extends Thread { * @throws IOException if there is a read error on the input stream or the input stream runs dry */ private String readFileBlock(String header) throws IOException { - String line=readLine(header); - StringBuffer files=new StringBuffer(); - boolean parsing=true; - while(parsing) { - line=lookahead(); - if(!line.startsWith(" ")) { - parsing=false; - } - else { - line=source.readLine(); - files.append(" "); - files.append(line.substring(10)); - } - } - return files.toString(); + String line=readLine(header); + StringBuffer files=new StringBuffer(); + boolean parsing=true; + while(parsing) { + line=lookahead(); + if(!line.startsWith(" ")) { + parsing=false; + } + else { + line=source.readLine(); + files.append(" "); + files.append(line.substring(8)); + } + } + return files.toString(); } /** @@ -388,11 +395,22 @@ public class Log2Gxl extends Thread { * @throws IllegalStateException if the header lines aren't as expected */ private void parseModifiedFiles() throws IOException,IllegalStateException { - String files=readFileBlock("Modified files:"); - if(!simpleGXL) currentNode.setAttr("Modified files",new GXLString(files)); + String files=readFileBlock("Modified files:"); + if(!simpleGXL) currentNode.setAttr("Modified files",new GXLString(files)); } /** + * Parse the modified files section of a log entry from a monotone log output + * Optionally pass the list of files to GXL (Don't do this is you're using dot as dxl2dot chokes on it) + * @throws IOException if there is a read error on the input stream or the input stream runs dry + * @throws IllegalStateException if the header lines aren't as expected + */ + private void parseModifiedAttrs() throws IOException,IllegalStateException { + String attrs=readFileBlock("Modified attrs:"); + if(!simpleGXL) currentNode.setAttr("Modified attrs",new GXLString(attrs)); + } + + /** * Parse the change log section of a log entry from a monotone log output * Currently this is discarded * @throws IOException if there is a read error on the input stream or the input stream runs dry @@ -400,19 +418,19 @@ public class Log2Gxl extends Thread { */ private void parseChangeLog() throws IOException,IllegalStateException { String line=source.readLine(); - if(line.length()>0) throw new IOException(source.getLineNumber()+": Unexpected data ["+line+"]"); - line=readLine("ChangeLog:"); + if(line.length()>0) throw new IOException(source.getLineNumber()+": Unexpected data ["+line+"]"); + line=readLine("ChangeLog:"); boolean parsing=true; - while(parsing) { - line=lookahead(); - if(line==null || line.startsWith("----")) { - parsing=false; - } - else { - line=source.readLine(); - if(!simpleGXL) addToAttributeSet("ChangeLog",line); // gxl2dot chokes on this, so comment it out if you want to use gxl2dot - } - } + while(parsing) { + line=lookahead(); + if(line==null || line.startsWith("----")) { + parsing=false; + } + else { + line=source.readLine(); + if(!simpleGXL) addToAttributeSet("ChangeLog",line); // gxl2dot chokes on this, so comment it out if you want to use gxl2dot + } + } } /** @@ -422,17 +440,21 @@ public class Log2Gxl extends Thread { */ private void parseFiles() throws IOException,IllegalStateException { String line=source.readLine(); - if(line.length()>0) throw new IOException(source.getLineNumber()+": Unexpected data ["+line+"]"); + if(line.length()>0) throw new IOException(source.getLineNumber()+": Unexpected data ["+line+"]"); line=lookahead(); - if(line.startsWith("Deleted files:")) parseDeletedFiles(); + if(line.startsWith("Deleted entries:")) parseDeletedEntries(); line=lookahead(); - if(line.startsWith("Renamed files:")) parseRenamedFiles(); + if(line.startsWith("Renamed entries:")) parseRenamedEntries(); line=lookahead(); if(line.startsWith("Renamed directories:")) parseRenamedDirectories(); line=lookahead(); if(line.startsWith("Added files:")) parseAddedFiles(); line=lookahead(); - if(line.startsWith("Modified files:")) parseModifiedFiles(); + if(line.startsWith("Added directories:")) parseAddedDirectories(); + line=lookahead(); + if(line.startsWith("Modified files:")) parseModifiedFiles(); + line=lookahead(); + if(line.startsWith("Modified attrs:")) parseModifiedAttrs(); } /** @@ -455,659 +477,659 @@ public class Log2Gxl extends Thread { * Don't make this static or final, it can get modified */ private String[] colors=new String[] { - "aliceblue", - "antiquewhite", - "antiquewhite1", - "antiquewhite2", - "antiquewhite3", - "antiquewhite4", - "aquamarine", - "aquamarine1", - "aquamarine2", - "aquamarine3", - "aquamarine4", - "azure", - "azure1", - "azure2", - "azure3", - "azure4", - "beige", - "bisque", - "bisque1", - "bisque2", - "bisque3", - "bisque4", - "black", - "blanchedalmond", - "blue", - "blue1", - "blue2", - "blue3", - "blue4", - "blueviolet", - "brown", - "brown1", - "brown2", - "brown3", - "brown4", - "burlywood", - "burlywood1", - "burlywood2", - "burlywood3", - "burlywood4", - "cadetblue", - "cadetblue1", - "cadetblue2", - "cadetblue3", - "cadetblue4", - "chartreuse", - "chartreuse1", - "chartreuse2", - "chartreuse3", - "chartreuse4", - "chocolate", - "chocolate1", - "chocolate2", - "chocolate3", - "chocolate4", - "coral", - "coral1", - "coral2", - "coral3", - "coral4", - "cornflowerblue", - "cornsilk", - "cornsilk1", - "cornsilk2", - "cornsilk3", - "cornsilk4", - "crimson", - "cyan", - "cyan1", - "cyan2", - "cyan3", - "cyan4", - "darkgoldenrod", - "darkgoldenrod1", - "darkgoldenrod2", - "darkgoldenrod3", - "darkgoldenrod4", - "darkgreen", - "darkkhaki", - "darkolivegreen", - "darkolivegreen1", - "darkolivegreen2", - "darkolivegreen3", - "darkolivegreen4", - "darkorange", - "darkorange1", - "darkorange2", - "darkorange3", - "darkorange4", - "darkorchid", - "darkorchid1", - "darkorchid2", - "darkorchid3", - "darkorchid4", - "darksalmon", - "darkseagreen", - "darkseagreen1", - "darkseagreen2", - "darkseagreen3", - "darkseagreen4", - "darkslateblue", - "darkslategray", - "darkslategray1", - "darkslategray2", - "darkslategray3", - "darkslategray4", - "darkslategrey", - "darkturquoise", - "darkviolet", - "deeppink", - "deeppink1", - "deeppink2", - "deeppink3", - "deeppink4", - "deepskyblue", - "deepskyblue1", - "deepskyblue2", - "deepskyblue3", - "deepskyblue4", - "dimgray", - "dimgrey", - "dodgerblue", - "dodgerblue1", - "dodgerblue2", - "dodgerblue3", - "dodgerblue4", - "firebrick", - "firebrick1", - "firebrick2", - "firebrick3", - "firebrick4", - "floralwhite", - "forestgreen", - "gainsboro", - "ghostwhite", - "gold", - "gold1", - "gold2", - "gold3", - "gold4", - "goldenrod", - "goldenrod1", - "goldenrod2", - "goldenrod3", - "goldenrod4", - "gray", - "gray0", - "gray1", - "gray10", - "gray100", - "gray11", - "gray12", - "gray13", - "gray14", - "gray15", - "gray16", - "gray17", - "gray18", - "gray19", - "gray2", - "gray20", - "gray21", - "gray22", - "gray23", - "gray24", - "gray25", - "gray26", - "gray27", - "gray28", - "gray29", - "gray3", - "gray30", - "gray31", - "gray32", - "gray33", - "gray34", - "gray35", - "gray36", - "gray37", - "gray38", - "gray39", - "gray4", - "gray40", - "gray41", - "gray42", - "gray43", - "gray44", - "gray45", - "gray46", - "gray47", - "gray48", - "gray49", - "gray5", - "gray50", - "gray51", - "gray52", - "gray53", - "gray54", - "gray55", - "gray56", - "gray57", - "gray58", - "gray59", - "gray6", - "gray60", - "gray61", - "gray62", - "gray63", - "gray64", - "gray65", - "gray66", - "gray67", - "gray68", - "gray69", - "gray7", - "gray70", - "gray71", - "gray72", - "gray73", - "gray74", - "gray75", - "gray76", - "gray77", - "gray78", - "gray79", - "gray8", - "gray80", - "gray81", - "gray82", - "gray83", - "gray84", - "gray85", - "gray86", - "gray87", - "gray88", - "gray89", - "gray9", - "gray90", - "gray91", - "gray92", - "gray93", - "gray94", - "gray95", - "gray96", - "gray97", - "gray98", - "gray99", - "green", - "green1", - "green2", - "green3", - "green4", - "greenyellow", - "grey", - "grey0", - "grey1", - "grey10", - "grey100", - "grey11", - "grey12", - "grey13", - "grey14", - "grey15", - "grey16", - "grey17", - "grey18", - "grey19", - "grey2", - "grey20", - "grey21", - "grey22", - "grey23", - "grey24", - "grey25", - "grey26", - "grey27", - "grey28", - "grey29", - "grey3", - "grey30", - "grey31", - "grey32", - "grey33", - "grey34", - "grey35", - "grey36", - "grey37", - "grey38", - "grey39", - "grey4", - "grey40", - "grey41", - "grey42", - "grey43", - "grey44", - "grey45", - "grey46", - "grey47", - "grey48", - "grey49", - "grey5", - "grey50", - "grey51", - "grey52", - "grey53", - "grey54", - "grey55", - "grey56", - "grey57", - "grey58", - "grey59", - "grey6", - "grey60", - "grey61", - "grey62", - "grey63", - "grey64", - "grey65", - "grey66", - "grey6", - "grey68", - "grey69", - "grey7", - "grey70", - "grey7", - "grey72", - "grey73", - "grey74", - "grey75", - "grey7", - "grey77", - "grey78", - "grey79", - "grey8", - "grey8", - "grey81", - "grey82", - "grey83", - "grey84", - "grey8", - "grey86", - "grey87", - "grey88", - "grey89", - "grey", - "grey90", - "grey91", - "grey92", - "grey93", - "grey9", - "grey95", - "grey96", - "grey97", - "grey98", - "grey9", - "honeydew", - "honeydew1", - "honeydew2", - "honeydew3", - "honeydew", - "hotpink", - "hotpink1", - "hotpink2", - "hotpink3", - "hotpink", - "indianred", - "indianred1", - "indianred2", - "indianred3", - "indianred", - "indigo", - "ivory", - "ivory1", - "ivory2", - "ivory", - "ivory4", - "khaki", - "khaki1", - "khaki2", - "khaki", - "khaki4", - "lavender", - "lavenderblush", - "lavenderblush1", - "lavenderblush", - "lavenderblush3", - "lavenderblush4", - "lawngreen", - "lemonchiffon", - "lemonchiffon", - "lemonchiffon2", - "lemonchiffon3", - "lemonchiffon4", - "lightblue", - "lightblue", - "lightblue2", - "lightblue3", - "lightblue4", - "lightcoral", - "lightcya", - "lightcyan1", - "lightcyan2", - "lightcyan3", - "lightcyan4", - "lightgoldenro", - "lightgoldenrod1", - "lightgoldenrod2", - "lightgoldenrod3", - "lightgoldenrod4", - "lightgoldenrodyello", - "lightgray", - "lightgrey", - "lightpink", - "lightpink1", - "lightpink", - "lightpink3", - "lightpink4", - "lightsalmon", - "lightsalmon1", - "lightsalmon", - "lightsalmon3", - "lightsalmon4", - "lightseagreen", - "lightskyblue", - "lightskyblue", - "lightskyblue2", - "lightskyblue3", - "lightskyblue4", - "lightslateblue", - "lightslategra", - "lightslategrey", - "lightsteelblue", - "lightsteelblue1", - "lightsteelblue2", - "lightsteelblue", - "lightsteelblue4", - "lightyellow", - "lightyellow1", - "lightyellow2", - "lightyellow", - "lightyellow4", - "limegreen", - "linen", - "magenta", - "magenta", - "magenta2", - "magenta3", - "magenta4", - "maroon", - "maroon", - "maroon2", - "maroon3", - "maroon4", - "mediumaquamarine", - "mediumblu", - "mediumorchid", - "mediumorchid1", - "mediumorchid2", - "mediumorchid3", - "mediumorchid", - "mediumpurple", - "mediumpurple1", - "mediumpurple2", - "mediumpurple3", - "mediumpurple", - "mediumseagreen", - "mediumslateblue", - "mediumspringgreen", - "mediumturquoise", - "mediumvioletre", - "midnightblue", - "mintcream", - "mistyrose", - "mistyrose1", - "mistyrose", - "mistyrose3", - "mistyrose4", - "moccasin", - "navajowhite", - "navajowhite", - "navajowhite2", - "navajowhite3", - "navajowhite4", - "navy", - "navyblu", - "oldlace", - "olivedrab", - "olivedrab1", - "olivedrab2", - "olivedrab", - "olivedrab4", - "orange", - "orange1", - "orange2", - "orange", - "orange4", - "orangered", - "orangered1", - "orangered2", - "orangered", - "orangered4", - "orchid", - "orchid1", - "orchid2", - "orchid", - "orchid4", - "palegoldenrod", - "palegreen", - "palegreen1", - "palegreen", - "palegreen3", - "palegreen4", - "paleturquoise", - "paleturquoise1", - "paleturquoise", - "paleturquoise3", - "paleturquoise4", - "palevioletred", - "palevioletred1", - "palevioletred", - "palevioletred3", - "palevioletred4", - "papayawhip", - "peachpuff", - "peachpuff", - "peachpuff2", - "peachpuff3", - "peachpuff4", - "peru", - "pin", - "pink1", - "pink2", - "pink3", - "pink4", - "plu", - "plum1", - "plum2", - "plum3", - "plum4", - "powderblu", - "purple", - "purple1", - "purple2", - "purple3", - "purple", - "red", - "red1", - "red2", - "red3", - "red", - "rosybrown", - "rosybrown1", - "rosybrown2", - "rosybrown3", - "rosybrown", - "royalblue", - "royalblue1", - "royalblue2", - "royalblue3", - "royalblue", - "saddlebrown", - "salmon", - "salmon1", - "salmon2", - "salmon", - "salmon4", - "sandybrown", - "seagreen", - "seagreen1", - "seagreen", - "seagreen3", - "seagreen4", - "seashell", - "seashell1", - "seashell", - "seashell3", - "seashell4", - "sienna", - "sienna1", - "sienna", - "sienna3", - "sienna4", - "skyblue", - "skyblue1", - "skyblue", - "skyblue3", - "skyblue4", - "slateblue", - "slateblue1", - "slateblue", - "slateblue3", - "slateblue4", - "slategray", - "slategray1", - "slategray", - "slategray3", - "slategray4", - "slategrey", - "snow", - "snow", - "snow2", - "snow3", - "snow4", - "springgreen", - "springgreen", - "springgreen2", - "springgreen3", - "springgreen4", - "steelblue", - "steelblue", - "steelblue2", - "steelblue3", - "steelblue4", - "tan", - "tan", - "tan2", - "tan3", - "tan4", - "thistle", - "thistle", - "thistle2", - "thistle3", - "thistle4", - "tomato", - "tomato", - "tomato2", - "tomato3", - "tomato4", - "transparent", - "turquois", - "turquoise1", - "turquoise2", - "turquoise3", - "turquoise4", - "viole", - "violetred", - "violetred1", - "violetred2", - "violetred3", - "violetred", - "wheat", - "wheat1", - "wheat2", - "wheat3", - "wheat", - "white", - "whitesmoke", - "yellow", - "yellow1", - "yellow", - "yellow3", - "yellow4", - "yellowgreen" + "aliceblue", + "antiquewhite", + "antiquewhite1", + "antiquewhite2", + "antiquewhite3", + "antiquewhite4", + "aquamarine", + "aquamarine1", + "aquamarine2", + "aquamarine3", + "aquamarine4", + "azure", + "azure1", + "azure2", + "azure3", + "azure4", + "beige", + "bisque", + "bisque1", + "bisque2", + "bisque3", + "bisque4", + "black", + "blanchedalmond", + "blue", + "blue1", + "blue2", + "blue3", + "blue4", + "blueviolet", + "brown", + "brown1", + "brown2", + "brown3", + "brown4", + "burlywood", + "burlywood1", + "burlywood2", + "burlywood3", + "burlywood4", + "cadetblue", + "cadetblue1", + "cadetblue2", + "cadetblue3", + "cadetblue4", + "chartreuse", + "chartreuse1", + "chartreuse2", + "chartreuse3", + "chartreuse4", + "chocolate", + "chocolate1", + "chocolate2", + "chocolate3", + "chocolate4", + "coral", + "coral1", + "coral2", + "coral3", + "coral4", + "cornflowerblue", + "cornsilk", + "cornsilk1", + "cornsilk2", + "cornsilk3", + "cornsilk4", + "crimson", + "cyan", + "cyan1", + "cyan2", + "cyan3", + "cyan4", + "darkgoldenrod", + "darkgoldenrod1", + "darkgoldenrod2", + "darkgoldenrod3", + "darkgoldenrod4", + "darkgreen", + "darkkhaki", + "darkolivegreen", + "darkolivegreen1", + "darkolivegreen2", + "darkolivegreen3", + "darkolivegreen4", + "darkorange", + "darkorange1", + "darkorange2", + "darkorange3", + "darkorange4", + "darkorchid", + "darkorchid1", + "darkorchid2", + "darkorchid3", + "darkorchid4", + "darksalmon", + "darkseagreen", + "darkseagreen1", + "darkseagreen2", + "darkseagreen3", + "darkseagreen4", + "darkslateblue", + "darkslategray", + "darkslategray1", + "darkslategray2", + "darkslategray3", + "darkslategray4", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deeppink1", + "deeppink2", + "deeppink3", + "deeppink4", + "deepskyblue", + "deepskyblue1", + "deepskyblue2", + "deepskyblue3", + "deepskyblue4", + "dimgray", + "dimgrey", + "dodgerblue", + "dodgerblue1", + "dodgerblue2", + "dodgerblue3", + "dodgerblue4", + "firebrick", + "firebrick1", + "firebrick2", + "firebrick3", + "firebrick4", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "gold1", + "gold2", + "gold3", + "gold4", + "goldenrod", + "goldenrod1", + "goldenrod2", + "goldenrod3", + "goldenrod4", + "gray", + "gray0", + "gray1", + "gray10", + "gray100", + "gray11", + "gray12", + "gray13", + "gray14", + "gray15", + "gray16", + "gray17", + "gray18", + "gray19", + "gray2", + "gray20", + "gray21", + "gray22", + "gray23", + "gray24", + "gray25", + "gray26", + "gray27", + "gray28", + "gray29", + "gray3", + "gray30", + "gray31", + "gray32", + "gray33", + "gray34", + "gray35", + "gray36", + "gray37", + "gray38", + "gray39", + "gray4", + "gray40", + "gray41", + "gray42", + "gray43", + "gray44", + "gray45", + "gray46", + "gray47", + "gray48", + "gray49", + "gray5", + "gray50", + "gray51", + "gray52", + "gray53", + "gray54", + "gray55", + "gray56", + "gray57", + "gray58", + "gray59", + "gray6", + "gray60", + "gray61", + "gray62", + "gray63", + "gray64", + "gray65", + "gray66", + "gray67", + "gray68", + "gray69", + "gray7", + "gray70", + "gray71", + "gray72", + "gray73", + "gray74", + "gray75", + "gray76", + "gray77", + "gray78", + "gray79", + "gray8", + "gray80", + "gray81", + "gray82", + "gray83", + "gray84", + "gray85", + "gray86", + "gray87", + "gray88", + "gray89", + "gray9", + "gray90", + "gray91", + "gray92", + "gray93", + "gray94", + "gray95", + "gray96", + "gray97", + "gray98", + "gray99", + "green", + "green1", + "green2", + "green3", + "green4", + "greenyellow", + "grey", + "grey0", + "grey1", + "grey10", + "grey100", + "grey11", + "grey12", + "grey13", + "grey14", + "grey15", + "grey16", + "grey17", + "grey18", + "grey19", + "grey2", + "grey20", + "grey21", + "grey22", + "grey23", + "grey24", + "grey25", + "grey26", + "grey27", + "grey28", + "grey29", + "grey3", + "grey30", + "grey31", + "grey32", + "grey33", + "grey34", + "grey35", + "grey36", + "grey37", + "grey38", + "grey39", + "grey4", + "grey40", + "grey41", + "grey42", + "grey43", + "grey44", + "grey45", + "grey46", + "grey47", + "grey48", + "grey49", + "grey5", + "grey50", + "grey51", + "grey52", + "grey53", + "grey54", + "grey55", + "grey56", + "grey57", + "grey58", + "grey59", + "grey6", + "grey60", + "grey61", + "grey62", + "grey63", + "grey64", + "grey65", + "grey66", + "grey6", + "grey68", + "grey69", + "grey7", + "grey70", + "grey7", + "grey72", + "grey73", + "grey74", + "grey75", + "grey7", + "grey77", + "grey78", + "grey79", + "grey8", + "grey8", + "grey81", + "grey82", + "grey83", + "grey84", + "grey8", + "grey86", + "grey87", + "grey88", + "grey89", + "grey", + "grey90", + "grey91", + "grey92", + "grey93", + "grey9", + "grey95", + "grey96", + "grey97", + "grey98", + "grey9", + "honeydew", + "honeydew1", + "honeydew2", + "honeydew3", + "honeydew", + "hotpink", + "hotpink1", + "hotpink2", + "hotpink3", + "hotpink", + "indianred", + "indianred1", + "indianred2", + "indianred3", + "indianred", + "indigo", + "ivory", + "ivory1", + "ivory2", + "ivory", + "ivory4", + "khaki", + "khaki1", + "khaki2", + "khaki", + "khaki4", + "lavender", + "lavenderblush", + "lavenderblush1", + "lavenderblush", + "lavenderblush3", + "lavenderblush4", + "lawngreen", + "lemonchiffon", + "lemonchiffon", + "lemonchiffon2", + "lemonchiffon3", + "lemonchiffon4", + "lightblue", + "lightblue", + "lightblue2", + "lightblue3", + "lightblue4", + "lightcoral", + "lightcya", + "lightcyan1", + "lightcyan2", + "lightcyan3", + "lightcyan4", + "lightgoldenro", + "lightgoldenrod1", + "lightgoldenrod2", + "lightgoldenrod3", + "lightgoldenrod4", + "lightgoldenrodyello", + "lightgray", + "lightgrey", + "lightpink", + "lightpink1", + "lightpink", + "lightpink3", + "lightpink4", + "lightsalmon", + "lightsalmon1", + "lightsalmon", + "lightsalmon3", + "lightsalmon4", + "lightseagreen", + "lightskyblue", + "lightskyblue", + "lightskyblue2", + "lightskyblue3", + "lightskyblue4", + "lightslateblue", + "lightslategra", + "lightslategrey", + "lightsteelblue", + "lightsteelblue1", + "lightsteelblue2", + "lightsteelblue", + "lightsteelblue4", + "lightyellow", + "lightyellow1", + "lightyellow2", + "lightyellow", + "lightyellow4", + "limegreen", + "linen", + "magenta", + "magenta", + "magenta2", + "magenta3", + "magenta4", + "maroon", + "maroon", + "maroon2", + "maroon3", + "maroon4", + "mediumaquamarine", + "mediumblu", + "mediumorchid", + "mediumorchid1", + "mediumorchid2", + "mediumorchid3", + "mediumorchid", + "mediumpurple", + "mediumpurple1", + "mediumpurple2", + "mediumpurple3", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletre", + "midnightblue", + "mintcream", + "mistyrose", + "mistyrose1", + "mistyrose", + "mistyrose3", + "mistyrose4", + "moccasin", + "navajowhite", + "navajowhite", + "navajowhite2", + "navajowhite3", + "navajowhite4", + "navy", + "navyblu", + "oldlace", + "olivedrab", + "olivedrab1", + "olivedrab2", + "olivedrab", + "olivedrab4", + "orange", + "orange1", + "orange2", + "orange", + "orange4", + "orangered", + "orangered1", + "orangered2", + "orangered", + "orangered4", + "orchid", + "orchid1", + "orchid2", + "orchid", + "orchid4", + "palegoldenrod", + "palegreen", + "palegreen1", + "palegreen", + "palegreen3", + "palegreen4", + "paleturquoise", + "paleturquoise1", + "paleturquoise", + "paleturquoise3", + "paleturquoise4", + "palevioletred", + "palevioletred1", + "palevioletred", + "palevioletred3", + "palevioletred4", + "papayawhip", + "peachpuff", + "peachpuff", + "peachpuff2", + "peachpuff3", + "peachpuff4", + "peru", + "pin", + "pink1", + "pink2", + "pink3", + "pink4", + "plu", + "plum1", + "plum2", + "plum3", + "plum4", + "powderblu", + "purple", + "purple1", + "purple2", + "purple3", + "purple", + "red", + "red1", + "red2", + "red3", + "red", + "rosybrown", + "rosybrown1", + "rosybrown2", + "rosybrown3", + "rosybrown", + "royalblue", + "royalblue1", + "royalblue2", + "royalblue3", + "royalblue", + "saddlebrown", + "salmon", + "salmon1", + "salmon2", + "salmon", + "salmon4", + "sandybrown", + "seagreen", + "seagreen1", + "seagreen", + "seagreen3", + "seagreen4", + "seashell", + "seashell1", + "seashell", + "seashell3", + "seashell4", + "sienna", + "sienna1", + "sienna", + "sienna3", + "sienna4", + "skyblue", + "skyblue1", + "skyblue", + "skyblue3", + "skyblue4", + "slateblue", + "slateblue1", + "slateblue", + "slateblue3", + "slateblue4", + "slategray", + "slategray1", + "slategray", + "slategray3", + "slategray4", + "slategrey", + "snow", + "snow", + "snow2", + "snow3", + "snow4", + "springgreen", + "springgreen", + "springgreen2", + "springgreen3", + "springgreen4", + "steelblue", + "steelblue", + "steelblue2", + "steelblue3", + "steelblue4", + "tan", + "tan", + "tan2", + "tan3", + "tan4", + "thistle", + "thistle", + "thistle2", + "thistle3", + "thistle4", + "tomato", + "tomato", + "tomato2", + "tomato3", + "tomato4", + "transparent", + "turquois", + "turquoise1", + "turquoise2", + "turquoise3", + "turquoise4", + "viole", + "violetred", + "violetred1", + "violetred2", + "violetred3", + "violetred", + "wheat", + "wheat1", + "wheat2", + "wheat3", + "wheat", + "white", + "whitesmoke", + "yellow", + "yellow1", + "yellow", + "yellow3", + "yellow4", + "yellowgreen" }; /** @@ -1175,26 +1197,26 @@ public class Log2Gxl extends Thread { * @throws IOException if there is a problem with the author to color mapping file */ private void loadColorfile(String colorfileName) throws IOException { - Properties colorMap=new Properties(); - InputStream colorMapStream=null; - try { - colorMapStream=new FileInputStream(colorfileName); - colorMap.load(colorMapStream); - List colorList=new ArrayList(Arrays.asList(colors)); - for(Object key: colorMap.keySet()) { - String color=(String)colorMap.get(key); - if(!colorList.contains(color)) { - throw new IOException("Illegal color "+color+" in color map file"); - } - highlightColorMap.put((String)key,color); - logger.config(key+"="+color); - colorList.remove(color); - } - colors=colorList.toArray(new String[colorList.size()]); - } - finally { - if(colorMapStream!=null) colorMapStream.close(); - } + Properties colorMap=new Properties(); + InputStream colorMapStream=null; + try { + colorMapStream=new FileInputStream(colorfileName); + colorMap.load(colorMapStream); + List colorList=new ArrayList(Arrays.asList(colors)); + for(Object key: colorMap.keySet()) { + String color=(String)colorMap.get(key); + if(!colorList.contains(color)) { + throw new IOException("Illegal color "+color+" in color map file"); + } + highlightColorMap.put((String)key,color); + logger.config(key+"="+color); + colorList.remove(color); + } + colors=colorList.toArray(new String[colorList.size()]); + } + finally { + if(colorMapStream!=null) colorMapStream.close(); + } } /** @@ -1205,7 +1227,7 @@ public class Log2Gxl extends Thread { * @throws IllegalStateException if the header lines aren't as expected */ private void start(String argv[]) throws IOException,IllegalStateException { - start(argv,System.in,System.out); + start(argv,System.in,System.out); } /** @@ -1216,63 +1238,63 @@ public class Log2Gxl extends Thread { * @throws IllegalStateException if the header lines aren't as expected */ public void start(String argv[],InputStream rawSource,OutputStream sink) throws IOException,IllegalStateException { - nodes=new HashMap(); - if(argv.length>0) { - for(int I=0;I"); - System.exit(-1); - } - } - } - } + nodes=new HashMap(); + if(argv.length>0) { + for(int I=0;I"); + System.exit(-1); + } + } + } + } source=new LineNumberReader(new InputStreamReader(rawSource)); - this.sink=sink; - setDaemon(true); - start(); + this.sink=sink; + setDaemon(true); + start(); } /** * Small stub method to wrap the run method and catch generic exceptions */ public void run() { - try { - doRun(); - } - catch(Exception e) { - e.printStackTrace(); - logger.throwing(this.getClass().getName(),"run",e); - } + try { + doRun(); + } + catch(Exception e) { + e.printStackTrace(); + logger.throwing(this.getClass().getName(),"run",e); + } } /** * Create a GXL document by parsing the monotone log output */ private void buildGXLDocument() throws IOException,IllegalStateException { - if(gxlDocument!=null) throw new IllegalStateException("Can't invoke buildGXLDocument twice on same instance of Log2Gxl"); - gxlDocument=new GXLDocument(); - graph=new GXLGraph("Monotone Log"); - graph.setAttribute(GXL.EDGEMODE,GXL.DIRECTED); - // graph.setAttr("rotate",new GXLString("90")); // Hmm. This rotates the coordinate system, not the graph drawing direction - gxlDocument.getDocumentElement().add(graph); - boolean parsing=true; - while(parsing) { - String line=source.readLine(); - if(line==null) { - parsing=false; - break; - } - if(!line.equals("-----------------------------------------------------------------")) { - throw new IOException(source.getLineNumber()+": Input ["+line+"] doesn't look like output of monotone log"); - } - parseHeader(); - logger.finer(currentNode.getID()); - parseFiles(); - parseChangeLog(); - commitNode(); - } + if(gxlDocument!=null) throw new IllegalStateException("Can't invoke buildGXLDocument twice on same instance of Log2Gxl"); + gxlDocument=new GXLDocument(); + graph=new GXLGraph("Monotone Log"); + graph.setAttribute(GXL.EDGEMODE,GXL.DIRECTED); + // graph.setAttr("rotate",new GXLString("90")); // Hmm. This rotates the coordinate system, not the graph drawing direction + gxlDocument.getDocumentElement().add(graph); + boolean parsing=true; + while(parsing) { + String line=source.readLine(); + if(line==null) { + parsing=false; + break; + } + if(!line.equals("-----------------------------------------------------------------")) { + throw new IOException(source.getLineNumber()+": Input ["+line+"] doesn't look like output of monotone log"); + } + parseHeader(); + logger.finer(currentNode.getID()); + parseFiles(); + parseChangeLog(); + commitNode(); + } } /** @@ -1280,16 +1302,16 @@ public class Log2Gxl extends Thread { */ public void doRun() throws IOException,IllegalStateException { - // Build the graph - buildGXLDocument(); + // Build the graph + buildGXLDocument(); - logger.info("Writing GXL graph.."); + logger.info("Writing GXL graph.."); - // Write the graph to std out - gxlDocument.write(sink); - sink.flush(); + // Write the graph to std out + gxlDocument.write(sink); + sink.flush(); - logger.info("Wrote GXL graph."); - // Note: Don't close rawSource or sink as they may be stdin/out + logger.info("Wrote GXL graph."); + // Note: Don't close rawSource or sink as they may be stdin/out } } ============================================================ --- contrib/monotree/Makefile e8406db78d4b42065b774d4ca259e25ac6765cef +++ contrib/monotree/Makefile 61e224323a0830ae488c0e7b72c47d5e528e62c5 @@ -15,7 +15,7 @@ Monotone.class Monotone$$ErrorReader.cla javac -g -classpath "gxl/gxl-0.92/gxl.jar${SEP}." Log2Gxl.java Monotone.class Monotone$$ErrorReader.class Monotone$$StreamCopier.class Monotone$$1.class Monotone$$HighlightTypes.class InternalURIResolver.class: Monotone.java Log2Gxl.class - javac -g Monotone.java + javac -g -classpath "gxl/gxl-0.92/gxl.jar;." Monotone.java GXLViewer$$OnClickAction.class GXLViewer$$ReadBranches.class GXLViewer$$2$$1.class GXLViewer$$DisplayLog.class GXLViewer$$1.class GXLViewer$$2.class GXLViewer$$3.class GXLViewer$$4.class GXLViewer$$5 GXLViewer$$6 GXLViewer.class GXLViewer$$MonotoneFileFilter.class GXLViewer$$ReadBranches$$1.class GXLViewer$$DisplayLog$$1.class GXLViewer$$GXLUserAgent.class GXLViewer$$7.class GXLViewer$$OnClickAction$$1.class: GXLViewer.java Monotone.class javac -g -classpath "batik/batik-1.5.1/batik.jar${SEP}gxl/gxl-0.92/gxl.jar${SEP}." GXLViewer.java ============================================================ --- contrib/monotree/Monotone.java 635d14051fad2e14b1a3bbf0072233c1f4376908 +++ contrib/monotree/Monotone.java 6d75d8c42c435cf9b103b630dd20631c3264f77f @@ -62,7 +62,7 @@ public class Monotone { * @return the base monotone command */ public String[] getBaseCommand() { - return new String[] { "monotone","--db="+database }; + return new String[] { "mtn","--db="+database }; } /** @@ -82,7 +82,7 @@ public class Monotone { * @return a list of strings which enumerates the heads of the specified branch in the current monotone database */ public List listHeads(String branch) throws IOException { - Listresult=runMonotone(new String[] { "heads", "--branch",branch}); + Listresult=runMonotone(new String[] { "heads", "--branch", branch}); return result; }