Class: TECSCDE::TECSModel::TmRegion

Inherits:
TECSCDE::TmObject show all
Defined in:
lib/tecscde/tecs_model/tm_region.rb

Instance Attribute Summary

Attributes inherited from TECSCDE::TmObject

#owner

Instance Method Summary collapse

Methods inherited from TECSCDE::TmObject

#copy_from, #model, #modified

Constructor Details

#initialize(namespace_path, owner) ⇒ TmRegion

TmRegion#initialize

namespace_path::NamespacePath owner::TmRegion (parent) or TECSModel (root region)



60
61
62
63
64
65
66
67
68
# File 'lib/tecscde/tecs_model/tm_region.rb', line 60

def initialize(namespace_path, owner)
  @namespace_path = namespace_path
  @owner = owner

  # region's property
  @sub_region = {}
  @cell_list = {}
  modified {}
end

Instance Method Details

#clone_for_undoObject

TmRegion#clone_for_undo



96
97
98
99
100
# File 'lib/tecscde/tecs_model/tm_region.rb', line 96

def clone_for_undo
  bu = clone
  bu.copy_from(self)
  bu
end

#delete_cell(cell) ⇒ Object



77
78
79
# File 'lib/tecscde/tecs_model/tm_region.rb', line 77

def delete_cell(cell)
  @owner.delete_cell(cell)
end

#get_colorObject



74
75
# File 'lib/tecscde/tecs_model/tm_region.rb', line 74

def get_color
end

#get_namespace_pathObject



70
71
72
# File 'lib/tecscde/tecs_model/tm_region.rb', line 70

def get_namespace_path
  @namespace_path
end

#get_region(name) ⇒ Object



85
86
87
88
89
90
91
92
93
# File 'lib/tecscde/tecs_model/tm_region.rb', line 85

def get_region(name)
  if @sub_region[name].nil?
    modified do
      parent = self
      @sub_region[name] = TmRegion.new(@namespace_path.append(name), parent)
    end
  end
  @sub_region[name]
end

#rename_cell(cell, name) ⇒ Object



81
82
83
# File 'lib/tecscde/tecs_model/tm_region.rb', line 81

def rename_cell(cell, name)
  @owner.rename_cell(cell, name)
end

#setup_clone(sub_region) ⇒ Object



102
103
104
# File 'lib/tecscde/tecs_model/tm_region.rb', line 102

def setup_clone(sub_region)
  @sub_region = sub_region.dup
end