<commit_before>package nl.mpi.kinnate.kindata;

import javax.xml.bind.annotation.XmlAttribute;
import nl.mpi.kinnate.kindata.DataTypes.RelationType;

/**
 * Document : RelationTypeDefinition
 * Created on : Jan 2, 2012, 3:29:25 PM
 * Author : <NAME>
 */
public class RelationTypeDefinition {

    public enum CurveLineOrientation {

        horizontal, vertical
    }
    @XmlAttribute(name = "name", namespace = "http://mpi.nl/tla/kin")
    private String displayName;
    @XmlAttribute(name = "type", namespace = "http://mpi.nl/tla/kin")
    private RelationType[] relationType;
    @XmlAttribute(name = "dcr", namespace = "http://mpi.nl/tla/kin")
    private String dataCategory;
    @XmlAttribute(name = "colour", namespace = "http://mpi.nl/tla/kin")
    private String lineColour;
    @XmlAttribute(name = "width", namespace = "http://mpi.nl/tla/kin")
    private int lineWidth;
    @XmlAttribute(name = "style", namespace = "http://mpi.nl/tla/kin")
    private String lineStye;
    @XmlAttribute(name = "orientation", namespace = "http://mpi.nl/tla/kin")
    private CurveLineOrientation curveLineOrientation = CurveLineOrientation.horizontal; // used to define the line orientation of curve lines only

    public RelationTypeDefinition() {
    }

    public RelationTypeDefinition(String displayName, String dataCategory, RelationType relationType[], String lineColour, int lineWidth, String lineStye) {
        this.displayName = displayName;
        this.relationType = relationType;
        this.dataCategory = dataCategory;
        this.lineColour = lineColour;
        this.lineWidth = lineWidth;
        this.lineStye = lineStye;
    }

    public String getDisplayName() {
        return displayName;
    }

    public String getLineColour() {
        return lineColour;
    }

    public String getLineStye() {
        return lineStye;
    }

    public int getLineWidth() {
        return lineWidth;
    }

    public String getDataCategory() {
        return dataCategory;
    }

    public RelationType[] getRelationType() {
        return relationType;
    }

    public CurveLineOrientation getCurveLineOrientation() {
        return curveLineOrientation;
    }

    public boolean matchesType(EntityRelation entityRelation) {
        if (entityRelation == null) {
            return false;
        }
        if (dataCategory == null) {
            if (entityRelation.dcrType != null) {
                return false;
            }
        } else {
            if (!dataCategory.equals(entityRelation.dcrType)) {
                return false;
            }
        }
        if (relationType == null) {
            if (entityRelation.getRelationType() != null) {
                return false;
            }
        } else {
            boolean foundType = false;
            final RelationType entityRelationType = entityRelation.getRelationType();
            for (RelationType currentType : relationType) {
                if (currentType.equals(entityRelationType)) {
                    foundType = true;
                }
            }
            if (!foundType) {
                return false;
            }
        }
        if (displayName == null) {
            if (entityRelation.customType != null) {
                return false;
            }
        } else {
            if (!displayName.equals(entityRelation.customType)) {
                return false;
            }
        }
        return true;
    }
}
<commit_msg>Updated the Line Orientation and Line/Dash so that it displays the result on the diagram. Modified the relation type definitions table so that there can be only one row for each custom type. This has the effect of maintaining that both descendant and ancestor are shown as a single custom type. Resolved some EDT issues. refs #1803 #1811<commit_after>package nl.mpi.kinnate.kindata;

import javax.xml.bind.annotation.XmlAttribute;
import nl.mpi.kinnate.kindata.DataTypes.RelationType;

/**
 * Document : RelationTypeDefinition
 * Created on : Jan 2, 2012, 3:29:25 PM
 * Author : <NAME>
 */
public class RelationTypeDefinition {

    public enum CurveLineOrientation {

        horizontal, vertical
    }
    @XmlAttribute(name = "name", namespace = "http://mpi.nl/tla/kin")
    private String displayName;
    @XmlAttribute(name = "type", namespace = "http://mpi.nl/tla/kin")
    private RelationType[] relationType;
    @XmlAttribute(name = "dcr", namespace = "http://mpi.nl/tla/kin")
    private String dataCategory;
    @XmlAttribute(name = "colour", namespace = "http://mpi.nl/tla/kin")
    private String lineColour;
    @XmlAttribute(name = "width", namespace = "http://mpi.nl/tla/kin")
    private int lineWidth;
    @XmlAttribute(name = "dash", namespace = "http://mpi.nl/tla/kin")
    private int lineDash;
    @XmlAttribute(name = "orientation", namespace = "http://mpi.nl/tla/kin")
    private CurveLineOrientation curveLineOrientation = CurveLineOrientation.horizontal; // used to define the line orientation of curve lines only

    public RelationTypeDefinition() {
    }

    public RelationTypeDefinition(String displayName, String dataCategory, RelationType relationType[], String lineColour, int lineWidth, int lineDash) {
        this.displayName = displayName;
        this.relationType = relationType;
        this.dataCategory = dataCategory;
        this.lineColour = lineColour;
        this.lineWidth = lineWidth;
        this.lineDash = lineDash;
    }

    public String getDisplayName() {
        return displayName;
    }

    public String getLineColour() {
        return lineColour;
    }

    public int getLineDash() {
        return lineDash;
    }

    public int getLineWidth() {
        return lineWidth;
    }

    public String getDataCategory() {
        return dataCategory;
    }

    public RelationType[] getRelationType() {
        return relationType;
    }

    public CurveLineOrientation getCurveLineOrientation() {
        return curveLineOrientation;
    }

    public boolean matchesType(EntityRelation entityRelation) {
        if (entityRelation == null) {
            return false;
        }
        if (dataCategory == null) {
            if (entityRelation.dcrType != null) {
                return false;
            }
        } else {
            if (!dataCategory.equals(entityRelation.dcrType)) {
                return false;
            }
        }
        if (relationType == null) {
            if (entityRelation.getRelationType() != null) {
                return false;
            }
        } else {
            boolean foundType = false;
            final RelationType entityRelationType = entityRelation.getRelationType();
            for (RelationType currentType : relationType) {
                if (currentType.equals(entityRelationType)) {
                    foundType = true;
                }
            }
            if (!foundType) {
                return false;
            }
        }
        if (displayName == null) {
            if (entityRelation.customType != null) {
                return false;
            }
        } else {
            if (!displayName.equals(entityRelation.customType)) {
                return false;
            }
        }
        return true;
    }
}

{'fraction_non_alphanumeric': 0.09620708748615725, 'fraction_numerical': 0.003875968992248062, 'mean_word_length': 2.203991130820399, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2771161', 'n_tokens_mistral': 2031, 'n_tokens_neox': 1937, 'n_words': 481}