-
Notifications
You must be signed in to change notification settings - Fork 0
/
PropertyHandler.m
42 lines (40 loc) · 1.78 KB
/
PropertyHandler.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
41
classdef PropertyHandler < handle
%PROPERTYHANDLER Halds the figure and axes properties of a figure
%
properties
figure
axes
end
properties (SetAccess = private)
readonly=struct('figure', {{'BeingDeleted','Children',...
'CurrentAxes','CurrentCharacter',...
'CurrentObject','Type'}},...
'axes' , {{'BeingDeleted','Children',...
'CurrentPoint','Parent',...
'TightInset','Title','Type',...
'XLabel','YLabel','ZLabel'}});
default_profile = 'default'
end
methods
function prophandler = PropertyHandler(fixed_props,profile)
if nargin == 1
profile = prophandler.default_profile;
end
this_file_path = mfilename('fullpath');
end_index = find(this_file_path=='/',1,'last');
module_root = this_file_path(1:end_index);
prophandler.readonly.figure = horzcat(fixed_props',...
prophandler.readonly.figure);
props = load([ module_root 'profiles/' profile '.mat']);
prophandler.figure = rmfield(props.figure,...
prophandler.readonly.figure);
% If FigureHandler.new hangs it might be due to problems with X
% this line removes it from the propertyhandler
if isfield(prophandler.figure,'XDisplay')
prophandler.figure = rmfield(prophandler.figure,'XDisplay');
end
prophandler.axes = rmfield(props.axes,...
prophandler.readonly.axes);
end
end
end