Class: SLComponents::NodeShape

Inherits:
Object
  • Object
show all
Defined in:
lib/mk_semi_lattice/sl_components.rb

Direct Known Subclasses

Document, Folder, FolderIcon, Icon

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ NodeShape

Returns a new instance of NodeShape.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/mk_semi_lattice/sl_components.rb', line 14

def initialize(attrs = {})
  @x = attrs[:x]
  @y = attrs[:y]
  @z = attrs[:z]
  @color = attrs[:color]
  @name = attrs[:name]
  @label = attrs[:label]
  @fixed = attrs[:fixed]
  @linked = attrs[:linked]
  @dx = attrs[:dx]
  @dy = attrs[:dy]
  @type = attrs[:type]
  @file_path = attrs[:file_path]
  @icon_path = attrs[:icon_path] || nil
  setup_shape
end

Instance Attribute Details

#dxObject

Returns the value of attribute dx.



12
13
14
# File 'lib/mk_semi_lattice/sl_components.rb', line 12

def dx
  @dx
end

#dyObject

Returns the value of attribute dy.



12
13
14
# File 'lib/mk_semi_lattice/sl_components.rb', line 12

def dy
  @dy
end

#file_pathObject

Returns the value of attribute file_path.



12
13
14
# File 'lib/mk_semi_lattice/sl_components.rb', line 12

def file_path
  @file_path
end

#fixedObject

Returns the value of attribute fixed.



12
13
14
# File 'lib/mk_semi_lattice/sl_components.rb', line 12

def fixed
  @fixed
end

#labelObject

Returns the value of attribute label.



12
13
14
# File 'lib/mk_semi_lattice/sl_components.rb', line 12

def label
  @label
end

#linkedObject

Returns the value of attribute linked.



12
13
14
# File 'lib/mk_semi_lattice/sl_components.rb', line 12

def linked
  @linked
end

#nameObject

Returns the value of attribute name.



12
13
14
# File 'lib/mk_semi_lattice/sl_components.rb', line 12

def name
  @name
end

#typeObject

Returns the value of attribute type.



12
13
14
# File 'lib/mk_semi_lattice/sl_components.rb', line 12

def type
  @type
end

#xObject

Returns the value of attribute x.



12
13
14
# File 'lib/mk_semi_lattice/sl_components.rb', line 12

def x
  @x
end

#yObject

Returns the value of attribute y.



12
13
14
# File 'lib/mk_semi_lattice/sl_components.rb', line 12

def y
  @y
end

Instance Method Details

#color=(c) ⇒ Object



31
32
33
# File 'lib/mk_semi_lattice/sl_components.rb', line 31

def color=(c)
  # 派生クラスでオーバーライド
end

#setup_shapeObject



43
44
45
# File 'lib/mk_semi_lattice/sl_components.rb', line 43

def setup_shape
  # 派生クラスでオーバーライド
end