Class BpSchemeUtil


  • public class BpSchemeUtil
    extends Object
    Support class for bp scheme.
    • Field Detail

      • UNKNOWN_BM_ID

        public static final long UNKNOWN_BM_ID
        Unknown bm id. If item returns this id, it means that item does not have attached to bm model object.
        See Also:
        Constant Field Values
    • Method Detail

      • createDummyEntity

        public static com._1c.g5.v8.dt.diagram.framework.IEntity createDummyEntity()
        Creates and returns dummy entity.
        Returns:
        dummy entity. Can't return null
      • getLanguage

        public static String getLanguage()
        Returns current JVM language.
        Returns:
        current JVM language. Can't return null.
      • isRussianLocale

        public static boolean isRussianLocale()
        Returns true if current JVM language is russian.
        Returns:
        true if current JVM language is russian.
      • getAvailableName

        public static String getAvailableName​(String desiredName,
                                              com._1c.g5.v8.dt.diagram.framework.IDiagramCore<? extends com._1c.g5.v8.dt.diagram.framework.IEntity,​? extends BpRelation> diagramCore)
        Returns available name. If item with given name already on diagram, adds number to given name.
        Parameters:
        desiredName - - desired name. Can't be null.
        diagramCore - - diagram core. Can't be null.
        Returns:
        available name. Can't return null.
      • getAvailableName

        public static String getAvailableName​(String desiredName,
                                              Collection<String> takenNames)
        Returns available name. If item with given name already on diagram, adds number to given name.
        Parameters:
        desiredName - - desired name. Can't be null.
        takenNames - - already taken names. Can't be null.
        Returns:
        available name. Can't return null.
      • setBmModel

        public static void setBmModel​(IBmModel bmModel)
        Set's bm model. Bm model should be set before using getItemById(long) mehtod.
        Parameters:
        bmModel - - bm model containing graphical scheme. Can't be null.
      • getItemById

        public static IBmObject getItemById​(long bmId)
        Returns item with given bm id.
        Parameters:
        bmId - - item's bm id.
        Returns:
        item with given bm id. If there is no item with given id, returns null.
      • createDiagramCore

        public static com._1c.g5.v8.dt.diagram.framework.IDiagramCore<BpEntity,​BpRelation> createDiagramCore​(Collection<GraphicalSchemeItem> items)
        Creates diagram core from given items.
        Parameters:
        items - - items to create diagram core. Can't be null.
        Returns:
        created diagram core. Can't return null.
      • createDiagramCore

        public static com._1c.g5.v8.dt.diagram.framework.IDiagramCore<BpEntity,​BpRelation> createDiagramCore​(GraphicalScheme graphicalScheme)
        Creates diagram core from given scheme.
        Parameters:
        graphicalScheme - - scheme to create diagram core. Can't be null.
        Returns:
        created diagram core. Can't return null.
      • createItemAddressingAttribute

        public static SchemeItemAddressingAttribute createItemAddressingAttribute​(AddressingAttribute addressingAttribute)
        Creates scheme item addressing attribute with undefined value.
        Parameters:
        addressingAttribute - - addressing attribute to create scheme item addressing attribute. Can't be null.
        Returns:
        created scheme item addressing attribute. Can't return null.