# This code was generated by dot2ruby.g

require 'rubygems'
require 'graphviz'
require './Config'

graph_g = GraphViz.digraph( "G", :strict => true, :use => :neato ) { |g|
  g1 = g.add_graph "g1"
  g2 = g.add_graph "g2" 
    
  apply_config_to g
  apply_config_to g1
  apply_config_to g2
  g[:fontsize] = 5
  g1[:fontsize] = 5
  g2[:fontsize] = 5
  
  sender = g1.add_nodes "Sender", fontsize: $SMALL_FONT_SIZE, label: 'Sender', pos: '1,2!', shape: :circle
  recipient = g1.add_nodes "Recipient", 
    fontsize: $SMALL_FONT_SIZE, 
    label: 'Concrete\nRecipient', 
    pos: '9.7,2!', 
    shape: :circle
  square = g1.add_nodes( "square", 
    fontsize: $DEFAULT_FONT_SIZE, 
    label: 'Recipient\n(Interface)', 
    pos: '4.4,2!', 
    shape: :Mdiamond )
  alarm = g2.add_nodes "Alarm", 
    fontsize: $SMALL_FONT_SIZE, 
    label: 'Alarm', 
    pos: '1,1!', 
    shape: :circle
  auto_lift = g2.add_nodes "AutoLift", 
    fontsize: $SMALL_FONT_SIZE, 
    label: 'AutoLift', 
    pos: '9.7,1!', 
    shape: :circle
  lift = g2.add_nodes "Lift", 
    fontsize: $SMALL_FONT_SIZE, 
    label: 'Lift\n(Interface)', 
    pos: '4.4,1!', 
    shape: :Mdiamond

  g1.add_edges sender, square, fontsize: $SMALL_FONT_SIZE, taillabel: 'Recipient::DoSomething()...' 
  g1.add_edges square, recipient, fontsize: $SMALL_FONT_SIZE, taillabel: '...ConcreteRecipient::DoSomething()' 
  g2.add_edges alarm, lift, fontsize: $SMALL_FONT_SIZE, taillabel: 'Lift::GoToBottomFloor()...' 
  g2.add_edges lift, auto_lift, fontsize: $SMALL_FONT_SIZE, taillabel: '...AutoLift::GoToBottomFloor()' 
}

graph_g.output(svg: "SenderRecipientMessage.svg")

