0001 function varargout = display_dke(varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 gui_Singleton = 1;
0032 gui_State = struct('gui_Name', mfilename, ...
0033 'gui_Singleton', gui_Singleton, ...
0034 'gui_OpeningFcn', @display_dke_OpeningFcn, ...
0035 'gui_OutputFcn', @display_dke_OutputFcn, ...
0036 'gui_LayoutFcn', [] , ...
0037 'gui_Callback', []);
0038 if nargin && ischar(varargin{1})
0039 gui_State.gui_Callback = str2func(varargin{1});
0040 end
0041
0042 if nargout
0043 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
0044 else
0045 gui_mainfcn(gui_State, varargin{:});
0046 end
0047
0048
0049
0050
0051 function display_dke_OpeningFcn(hObject, eventdata, handles, varargin)
0052
0053
0054
0055
0056
0057
0058
0059 handles.output = hObject;
0060
0061
0062
0063 handles.scenarios = {};
0064 handles.graphs = {};
0065 handles.selectedgraphs1 = [];
0066 handles.selectedgraphs2 = [];
0067
0068 [handles.listofgraphtypes,...
0069 handles.listoflinestyles,...
0070 handles.listoflinewidths,...
0071 handles.listoflinecolors,...
0072 handles.listofmarkerstyles,...
0073 handles.listofmarkersizes,...
0074 handles.listofmarkercolors]...
0075 = GetGraphProperties_jd;
0076
0077 UpdateVisible_jd(handles.visible1, [], handles, handles.axes1, handles.selectedgraphs1);
0078 UpdateVisible_jd(handles.visible2, [], handles, handles.axes2, handles.selectedgraphs2);
0079
0080 set(handles.modifypanel1,'visible','off')
0081 set(handles.modifypanel2,'visible','off')
0082
0083
0084
0085
0086
0087 guidata(hObject, handles);
0088
0089
0090
0091
0092
0093
0094 function varargout = display_dke_OutputFcn(hObject, eventdata, handles)
0095
0096
0097
0098
0099
0100
0101 varargout{1} = handles.output;
0102
0103
0104
0105 function figure1_CreateFcn(hObject, eventdata, handles)
0106
0107
0108
0109
0110
0111 function File_Callback(hObject, eventdata, handles)
0112
0113
0114
0115
0116
0117 function Load_Callback(hObject, eventdata, handles)
0118
0119
0120
0121 [filename,pathname] = uigetfile('RESULTS_*.mat','Load DKE Scenario');
0122
0123 if filename == 0,
0124 return
0125 else
0126 filename = [pathname,filename];
0127 end
0128
0129 NumberOfScenarios = length(handles.scenarios);
0130
0131 for iScenario = 1:NumberOfScenarios,
0132 if isequal(handles.scenarios{iScenario}.name,filename),
0133 h = warndlg('The scenario you are trying to load is already in memory','Existing scenario');
0134 return
0135 end
0136 end
0137
0138 load(filename,'equil');
0139
0140 handles.scenarios{NumberOfScenarios + 1}.name = filename;
0141
0142 guidata(hObject,handles);
0143
0144
0145
0146 function Open_Callback(hObject, eventdata, handles)
0147
0148
0149
0150 [filename,pathname] = uigetfile('.dke','Open Saved Workspace');
0151
0152 if filename == 0,
0153 return
0154 end
0155
0156 load([pathname,filename],'scenarios','graphs','listofgraphtypes','selectedgraphs1','selectedgraphs2','-mat')
0157
0158 handles.scenarios = scenarios;
0159 handles.graphs = graphs;
0160 handles.listofgraphtypes = listofgraphtypes;
0161 handles.selectedgraphs1 = selectedgraphs1;
0162 handles.selectedgraphs2 = selectedgraphs2;
0163
0164 UpdateListOfGraphs_jd(handles.listbox1, eventdata, handles, handles.axes1)
0165 UpdateListOfGraphs_jd(handles.listbox2, eventdata, handles, handles.axes2)
0166
0167 guidata(hObject,handles);
0168
0169
0170
0171 function Save_Callback(hObject, eventdata, handles)
0172
0173
0174
0175 [filename,pathname] = uiputfile('.dke','Save Workspace','display_workspace');
0176
0177 if filename == 0,
0178 return
0179 end
0180
0181 scenarios = handles.scenarios;
0182 graphs = handles.graphs;
0183 listofgraphtypes = handles.listofgraphtypes;
0184 selectedgraphs1 = handles.selectedgraphs1;
0185 selectedgraphs2 = handles.selectedgraphs2;
0186
0187 save([pathname,filename],'scenarios','graphs','listofgraphtypes','selectedgraphs1','selectedgraphs2','-mat')
0188
0189
0190
0191 function Print_Callback(hObject, eventdata, handles)
0192
0193
0194
0195
0196 printdlg(handles.figure1)
0197
0198
0199 function Exit_Callback(hObject, eventdata, handles)
0200
0201
0202
0203 close(handles.figure1)
0204
0205
0206
0207 function Tools_Callback(hObject, eventdata, handles)
0208
0209
0210
0211
0212
0213
0214 function Help_Callback(hObject, eventdata, handles)
0215
0216
0217
0218
0219
0220
0221 function listbox1_Callback(hObject, eventdata, handles)
0222
0223
0224
0225 selectedgraphs1 = UpdateSelectedGraphs_jd(hObject, [], handles, handles.axes1, handles.visible1);
0226
0227 handles.selectedgraphs1 = selectedgraphs1;
0228
0229 UpdateGraphs_jd(handles.modifypanel1, [], handles, handles.axes1, handles.selectedgraphs1);
0230
0231 guidata(hObject,handles);
0232
0233
0234
0235 function listbox1_CreateFcn(hObject, eventdata, handles)
0236
0237
0238
0239
0240
0241
0242 if ispc
0243 set(hObject,'BackgroundColor','white');
0244 else
0245 set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
0246 end
0247
0248
0249
0250 function listbox2_Callback(hObject, eventdata, handles)
0251
0252
0253
0254 selectedgraphs2 = UpdateSelectedGraphs_jd(hObject, [], handles, handles.axes2, handles.visible2);
0255
0256 handles.selectedgraphs2 = selectedgraphs2;
0257
0258 UpdateGraphs_jd(handles.modifypanel2, [], handles, handles.axes2, handles.selectedgraphs2);
0259
0260 guidata(hObject,handles);
0261
0262
0263
0264 function listbox2_CreateFcn(hObject, eventdata, handles)
0265
0266
0267
0268
0269
0270
0271 if ispc
0272 set(hObject,'BackgroundColor','white');
0273 else
0274 set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
0275 end
0276
0277
0278
0279 function new1_Callback(hObject, eventdata, handles)
0280
0281
0282
0283 [handles,selectedgraphs1] = AddNewGraph_jd(hObject, [], handles, handles.axes1, handles.listbox1, handles.visible1, handles.selectedgraphs1);
0284
0285 handles.selectedgraphs1 = selectedgraphs1;
0286
0287 UpdateGraphs_jd(handles.modifypanel1, [], handles, handles.axes1, handles.selectedgraphs1);
0288
0289 guidata(hObject,handles);
0290
0291
0292
0293 function new2_Callback(hObject, eventdata, handles)
0294
0295
0296
0297 [handles,selectedgraphs2] = AddNewGraph_jd(hObject, [], handles, handles.axes2, handles.listbox2, handles.visible2, handles.selectedgraphs2);
0298
0299 handles.selectedgraphs2 = selectedgraphs2;
0300
0301 UpdateGraphs_jd(handles.modifypanel2, [], handles, handles.axes2, handles.selectedgraphs2);
0302
0303 guidata(hObject,handles);
0304
0305
0306
0307 function remove1_Callback(hObject, eventdata, handles)
0308
0309
0310
0311 [handles,selectedgraphs1] = RemoveGraph_jd(hObject, [], handles, handles.axes1, handles.listbox1, handles.visible1, handles.selectedgraphs1);
0312
0313 handles.selectedgraphs1 = selectedgraphs1;
0314
0315 UpdateGraphs_jd(handles.modifypanel1, [], handles, handles.axes1, handles.selectedgraphs1);
0316
0317 guidata(hObject,handles);
0318
0319
0320
0321 function remove2_Callback(hObject, eventdata, handles)
0322
0323
0324
0325 [handles,selectedgraphs2] = RemoveGraph_jd(hObject, [], handles, handles.axes2, handles.listbox2, handles.visible2, handles.selectedgraphs2);
0326
0327 handles.selectedgraphs2 = selectedgraphs2;
0328
0329 UpdateGraphs_jd(handles.modifypanel2, [], handles, handles.axes2, handles.selectedgraphs2);
0330
0331 guidata(hObject,handles);
0332
0333
0334
0335 function visible1_Callback(hObject, eventdata, handles)
0336
0337
0338
0339 ChangeVisible_jd(hObject, [], handles, handles.axes1, handles.selectedgraphs1)
0340
0341
0342
0343 function visible2_Callback(hObject, eventdata, handles)
0344
0345
0346
0347 ChangeVisible_jd(hObject, [], handles, handles.axes2, handles.selectedgraphs2)
0348
0349
0350
0351 function modify1_Callback(hObject, eventdata, handles)
0352
0353
0354
0355 if isequal(get(hObject,'string'),'Modify')
0356 set(handles.modifypanel1,'visible','on')
0357 set(hObject,'string','Hide')
0358 else
0359 set(handles.modifypanel1,'visible','off')
0360 set(hObject,'string','Modify')
0361 end
0362
0363
0364
0365 function modify2_Callback(hObject, eventdata, handles)
0366
0367
0368
0369 if isequal(get(hObject,'string'),'Modify')
0370 set(handles.modifypanel2,'visible','on')
0371 set(hObject,'string','Hide')
0372 else
0373 set(handles.modifypanel2,'visible','off')
0374 set(hObject,'string','Modify')
0375 end
0376
0377
0378
0379 function linestyle1_Callback(hObject, eventdata, handles)
0380
0381
0382
0383 ChangeGraphProperty_jd(hObject, [], handles, handles.axes1, handles.selectedgraphs1, 'linestyle', handles.listoflinestyles);
0384
0385
0386
0387 function linestyle1_CreateFcn(hObject, eventdata, handles)
0388
0389
0390
0391
0392
0393
0394 if ispc
0395 set(hObject,'BackgroundColor','white');
0396 else
0397 set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
0398 end
0399
0400
0401 function linestyle2_Callback(hObject, eventdata, handles)
0402
0403
0404
0405 ChangeGraphProperty_jd(hObject, [], handles, handles.axes2, handles.selectedgraphs2, 'linestyle', handles.listoflinestyles);
0406
0407
0408
0409 function linestyle2_CreateFcn(hObject, eventdata, handles)
0410
0411
0412
0413
0414
0415
0416 if ispc
0417 set(hObject,'BackgroundColor','white');
0418 else
0419 set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
0420 end
0421
0422
0423 function linewidth1_Callback(hObject, eventdata, handles)
0424
0425
0426
0427 ChangeGraphProperty_jd(hObject, [], handles, handles.axes1, handles.selectedgraphs1, 'linewidth', handles.listoflinewidths);
0428
0429
0430
0431 function linewidth1_CreateFcn(hObject, eventdata, handles)
0432
0433
0434
0435
0436
0437
0438 if ispc
0439 set(hObject,'BackgroundColor','white');
0440 else
0441 set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
0442 end
0443
0444
0445 function linewidth2_Callback(hObject, eventdata, handles)
0446
0447
0448
0449 ChangeGraphProperty_jd(hObject, [], handles, handles.axes2, handles.selectedgraphs2, 'linewidth', handles.listoflinewidths);
0450
0451
0452
0453 function linewidth2_CreateFcn(hObject, eventdata, handles)
0454
0455
0456
0457
0458
0459
0460 if ispc
0461 set(hObject,'BackgroundColor','white');
0462 else
0463 set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
0464 end
0465
0466
0467 function linecolor1_Callback(hObject, eventdata, handles)
0468
0469
0470
0471 ChangeGraphProperty_jd(hObject, [], handles, handles.axes1, handles.selectedgraphs1, 'color', handles.listoflinecolors);
0472
0473
0474
0475 function linecolor1_CreateFcn(hObject, eventdata, handles)
0476
0477
0478
0479
0480
0481
0482 if ispc
0483 set(hObject,'BackgroundColor','white');
0484 else
0485 set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
0486 end
0487
0488
0489 function linecolor2_Callback(hObject, eventdata, handles)
0490
0491
0492
0493 ChangeGraphProperty_jd(hObject, [], handles, handles.axes2, handles.selectedgraphs2, 'color', handles.listoflinecolors);
0494
0495
0496
0497 function linecolor2_CreateFcn(hObject, eventdata, handles)
0498
0499
0500
0501
0502
0503
0504 if ispc
0505 set(hObject,'BackgroundColor','white');
0506 else
0507 set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
0508 end
0509
0510
0511
0512 function markerstyle1_Callback(hObject, eventdata, handles)
0513
0514
0515
0516 ChangeGraphProperty_jd(hObject, [], handles, handles.axes1, handles.selectedgraphs1, 'marker', handles.listofmarkerstyles);
0517
0518
0519
0520 function markerstyle1_CreateFcn(hObject, eventdata, handles)
0521
0522
0523
0524
0525
0526
0527 if ispc
0528 set(hObject,'BackgroundColor','white');
0529 else
0530 set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
0531 end
0532
0533
0534 function markerstyle2_Callback(hObject, eventdata, handles)
0535
0536
0537
0538 ChangeGraphProperty_jd(hObject, [], handles, handles.axes2, handles.selectedgraphs2, 'marker', handles.listofmarkerstyles);
0539
0540
0541
0542 function markerstyle2_CreateFcn(hObject, eventdata, handles)
0543
0544
0545
0546
0547
0548
0549 if ispc
0550 set(hObject,'BackgroundColor','white');
0551 else
0552 set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
0553 end
0554
0555
0556
0557 function markersize1_Callback(hObject, eventdata, handles)
0558
0559
0560
0561 ChangeGraphProperty_jd(hObject, [], handles, handles.axes1, handles.selectedgraphs1, 'markersize', handles.listofmarkersizes);
0562
0563
0564
0565 function markersize1_CreateFcn(hObject, eventdata, handles)
0566
0567
0568
0569
0570
0571
0572 if ispc
0573 set(hObject,'BackgroundColor','white');
0574 else
0575 set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
0576 end
0577
0578
0579 function markersize2_Callback(hObject, eventdata, handles)
0580
0581
0582
0583 ChangeGraphProperty_jd(hObject, [], handles, handles.axes2, handles.selectedgraphs2, 'markersize', handles.listofmarkersizes);
0584
0585
0586
0587 function markersize2_CreateFcn(hObject, eventdata, handles)
0588
0589
0590
0591
0592
0593
0594 if ispc
0595 set(hObject,'BackgroundColor','white');
0596 else
0597 set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
0598 end
0599
0600
0601 function markercolor1_Callback(hObject, eventdata, handles)
0602
0603
0604
0605 ChangeGraphProperty_jd(hObject, [], handles, handles.axes1, handles.selectedgraphs1, 'markeredgecolor', handles.listofmarkercolors);
0606 ChangeGraphProperty_jd(hObject, [], handles, handles.axes1, handles.selectedgraphs1, 'markerfacecolor', handles.listofmarkercolors);
0607
0608
0609
0610 function markercolor1_CreateFcn(hObject, eventdata, handles)
0611
0612
0613
0614
0615
0616
0617 if ispc
0618 set(hObject,'BackgroundColor','white');
0619 else
0620 set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
0621 end
0622
0623
0624 function markercolor2_Callback(hObject, eventdata, handles)
0625
0626
0627
0628 ChangeGraphProperty_jd(hObject, [], handles, handles.axes2, handles.selectedgraphs2, 'markeredgecolor', handles.listofmarkercolors);
0629 ChangeGraphProperty_jd(hObject, [], handles, handles.axes2, handles.selectedgraphs2, 'markerfacecolor', handles.listofmarkercolors);
0630
0631
0632
0633 function markercolor2_CreateFcn(hObject, eventdata, handles)
0634
0635
0636
0637
0638
0639
0640 if ispc
0641 set(hObject,'BackgroundColor','white');
0642 else
0643 set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
0644 end
0645
0646