protected virtual void PaintNetwork(IOGraph graph, PaintState state)
{
// Create per-node state info.
int hiddenNodeCount = graph.HiddenNodeList.Count;
int inputNodeCount = graph.InputNodeList.Count;
int outputNodeCount = graph.OutputNodeList.Count;
state._nodeStateDict = new Dictionary<GraphNode,ConnectionPointInfo>(hiddenNodeCount + inputNodeCount + outputNodeCount);
// Paint all connections. We do this first and paint nodes on top of the connections. This allows the
// slightly messy ends of the connections to be painted over by the nodes.
PaintConnections(graph.InputNodeList, state);
PaintConnections(graph.HiddenNodeList, state);
PaintConnections(graph.OutputNodeList, state);
// Paint all nodes. Painted over the top of connection endpoints.
PaintNodes(graph.InputNodeList, state);
PaintNodes(graph.HiddenNodeList, state);
PaintNodes(graph.OutputNodeList, state);
}