Class: Coopy::CombinedTableBody

Inherits:
Object
  • Object
show all
Defined in:
lib/lib/coopy/combined_table_body.rb

Instance Method Summary collapse

Constructor Details

#initialize(parent, dx, dy) ⇒ CombinedTableBody

Returns a new instance of CombinedTableBody.



7
8
9
10
11
12
# File 'lib/lib/coopy/combined_table_body.rb', line 7

def initialize(parent,dx,dy)
  @parent = parent
  @dx = dx
  @dy = dy
  @all = parent.all
end

Instance Method Details

#clearObject



73
74
75
76
77
# File 'lib/lib/coopy/combined_table_body.rb', line 73

def clear 
  @all.clear
  @dx = 0
  @dy = 0
end

#cloneObject



136
137
138
# File 'lib/lib/coopy/combined_table_body.rb', line 136

def clone 
  ::Coopy::CombinedTable.new(@all.clone)
end

#createObject



140
141
142
# File 'lib/lib/coopy/combined_table_body.rb', line 140

def create 
  ::Coopy::CombinedTable.new(@all.create)
end

#get_cell(x, y) ⇒ Object



41
42
43
44
45
46
47
# File 'lib/lib/coopy/combined_table_body.rb', line 41

def get_cell(x,y)
  if y == 0 
    @meta = @parent.get_meta.as_table if @meta == nil
    return @meta.get_cell(x + @dx,0)
  end
  @all.get_cell(x + @dx,y + @dy - 1)
end

#get_cell_viewObject



61
62
63
# File 'lib/lib/coopy/combined_table_body.rb', line 61

def get_cell_view 
  @all.get_cell_view
end

#get_dataObject



132
133
134
# File 'lib/lib/coopy/combined_table_body.rb', line 132

def get_data 
  nil
end

#get_heightObject



37
38
39
# File 'lib/lib/coopy/combined_table_body.rb', line 37

def get_height 
  @all.get_height - @dy + 1
end

#get_metaObject



144
145
146
# File 'lib/lib/coopy/combined_table_body.rb', line 144

def get_meta 
  @parent.get_meta
end

#get_tableObject



24
25
26
# File 'lib/lib/coopy/combined_table_body.rb', line 24

def get_table 
  self
end

#get_widthObject



33
34
35
# File 'lib/lib/coopy/combined_table_body.rb', line 33

def get_width 
  @all.get_width - 1
end

#heightObject



28
# File 'lib/lib/coopy/combined_table_body.rb', line 28

def height() get_height end

#height=(__v) ⇒ Object



29
# File 'lib/lib/coopy/combined_table_body.rb', line 29

def height=(__v) @height = __v end

#insert_or_delete_columns(fate, wfate) ⇒ Object



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/lib/coopy/combined_table_body.rb', line 106

def insert_or_delete_columns(fate,wfate)
  fate2 = Array.new
  begin
    _g1 = 0
    _g = @dx + 1
    while(_g1 < _g) 
      x = _g1
      _g1+=1
      fate2.push(x)
    end
  end
  begin
    _g2 = 0
    while(_g2 < fate.length) 
      f = fate[_g2]
      _g2+=1
      fate2.push(((f >= 0) ? f + @dx + 1 : f))
    end
  end
  @all.insert_or_delete_columns(fate2,wfate + @dx)
end

#insert_or_delete_rows(fate, hfate) ⇒ Object



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/lib/coopy/combined_table_body.rb', line 79

def insert_or_delete_rows(fate,hfate)
  fate2 = Array.new
  begin
    _g1 = 0
    _g = @dy
    while(_g1 < _g) 
      y = _g1
      _g1+=1
      fate2.push(y)
    end
  end
  hdr = true
  begin
    _g2 = 0
    while(_g2 < fate.length) 
      f = fate[_g2]
      _g2+=1
      if hdr 
        hdr = false
        next
      end
      fate2.push(((f >= 0) ? f + @dy - 1 : f))
    end
  end
  @all.insert_or_delete_rows(fate2,hfate + @dy - 1)
end

#is_resizableObject



65
66
67
# File 'lib/lib/coopy/combined_table_body.rb', line 65

def is_resizable 
  @all.is_resizable
end

#resize(w, h) ⇒ Object



69
70
71
# File 'lib/lib/coopy/combined_table_body.rb', line 69

def resize(w,h)
  @all.resize(w + 1,h + @dy)
end

#set_cell(x, y, c) ⇒ Object



49
50
51
52
53
54
55
# File 'lib/lib/coopy/combined_table_body.rb', line 49

def set_cell(x,y,c)
  if y == 0 
    @all.set_cell(x + @dx,0,c)
    return
  end
  @all.set_cell(x + @dx,y + @dy - 1,c)
end

#to_sObject



57
58
59
# File 'lib/lib/coopy/combined_table_body.rb', line 57

def to_s 
  ::Coopy::SimpleTable.table_to_string(self)
end

#trim_blankObject



128
129
130
# File 'lib/lib/coopy/combined_table_body.rb', line 128

def trim_blank 
  @all.trim_blank
end

#widthObject



30
# File 'lib/lib/coopy/combined_table_body.rb', line 30

def width() get_width end

#width=(__v) ⇒ Object



31
# File 'lib/lib/coopy/combined_table_body.rb', line 31

def width=(__v) @width = __v end