Class DiagramModel

java.lang.Object
lu.kbra.modelizer_next.domain.DiagramModel
All Implemented Interfaces:
PostConstructOwner, PreDeconstructOwner

public class DiagramModel extends Object implements PostConstructOwner, PreDeconstructOwner
Root model for diagram elements. It stores classes, links, comments, and their relationships.
  • Constructor Details

    • DiagramModel

      public DiagramModel()
      Creates a diagram model instance.
  • Method Details

    • addClass

      public void addClass(ClassModel classModel)
    • addComment

      public void addComment(CommentModel commentModel)
    • addConceptualLink

      public void addConceptualLink(LinkModel linkModel)
    • addTechnicalLink

      public void addTechnicalLink(LinkModel linkModel)
    • buildClassByIdIndex

      public Map<String,ClassModel> buildClassByIdIndex()
    • buildClassesByPanelIndex

      public Map<PanelType,Set<ClassModel>> buildClassesByPanelIndex()
    • buildCommentByIdIndex

      public Map<String,CommentModel> buildCommentByIdIndex()
    • buildConceptualLinkByIdIndex

      public Map<String,LinkModel> buildConceptualLinkByIdIndex()
    • buildLinkByAssociationClassIdIndex

      public Map<String,LinkModel> buildLinkByAssociationClassIdIndex()
    • buildLinkByIdIndex

      public Map<String,LinkModel> buildLinkByIdIndex()
    • buildTechnicalLinkByIdIndex

      public Map<String,LinkModel> buildTechnicalLinkByIdIndex()
    • getAllLinks

      public Collection<LinkModel> getAllLinks()
      Returns the all links.
      Returns:
      the all links
    • getClassById

      public Map<String,ClassModel> getClassById()
    • getClasses

      public List<ClassModel> getClasses()
      Returns the classes.
      Returns:
      the classes
    • getClasses

      public Set<ClassModel> getClasses(PanelType panelType)
    • getClassesByPanel

      public Map<PanelType,Set<ClassModel>> getClassesByPanel()
    • getCommentById

      public Map<String,CommentModel> getCommentById()
    • getComments

      public List<CommentModel> getComments()
      Returns the comments.
      Returns:
      the comments
    • getConceptualLinkById

      public Map<String,LinkModel> getConceptualLinkById()
    • getConceptualLinks

      public List<LinkModel> getConceptualLinks()
      Returns the conceptual links.
      Returns:
      the conceptual links
    • getLinkByAssociationClassId

      public Map<String,LinkModel> getLinkByAssociationClassId()
    • getLinkById

      public Map<String,LinkModel> getLinkById()
    • getTechnicalLinkById

      public Map<String,LinkModel> getTechnicalLinkById()
    • getTechnicalLinks

      public List<LinkModel> getTechnicalLinks()
      Returns the technical links.
      Returns:
      the technical links
    • postConstruct

      public void postConstruct()
      Restores derived model state after JSON deserialization.
      Specified by:
      postConstruct in interface PostConstructOwner
    • preDeconstruct

      public void preDeconstruct()
      Prepares the model before it is serialized.
      Specified by:
      preDeconstruct in interface PreDeconstructOwner
    • removeClass

      public void removeClass(ClassModel classModel)
    • removeComment

      public void removeComment(CommentModel commentModel)
    • removeConceptualLink

      public void removeConceptualLink(LinkModel linkModel)
    • removeTechnicalLink

      public void removeTechnicalLink(LinkModel linkModel)
    • setClasses

      public void setClasses(List<ClassModel> classes)
      Sets the classes.
      Parameters:
      classes - values for classes
    • setComments

      public void setComments(List<CommentModel> comments)
      Sets the comments.
      Parameters:
      comments - values for comments
    • setConceptualLinks

      public void setConceptualLinks(List<LinkModel> conceptualLinks)
    • setTechnicalLinks

      public void setTechnicalLinks(List<LinkModel> technicalLinks)
    • toString

      public String toString()
      Builds a debug string for this diagram model.
      Overrides:
      toString in class Object
      Returns:
      a debug string for this object
    • validateClassByIdIndex

      public Map<String,ClassModel> validateClassByIdIndex()
    • validateClassByPanel

      public void validateClassByPanel(ClassModel classModel)
    • validateCommentsByIdIndex

      public Map<String,CommentModel> validateCommentsByIdIndex()
    • validateConceptualLinkByIdIndex

      public Map<String,LinkModel> validateConceptualLinkByIdIndex()
    • validateData

      public void validateData()
      Validates the data before it is used.
    • validateLinkByAssociationClassIdIndex

      public Map<String,LinkModel> validateLinkByAssociationClassIdIndex()
    • validateLinkByIdIndex

      public Map<String,LinkModel> validateLinkByIdIndex()
    • validateTechnicalLinkByIdIndex

      public Map<String,LinkModel> validateTechnicalLinkByIdIndex()