This method initializes data array according to values in var_info and col_ids. It calls CreateAndUpdateCategories which does all of the category classification. */
| 383 | and col_ids. It calls CreateAndUpdateCategories which does all of the |
| 384 | category classification. */ |
| 385 | void ConditionalMapCanvas::ChangeCatThemeType(CatClassification::CatClassifType new_cat_theme, |
| 386 | int num_categories_s, |
| 387 | const wxString& custom_classif_title) |
| 388 | { |
| 389 | num_categories = num_categories_s; |
| 390 | |
| 391 | if (new_cat_theme == CatClassification::custom) { |
| 392 | CatClassifManager* ccm = project->GetCatClassifManager(); |
| 393 | if (!ccm) |
| 394 | return; |
| 395 | CatClassifState* new_ccs = ccm->FindClassifState(custom_classif_title); |
| 396 | if (!new_ccs) |
| 397 | return; |
| 398 | if (cc_state_map == new_ccs) |
| 399 | return; |
| 400 | if (cc_state_map) { |
| 401 | cc_state_map->removeObserver(this); |
| 402 | } |
| 403 | cc_state_map = new_ccs; |
| 404 | cc_state_map->registerObserver(this); |
| 405 | cat_classif_def_map = cc_state_map->GetCatClassif(); |
| 406 | } else { |
| 407 | if (cc_state_map) { |
| 408 | cc_state_map->removeObserver(this); |
| 409 | } |
| 410 | cc_state_map = NULL; |
| 411 | } |
| 412 | SetCatType(new_cat_theme); |
| 413 | VarInfoAttributeChange(); |
| 414 | CreateAndUpdateCategories(); |
| 415 | UserChangedCellCategories(); |
| 416 | PopulateCanvas(); |
| 417 | if (all_init && template_frame) { |
| 418 | template_frame->UpdateTitle(); |
| 419 | if (template_frame->GetTemplateLegend()) { |
| 420 | template_frame->GetTemplateLegend()->Recreate(); |
| 421 | } |
| 422 | } |
| 423 | } |
| 424 | |
| 425 | void ConditionalMapCanvas::update(CatClassifState* o) |
| 426 | { |
no test coverage detected