Class ErdUtil


  • public final class ErdUtil
    extends Object
    Support class for ERD. Contains static methods for entities processing.
    • Method Detail

      • getAllEntities

        public static Collection<IErdEntity> getAllEntities​(ErdEntityGroup entityGroup)
        Returns all entities (instance of ErdEntity) from given group. Changes to returned list does not reflect on groups. There is no group entities in returned list.
        Parameters:
        entityGroup - - group to look for entities. Can't be null.
        Returns:
        entities from given group. Can't return null.
      • getInnerGroups

        public static Collection<IErdEntity> getInnerGroups​(ErdEntityGroup entityGroup)
        Return all inner groups (instance of ErdEntityGroup) from given group.
        Parameters:
        entityGroup - - group. Can't be null.
        Returns:
        collection of inner groups. Can't return null.
      • cloneEntity

        public static IErdEntity cloneEntity​(IErdEntity entityToClone)
        Clones given entity (not entity group). Cloned entity has same data as original.
        Parameters:
        entityToClone - - entity to clone. Can't be null.
        Returns:
        cloned entity. Can't return null.
      • copyGroup

        public static ErdEntityGroup copyGroup​(ErdEntityGroup groupToCopy)
        Copies given group. Every entity in copied group is copy of entity in original group.
        Parameters:
        groupToCopy - - group to copy. Can't be null.
        Returns:
        copied group. Can't return null.
      • getEntityGroup

        public static IErdEntity getEntityGroup​(IErdDiagramCore diagramCore,
                                                com._1c.g5.v8.dt.diagram.framework.IEntity entity)
        Returns group from given diagram core which contain given entity.
        Parameters:
        diagramCore - - diagram to find group. Can't be null.
        entity - - entity which group need to look for. Can't be null.
        Returns:
        group which contain given entity. Can return null.
      • getAssociatedEntities

        public static Collection<IErdEntity> getAssociatedEntities​(IErdDiagramCore diagramCore,
                                                                   Collection<MdObject> mdObjects)
        Returns associated with given mdObjects entities.
        Parameters:
        diagramCore - - diagram core to search in. Can't be null.
        mdObjects - - mdObjects to look for associated entities. Can't be null.
        Returns:
        associated with given mdObjects entities. Can't return null.
      • getAssociatedEntitiesExtended

        public static Collection<IErdEntity> getAssociatedEntitiesExtended​(IErdDiagramCore diagramCore,
                                                                           Collection<MdObject> mdObjects)
        Returns associated with given mdObjects entities. If one of given MdObject is in group, returns group.
        Parameters:
        diagramCore - - diagram core to search in. Can't be null.
        mdObjects - - mdObjects to look for associated entities. Can't be null.
        Returns:
        associated with given mdObjects entities. Can't return null.
      • getAssociatedMdObjects

        public static Collection<MdObject> getAssociatedMdObjects​(Collection<IErdEntity> entities)
        Returns associated with given entities mdObjects proxies.
        Parameters:
        entities - - entities to create mdObjects proxies. Can't be null.
        Returns:
        associated with given entities mdObjects proxies. Can't return null.
      • moveEntitiesToFreeSpace

        public static void moveEntitiesToFreeSpace​(Collection<IErdEntity> entitiesToMove,
                                                   Collection<com._1c.g5.v8.dt.diagram.framework.IRelation> relationsToMove,
                                                   Collection<IErdEntity> allEntities,
                                                   Collection<com._1c.g5.v8.dt.diagram.framework.IRelation> allRelations)
        Moves entities to closest free space on given diagram
        Parameters:
        entitiesToMove - - entities to move. Can't be null.
        relationsToMove - - relations, connected to entities moved entities. Can't be null.
        allEntities - - all diagram entities. Can't be null.
        allRelations - - all diagram relations. Can't be null.
      • createProxy

        public static MdObject createProxy​(IErdEntity entity)
        Creates proxy for given entity. Entity should have not null URI and not null eClass.
        Parameters:
        entity - - entity to create proxy for. Can't have null URI or null eClass. Can't be null.
        Returns:
        proxy for given entity. Can't return null.
      • isRussianLocale

        public static boolean isRussianLocale()
        Returns true if current locale is russian.
        Returns:
        true if current locale is russian.
      • containsRelation

        public static boolean containsRelation​(Collection<com._1c.g5.v8.dt.diagram.framework.IRelation> relations,
                                               com._1c.g5.v8.dt.diagram.framework.IRelation relationToCheck)
        Returns true if given relations contains relationToCheck.
        Parameters:
        relations - - relations. Cannot be null.
        relationToCheck - - relation to check for containment. Cannot be null.
        Returns:
        true if given relations contains relationToCheck.