 		onActivatedAction = null
 		onDeactivatedAction = null
 
+		# Create and return the state machine instance
 		smRef = null
-		# Create and return the state machine instance
 		@sm = ->
 			smRef ||= new StateMachine
 				states: [Node.States.DEACTIVATED, Node.States.ACTIVATED]

			else if action.transition == Node.Transitions.DEACTIVATE
				@deactivate(action.node)

	# # # instance
	
	constructor: (opts={})->
		parent = null
		children = []

		if opts.children
			for node in opts.children
				node.setParent @

						from: Node.States.ACTIVATED
						to: Node.States.DEACTIVATED

		# Add a callback lambda to the SM and map the two  
		# state transitions to methods in this class.
		@sm().performTransition = (t) =>
			if t == Node.Transitions.ACTIVATE
				@beforeActivate()
				@doActivate()
			else if t == Node.Transitions.DEACTIVATE
				@beforeDeactivate()
				@doDeactivate()

		@setOnActivatedAction = (action) ->
