Ejemplo n.º 1
0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Author: Charles Y. Choi

# This example is drawn from the example from the UMLGraph documentation
# http://umlgraph.org/doc/uml-appa.html

from sequenceplot import SequenceObject, Placeholder, SequenceDiagram

# declare objects
e = Placeholder()
t = SequenceObject("t:thread")
o = SequenceObject(":Toolkit")
p = Placeholder()

diagram = SequenceDiagram([e, t, o, p])
diagram.setParam('objectSpacing', 1.75)

# use pushMethod() to nest activations
e.pushMethod(t, "a1: run(3)")
t.pushMethod(o, "run()")
o.callMethod(o, "callbackLoop()")

o.createInstance(p, "p:Peer")
o.callMethod(p, "handleExpose()", "", responseSync=True)
o.destroyInstance(p)
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Author: Charles Y. Choi

# This example is drawn from the example from the UMLGraph documentation
# http://umlgraph.org/doc/uml-appa.html

from sequenceplot import SequenceObject, Placeholder, SequenceDiagram

# declare objects

s = SequenceObject('s:Caller')
w = SequenceObject(':Switch')
c = Placeholder()
r = SequenceObject('r:Caller')

diagram = SequenceDiagram([s, w, c, r])
diagram.setParam('objectSpacing', 0.5)

diagram.step()
w.active()
diagram.async()

s.message(w, 'liftReceiver')
diagram.sync()
w.message(s, 'setDialTone()')
diagram.async()
s.message(w, '*dialDigit(d)')
w.lconstraint('{dialing.executionTime < 30s}')
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Author: Charles Y. Choi

# This example is drawn from the example from the UMLGraph documentation
# http://umlgraph.org/doc/uml-appa.html

from sequenceplot import SequenceObject, Placeholder, SequenceDiagram

# declare objects
x = Placeholder()
t = Placeholder()
c = Placeholder()
a1 = Placeholder()
a2 = Placeholder()

diagram = SequenceDiagram([x, t, c, a1, a2])
diagram.setParam('boxWidth', 1.0)
diagram.setParam('diagramWidth', 14)

x.createInstance(t, "a:Transaction", sync=False)
t.active()
t.createInstance(c, "a:TransCoord", sync=False)
t.inactive()

c.active()
Ejemplo n.º 4
0
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Author: Charles Y. Choi

# This example is drawn from the example from the UMLGraph documentation
# http://umlgraph.org/doc/uml-appa.html

from sequenceplot import SequenceObject, Placeholder, SequenceDiagram

# declare objects

c = SequenceObject('c:Client')
t = Placeholder()
p = SequenceObject('p:ODBCProxy')

diagram = SequenceDiagram([c, t, p])
diagram.params.boxWidth = 1.1
diagram.params.objectSpacing = 0.5

diagram.step()
c.active()
c.createInstance(t, ':Transaction')
diagram.oconstraint('{Transient}')

c.pushMethod(t, "setActions(a,d,o)")

diagram.sync()