java.lang.Object
org.praxislive.project.GraphElement
- Direct Known Subclasses:
GraphElement.Command,GraphElement.Comment,GraphElement.Component,GraphElement.Connection,GraphElement.Property
public abstract sealed class GraphElement
extends Object
permits GraphElement.Component, GraphElement.Command, GraphElement.Comment, GraphElement.Property, GraphElement.Connection
Elements of a graph tree.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final classstatic classA component element.static final classstatic final classstatic final classA root component element. -
Method Summary
Modifier and TypeMethodDescriptionstatic GraphElement.CommandCreate a Command element from the given script line.static GraphElement.CommentCreate a Comment element from the given text.static GraphElement.Connectionconnection(String sourceComponent, String sourcePort, String targetComponent, String targetPort) Create a Connection element between the given source component ID and port ID, and target component ID and port ID.static GraphElement.Propertyproperty(org.praxislive.core.Value value) Create a property element of the given value.
-
Method Details
-
command
Create a Command element from the given script line. The command must be a single line of script with a plain first token.- Parameters:
command- script line- Returns:
- command element
- Throws:
IllegalArgumentException- if the command fails to parse according to the rules
-
comment
Create a Comment element from the given text.- Parameters:
text- comment text- Returns:
- comment element
-
connection
public static GraphElement.Connection connection(String sourceComponent, String sourcePort, String targetComponent, String targetPort) Create a Connection element between the given source component ID and port ID, and target component ID and port ID.- Parameters:
sourceComponent- source component IDsourcePort- source port IDtargetComponent- target component IDtargetPort- target port ID- Returns:
- connection element
-
property
Create a property element of the given value.- Parameters:
value- property value- Returns:
- property element
-