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