Skip to content

Commit 4f1c4c6

Browse files
committed
Improved performance of JTableWrapper
1 parent c98a14c commit 4f1c4c6

File tree

1 file changed

+61
-61
lines changed
  • lib/JavaTableWrapper_20150312/JavaTableWrapper/+uiextras/+jTable

1 file changed

+61
-61
lines changed

lib/JavaTableWrapper_20150312/JavaTableWrapper/+uiextras/+jTable/Table.m

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@
192192
end
193193
properties
194194
MouseClickedCallback = ''
195-
MouseDraggedCallback = ''
196-
MouseMotionFcn = ''
195+
%MouseDraggedCallback = ''
196+
%MouseMotionFcn = ''
197197
end
198198
properties(Dependent = true)
199199
Parent
@@ -318,8 +318,8 @@
318318
p.addParamValue('FontSize',10);
319319
p.addParamValue('FontWeight','normal');
320320
p.addParamValue('MouseClickedCallback','');
321-
p.addParamValue('MouseDraggedCallback','');
322-
p.addParamValue('MouseMotionFcn','');
321+
%p.addParamValue('MouseDraggedCallback','');
322+
%p.addParamValue('MouseMotionFcn','');
323323
p.addParamValue('Parent',[]);
324324
p.addParamValue('Position',[0 0 1 1]);
325325
p.addParamValue('RowHeight',20);
@@ -447,14 +447,14 @@ function create(obj, ParamsToSet)
447447
set(CbProps,'MouseClickedCallback',@(src,e)onMouseClick(obj,e,'table'))
448448
set(CbProps,'MousePressedCallback',@(src,e)onButtonDown(obj,e,'table'))
449449
set(CbProps,'MouseReleasedCallback',@(src,e)onButtonUp(obj,e,'table'))
450-
set(CbProps,'MouseDraggedCallback',@(src,e)onMouseDrag(obj,e,'table'))
451-
set(CbProps,'MouseMovedCallback',@(src,e)onMouseMotion(obj,e,'table'))
450+
%set(CbProps,'MouseDraggedCallback',@(src,e)onMouseDrag(obj,e,'table'))
451+
%set(CbProps,'MouseMovedCallback',@(src,e)onMouseMotion(obj,e,'table'))
452452
CbProps = handle(jScrollPane,'CallbackProperties');
453453
set(CbProps,'MouseClickedCallback',@(src,e)onMouseClick(obj,e,'scrollpane'))
454454
set(CbProps,'MousePressedCallback',@(src,e)onButtonDown(obj,e,'scrollpane'))
455455
set(CbProps,'MouseReleasedCallback',@(src,e)onButtonUp(obj,e,'scrollpane'))
456-
set(CbProps,'MouseDraggedCallback',@(src,e)onMouseDrag(obj,e,'scrollpane'))
457-
set(CbProps,'MouseMovedCallback',@(src,e)onMouseMotion(obj,e,'scrollpane'))
456+
%set(CbProps,'MouseDraggedCallback',@(src,e)onMouseDrag(obj,e,'scrollpane'))
457+
%set(CbProps,'MouseMovedCallback',@(src,e)onMouseMotion(obj,e,'scrollpane'))
458458

459459
% Get the column model
460460
jColumnModel = jTable.getColumnModel();
@@ -1776,59 +1776,59 @@ function onMouseClick(obj,e,location)
17761776
end %function onMouseClick
17771777

17781778

1779-
function onMouseDrag(obj,e,location)
1780-
1781-
if obj.Debug, disp('onMouseDrag'); end
1782-
1783-
if callbacksEnabled(obj) && ~isempty(obj.MouseDraggedCallback)
1784-
1785-
if obj.Debug, disp('onMouseDrag - entered'); end
1786-
1787-
% Get the position clicked
1788-
x = e.getX;
1789-
y = e.getY;
1790-
1791-
% Get the cell clicked
1792-
row = obj.JTable.rowAtPoint(e.getPoint) + 1;
1793-
col = obj.JTable.columnAtPoint(e.getPoint) + 1;
1794-
1795-
% Call the custom callback
1796-
e1 = struct(...
1797-
'Position',[x,y],...
1798-
'Location',location,...
1799-
'Cell',[row col]);
1800-
hgfeval(obj.MouseDraggedCallback,obj,e1);
1801-
1802-
end
1803-
1804-
end %function
1805-
1806-
function onMouseMotion(obj,e,location)
1807-
1808-
%if obj.Debug, disp('onMouseMotion'); end
1809-
1810-
if callbacksEnabled(obj) && ~isempty(obj.MouseMotionFcn)
1811-
1812-
if obj.Debug, disp('onMouseMotion - entered'); end
1813-
1814-
% Get the position clicked
1815-
x = e.getX;
1816-
y = e.getY;
1817-
1818-
% Get the cell clicked
1819-
row = obj.JTable.rowAtPoint(e.getPoint) + 1;
1820-
col = obj.JTable.columnAtPoint(e.getPoint) + 1;
1821-
1822-
% Call the custom callback
1823-
e1 = struct(...
1824-
'Position',[x,y],...
1825-
'Location',location,...
1826-
'Cell',[row col]);
1827-
hgfeval(obj.MouseMotionFcn,obj,e1);
1828-
1829-
end
1830-
1831-
end %function
1779+
% function onMouseDrag(obj,e,location)
1780+
%
1781+
% if obj.Debug, disp('onMouseDrag'); end
1782+
%
1783+
% if callbacksEnabled(obj) && ~isempty(obj.MouseDraggedCallback)
1784+
%
1785+
% if obj.Debug, disp('onMouseDrag - entered'); end
1786+
%
1787+
% % Get the position clicked
1788+
% x = e.getX;
1789+
% y = e.getY;
1790+
%
1791+
% % Get the cell clicked
1792+
% row = obj.JTable.rowAtPoint(e.getPoint) + 1;
1793+
% col = obj.JTable.columnAtPoint(e.getPoint) + 1;
1794+
%
1795+
% % Call the custom callback
1796+
% e1 = struct(...
1797+
% 'Position',[x,y],...
1798+
% 'Location',location,...
1799+
% 'Cell',[row col]);
1800+
% hgfeval(obj.MouseDraggedCallback,obj,e1);
1801+
%
1802+
% end
1803+
%
1804+
% end %function
1805+
1806+
% function onMouseMotion(obj,e,location)
1807+
%
1808+
% %if obj.Debug, disp('onMouseMotion'); end
1809+
%
1810+
% if callbacksEnabled(obj) && ~isempty(obj.MouseMotionFcn)
1811+
%
1812+
% if obj.Debug, disp('onMouseMotion - entered'); end
1813+
%
1814+
% % Get the position clicked
1815+
% x = e.getX;
1816+
% y = e.getY;
1817+
%
1818+
% % Get the cell clicked
1819+
% row = obj.JTable.rowAtPoint(e.getPoint) + 1;
1820+
% col = obj.JTable.columnAtPoint(e.getPoint) + 1;
1821+
%
1822+
% % Call the custom callback
1823+
% e1 = struct(...
1824+
% 'Position',[x,y],...
1825+
% 'Location',location,...
1826+
% 'Cell',[row col]);
1827+
% hgfeval(obj.MouseMotionFcn,obj,e1);
1828+
%
1829+
% end
1830+
%
1831+
% end %function
18321832

18331833

18341834
function onSelectionChanged(obj, ~, eventData)

0 commit comments

Comments
 (0)