Mercurial > hg > ltpda
comparison m-toolbox/classes/@LTPDAprefs/cb_plotPrefsChanged.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % cb_addModelPath callback for adding a model path | |
2 % | |
3 % Parameters: | |
4 % first - LTPDAprefs object | |
5 % second - Source object (here: java PlotPrefGroup) | |
6 % third - Event Object (here: PropertyChangeEvent) | |
7 % | |
8 % Version: | |
9 % $Id: cb_plotPrefsChanged.m,v 1.7 2011/02/08 10:35:34 ingo Exp $ | |
10 % | |
11 | |
12 function cb_plotPrefsChanged(varargin) | |
13 | |
14 mLtpdaPrefs = varargin{1}; | |
15 jPlotPrefGroup = varargin{2}; | |
16 jPropChangeEvent = varargin{3}; | |
17 | |
18 jPropName = jPropChangeEvent.getPropertyName(); | |
19 jNewVal = jPropChangeEvent.getNewValue(); | |
20 | |
21 jPlotPrefs = jPlotPrefGroup.getPlotPrefs(); | |
22 | |
23 % Set the plot preferences only to the default-application-data if the | |
24 % user chose: 'Apply plot settings to all figures'. | |
25 if ~isempty(jPropName) && ... | |
26 (jPlotPrefs.getPlotApplyPlotSettings.equals(mpipeline.ltpdapreferences.EnumPlotSetting.ALL_FIGURES)) | |
27 | |
28 if mpipeline.ltpdapreferences.PlotPrefGroup.PLOT_APPLY_PLOT_SETTINGS_CHANGED.equals(jPropName) | |
29 % Backup current plot settings | |
30 utils.plottools.backupDefaultPlotSettings(); | |
31 end | |
32 | |
33 if mpipeline.ltpdapreferences.PlotPrefGroup.PLOT_DEFAULT_AXES_FONT_SIZE_CHANGED.equals(jPropName) || ... | |
34 mpipeline.ltpdapreferences.PlotPrefGroup.PLOT_APPLY_PLOT_SETTINGS_CHANGED.equals(jPropName) | |
35 set(0, 'DefaultAxesFontSize', double(jPlotPrefs.getPlotDefaultAxesFontSize)); | |
36 end | |
37 | |
38 if mpipeline.ltpdapreferences.PlotPrefGroup.PLOT_DEFAULT_AXES_LINE_WIDTH_CHANGED.equals(jPropName) || ... | |
39 mpipeline.ltpdapreferences.PlotPrefGroup.PLOT_APPLY_PLOT_SETTINGS_CHANGED.equals(jPropName) | |
40 set(0, 'DefaultAxesLineWidth', double(jPlotPrefs.getPlotDefaultAxesLineWidth)); | |
41 end | |
42 | |
43 if mpipeline.ltpdapreferences.PlotPrefGroup.PLOT_DEFAULT_LINE_LINE_WIDTH_CHANGED.equals(jPropName) || ... | |
44 mpipeline.ltpdapreferences.PlotPrefGroup.PLOT_APPLY_PLOT_SETTINGS_CHANGED.equals(jPropName) | |
45 set(0, 'DefaultLineLineWidth', double(jPlotPrefs.getPlotDefaultLineLineWidth)); | |
46 end | |
47 | |
48 if mpipeline.ltpdapreferences.PlotPrefGroup.PLOT_DEFAULT_LINE_MARKER_SIZE_CHANGED.equals(jPropName) || ... | |
49 mpipeline.ltpdapreferences.PlotPrefGroup.PLOT_APPLY_PLOT_SETTINGS_CHANGED.equals(jPropName) | |
50 set(0, 'defaultlinemarkersize', double(jPlotPrefs.getPlotDefaultLineMarkerSize)); | |
51 end | |
52 | |
53 if mpipeline.ltpdapreferences.PlotPrefGroup.PLOT_DEFAULT_AXES_GRID_LINE_STYLE_CHANGED.equals(jPropName) || ... | |
54 mpipeline.ltpdapreferences.PlotPrefGroup.PLOT_APPLY_PLOT_SETTINGS_CHANGED.equals(jPropName) | |
55 set(0, 'DefaultAxesGridLineStyle', char(jPlotPrefs.getPlotDefaultAxesGridLineStyle)); | |
56 end | |
57 | |
58 if mpipeline.ltpdapreferences.PlotPrefGroup.PLOT_DEFAULT_AXES_MINOR_GRID_LINE_STYLE_CHANGED.equals(jPropName) || ... | |
59 mpipeline.ltpdapreferences.PlotPrefGroup.PLOT_APPLY_PLOT_SETTINGS_CHANGED.equals(jPropName) | |
60 set(0, 'DefaultAxesMinorGridLineStyle', char(jPlotPrefs.getPlotDefaultAxesMinorGridLineStyle)); | |
61 end | |
62 | |
63 if mpipeline.ltpdapreferences.PlotPrefGroup.PLOT_DEFAULT_AXES_FONT_WEIGHT_CHANGED.equals(jPropName) || ... | |
64 mpipeline.ltpdapreferences.PlotPrefGroup.PLOT_APPLY_PLOT_SETTINGS_CHANGED.equals(jPropName) | |
65 switch lower(char(jPlotPrefs.getPlotDefaultAxesFontWeight)) | |
66 case 'plain' | |
67 set(0, 'DefaultAxesFontWeight', 'normal'); | |
68 case 'bold' | |
69 set(0, 'DefaultAxesFontWeight', 'bold'); | |
70 case 'italic' | |
71 set(0, 'DefaultAxesFontWeight', 'light'); | |
72 case 'bold italic' | |
73 set(0, 'DefaultAxesFontWeight', 'demi'); | |
74 otherwise | |
75 error('### Unknown value (%s) for the default axes property ''FontWeight''', char(jPlotPrefs.getPlotDefaultAxesFontWeight)); | |
76 end | |
77 end | |
78 | |
79 if mpipeline.ltpdapreferences.PlotPrefGroup.PLOT_DEFAULT_LEGEND_FONT_SIZE_CHANGED.equals(jPropName) || ... | |
80 mpipeline.ltpdapreferences.PlotPrefGroup.PLOT_APPLY_PLOT_SETTINGS_CHANGED.equals(jPropName) | |
81 % Nothing to do. There doesn't exist any application value. | |
82 % We have to change the axis-handle of the legend. | |
83 % There exist only a general axes-font-size and not a special for the legends. | |
84 end | |
85 | |
86 if mpipeline.ltpdapreferences.PlotPrefGroup.PLOT_INCLUDE_DESCRIPTION_CHANGED.equals(jPropName) || ... | |
87 mpipeline.ltpdapreferences.PlotPrefGroup.PLOT_APPLY_PLOT_SETTINGS_CHANGED.equals(jPropName) | |
88 % Nothing to do. There doesn't exist any application value. | |
89 end | |
90 | |
91 else | |
92 % Restore MATLAB plot setting only if the user changed 'Apply plot settings: ...' | |
93 if mpipeline.ltpdapreferences.PlotPrefGroup.PLOT_APPLY_PLOT_SETTINGS_CHANGED.equals(jPropName) | |
94 warning('LTPDA:cb_plotPrefsChanged', '!!! Recover MATLAB''s default plot settings.'); | |
95 utils.plottools.restoreDefaultPlotSettings(); | |
96 end | |
97 end | |
98 | |
99 end |