Project

General

Profile

Revision 61473b5a

ID61473b5add814c383e82530f8c1737a5397ef385
Parent 3da4a5e6
Child d4aefb3a

Added by Patrick Plitzner about 2 years ago

ref #7674 Show taxon descriptions as rows in matrix

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrix.java
117 117
    static final String COUNTRY_COLUMN = "country_column"; //$NON-NLS-1$
118 118

  
119 119
    static final String LABEL_TAXON_ROW = "TAXON_ROW"; //$NON-NLS-1$
120
    static final String LABEL_TAXON_AGGREGATED_DESCRIPTION = "TAXON_AGGREGATED_DESCRIPTION"; //$NON-NLS-1$
121
    static final String LABEL_TAXON_DESCRIPTION = "LABEL_TAXON_DESCRIPTION"; //$NON-NLS-1$
120 122

  
121 123
    @Inject
122 124
    private UISynchronize sync;
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixConfigLabelAccumulator.java
11 11
import org.eclipse.nebula.widgets.nattable.layer.LabelStack;
12 12
import org.eclipse.nebula.widgets.nattable.layer.cell.IConfigLabelAccumulator;
13 13

  
14
import eu.etaxonomy.cdm.api.service.dto.TaxonRowWrapperDTO;
15
import eu.etaxonomy.cdm.model.common.MarkerType;
14 16
import eu.etaxonomy.cdm.model.description.Feature;
17
import eu.etaxonomy.cdm.model.description.TaxonDescription;
15 18
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
16 19

  
17 20
/**
......
37 40
        if(rowObject instanceof TaxonNode){
38 41
            configLabels.addLabel(CharacterMatrix.LABEL_TAXON_ROW);
39 42
        }
43
        else if(rowObject instanceof TaxonRowWrapperDTO){
44
            TaxonDescription taxonDescription = ((TaxonRowWrapperDTO) rowObject).getDescription();
45
            boolean isComputed = taxonDescription.getMarkers().stream()
46
            .anyMatch(marker->marker.getMarkerType().equals(MarkerType.COMPUTED()));
47
            if(isComputed){
48
                configLabels.addLabel(CharacterMatrix.LABEL_TAXON_AGGREGATED_DESCRIPTION);
49
            }
50
            else{
51
                configLabels.addLabel(CharacterMatrix.LABEL_TAXON_DESCRIPTION);
52
            }
53
        }
54

  
40 55
        if(columnPosition==0){
41 56
            configLabels.addLabel(CharacterMatrix.TAXON_COLUMN);
42 57
        }
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/SpecimenColumnPropertyAccessor.java
12 12

  
13 13
import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
14 14
import eu.etaxonomy.cdm.api.service.dto.SpecimenRowWrapperDTO;
15
import eu.etaxonomy.cdm.api.service.dto.TaxonRowWrapperDTO;
15 16
import eu.etaxonomy.cdm.model.description.Feature;
16 17

  
17 18
/**
......
57 58
            }
58 59
            Feature feature = matrix.getIndexToFeatureMap().get(columnIndex);
59 60
            return rowWrapper.getDataValueForFeature(feature);
60
        } else if (columnIndex == 0) {
61
        } else if(rowObject instanceof TaxonRowWrapperDTO){
62
            TaxonRowWrapperDTO taxonWrapper = (TaxonRowWrapperDTO)rowObject;
63
            if(columnIndex==0){
64
                return taxonWrapper.getTaxonNode();
65
            }
66
            Feature feature = matrix.getIndexToFeatureMap().get(columnIndex);
67
            return taxonWrapper.getDataValueForFeature(feature);
68

  
69
        }
70
        else if (columnIndex == 0) {
61 71
            return rowObject;
62 72
        }
63 73
        return null;

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)