Author: sb
Date: Mon Feb 11 08:55:48 2008
New Revision: 7328

Log:
- Implement node highlighting.

Added:
    trunk/Workflow/tests/data/StartEnd2.dot
      - copied, changed from r7326, trunk/Workflow/tests/data/StartEnd.dot
Modified:
    trunk/Workflow/ChangeLog
    trunk/Workflow/src/visitors/visualization.php
    trunk/Workflow/tests/data/AddVariables.dot
    trunk/Workflow/tests/data/DecrementingLoop.dot
    trunk/Workflow/tests/data/ExclusiveChoiceSimpleMerge.dot
    
trunk/Workflow/tests/data/ExclusiveChoiceWithUnconditionalOutNodeSimpleMerge.dot
    trunk/Workflow/tests/data/IncrementingLoop.dot
    trunk/Workflow/tests/data/MultiChoiceDiscriminator.dot
    trunk/Workflow/tests/data/MultiChoiceSynchronizingMerge.dot
    trunk/Workflow/tests/data/NestedExclusiveChoiceSimpleMerge.dot
    trunk/Workflow/tests/data/NestedLoops.dot
    
trunk/Workflow/tests/data/ParallelSplitActionActionCancelCaseSynchronization.dot
    
trunk/Workflow/tests/data/ParallelSplitCancelCaseActionActionSynchronization.dot
    trunk/Workflow/tests/data/ParallelSplitSynchronization.dot
    trunk/Workflow/tests/data/ParallelSplitSynchronization2.dot
    trunk/Workflow/tests/data/SetAddSubMulDiv.dot
    trunk/Workflow/tests/data/StartEnd.dot
    trunk/Workflow/tests/data/StartInputEnd.dot
    trunk/Workflow/tests/data/StartSetEnd.dot
    trunk/Workflow/tests/data/StartSetUnsetEnd.dot
    trunk/Workflow/tests/data/StartSetUnsetEnd_1.dot
    trunk/Workflow/tests/data/VariableEqualsVariable.dot
    
trunk/Workflow/tests/data/WorkflowWithSubWorkflowParallelSplitActionActionCancelCaseSynchronization.dot
    trunk/Workflow/tests/data/WorkflowWithSubWorkflowStartEnd.dot
    trunk/Workflow/tests/visitor_visualization_test.php

Modified: trunk/Workflow/ChangeLog
==============================================================================
--- trunk/Workflow/ChangeLog [iso-8859-1] (original)
+++ trunk/Workflow/ChangeLog [iso-8859-1] Mon Feb 11 08:55:48 2008
@@ -2,6 +2,8 @@
 
 - Implemented issue #12404: Separate file i/o from XML processing in
   ezcWorkflowDefinitionStorageXml.
+
+- The visualization visitor can now highlight a set of nodes.
 
 1.1 - Monday 17 December 2007
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Modified: trunk/Workflow/src/visitors/visualization.php
==============================================================================
--- trunk/Workflow/src/visitors/visualization.php [iso-8859-1] (original)
+++ trunk/Workflow/src/visitors/visualization.php [iso-8859-1] Mon Feb 11 
08:55:48 2008
@@ -18,12 +18,25 @@
  *  print $visitor;
  * </code>
  *
+ * @property string $colorHighlighted Color used for active nodes.
+ * @property string $colorNormal      Color used for inactive nodes.
+ *
  * @package Workflow
  * @version //autogen//
  */
 class ezcWorkflowVisitorVisualization implements ezcWorkflowVisitor
 {
     /**
+     * Container to hold the properties.
+     *
+     * @var array(string=>mixed)
+     */
+    protected $properties = array(
+      'colorHighlighted' => '#204a87',
+      'colorNormal'      => '#2e3436'
+    );
+
+    /**
      * Holds the displayed strings for each of the nodes.
      *
      * @var array(string => string)
@@ -45,11 +58,100 @@
     protected $visited = array();
 
     /**
-     * The name of the workflow.
+     * Holds the name of the workflow.
      *
      * @var string
      */
     protected $workflowName = 'Workflow';
+
+    /**
+     * Holds the nodes that are to be highlighted.
+     *
+     * @var array
+     */
+    protected $highlightedNodes = array();
+
+    /**
+     * Constructor.
+     *
+     * @param array $highlightedNodes Array of nodes that should be 
highlighted.
+     */
+    public function __construct( array $highlightedNodes = array() )
+    {
+        $this->highlightedNodes = $highlightedNodes;
+    }
+
+    /**
+     * Property read access.
+     *
+     * @throws ezcBasePropertyNotFoundException 
+     *         If the the desired property is not found.
+     * 
+     * @param string $propertyName Name of the property.
+     * @return mixed Value of the property or null.
+     * @ignore
+     */
+    public function __get( $propertyName )
+    {
+        switch ( $propertyName ) 
+        {
+            case 'colorHighlighted':
+            case 'colorNormal':
+                return $this->properties[$propertyName];
+        }
+
+        throw new ezcBasePropertyNotFoundException( $propertyName );
+    }
+
+    /**
+     * Property write access.
+     * 
+     * @param string $propertyName Name of the property.
+     * @param mixed $val  The value for the property.
+     *
+     * @throws ezcBaseValueException 
+     *         If the value for the property colorHighlighted is not a string.
+     * @throws ezcBaseValueException 
+     *         If the value for the property colorNormal is not a string.
+     * @ignore
+     */
+    public function __set( $propertyName, $val )
+    {
+        switch ( $propertyName ) 
+        {
+            case 'colorHighlighted':
+            case 'colorNormal':
+                if ( !is_string( $val ) )
+                {
+                    throw new ezcBaseValueException( $propertyName, $val, 
'string' );
+                }
+
+                $this->properties[$propertyName] = $val;
+
+                return;
+        }
+
+        throw new ezcBasePropertyNotFoundException( $propertyName );
+    }
+ 
+    /**
+     * Property isset access.
+     * 
+     * @param string $propertyName Name of the property.
+     * @return bool True is the property is set, otherwise false.
+     * @ignore
+     */
+    public function __isset( $propertyName )
+    {
+        switch ( $propertyName )
+        {
+            case 'colorHighlighted':
+            case 'colorNormal':
+                return true;
+        }
+
+        return false;
+    }
 
     /**
      * Visits the node and sets the the member variables according to the node
@@ -81,9 +183,21 @@
 
             $this->visited[$id] = true;
 
-            if ( !isset( $this->nodes[ $id ] ) )
-            {
-                $this->nodes[ $id ] = $visitable->__toString();
+            if ( in_array( $id, $this->highlightedNodes ) )
+            {
+                $color = $this->properties['colorHighlighted'];
+            }
+            else
+            {
+                $color = $this->properties['colorNormal'];
+            }
+
+            if ( !isset( $this->nodes[$id] ) )
+            {
+                $this->nodes[$id] = array(
+                  'label' => $visitable->__toString(),
+                  'color' => $color
+                );
             }
 
             $outNodes = array();
@@ -105,7 +219,7 @@
                 $outNodes[] = array( $outNode->getId(), $label );
             }
 
-            $this->edges[ $id ] = $outNodes;
+            $this->edges[$id] = $outNodes;
         }
 
         return true;
@@ -121,12 +235,13 @@
     {
         $dot = 'digraph ' . $this->workflowName . " {\n";
 
-        foreach ( $this->nodes as $key => $value )
+        foreach ( $this->nodes as $key => $data )
         {
             $dot .= sprintf(
-              "node%s [label=\"%s\"]\n",
+              "node%s [label=\"%s\", color=\"%s\"]\n",
               $key,
-              $value
+              $data['label'],
+              $data['color']
             );
         }
 

Modified: trunk/Workflow/tests/data/AddVariables.dot
==============================================================================
--- trunk/Workflow/tests/data/AddVariables.dot [iso-8859-1] (original)
+++ trunk/Workflow/tests/data/AddVariables.dot [iso-8859-1] Mon Feb 11 08:55:48 
2008
@@ -1,8 +1,8 @@
 digraph AddVariables {
-node1 [label="Start"]
-node2 [label="a = 1, b = 1"]
-node3 [label="b += a"]
-node4 [label="End"]
+node1 [label="Start", color="#2e3436"]
+node2 [label="a = 1, b = 1", color="#2e3436"]
+node3 [label="b += a", color="#2e3436"]
+node4 [label="End", color="#2e3436"]
 
 node1 -> node2
 node2 -> node3

Modified: trunk/Workflow/tests/data/DecrementingLoop.dot
==============================================================================
--- trunk/Workflow/tests/data/DecrementingLoop.dot [iso-8859-1] (original)
+++ trunk/Workflow/tests/data/DecrementingLoop.dot [iso-8859-1] Mon Feb 11 
08:55:48 2008
@@ -1,9 +1,9 @@
 digraph DecrementingLoop {
-node1 [label="Start"]
-node2 [label="i = 10"]
-node3 [label="Loop"]
-node4 [label="i--"]
-node5 [label="End"]
+node1 [label="Start", color="#2e3436"]
+node2 [label="i = 10", color="#2e3436"]
+node3 [label="Loop", color="#2e3436"]
+node4 [label="i--", color="#2e3436"]
+node5 [label="End", color="#2e3436"]
 
 node1 -> node2
 node2 -> node3

Modified: trunk/Workflow/tests/data/ExclusiveChoiceSimpleMerge.dot
==============================================================================
--- trunk/Workflow/tests/data/ExclusiveChoiceSimpleMerge.dot [iso-8859-1] 
(original)
+++ trunk/Workflow/tests/data/ExclusiveChoiceSimpleMerge.dot [iso-8859-1] Mon 
Feb 11 08:55:48 2008
@@ -1,10 +1,10 @@
 digraph ExclusiveChoiceSimpleMerge {
-node1 [label="Start"]
-node2 [label="Exclusive Choice"]
-node3 [label=""]
-node4 [label="Simple Merge"]
-node5 [label="End"]
-node6 [label=""]
+node1 [label="Start", color="#2e3436"]
+node2 [label="Exclusive Choice", color="#2e3436"]
+node3 [label="", color="#2e3436"]
+node4 [label="Simple Merge", color="#2e3436"]
+node5 [label="End", color="#2e3436"]
+node6 [label="", color="#2e3436"]
 
 node1 -> node2
 node2 -> node3 [label="condition is true"]

Modified: 
trunk/Workflow/tests/data/ExclusiveChoiceWithUnconditionalOutNodeSimpleMerge.dot
==============================================================================
--- 
trunk/Workflow/tests/data/ExclusiveChoiceWithUnconditionalOutNodeSimpleMerge.dot
 [iso-8859-1] (original)
+++ 
trunk/Workflow/tests/data/ExclusiveChoiceWithUnconditionalOutNodeSimpleMerge.dot
 [iso-8859-1] Mon Feb 11 08:55:48 2008
@@ -1,11 +1,11 @@
 digraph ExclusiveChoiceWithUnconditionalOutNodeSimpleMerge {
-node1 [label="Start"]
-node2 [label="Exclusive Choice"]
-node3 [label="x = <true>"]
-node4 [label="Simple Merge"]
-node5 [label="End"]
-node6 [label="y = <true>"]
-node7 [label="z = <true>"]
+node1 [label="Start", color="#2e3436"]
+node2 [label="Exclusive Choice", color="#2e3436"]
+node3 [label="x = <true>", color="#2e3436"]
+node4 [label="Simple Merge", color="#2e3436"]
+node5 [label="End", color="#2e3436"]
+node6 [label="y = <true>", color="#2e3436"]
+node7 [label="z = <true>", color="#2e3436"]
 
 node1 -> node2
 node2 -> node3 [label="condition is true"]

Modified: trunk/Workflow/tests/data/IncrementingLoop.dot
==============================================================================
--- trunk/Workflow/tests/data/IncrementingLoop.dot [iso-8859-1] (original)
+++ trunk/Workflow/tests/data/IncrementingLoop.dot [iso-8859-1] Mon Feb 11 
08:55:48 2008
@@ -1,9 +1,9 @@
 digraph IncrementingLoop {
-node1 [label="Start"]
-node2 [label="i = 1"]
-node3 [label="Loop"]
-node4 [label="i++"]
-node5 [label="End"]
+node1 [label="Start", color="#2e3436"]
+node2 [label="i = 1", color="#2e3436"]
+node3 [label="Loop", color="#2e3436"]
+node4 [label="i++", color="#2e3436"]
+node5 [label="End", color="#2e3436"]
 
 node1 -> node2
 node2 -> node3

Modified: trunk/Workflow/tests/data/MultiChoiceDiscriminator.dot
==============================================================================
--- trunk/Workflow/tests/data/MultiChoiceDiscriminator.dot [iso-8859-1] 
(original)
+++ trunk/Workflow/tests/data/MultiChoiceDiscriminator.dot [iso-8859-1] Mon Feb 
11 08:55:48 2008
@@ -1,12 +1,12 @@
 digraph MultiChoiceDiscriminator {
-node1 [label="Start"]
-node2 [label="x = 1, y = 2"]
-node3 [label="Multi Choice"]
-node4 [label=""]
-node5 [label="Discriminator"]
-node6 [label="End"]
-node7 [label=""]
-node8 [label=""]
+node1 [label="Start", color="#2e3436"]
+node2 [label="x = 1, y = 2", color="#2e3436"]
+node3 [label="Multi Choice", color="#2e3436"]
+node4 [label="", color="#2e3436"]
+node5 [label="Discriminator", color="#2e3436"]
+node6 [label="End", color="#2e3436"]
+node7 [label="", color="#2e3436"]
+node8 [label="", color="#2e3436"]
 
 node1 -> node2
 node2 -> node3

Modified: trunk/Workflow/tests/data/MultiChoiceSynchronizingMerge.dot
==============================================================================
--- trunk/Workflow/tests/data/MultiChoiceSynchronizingMerge.dot [iso-8859-1] 
(original)
+++ trunk/Workflow/tests/data/MultiChoiceSynchronizingMerge.dot [iso-8859-1] 
Mon Feb 11 08:55:48 2008
@@ -1,12 +1,12 @@
 digraph MultiChoiceSynchronizingMerge {
-node1 [label="Start"]
-node2 [label="x = 1, y = 2"]
-node3 [label="Multi Choice"]
-node4 [label=""]
-node5 [label="Synchronizing Merge"]
-node6 [label="End"]
-node7 [label=""]
-node8 [label=""]
+node1 [label="Start", color="#2e3436"]
+node2 [label="x = 1, y = 2", color="#2e3436"]
+node3 [label="Multi Choice", color="#2e3436"]
+node4 [label="", color="#2e3436"]
+node5 [label="Synchronizing Merge", color="#2e3436"]
+node6 [label="End", color="#2e3436"]
+node7 [label="", color="#2e3436"]
+node8 [label="", color="#2e3436"]
 
 node1 -> node2
 node2 -> node3

Modified: trunk/Workflow/tests/data/NestedExclusiveChoiceSimpleMerge.dot
==============================================================================
--- trunk/Workflow/tests/data/NestedExclusiveChoiceSimpleMerge.dot [iso-8859-1] 
(original)
+++ trunk/Workflow/tests/data/NestedExclusiveChoiceSimpleMerge.dot [iso-8859-1] 
Mon Feb 11 08:55:48 2008
@@ -1,15 +1,15 @@
 digraph NestedExclusiveChoiceSimpleMerge {
-node1 [label="Start"]
-node2 [label="x = <true>"]
-node3 [label="Exclusive Choice"]
-node4 [label="y = <true>"]
-node5 [label="Exclusive Choice"]
-node6 [label="z = <true>"]
-node7 [label="Simple Merge"]
-node8 [label="Simple Merge"]
-node9 [label="End"]
-node10 [label="z = <false>"]
-node11 [label="z = <false>"]
+node1 [label="Start", color="#2e3436"]
+node2 [label="x = <true>", color="#2e3436"]
+node3 [label="Exclusive Choice", color="#2e3436"]
+node4 [label="y = <true>", color="#2e3436"]
+node5 [label="Exclusive Choice", color="#2e3436"]
+node6 [label="z = <true>", color="#2e3436"]
+node7 [label="Simple Merge", color="#2e3436"]
+node8 [label="Simple Merge", color="#2e3436"]
+node9 [label="End", color="#2e3436"]
+node10 [label="z = <false>", color="#2e3436"]
+node11 [label="z = <false>", color="#2e3436"]
 
 node1 -> node2
 node2 -> node3

Modified: trunk/Workflow/tests/data/NestedLoops.dot
==============================================================================
--- trunk/Workflow/tests/data/NestedLoops.dot [iso-8859-1] (original)
+++ trunk/Workflow/tests/data/NestedLoops.dot [iso-8859-1] Mon Feb 11 08:55:48 
2008
@@ -1,12 +1,12 @@
 digraph NestedLoops {
-node1 [label="Start"]
-node2 [label="i = 1"]
-node3 [label="Loop"]
-node4 [label="j = 1"]
-node5 [label="Loop"]
-node6 [label="j++"]
-node7 [label="i++"]
-node8 [label="End"]
+node1 [label="Start", color="#2e3436"]
+node2 [label="i = 1", color="#2e3436"]
+node3 [label="Loop", color="#2e3436"]
+node4 [label="j = 1", color="#2e3436"]
+node5 [label="Loop", color="#2e3436"]
+node6 [label="j++", color="#2e3436"]
+node7 [label="i++", color="#2e3436"]
+node8 [label="End", color="#2e3436"]
 
 node1 -> node2
 node2 -> node3

Modified: 
trunk/Workflow/tests/data/ParallelSplitActionActionCancelCaseSynchronization.dot
==============================================================================
--- 
trunk/Workflow/tests/data/ParallelSplitActionActionCancelCaseSynchronization.dot
 [iso-8859-1] (original)
+++ 
trunk/Workflow/tests/data/ParallelSplitActionActionCancelCaseSynchronization.dot
 [iso-8859-1] Mon Feb 11 08:55:48 2008
@@ -1,12 +1,12 @@
 digraph ParallelSplitActionActionCancelCaseSynchronization {
-node1 [label="Start"]
-node2 [label=""]
-node3 [label="Parallel Split"]
-node4 [label=""]
-node5 [label="Synchronization"]
-node6 [label="End"]
-node7 [label=""]
-node8 [label="Cancel"]
+node1 [label="Start", color="#2e3436"]
+node2 [label="", color="#2e3436"]
+node3 [label="Parallel Split", color="#2e3436"]
+node4 [label="", color="#2e3436"]
+node5 [label="Synchronization", color="#2e3436"]
+node6 [label="End", color="#2e3436"]
+node7 [label="", color="#2e3436"]
+node8 [label="Cancel", color="#2e3436"]
 
 node1 -> node2
 node2 -> node3

Modified: 
trunk/Workflow/tests/data/ParallelSplitCancelCaseActionActionSynchronization.dot
==============================================================================
--- 
trunk/Workflow/tests/data/ParallelSplitCancelCaseActionActionSynchronization.dot
 [iso-8859-1] (original)
+++ 
trunk/Workflow/tests/data/ParallelSplitCancelCaseActionActionSynchronization.dot
 [iso-8859-1] Mon Feb 11 08:55:48 2008
@@ -1,12 +1,12 @@
 digraph ParallelSplitCancelCaseActionActionSynchronization {
-node1 [label="Start"]
-node2 [label=""]
-node3 [label="Parallel Split"]
-node4 [label="Cancel"]
-node5 [label="Synchronization"]
-node6 [label="End"]
-node7 [label=""]
-node8 [label=""]
+node1 [label="Start", color="#2e3436"]
+node2 [label="", color="#2e3436"]
+node3 [label="Parallel Split", color="#2e3436"]
+node4 [label="Cancel", color="#2e3436"]
+node5 [label="Synchronization", color="#2e3436"]
+node6 [label="End", color="#2e3436"]
+node7 [label="", color="#2e3436"]
+node8 [label="", color="#2e3436"]
 
 node1 -> node2
 node2 -> node3

Modified: trunk/Workflow/tests/data/ParallelSplitSynchronization.dot
==============================================================================
--- trunk/Workflow/tests/data/ParallelSplitSynchronization.dot [iso-8859-1] 
(original)
+++ trunk/Workflow/tests/data/ParallelSplitSynchronization.dot [iso-8859-1] Mon 
Feb 11 08:55:48 2008
@@ -1,11 +1,11 @@
 digraph ParallelSplitSynchronization {
-node1 [label="Start"]
-node2 [label="Parallel Split"]
-node3 [label=""]
-node4 [label="Synchronization"]
-node5 [label="End"]
-node6 [label=""]
-node7 [label=""]
+node1 [label="Start", color="#2e3436"]
+node2 [label="Parallel Split", color="#2e3436"]
+node3 [label="", color="#2e3436"]
+node4 [label="Synchronization", color="#2e3436"]
+node5 [label="End", color="#2e3436"]
+node6 [label="", color="#2e3436"]
+node7 [label="", color="#2e3436"]
 
 node1 -> node2
 node2 -> node3

Modified: trunk/Workflow/tests/data/ParallelSplitSynchronization2.dot
==============================================================================
--- trunk/Workflow/tests/data/ParallelSplitSynchronization2.dot [iso-8859-1] 
(original)
+++ trunk/Workflow/tests/data/ParallelSplitSynchronization2.dot [iso-8859-1] 
Mon Feb 11 08:55:48 2008
@@ -1,10 +1,10 @@
 digraph ParallelSplitSynchronization2 {
-node1 [label="Start"]
-node2 [label="Parallel Split"]
-node3 [label="Input"]
-node4 [label="Synchronization"]
-node5 [label="End"]
-node6 [label="Input"]
+node1 [label="Start", color="#2e3436"]
+node2 [label="Parallel Split", color="#2e3436"]
+node3 [label="Input", color="#2e3436"]
+node4 [label="Synchronization", color="#2e3436"]
+node5 [label="End", color="#2e3436"]
+node6 [label="Input", color="#2e3436"]
 
 node1 -> node2
 node2 -> node3

Modified: trunk/Workflow/tests/data/SetAddSubMulDiv.dot
==============================================================================
--- trunk/Workflow/tests/data/SetAddSubMulDiv.dot [iso-8859-1] (original)
+++ trunk/Workflow/tests/data/SetAddSubMulDiv.dot [iso-8859-1] Mon Feb 11 
08:55:48 2008
@@ -1,11 +1,11 @@
 digraph SetAddSubMulDiv {
-node1 [label="Start"]
-node2 [label="x = 1"]
-node3 [label="x += 1"]
-node4 [label="x -= 1"]
-node5 [label="x *= 2"]
-node6 [label="x /= 2"]
-node7 [label="End"]
+node1 [label="Start", color="#2e3436"]
+node2 [label="x = 1", color="#2e3436"]
+node3 [label="x += 1", color="#2e3436"]
+node4 [label="x -= 1", color="#2e3436"]
+node5 [label="x *= 2", color="#2e3436"]
+node6 [label="x /= 2", color="#2e3436"]
+node7 [label="End", color="#2e3436"]
 
 node1 -> node2
 node2 -> node3

Modified: trunk/Workflow/tests/data/StartEnd.dot
==============================================================================
--- trunk/Workflow/tests/data/StartEnd.dot [iso-8859-1] (original)
+++ trunk/Workflow/tests/data/StartEnd.dot [iso-8859-1] Mon Feb 11 08:55:48 2008
@@ -1,6 +1,6 @@
 digraph StartEnd {
-node1 [label="Start"]
-node2 [label="End"]
+node1 [label="Start", color="#2e3436"]
+node2 [label="End", color="#2e3436"]
 
 node1 -> node2
 }

Copied: trunk/Workflow/tests/data/StartEnd2.dot (from r7326, 
trunk/Workflow/tests/data/StartEnd.dot)
==============================================================================
--- trunk/Workflow/tests/data/StartEnd.dot [iso-8859-1] (original)
+++ trunk/Workflow/tests/data/StartEnd2.dot [iso-8859-1] Mon Feb 11 08:55:48 
2008
@@ -1,6 +1,6 @@
 digraph StartEnd {
-node1 [label="Start"]
-node2 [label="End"]
+node1 [label="Start", color="#204a87"]
+node2 [label="End", color="#2e3436"]
 
 node1 -> node2
 }

Modified: trunk/Workflow/tests/data/StartInputEnd.dot
==============================================================================
--- trunk/Workflow/tests/data/StartInputEnd.dot [iso-8859-1] (original)
+++ trunk/Workflow/tests/data/StartInputEnd.dot [iso-8859-1] Mon Feb 11 
08:55:48 2008
@@ -1,7 +1,7 @@
 digraph StartInputEnd {
-node1 [label="Start"]
-node2 [label="Input"]
-node3 [label="End"]
+node1 [label="Start", color="#2e3436"]
+node2 [label="Input", color="#2e3436"]
+node3 [label="End", color="#2e3436"]
 
 node1 -> node2
 node2 -> node3

Modified: trunk/Workflow/tests/data/StartSetEnd.dot
==============================================================================
--- trunk/Workflow/tests/data/StartSetEnd.dot [iso-8859-1] (original)
+++ trunk/Workflow/tests/data/StartSetEnd.dot [iso-8859-1] Mon Feb 11 08:55:48 
2008
@@ -1,7 +1,7 @@
 digraph StartSetEnd {
-node1 [label="Start"]
-node2 [label="null = <null>, true = <true>, false = <false>, array = <array>, 
object = <stdClass>"]
-node3 [label="End"]
+node1 [label="Start", color="#2e3436"]
+node2 [label="null = <null>, true = <true>, false = <false>, array = <array>, 
object = <stdClass>", color="#2e3436"]
+node3 [label="End", color="#2e3436"]
 
 node1 -> node2
 node2 -> node3

Modified: trunk/Workflow/tests/data/StartSetUnsetEnd.dot
==============================================================================
--- trunk/Workflow/tests/data/StartSetUnsetEnd.dot [iso-8859-1] (original)
+++ trunk/Workflow/tests/data/StartSetUnsetEnd.dot [iso-8859-1] Mon Feb 11 
08:55:48 2008
@@ -1,8 +1,8 @@
 digraph StartSetUnsetEnd {
-node1 [label="Start"]
-node2 [label="x = 1"]
-node3 [label="unset(x)"]
-node4 [label="End"]
+node1 [label="Start", color="#2e3436"]
+node2 [label="x = 1", color="#2e3436"]
+node3 [label="unset(x)", color="#2e3436"]
+node4 [label="End", color="#2e3436"]
 
 node1 -> node2
 node2 -> node3

Modified: trunk/Workflow/tests/data/StartSetUnsetEnd_1.dot
==============================================================================
--- trunk/Workflow/tests/data/StartSetUnsetEnd_1.dot [iso-8859-1] (original)
+++ trunk/Workflow/tests/data/StartSetUnsetEnd_1.dot [iso-8859-1] Mon Feb 11 
08:55:48 2008
@@ -1,8 +1,8 @@
 digraph StartSetUnsetEnd {
-node1 [label="Start"]
-node3 [label="x = 1"]
-node4 [label="unset(x)"]
-node2 [label="End"]
+node1 [label="Start", color="#2e3436"]
+node3 [label="x = 1", color="#2e3436"]
+node4 [label="unset(x)", color="#2e3436"]
+node2 [label="End", color="#2e3436"]
 
 node1 -> node3
 node3 -> node4

Modified: trunk/Workflow/tests/data/VariableEqualsVariable.dot
==============================================================================
--- trunk/Workflow/tests/data/VariableEqualsVariable.dot [iso-8859-1] (original)
+++ trunk/Workflow/tests/data/VariableEqualsVariable.dot [iso-8859-1] Mon Feb 
11 08:55:48 2008
@@ -1,11 +1,11 @@
 digraph VariableEqualsVariable {
-node1 [label="Start"]
-node2 [label="a = 1, b = 1"]
-node3 [label="Exclusive Choice"]
-node4 [label="c = 1"]
-node5 [label="Simple Merge"]
-node6 [label="End"]
-node7 [label="c = 0"]
+node1 [label="Start", color="#2e3436"]
+node2 [label="a = 1, b = 1", color="#2e3436"]
+node3 [label="Exclusive Choice", color="#2e3436"]
+node4 [label="c = 1", color="#2e3436"]
+node5 [label="Simple Merge", color="#2e3436"]
+node6 [label="End", color="#2e3436"]
+node7 [label="c = 0", color="#2e3436"]
 
 node1 -> node2
 node2 -> node3

Modified: 
trunk/Workflow/tests/data/WorkflowWithSubWorkflowParallelSplitActionActionCancelCaseSynchronization.dot
==============================================================================
--- 
trunk/Workflow/tests/data/WorkflowWithSubWorkflowParallelSplitActionActionCancelCaseSynchronization.dot
 [iso-8859-1] (original)
+++ 
trunk/Workflow/tests/data/WorkflowWithSubWorkflowParallelSplitActionActionCancelCaseSynchronization.dot
 [iso-8859-1] Mon Feb 11 08:55:48 2008
@@ -1,7 +1,7 @@
 digraph 
WorkflowWithSubWorkflowParallelSplitActionActionCancelCaseSynchronization {
-node1 [label="Start"]
-node2 [label="Sub Workflow: 
ParallelSplitActionActionCancelCaseSynchronization"]
-node3 [label="End"]
+node1 [label="Start", color="#2e3436"]
+node2 [label="Sub Workflow: 
ParallelSplitActionActionCancelCaseSynchronization", color="#2e3436"]
+node3 [label="End", color="#2e3436"]
 
 node1 -> node2
 node2 -> node3

Modified: trunk/Workflow/tests/data/WorkflowWithSubWorkflowStartEnd.dot
==============================================================================
--- trunk/Workflow/tests/data/WorkflowWithSubWorkflowStartEnd.dot [iso-8859-1] 
(original)
+++ trunk/Workflow/tests/data/WorkflowWithSubWorkflowStartEnd.dot [iso-8859-1] 
Mon Feb 11 08:55:48 2008
@@ -1,7 +1,7 @@
 digraph WorkflowWithSubWorkflowStartEnd {
-node1 [label="Start"]
-node2 [label="Sub Workflow: StartEnd"]
-node3 [label="End"]
+node1 [label="Start", color="#2e3436"]
+node2 [label="Sub Workflow: StartEnd", color="#2e3436"]
+node3 [label="End", color="#2e3436"]
 
 node1 -> node2
 node2 -> node3

Modified: trunk/Workflow/tests/visitor_visualization_test.php
==============================================================================
--- trunk/Workflow/tests/visitor_visualization_test.php [iso-8859-1] (original)
+++ trunk/Workflow/tests/visitor_visualization_test.php [iso-8859-1] Mon Feb 11 
08:55:48 2008
@@ -40,6 +40,19 @@
         );
     }
 
+    public function testVisitStartEnd2()
+    {
+        $this->visitor = new ezcWorkflowVisitorVisualization( array( 1 ) );
+
+        $this->setUpStartEnd();
+        $this->workflow->accept( $this->visitor );
+
+        $this->assertEquals(
+          $this->readExpected( 'StartEnd2' ),
+          $this->visitor->__toString()
+        );
+    }
+
     public function testVisitStartInputEnd()
     {
         $this->setUpStartInputEnd();
@@ -258,6 +271,64 @@
           $this->readExpected( 
'ParallelSplitActionActionCancelCaseSynchronization' ),
           $this->visitor->__toString()
         );
+    }
+
+    public function testProperties()
+    {
+        $this->assertTrue( isset( $this->visitor->colorHighlighted ) );
+        $this->assertTrue( isset( $this->visitor->colorNormal ) );
+        $this->assertFalse( isset( $this->visitor->foo ) );
+
+        $this->assertEquals( '#204a87', $this->visitor->colorHighlighted );
+        $this->assertEquals( '#2e3436', $this->visitor->colorNormal );
+
+        $this->visitor->colorHighlighted   = '#2e3436';
+        $this->visitor->colorNormal = '#204a87';
+
+        $this->assertEquals( '#2e3436', $this->visitor->colorHighlighted );
+        $this->assertEquals( '#204a87', $this->visitor->colorNormal );
+    }
+
+    public function testProperties2()
+    {
+        try
+        {
+            $foo = $this->visitor->foo;
+        }
+        catch ( ezcBasePropertyNotFoundException $e )
+        {
+            return;
+        }
+
+        $this->fail();
+    }
+
+    public function testProperties3()
+    {
+        try
+        {
+            $this->visitor->foo = 'foo';
+        }
+        catch ( ezcBasePropertyNotFoundException $e )
+        {
+            return;
+        }
+
+        $this->fail();
+    }
+
+    public function testProperties4()
+    {
+        try
+        {
+            $this->visitor->colorHighlighted = null;
+        }
+        catch ( ezcBaseValueException $e )
+        {
+            return;
+        }
+
+        $this->fail();
     }
 
     protected function readExpected( $name )


-- 
svn-components mailing list
[EMAIL PROTECTED]
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to