All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.structurizr.view.Animation Maven / Gradle / Ivy

The newest version!
package com.structurizr.view;

import com.structurizr.model.Element;
import com.structurizr.model.Relationship;

import java.util.Set;
import java.util.TreeSet;

/**
 * A wrapper for a collection of animation steps.
 */
public final class Animation {

    private int order;
    private Set elements = new TreeSet<>();
    private Set relationships = new TreeSet<>();

    Animation() {
    }

    Animation(int order, Set elements, Set relationships) {
        this.order = order;

        for (Element element : elements) {
            this.elements.add(element.getId());
        }

        for (Relationship relationship : relationships) {
            this.relationships.add(relationship.getId());
        }
    }

    public int getOrder() {
        return order;
    }

    void setOrder(int order) {
        this.order = order;
    }

    public Set getElements() {
        return new TreeSet<>(elements);
    }

    void setElements(Set elements) {
        if (elements != null) {
            this.elements = new TreeSet<>(elements);
        }
    }

    public Set getRelationships() {
        return new TreeSet<>(relationships);
    }

    void setRelationships(Set relationships) {
        if (relationships != null) {
            this.relationships = new TreeSet<>(relationships);
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy