-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathplotBrowserState.m
40 lines (35 loc) · 1.32 KB
/
plotBrowserState.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
classdef (Abstract) plotBrowserState < handle
%PLOTBROWSERSTATE Abstract State interface for the plotBrowser.
%
%SEE ALSO: plotBrowser
properties
plotBrowserObj;
end
methods
function s = plotBrowserState(obj)
s.plotBrowserObj = obj;
end
function hide(s, obj)
if s.isLegendColorbarOrCustomElement(obj)
obj.Visible = 'off';
end
end
function show(s, obj)
if s.isLegendColorbarOrCustomElement(obj)
obj.Visible = 'on';
end
end
end
methods (Static)
function tf = isLegendColorbarOrCustomElement(obj)
tf = strcmp(plotBrowserObj.getElementName(obj), 'Legend') || ...
strcmp(plotBrowserObj.getElementName(obj), 'Legend String') || ...
strcmp(plotBrowserObj.getElementName(obj), 'Title') || ...
strcmp(plotBrowserObj.getElementName(obj), 'XLabel') || ...
strcmp(plotBrowserObj.getElementName(obj), 'YLabel') || ...
strcmp(plotBrowserObj.getElementName(obj), 'YTickLabel') || ...
strcmp(plotBrowserObj.getElementName(obj), 'XTickLabel') || ...
strcmp(plotBrowserObj.getElementName(obj), 'ColorBar');
end
end
end