Package com._1c.g5.v8.dt.erd.service
Class ErdUtil
- java.lang.Object
-
- com._1c.g5.v8.dt.erd.service.ErdUtil
-
public final class ErdUtil extends Object
Support class for ERD. Contains static methods for entities processing.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IErdEntity
cloneEntity(IErdEntity entityToClone)
Clones given entity (not entity group).static boolean
containsRelation(Collection<com._1c.g5.v8.dt.diagram.framework.IRelation> relations, com._1c.g5.v8.dt.diagram.framework.IRelation relationToCheck)
Returnstrue
if givenrelations
containsrelationToCheck
.static ErdEntityGroup
copyGroup(ErdEntityGroup groupToCopy)
Copies given group.static MdObject
createProxy(IErdEntity entity)
Creates proxy for given entity.static Collection<IErdEntity>
getAllEntities(ErdEntityGroup entityGroup)
Returns all entities (instance ofErdEntity
) from given group.static Collection<IErdEntity>
getAssociatedEntities(IErdDiagramCore diagramCore, Collection<MdObject> mdObjects)
Returns associated with given mdObjects entities.static Collection<IErdEntity>
getAssociatedEntitiesExtended(IErdDiagramCore diagramCore, Collection<MdObject> mdObjects)
Returns associated with given mdObjects entities.static Collection<MdObject>
getAssociatedMdObjects(Collection<IErdEntity> entities)
Returns associated with given entities mdObjects proxies.static IErdEntity
getEntityGroup(IErdDiagramCore diagramCore, com._1c.g5.v8.dt.diagram.framework.IEntity entity)
Returns group from given diagram core which contain given entity.static Collection<IErdEntity>
getInnerGroups(ErdEntityGroup entityGroup)
Return all inner groups (instance ofErdEntityGroup
) from given group.static boolean
isRussianLocale()
Returnstrue
if current locale is russian.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
-
-
-
Method Detail
-
getAllEntities
public static Collection<IErdEntity> getAllEntities(ErdEntityGroup entityGroup)
Returns all entities (instance ofErdEntity
) 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 benull
.- Returns:
- entities from given group. Can't return
null
.
-
getInnerGroups
public static Collection<IErdEntity> getInnerGroups(ErdEntityGroup entityGroup)
Return all inner groups (instance ofErdEntityGroup
) from given group.- Parameters:
entityGroup
- - group. Can't benull
.- 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 benull
.- 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 benull
.- 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 benull
.entity
- - entity which group need to look for. Can't benull
.- 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 benull
.mdObjects
- - mdObjects to look for associated entities. Can't benull
.- 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 benull
.mdObjects
- - mdObjects to look for associated entities. Can't benull
.- 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 benull
.- 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 benull
.relationsToMove
- - relations, connected to entities moved entities. Can't benull
.allEntities
- - all diagram entities. Can't benull
.allRelations
- - all diagram relations. Can't benull
.
-
createProxy
public static MdObject createProxy(IErdEntity entity)
Creates proxy for given entity. Entity should have notnull
URI and notnull
eClass.- Parameters:
entity
- - entity to create proxy for. Can't havenull
URI ornull
eClass. Can't benull
.- Returns:
- proxy for given entity. Can't return
null
.
-
isRussianLocale
public static boolean isRussianLocale()
Returnstrue
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)
Returnstrue
if givenrelations
containsrelationToCheck
.- Parameters:
relations
- - relations. Cannot benull
.relationToCheck
- - relation to check for containment. Cannot benull
.- Returns:
true
if givenrelations
containsrelationToCheck
.
-
-