Project

General

Profile

Download (3.82 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2021 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.cdm.ext.geo;
10

    
11
import java.util.ArrayList;
12
import java.util.Arrays;
13
import java.util.HashSet;
14
import java.util.List;
15
import java.util.Set;
16
import java.util.UUID;
17

    
18
import eu.etaxonomy.cdm.common.UTF8;
19
import eu.etaxonomy.cdm.compare.common.OrderType;
20
import eu.etaxonomy.cdm.ext.geo.CondensedDistributionComposer.SymbolUsage;
21
import eu.etaxonomy.cdm.model.common.MarkerType;
22
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
23

    
24
/**
25
 * @author a.mueller
26
 * @since 17.02.2021
27
 */
28
public class CondensedDistributionConfiguration{
29

    
30
    //if true, all areas are shown in bold, no matter which status they have
31
    public boolean areasBold = false;  //true for Cuba
32

    
33
    //if true the area of scope (e.g. EM) area label is shown, otherwise only
34
    //the status symbol (usually an endemism information is shown, if at all)
35
    public boolean showAreaOfScopeLabel = false;   //true for Cuba
36

    
37
    //the separator before the list of outOfScope areas
38
    public String outOfScopeAreasSeperator = " " + UTF8.EN_DASH.toString() + " ";   //not needed for E+M
39

    
40
    public boolean splitNativeAndIntroduced = true;  //false for Cuba
41

    
42
    public String introducedBracketStart = "[";
43

    
44
    public String introducedBracketEnd = "]";
45

    
46
    //if true a subarea Az(F) will be shortened to F if it is shown in brackets after the parent area
47
    public boolean shortenSubAreaLabelsIfPossible = true;  //not relevant for Cuba
48

    
49
    public boolean showStatusOnParentAreaIfAllSame = true;  //false for Cuba
50

    
51
    public List<String> areaOfScopeSubAreaBracketStart = Arrays.asList(new String[]{" ","("});  // "(","(" for Cuba
52

    
53
    public List<String> areaOfScopeSubAreaBracketEnd = Arrays.asList(new String[]{"",")"});    // ")",")" for Cuba
54

    
55
    public List<UUID> statusForBoldAreas = Arrays.asList(new UUID[]{PresenceAbsenceTerm.uuidNative});  //empty for Cuba as for Cuba all areas are bold
56

    
57
    public SymbolUsage areaSymbolField = SymbolUsage.IdInVoc;   //currently IdInVoc for both, but may change in future
58

    
59
    public SymbolUsage statusSymbolField = SymbolUsage.Symbol2;   //currently Symbol1 for Cuba, but may change in future
60

    
61
    public OrderType orderType = OrderType.ALPHABETIC;
62

    
63
    //if true, any non-empty symbol is taken from symbol2, symbol1, idInVoc and abbrevLabel according to the given order
64
    public boolean showAnyStatusSmbol = false;   //usually does not make sense to mix symbol fields
65

    
66
    public Set<UUID> hiddenAndFallbackAreaMarkers = new HashSet<>(Arrays.asList(MarkerType.uuidFallbackArea)); //TODO shouldn't we add the hiddenAreaMarker here, too?
67

    
68
//************************** FACTORY ***************************************/
69

    
70
    public static CondensedDistributionConfiguration NewDefaultInstance() {
71
        CondensedDistributionConfiguration result = new CondensedDistributionConfiguration();
72
        result.hiddenAndFallbackAreaMarkers.add(MarkerType.uuidFallbackArea);
73
        return result;
74
    }
75

    
76
    public static CondensedDistributionConfiguration NewCubaInstance() {
77
        CondensedDistributionConfiguration result = new CondensedDistributionConfiguration();
78
        result.areasBold = true;
79
        result.showAreaOfScopeLabel = true;
80
        result.splitNativeAndIntroduced = false;
81
        result.shortenSubAreaLabelsIfPossible = false;
82
        result.showStatusOnParentAreaIfAllSame = false;
83
        result.areaOfScopeSubAreaBracketStart.set(0, "(");
84
        result.areaOfScopeSubAreaBracketEnd.set(0, ")");
85
        result.statusForBoldAreas = new ArrayList<>();
86
        result.statusSymbolField = SymbolUsage.Symbol1;
87
        result.orderType = OrderType.NATURAL;
88
        return result;
89
    }
90
}
(2-2/11)