|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinpro.incremental.PushBuffer
inpro.incremental.sink.IUNetworkToDOT
public class IUNetworkToDOT
A viewer for IU networks that calls graphviz for laying out the graph
Field Summary | |
---|---|
private boolean |
display
Whether to show dot output images. |
private java.io.File |
dot
The dot executable |
(package private) javax.swing.JFrame |
f
Frame for display of output |
private static int |
File_idCounter
Output file ID counter. |
private java.util.List<java.lang.String> |
iuTypes
The string of comma separated iu types |
(package private) javax.swing.JLabel |
l
Label for display of output |
private java.util.List<java.util.List<IU>> |
nodeClusters
List of lists of nodes to cluster |
private java.io.File |
out
The current .dot output file. |
private java.lang.String |
outputFormat
String for image extension, defaults to .png |
private java.io.PrintStream |
outStream
PrintStream to write dot output to. |
static java.lang.String |
PROP_DISPLAY_OUTPUT
Boolean for whether to show dot output images |
static java.lang.String |
PROP_DOT
String for dot executable |
static java.lang.String |
PROP_FAST_SCALE
Boolean for determining whether to scale output images quickly rather than smoothly |
static java.lang.String |
PROP_IU_TYPES
String, comma-separated, for what iu types to display |
static java.lang.String |
PROP_OUTPUT_FORMAT
String for image extension, defaults to .png |
static java.lang.String |
PROP_RUN_DOT
Boolean for determining whether to turn dot output into images |
static java.lang.String |
PROP_TMP_DIR
String for the temporary directory |
private boolean |
runDot
Whether to turn dot output into images |
private int |
scale
Setting for scaling images smooth or fast |
private java.lang.String |
tmpDir
The dot executable |
Constructor Summary | |
---|---|
IUNetworkToDOT()
|
Method Summary | |
---|---|
private void |
addToIUCluster(IU iu)
|
private int |
getNewFileID()
|
void |
hypChange(java.util.Collection<? extends IU> ius,
java.util.List<? extends EditMessage<? extends IU>> edits)
this should receive a list of current IUs and a list of edit messages since the last call to hypChange |
void |
newProperties(edu.cmu.sphinx.util.props.PropertySheet ps)
Sets up the dot listener |
private void |
printGrin(IU iu,
IU gr)
|
private void |
printHead()
|
private void |
printNode(IU iu)
|
private void |
printSLL(IU iu,
IU sll)
|
private void |
printTail()
|
private void |
runDot()
Runs dot for the output .dot file with the configured output format and displays in window (if so configured). |
Methods inherited from class inpro.incremental.PushBuffer |
---|
reset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@S4String(defaultValue="/usr/bin/dot") public static final java.lang.String PROP_DOT
private java.io.File dot
@S4String(defaultValue="/tmp") public static final java.lang.String PROP_TMP_DIR
private java.lang.String tmpDir
@S4String(defaultValue="") public static final java.lang.String PROP_IU_TYPES
private java.util.List<java.lang.String> iuTypes
@S4Boolean(defaultValue=false) public static final java.lang.String PROP_RUN_DOT
private boolean runDot
@S4Boolean(defaultValue=false) public static final java.lang.String PROP_FAST_SCALE
private int scale
@S4Boolean(defaultValue=false) public static final java.lang.String PROP_DISPLAY_OUTPUT
private boolean display
@S4String(defaultValue="png") public static final java.lang.String PROP_OUTPUT_FORMAT
private java.lang.String outputFormat
private static int File_idCounter
private java.io.PrintStream outStream
private java.io.File out
private java.util.List<java.util.List<IU>> nodeClusters
javax.swing.JFrame f
javax.swing.JLabel l
Constructor Detail |
---|
public IUNetworkToDOT()
Method Detail |
---|
public void newProperties(edu.cmu.sphinx.util.props.PropertySheet ps) throws edu.cmu.sphinx.util.props.PropertyException
newProperties
in interface edu.cmu.sphinx.util.props.Configurable
newProperties
in class PushBuffer
edu.cmu.sphinx.util.props.PropertyException
public void hypChange(java.util.Collection<? extends IU> ius, java.util.List<? extends EditMessage<? extends IU>> edits)
PushBuffer
hypChange
in class PushBuffer
ius
- while this is a (plain) collection, the collection's iterator()
method must ensure a sensible ordering of the returned elements.
For now we have only used Lists (which are ordered),
but a Tree of IUs should also be possible and this should gracefully
work together with processors that expect listsedits
- a list of edits since the last call to hypChangeprivate int getNewFileID()
private void printHead()
private void printNode(IU iu)
private void printSLL(IU iu, IU sll)
private void printGrin(IU iu, IU gr)
private void addToIUCluster(IU iu)
private void printTail()
private void runDot()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |