module Roby::GUI::GraphvizPlanObject
Public Instance Methods
apply_layout(bounding_rects, positions, display)
click to toggle source
Applys the layout in positions
to this particular object
# File lib/roby/gui/plan_dot_layout.rb, line 143 def apply_layout(bounding_rects, positions, display) return unless display.displayed?(self) if p = positions[dot_id] raise "no graphics for #{self}" unless graphics_item = display[self] graphics_item.pos = p elsif b = bounding_rects[dot_id] raise "no graphics for #{self}" unless graphics_item = display[self] graphics_item.rect = b else STDERR.puts "WARN: #{self} has not been layouted (#{dot_id.inspect})" end end
dot_label(display)
click to toggle source
# File lib/roby/gui/plan_dot_layout.rb, line 128 def dot_label(display); display_name(display) end
to_dot(display, io)
click to toggle source
Adds the dot definition for this object in io
# File lib/roby/gui/plan_dot_layout.rb, line 131 def to_dot(display, io) return unless display.displayed?(self) graphics = display.graphics[self] bounding_rect = graphics.bounding_rect if graphics.respond_to?(:text) bounding_rect |= graphics.text.bounding_rect end io << " #{dot_id}[label=\"#{dot_label(display).split("\n").join('\n')}\",width=#{bounding_rect.width},height=#{bounding_rect.height},fixedsize=true];\n" end