Class CustomView

All Implemented Interfaces:
PropertyHolder, AnimatedView, Comparable<View>

public final class CustomView extends ModelView implements AnimatedView
Represents a custom view, containing custom elements.
  • Method Details

    • getName

      public String getName()
      Gets the (computed) name of this view.
      Specified by:
      getName in class View
      Returns:
      the name, as a String
    • getModel

      public Model getModel()
      Gets the model that this view belongs to.
      Overrides:
      getModel in class ModelView
      Returns:
      a Model object
    • checkElementCanBeAdded

      protected void checkElementCanBeAdded(Element element)
      Specified by:
      checkElementCanBeAdded in class ModelView
    • canBeRemoved

      protected boolean canBeRemoved(Element element)
      Specified by:
      canBeRemoved in class ModelView
    • add

      public RelationshipView add(@Nonnull Relationship relationship)
      Adds a specific relationship to this view.
      Parameters:
      relationship - the Relationship to be added
      Returns:
      a RelationshipView object representing the relationship added
    • addAnimation

      public void addAnimation(CustomElement... elements)
      Adds an animation step, with the specified elements.
      Parameters:
      elements - the elements that should be shown in the animation step
    • getAnimations

      @Nonnull public List<Animation> getAnimations()
      Specified by:
      getAnimations in interface AnimatedView
    • add

      public void add(@Nonnull CustomElement customElement)
      Adds the given custom element to this view, including relationships to/from that custom element.
      Parameters:
      customElement - the CustomElement to add
    • add

      public void add(@Nonnull CustomElement customElement, boolean addRelationships)
      Adds the given custom element to this view.
      Parameters:
      customElement - the CustomElement to add
      addRelationships - whether to add relationships to/from the custom element
    • remove

      public void remove(@Nonnull CustomElement customElement)
      Removes the given custom element from this view.
      Parameters:
      customElement - the CustomElement to add
    • addDefaultElements

      public void addDefaultElements()
      Adds the default set of elements to this view.
    • addAllCustomElements

      public void addAllCustomElements()
      Adds all custom elements to this view.