Home| Printable Version
A pattern consists of a series of nodes that can interact with each other. Once we have created a pattern file, we need to create these nodes and define any links between them. This is achieved using the Pattern Viewer screen, which uses a graphical view to make the process as easy as possible. Screen shot of the XDE pattern viewer screen The top part of the screen shows us the pattern that we are working on, and the current description for this pattern. We can change the description on this page, but we cannot change the name. See the previous section for details of how to rename a pattern. The main area of the screen contains a canvas for us to create our pattern on. If we are creating a new pattern this will be empty, but otherwise it will show the current structure of our pattern. Each node will be represented by a symbol accompanied by the node name. Each interaction is shown by an arrow from the source to the target node.
The controls on the left allow us to choose the editing mode, and they are described below. The current mode is always highlighted in blue:
The default mode, move node, can be accessed by clicking Move under NODE on the control bar. This mode allows us to position our nodes at the required location on the canvas. To move a node simply click and drag the node symbol to the desired position. To add a node to the pattern, we need to be in the add node mode. This is achieved by clicking Add under NODE on the control bar. We add the node by clicking where we would like it to be positioned on the canvas. We will be prompted to provide an id for the new node, which must be unique within the pattern. The name for the node will also default to this id, but this can be changed later (See changing node and action information). Once we have entered an id, a new node symbol will appear showing the location of the new node. The delete node mode allows us to remove nodes from the pattern. This mode is accessed by clicking Delete under NODE on the control bar, and we remove a node by simply clicking on it. This will also automatically remove any links between this node and other nodes in the pattern. The add link mode allows us to specify links or interactions between nodes. With each link we are saying that, at runtime, it is possible for the source node of the link to call the target node as necessary. We can activate this mode in a similar way by selecting Add under LINK on the control bar. To add a link between two nodes, click and drag from the source node to the target node. While we are doing this, we will see an arrow to show where the interaction will be defined. When we release the arrow on the target node, the link will be created and we will be taken to the Action Selection screen. This allows us to select which actions could be called on the target node from the source node. Select the appropriate actions using the checkboxes and click back to save the details. If we have not yet defined any actions for the target node (see changing node and action information) the list will be empty, and we will need to edit this link once an action has been defined. To delete a link, we need to first enter delete link mode by selecting Delete under LINK on the control bar, and then we click on the arrow that represents the link we wish to delete. The edit link mode allows us to alter the actions that can be called for a particular link. Selecting this mode and then clicking on the arrow for a particular link will show the Action Selection screen. Check the required actions and click back to save the changes.
Clicking RESET on the control bar will reset the pattern structure to how it was when the page was last loaded. Going to the Action Selection screen will cause the page to be reloaded, so we will not be able to undo the previous changes. Double-clicking on a particular node will allow us to edit the details for that node on the Node Viewer screen. This is described in the next section, changing node and action information. It is also possible to define a default image for the pattern on this screen. This image will then be use whenever a runtime pattern cloned from this pattern is displayed on the graphical diagrams within the studio. If you do not define an image here, then the image used will be determined from the project layer into which the runtime pattern is eventually included.
Listing Patterns Changing Node and Action Information