-
Notifications
You must be signed in to change notification settings - Fork 263
Statechart Graph Support
Statecharts, or state transition diagrams, show states and transitions between them in a state machine. A child state machine can be embedded inside a state. Statecharts are illustrated in the ATF State Chart Editor Sample, as shown in this figure:
A statechart, like a circuit, specializes a graph. The general graph interface
IGraph<IGraphNode, IGraphEdge<IGraphNode, IEdgeRoute>, IEdgeRoute>
becomes this for a statechart:
IGraph<IState, IGraphEdge<IState, BoundaryRoute>, BoundaryRoute>
The distinguishing items for a statechart are:
-
IState
: Interface for states in state-transition diagrams. For details, see IState Interface. -
BoundaryRoute
: Edge route for statecharts. For more information, see BoundaryRoute Class.
Most statechart classes and all the interfaces are in this assembly.
Statecharts can have regular states and pseudo-states. Pseudo-states provide information about actual states.
IState
is the interface for states in statechart diagrams that are non-pseudo-states. Its property:
-
Text
: Get the state's interior text.
IState
implements IHierarchicalGraphNode
, the interface for hierarchical nodes in a graph, which contain sub-nodes.
IState
is the general interface for states in state-transition diagrams, and covers both states and pseudo-states. Its properties are:
-
Type
: Get the state type, aStateType
enumeration. For further details, see StateType Enumeration. -
Indicators
: Get the visual indicators on the state, aStateIndicators
enumeration. For more information, see StateIndicators Enumeration.
IState
implements IGraphNode
, the interface for a node in a graph. For more details, see IGraphNode Interface.
BoundaryRoute
is an IEdgeRoute
implementer for transitions between states. It is distinguished by its Position
float
property, which indicates the route position on the perimeter of a state. Its range is \[0..4\[,]and]it starts and ends at the top-left, going in a clockwise direction. The range from 0 to 1 is on the right side, from 1 to 2 on the bottom, and so on.
Two enumerations provide state information.
StateIndicators
values enumerate visual indicators for state transition diagrams:
-
Breakpoint
: Display a breakpoint indicator on a state. -
Active
: Display an "active" indicator on a state.
StateType
identifies the kind of state or pseudostate, which marks or points to states.
-
Normal
: A normal state. -
Start
: The start pseudostate, which points to the first state that is active when the state machine starts running. -
Final
: The final pseudostate, which is the last state that a state machine can be in. -
ShallowHistory
: The shallow history pseudostate. -
DeepHistory
: The deep history pseudostate. -
Conditional
: A conditional pseudostate, which indicates a state with conditions to reduce the number of transitions.
This assembly contains the rendering class for statecharts.
D2dStatechartRenderer
is the class to handle rendering and hit testing on statechart graphs. It is analogous to the D2dCircuitRenderer
that specializes in rendering circuit graphs. D2dStatechartRenderer
draws graph nodes as states, and edges as transitions.
D2dStatechartRenderer
derives from D2dGraphRenderer
, which is described in D2dGraphRenderer Class. D2dStatechartRenderer
overrides D2dGraphRenderer
's Draw()
methods using Direct2D (D2dGraphics
class) to draw the statechart. It also overrides the Pick()
methods.
D2dStatechartRenderer
requires a D2dDiagramTheme
in its constructor to specify the rendering theme. For a description of its use in the ATF Fsm Editor Sample, see Document Client in FSM Editor Programming Discussion.
Like the other rendering classes, D2dStatechartRenderer
works with an adapter. For example, the ATF State Chart Editor Sample defines its own private class StatechartGraphAdapter
derived from D2dGraphAdapter
that takes a D2dStatechartRenderer
in its constructor. Both D2dGraphNodeEditAdapter
and D2dGraphEdgeEditAdapter
also require a renderer, which can be a D2dStatechartRenderer
. The ATF State Chart Editor Sample shows using a D2dStatechartRenderer
with its StatechartGraphAdapter
adapter for drawing statecharts, as well as with the adapters D2dGraphNodeEditAdapter
and D2dGraphEdgeEditAdapter
.
- What is a Graph in ATF: General description of graphs.
- Graph Data Model: Data model for graphs using the ATF DOM.
- Types of Graphs: Types of graphs supported in ATF.
-
ATF Graph Interfaces: The main interface
IGraph
and other interfaces used in graphs. - General Graph Support: Description of general graph support.
- Circuit Graph Support: How to use circuit graphs, which ATF provides the most support for.
- Statechart Graph Support: Support for statechart type graphs.
- Home
- Getting Started
- Features & Benefits
- Requirements & Dependencies
- Gallery
- Technology & Samples
- Adoption
- News
- Release Notes
- ATF Community
- Searching Documentation
- Using Documentation
- Videos
- Tutorials
- How To
- Programmer's Guide
- Reference
- Code Samples
- Documentation Files
© 2014-2015, Sony Computer Entertainment America LLC