Loading @Data/Data.m +1 Changes for @Data/Data.m: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ classdef Data < handle object.outputs_grid = TableGrid(); object.left_cond.addlistener('AddedOuterCell', @(src, event) left_grid_added_cell(object, src, event)); object.left_cond.addlistener('RemovedOuterCell', @(src, event) object.outputs_grid.delete_row(event.changed_cell)); object.top_cond.addlistener('AddedOuterCell', @(src, event) top_grid_added_cell(object, src, event)); object.top_cond.addlistener('RemovedOuterCell', @(src, event) object.outputs_grid.delete_column(event.changed_cell)); end Loading @GUIBase/GUIBase.m +5 Changes for @GUIBase/GUIBase.m: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -16,6 +16,11 @@ classdef GUIBase < handle function redraw(object) draw_onto(object, object.phandle); end function redraw_and_update_bb(object, src, event) object.redraw(); object.notify('BoundingBoxChanged'); end end methods(Abstract) Loading @GridLayout/draw_onto.m +12 −2 Changes for @GridLayout/draw_onto.m: 12 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -5,12 +5,22 @@ function draw_onto( object, parent_handle ) % needs to be called everytime the back table is updated. The class will % notify when its necessary. [~, y] = object.get_bounding_box(); [x, y] = object.get_bounding_box(); if size(object.controls, 2) ~= size(object.drawables, 2) || size(object.controls, 1) ~= size(object.drawables, 1) object.controls(size(object.drawables, 1), size(object.drawables, 2)) = 0; end for i = 1:size(object.drawables, 2) for j = 1:size(object.drawables, 1) if ~isempty( object.drawables{j, i} ) p = uipanel('Parent', parent_handle, 'Units', 'pixels', 'Position', [sum(object.column_sizes(1:j-1))+(j-1)*20, y - sum(object.row_sizes(1:i)) - (i-1)*20, 1, 1]); if object.controls(j, i) == 0 || ~ishandle(object.controls(j, i)) p = uipanel('Parent', parent_handle, 'Units', 'pixels', 'Position', [sum(object.column_sizes(1:j-1))+(j-1)*20, y - sum(object.row_sizes(1:i)) - (i-1)*20, x, y]); object.controls(j, i) = p; else p = object.controls(j, i); set(p, 'Position', [sum(object.column_sizes(1:j-1))+(j-1)*20, y - sum(object.row_sizes(1:i)) - (i-1)*20, x, y]); end object.drawables{j, i}.draw(p); end end Loading @TableGrid/delete_row.m +10 Changes for @TableGrid/delete_row.m: 10 added lines, 0 removed lines. Original line number Diff line number Diff line function delete_row( object, index ) %DELETE_COLUMN Deletes the requested column % Deletes the requested column from the table. object.grid(index, :) = []; object.height = object.height-1; notify(object, 'StructureChanged'); end @TableGridDraw/draw_onto.m +4 Changes for @TableGridDraw/draw_onto.m: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -14,6 +14,10 @@ function draw_onto( object, parent_handle ) object.controls(:, object.my_table_grid.width+1:size(object.controls, 2)) = []; end assert( ~(size(object.controls, 2) > object.my_table_grid.width), 'Implment delete when necessary.'); if size(object.controls, 1) > object.my_table_grid.height delete(object.controls(object.my_table_grid.height+1:size(object.controls, 1), :)); object.controls(object.my_table_grid.height+1:size(object.controls, 1), :) = []; end assert( ~(size(object.controls, 1) > object.my_table_grid.height), 'Implment delete when necessary.'); if size(object.controls, 2) ~= object.my_table_grid.width || size(object.controls, 1) ~= object.my_table_grid.height Loading Loading
@Data/Data.m +1 Changes for @Data/Data.m: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ classdef Data < handle object.outputs_grid = TableGrid(); object.left_cond.addlistener('AddedOuterCell', @(src, event) left_grid_added_cell(object, src, event)); object.left_cond.addlistener('RemovedOuterCell', @(src, event) object.outputs_grid.delete_row(event.changed_cell)); object.top_cond.addlistener('AddedOuterCell', @(src, event) top_grid_added_cell(object, src, event)); object.top_cond.addlistener('RemovedOuterCell', @(src, event) object.outputs_grid.delete_column(event.changed_cell)); end Loading
@GUIBase/GUIBase.m +5 Changes for @GUIBase/GUIBase.m: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -16,6 +16,11 @@ classdef GUIBase < handle function redraw(object) draw_onto(object, object.phandle); end function redraw_and_update_bb(object, src, event) object.redraw(); object.notify('BoundingBoxChanged'); end end methods(Abstract) Loading
@GridLayout/draw_onto.m +12 −2 Changes for @GridLayout/draw_onto.m: 12 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -5,12 +5,22 @@ function draw_onto( object, parent_handle ) % needs to be called everytime the back table is updated. The class will % notify when its necessary. [~, y] = object.get_bounding_box(); [x, y] = object.get_bounding_box(); if size(object.controls, 2) ~= size(object.drawables, 2) || size(object.controls, 1) ~= size(object.drawables, 1) object.controls(size(object.drawables, 1), size(object.drawables, 2)) = 0; end for i = 1:size(object.drawables, 2) for j = 1:size(object.drawables, 1) if ~isempty( object.drawables{j, i} ) p = uipanel('Parent', parent_handle, 'Units', 'pixels', 'Position', [sum(object.column_sizes(1:j-1))+(j-1)*20, y - sum(object.row_sizes(1:i)) - (i-1)*20, 1, 1]); if object.controls(j, i) == 0 || ~ishandle(object.controls(j, i)) p = uipanel('Parent', parent_handle, 'Units', 'pixels', 'Position', [sum(object.column_sizes(1:j-1))+(j-1)*20, y - sum(object.row_sizes(1:i)) - (i-1)*20, x, y]); object.controls(j, i) = p; else p = object.controls(j, i); set(p, 'Position', [sum(object.column_sizes(1:j-1))+(j-1)*20, y - sum(object.row_sizes(1:i)) - (i-1)*20, x, y]); end object.drawables{j, i}.draw(p); end end Loading
@TableGrid/delete_row.m +10 Changes for @TableGrid/delete_row.m: 10 added lines, 0 removed lines. Original line number Diff line number Diff line function delete_row( object, index ) %DELETE_COLUMN Deletes the requested column % Deletes the requested column from the table. object.grid(index, :) = []; object.height = object.height-1; notify(object, 'StructureChanged'); end
@TableGridDraw/draw_onto.m +4 Changes for @TableGridDraw/draw_onto.m: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -14,6 +14,10 @@ function draw_onto( object, parent_handle ) object.controls(:, object.my_table_grid.width+1:size(object.controls, 2)) = []; end assert( ~(size(object.controls, 2) > object.my_table_grid.width), 'Implment delete when necessary.'); if size(object.controls, 1) > object.my_table_grid.height delete(object.controls(object.my_table_grid.height+1:size(object.controls, 1), :)); object.controls(object.my_table_grid.height+1:size(object.controls, 1), :) = []; end assert( ~(size(object.controls, 1) > object.my_table_grid.height), 'Implment delete when necessary.'); if size(object.controls, 2) ~= object.my_table_grid.width || size(object.controls, 1) ~= object.my_table_grid.height Loading