03.08.2013 Views

PTOLEMY II - CiteSeerX

PTOLEMY II - CiteSeerX

PTOLEMY II - CiteSeerX

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

MoML<br />

the three entities. They have ports with arrowheads suggesting direction. There is a single relation,<br />

which shows up visually only as a set of lines and two vertices. The vertices are shown as small diamonds.<br />

A vertex is exactly like a property, except that it has an additional attribute, pathTo, used to link<br />

vertices, and it can be referenced in a link element. Like any other property, it has a class attribute,<br />

which specifies the class implementing the vertex. In Ptolemy <strong>II</strong>, the class for a vertex is typically<br />

ptolemy.moml.Vertex. Like other properties, a vertex can have a value. This value will typically specify<br />

a location for a visual rendition. For example, in Ptolemy <strong>II</strong>, the first vertex above might be given<br />

as<br />

<br />

This indicates that the vertex should be rendered at the location 184.0, 93.0.<br />

Ptolemy <strong>II</strong> uses ordinary MoML properties to specify other visual aspects of a model. First, an<br />

entity can contain a location property, which is a hint to a visual renderer, as follows:<br />

<br />

<br />

<br />

This suggests to the visual renderer that the Ramp actor should be drawn at location 50.0, 50.0.<br />

Ptolemy <strong>II</strong> also supports a powerful and extensible mechanism for specifying the visual rendition<br />

of an entity. Consider the following example:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

The SingletonAttribute class is used to attach an XML description of the rendition, which in this case<br />

is a wide box filled with green. The XML schema used to define the icon is SVG (scalable vector<br />

graphics), which can be found at http://www.w3.org/TR/SVG/. 9<br />

9. Currently, the Diva graphics infrastructure, which is used by Vergil to render these icons, only supports a small<br />

subset of SVG. Eventually, we hope it will support the full specification.<br />

212 Ptolemy <strong>II</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!