Index: trunk/extensions/SemanticResultFormats/GraphViz/SRF_Process.php |
— | — | @@ -401,6 +401,8 @@ |
402 | 402 | protected $m_showRedLinks = false; // check and highlight red links? |
403 | 403 | protected $m_redLinkColor = 'red'; // red link font color |
404 | 404 | protected $m_showCompound = true; // highlight compound nodes (=subprocesses) |
| 405 | + |
| 406 | + public $m_useHtmlNodes = true; // Set to false if you do not want to use HTML table nodes |
405 | 407 | |
406 | 408 | // instance variables |
407 | 409 | protected $m_nodes = array(); // list of all nodes |
— | — | @@ -671,7 +673,19 @@ |
672 | 674 | // TODO I18N |
673 | 675 | private $m_id = 'no_id'; |
674 | 676 | private $m_label = 'unlabeled'; |
675 | | - |
| 677 | + private $m_uid; |
| 678 | + |
| 679 | + public function getUUID(){ |
| 680 | + if (!isset($this->m_uid)){ |
| 681 | + $this->m_uid = sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', |
| 682 | + mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff), |
| 683 | + mt_rand(0, 0x0fff) | 0x4000, |
| 684 | + mt_rand(0, 0x3fff) | 0x8000, |
| 685 | + mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)); |
| 686 | + } |
| 687 | + |
| 688 | + return $this->m_uid; |
| 689 | + } |
676 | 690 | public function getId() { |
677 | 691 | return $this->m_id; |
678 | 692 | } |
— | — | @@ -920,9 +934,15 @@ |
921 | 935 | // |
922 | 936 | // render node itself |
923 | 937 | // |
924 | | - $res = |
925 | | - '"' . $this->getId() . '" [shape=plaintext,label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">' . $compound . '</TD><TD BORDER="0" WIDTH="80%"></TD><TD ALIGN="RIGHT" BORDER="0" WIDTH="20px"' . $status . '></TD><TD ALIGN="RIGHT" BORDER="0" WIDTH="20px"' . $discussion . '></TD></TR><TR><TD COLSPAN="4" PORT="port1" HREF="[[' . $this->getId() . ']]" TOOLTIP="' . $this->getLabel() .'"><FONT' . $high .'>' . $this->getLabel() . '</FONT></TD> </TR></TABLE>>]; |
926 | | - '; |
| 938 | + if ($this->m_process->m_useHtmlNodes){ |
| 939 | + $res = |
| 940 | + '"' . $this->getId() . '" [shape=plaintext,label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">' . $compound . '</TD><TD BORDER="0" WIDTH="80%"></TD><TD ALIGN="RIGHT" BORDER="0" WIDTH="20px"' . $status . '></TD><TD ALIGN="RIGHT" BORDER="0" WIDTH="20px"' . $discussion . '></TD></TR><TR><TD COLSPAN="4" PORT="port1" HREF="[[' . $this->getId() . ']]" TOOLTIP="' . $this->getLabel() .'"><FONT' . $high .'>' . $this->getLabel() . '</FONT></TD> </TR></TABLE>>]; |
| 941 | + '; |
| 942 | + } else { |
| 943 | + $res = |
| 944 | + '"' . $this->getId() . '"[label="' . $this->getLabel() . '",shape=rect, height=1.5, URL="[[' . $this->getId() . ']]"]; |
| 945 | + '; |
| 946 | + } |
927 | 947 | |
928 | 948 | // |
929 | 949 | // render outgoing node |
— | — | @@ -986,6 +1006,7 @@ |
987 | 1007 | abstract class ProcessEdge{ |
988 | 1008 | |
989 | 1009 | private $m_id; |
| 1010 | + private $m_uid; |
990 | 1011 | |
991 | 1012 | public function getId(){ |
992 | 1013 | if (!isset($this->m_id)){ |
— | — | @@ -995,6 +1016,18 @@ |
996 | 1017 | return $this->m_id; |
997 | 1018 | } |
998 | 1019 | |
| 1020 | + public function getUUID(){ |
| 1021 | + if (!isset($this->m_uid)){ |
| 1022 | + $this->m_uid = sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', |
| 1023 | + mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff), |
| 1024 | + mt_rand(0, 0x0fff) | 0x4000, |
| 1025 | + mt_rand(0, 0x3fff) | 0x8000, |
| 1026 | + mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)); |
| 1027 | + } |
| 1028 | + |
| 1029 | + return $this->m_uid; |
| 1030 | + } |
| 1031 | + |
999 | 1032 | abstract public function getSucc(); |
1000 | 1033 | abstract public function getPred(); |
1001 | 1034 | |