- java.lang.Object
-
- org.logicng.io.graphical.generators.GraphicalGenerator<C>
-
- Type Parameters:
C- the type of the content from which the nodes are generated
- Direct Known Subclasses:
BddGraphicalGenerator,FormulaAstGraphicalGenerator,FormulaDagGraphicalGenerator,GraphGraphicalGenerator
public abstract class GraphicalGenerator<C> extends Object
An abstract super class for graphical generators.- Since:
- 2.4.0
- Version:
- 2.4.0
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanalignTerminalsprotected GraphicalColorbackgroundColorprotected GraphicalEdgeStyledefaultEdgeStyleprotected GraphicalNodeStyledefaultNodeStyleprotected static StringID
-
Constructor Summary
Constructors Modifier Constructor Description protectedGraphicalGenerator(GraphicalColor backgroundColor, boolean alignTerminals, GraphicalEdgeStyle defaultEdgeStyle, GraphicalNodeStyle defaultNodeStyle, NodeStyleMapper<C> nodeStyleMapper, LabelMapper<C> labelMapper, EdgeStyleMapper<C> edgeStyleMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected GraphicalEdgeStyleedgeStyle(C source, C destination)Computes the style for an edge.protected StringlabelOrDefault(C content, String defaultLabel)Computes the label with the label mapper or returns the default value if no label mapper is configured.protected GraphicalNodeStylenodeStyle(C content)Computes the style for a node.
-
-
-
Field Detail
-
ID
protected static final String ID
- See Also:
- Constant Field Values
-
backgroundColor
protected final GraphicalColor backgroundColor
-
alignTerminals
protected final boolean alignTerminals
-
defaultEdgeStyle
protected final GraphicalEdgeStyle defaultEdgeStyle
-
defaultNodeStyle
protected final GraphicalNodeStyle defaultNodeStyle
-
-
Constructor Detail
-
GraphicalGenerator
protected GraphicalGenerator(GraphicalColor backgroundColor, boolean alignTerminals, GraphicalEdgeStyle defaultEdgeStyle, GraphicalNodeStyle defaultNodeStyle, NodeStyleMapper<C> nodeStyleMapper, LabelMapper<C> labelMapper, EdgeStyleMapper<C> edgeStyleMapper)
-
-
Method Detail
-
nodeStyle
protected GraphicalNodeStyle nodeStyle(C content)
Computes the style for a node. If no style mapper is configured the default style is applied, otherwise, the style mapper is used to dynamically compute the style for the given content.- Parameters:
content- the content to style- Returns:
- the node style
-
labelOrDefault
protected String labelOrDefault(C content, String defaultLabel)
Computes the label with the label mapper or returns the default value if no label mapper is configured.- Parameters:
content- the content for which to compute the labeldefaultLabel- the default label- Returns:
- the label
-
edgeStyle
protected GraphicalEdgeStyle edgeStyle(C source, C destination)
Computes the style for an edge. If no style mapper is configured the default style is applied, otherwise, the style mapper is used to dynamically compute the style for the given edge.- Parameters:
source- the content of the source nodedestination- the content of the destination node- Returns:
- the edge style
-
-