Class: Xsdvi::SVG::Generator
- Inherits:
-
Object
- Object
- Xsdvi::SVG::Generator
- Defined in:
- lib/xsdvi/svg/generator.rb
Overview
Generates SVG files from symbol trees
Instance Attribute Summary collapse
-
#embody_style ⇒ Object
Returns the value of attribute embody_style.
-
#hide_menu_buttons ⇒ Object
Returns the value of attribute hide_menu_buttons.
-
#style_uri ⇒ Object
Returns the value of attribute style_uri.
-
#writer ⇒ Object
Returns the value of attribute writer.
Instance Method Summary collapse
- #draw(root_symbol) ⇒ Object
-
#initialize(writer) ⇒ Generator
constructor
A new instance of Generator.
- #print(string) ⇒ Object
- #print_extern_style ⇒ Object
Constructor Details
#initialize(writer) ⇒ Generator
Returns a new instance of Generator.
11 12 13 14 15 16 17 |
# File 'lib/xsdvi/svg/generator.rb', line 11 def initialize(writer) @writer = writer @embody_style = true @style_uri = nil @hide_menu_buttons = false @resource_loader = Utils::ResourceLoader.new end |
Instance Attribute Details
#embody_style ⇒ Object
Returns the value of attribute embody_style.
9 10 11 |
# File 'lib/xsdvi/svg/generator.rb', line 9 def embody_style @embody_style end |
#hide_menu_buttons ⇒ Object
Returns the value of attribute hide_menu_buttons.
9 10 11 |
# File 'lib/xsdvi/svg/generator.rb', line 9 def @hide_menu_buttons end |
#style_uri ⇒ Object
Returns the value of attribute style_uri.
9 10 11 |
# File 'lib/xsdvi/svg/generator.rb', line 9 def style_uri @style_uri end |
#writer ⇒ Object
Returns the value of attribute writer.
9 10 11 |
# File 'lib/xsdvi/svg/generator.rb', line 9 def writer @writer end |
Instance Method Details
#draw(root_symbol) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/xsdvi/svg/generator.rb', line 19 def draw(root_symbol) # Reset class variables before drawing Symbol.reset_class_variables svg_begin draw_symbol(root_symbol) svg_end end |
#print(string) ⇒ Object
34 35 36 |
# File 'lib/xsdvi/svg/generator.rb', line 34 def print(string) writer.append("#{string}\n") end |
#print_extern_style ⇒ Object
28 29 30 31 32 |
# File 'lib/xsdvi/svg/generator.rb', line 28 def print_extern_style writer.new_writer(style_uri) print(load_resource("svg/style.css")) writer.close end |