Esempio n. 1
0
 /**
  * Creates a specific dot-graph node that represents the given state.
  *
  * @param StateMachineInterface $state_machine
  * @param StateInterface $state
  *
  * @return string
  */
 protected function createStateNode(StateMachineInterface $state_machine, StateInterface $state)
 {
     $state_name = $state->getName();
     $attributes = [sprintf('label="%s"', $state_name), sprintf('fontname="%s"', $this->getStyle('state_node.fontname', self::STATE_NODE_FONTNAME)), sprintf('fontsize="%s"', $this->getStyle('state_node.fontsize', self::STATE_NODE_FONTSIZE)), sprintf('fontcolor="%s"', $this->getStyle('state_node.fontcolor', self::STATE_NODE_FONTCOLOR)), sprintf('color="%s"', $this->getStyle('state_node.color', self::STATE_NODE_COLOR))];
     if ($state->isFinal()) {
         $attributes[] = 'style="bold"';
     }
     if (!$state_machine->isEventState($state_name) && !$state->isFinal()) {
         $attributes[] = 'shape="parallelogram"';
     }
     return sprintf('%s [%s]', $this->node_id_map[$state_name], implode(' ', $attributes));
 }