public abstract class AbstractStatesExporter<R,S extends State,M extends Message,T extends Transitioner<S,M,? extends Transition<S,M>>> extends Object implements Exporter<R,S,M,T>
| Modifier and Type | Field and Description |
|---|---|
protected Color |
currentStateColor
The color for final states
|
static String |
DEFAULT_CURRENT_COLOR
The default color for current state
|
static String |
DEFAULT_FINAL_COLOR
The default color for final states
|
protected FileSystem |
fileSystem
The file system to use when locating paths
|
protected Color |
finalStateColor
The color for final states
|
protected String |
graphName
The name of the graph
|
protected static String |
NL
The system's new line character
|
protected boolean |
showCurrent
Show current status in different color
|
protected static char |
TB
The tabulator character
|
protected boolean |
useHSB
Use HSB colors in the output format.
|
| Constructor and Description |
|---|
AbstractStatesExporter()
No arguments constructor.
|
AbstractStatesExporter(FileSystem fileSystem,
String graphName,
Color finalStateColor,
boolean useHSB,
boolean showCurrent,
Color currentStateColor)
All arguments constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
exportToFile(T transitioner,
@NonNull Path outputFile)
Export the current contents of the transitioner
to the DOT language to the given file path.
|
void |
exportToFile(T transitioner,
@NonNull String outputFile)
Export the current contents of the transitioner
to the DOT language to the given file path.
|
protected void |
fillDefaults()
Fills default values for all non-primitive types
|
public static final String DEFAULT_FINAL_COLOR
public static final String DEFAULT_CURRENT_COLOR
protected static final String NL
protected static final char TB
protected FileSystem fileSystem
protected String graphName
protected Color finalStateColor
protected boolean useHSB
protected boolean showCurrent
protected Color currentStateColor
public AbstractStatesExporter(FileSystem fileSystem, String graphName, Color finalStateColor, boolean useHSB, boolean showCurrent, Color currentStateColor)
fileSystem - the filesystemgraphName - the graph namefinalStateColor - the final state coloruseHSB - the flag to control exporting using HSB color formatshowCurrent - the flag to control annotating current statuscurrentStateColor - the current state colorpublic AbstractStatesExporter()
protected void fillDefaults()
public void exportToFile(@NonNull
T transitioner,
@NonNull
@NonNull String outputFile)
transitioner - the state machine to exportoutputFile - the output file pathpublic void exportToFile(@NonNull
T transitioner,
@NonNull
@NonNull Path outputFile)
exportToFile in interface Exporter<R,S extends State,M extends Message,T extends Transitioner<S,M,? extends Transition<S,M>>>transitioner - the transitioner to exportoutputFile - the output file pathCopyright © 2019 state-machine. All rights reserved.