Project

General

Profile

Revision 3fe2a4b6

ID3fe2a4b66c2205a1eb64ddbe0d8906398053e432
Parent 081d99b4
Child 80a0c0dc

Added by Patrick Plitzner over 2 years ago

ref #7095 Sort feature columns according to FeatureTree

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/workingSet/matrix/CharacterMatrix.java
14 14
import java.util.ArrayList;
15 15
import java.util.Arrays;
16 16
import java.util.Collection;
17
import java.util.Collections;
18 17
import java.util.HashMap;
19 18
import java.util.HashSet;
20 19
import java.util.List;
......
120 119
import eu.etaxonomy.cdm.model.description.DescriptionBase;
121 120
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
122 121
import eu.etaxonomy.cdm.model.description.Feature;
122
import eu.etaxonomy.cdm.model.description.FeatureNode;
123 123
import eu.etaxonomy.cdm.model.description.FeatureTree;
124 124
import eu.etaxonomy.cdm.model.description.MeasurementUnit;
125 125
import eu.etaxonomy.cdm.model.description.SpecimenDescription;
......
519 519
        this.layout();
520 520
    }
521 521

  
522
    private List<Feature> initFeatureList(FeatureNode node){
523
        List<Feature> features = new ArrayList<>();
524
        node.getChildNodes().forEach(childNode->
525
                {
526
                    features.add(childNode.getFeature());
527
                    features.addAll(initFeatureList(childNode));
528
                });
529
        return features;
530
    }
531

  
522 532
    public void initWorkingSet(WorkingSet workingSet){
523 533
        this.workingSet = workingSet;
524 534
        //get features/columns stored in working set
525 535
        FeatureTree tree = workingSet.getDescriptiveSystem();
526
        features = new ArrayList<>(tree.getDistinctFeatures());
527
        Collections.sort(features);
536
        features = initFeatureList(tree.getRoot());
537

  
528 538
        //init state data for categorical features
529 539
        features.forEach(feature->
530 540
        {

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)