Class UiLayoutService

    • Constructor Detail

      • UiLayoutService

        public UiLayoutService()
    • Method Detail

      • getConnectionMidpoint

        public ILocation getConnectionMidpoint​(Connection c,
                                               double d)
        Description copied from interface: IPeLayoutService
        Gets the connection midpoint.
        Specified by:
        getConnectionMidpoint in interface IPeLayoutService
        Parameters:
        c - the connection
        d - a relative location on the connection (must be between 0 and 1)
        Returns:
        the connection midpoint
      • getGaBoundsForAnchor

        public IRectangle getGaBoundsForAnchor​(Anchor anchor)
        Description copied from interface: IPeLayoutService
        Returns the bounds of the graphics algorithm, which is referenced by the anchor.
        Specified by:
        getGaBoundsForAnchor in interface IPeLayoutService
        Parameters:
        anchor - the anchor
        Returns:
        the bounds of the anchor graphics algorithm
      • getLocationInfo

        public ILocationInfo getLocationInfo​(Shape shape,
                                             int x,
                                             int y)
        Description copied from interface: IPeLayoutService
        Returns the location info for a specific position inside a shape. The location info contains the shape and the graphics algorithm at the given position.
        Specified by:
        getLocationInfo in interface IPeLayoutService
        Parameters:
        shape - the shape
        x - x coordinate
        y - y coordinate
        Returns:
        the location info
        See Also:
        ILocationInfo
      • calculateSize

        public IDimension calculateSize​(GraphicsAlgorithm ga)
        Description copied from interface: IGaLayoutService
        Calculates the size of the given graphics algorithm. If the graphics algorithm is a polyline or polygon then the size will be calculated. Otherwise the size of the graphics algorithm is simply returned.
        Specified by:
        calculateSize in interface IGaLayoutService
        Parameters:
        ga - graphics algorithm
        Returns:
        the dimension of the given graphics algorithm
      • calculateSize

        public IDimension calculateSize​(GraphicsAlgorithm ga,
                                        boolean considerLineWidth)
        Description copied from interface: IGaLayoutService
        Calculates the size of the given graphics algorithm. If the graphics algorithm is a polyline or polygon then the size will be calculated. Otherwise the size of the graphics algorithm is simply returned.
        Specified by:
        calculateSize in interface IGaLayoutService
        Parameters:
        ga - graphics algorithm
        considerLineWidth - if TRUE, the line width will be considered in the dimension
        Returns:
        the dimension of the given graphics algorithm
      • setHeight

        public void setHeight​(GraphicsAlgorithm ga,
                              int height)
        Description copied from interface: IGaLayoutService
        Sets the height of the given graphics algorithm.
        Specified by:
        setHeight in interface IGaLayoutService
        Parameters:
        ga - graphics algorithm
        height - the new height
      • setLocationAndSize

        public void setLocationAndSize​(GraphicsAlgorithm ga,
                                       int x,
                                       int y,
                                       int width,
                                       int height)
        Description copied from interface: IGaLayoutService
        Sets location and size of the given graphics algorithm.
        Specified by:
        setLocationAndSize in interface IGaLayoutService
        Parameters:
        ga - graphics algorithm
        x - the new x coordinate
        y - the new y coordinate
        width - the new width
        height - the new height
      • setLocationAndSize

        public void setLocationAndSize​(GraphicsAlgorithm ga,
                                       int x,
                                       int y,
                                       int width,
                                       int height,
                                       boolean avoidNegativeCoordinates)
        Description copied from interface: IGaLayoutService
        Sets location and size of the given graphics algorithm.
        Specified by:
        setLocationAndSize in interface IGaLayoutService
        Parameters:
        ga - graphics algorithm
        x - the new x coordinate
        y - the new y coordinate
        width - the new width
        height - the new height
        avoidNegativeCoordinates - if TRUE, a negative coordinate will automatically set to 0.
      • setLocation

        public void setLocation​(GraphicsAlgorithm ga,
                                int x,
                                int y)
        Description copied from interface: IGaLayoutService
        Sets the location of the given graphics algorithm.
        Specified by:
        setLocation in interface IGaLayoutService
        Parameters:
        ga - graphics algorithm
        x - the new x coordinate
        y - the new y coordinate
      • setLocation

        public void setLocation​(GraphicsAlgorithm ga,
                                int x,
                                int y,
                                boolean avoidNegativeCoordinates)
        Description copied from interface: IGaLayoutService
        Sets the location of the given graphics algorithm.
        Specified by:
        setLocation in interface IGaLayoutService
        Parameters:
        ga - graphics algorithm
        x - the new x coordinate
        y - the new y coordinate
        avoidNegativeCoordinates - if TRUE, a negative coordinate will automatically set to 0.
      • setSize

        public void setSize​(GraphicsAlgorithm ga,
                            int width,
                            int height)
        Description copied from interface: IGaLayoutService
        Sets the size of the given graphics algorithm.
        Specified by:
        setSize in interface IGaLayoutService
        Parameters:
        ga - graphics algorithm
        width - the new width
        height - the new height
      • setWidth

        public void setWidth​(GraphicsAlgorithm ga,
                             int width)
        Description copied from interface: IGaLayoutService
        Sets the width of the given graphics algorithm.
        Specified by:
        setWidth in interface IGaLayoutService
        Parameters:
        ga - graphics algorithm
        width - the new width
      • calculateTextSize

        public IDimension calculateTextSize​(java.lang.String text,
                                            Font font,
                                            boolean handleMultiline)
        Description copied from interface: IUiLayoutService
        Calculates the width and height of the given text in the given font.
        Specified by:
        calculateTextSize in interface IUiLayoutService
        Parameters:
        text - the string to calculate the rendering size for
        font - the font which should be considered for the string
        handleMultiline - Defines if line breaks in the string should be used in the calculation of the size or not. In case true, a new line character in the string will increase the size of the returned dimensions by one line, in case false a new line character will be ignored.
        Returns:
      • calculateTextSize

        public IDimension calculateTextSize​(AbstractText text)
        Description copied from interface: IUiLayoutService
        Calculates the width and height of the given text in the font of the gievn text. In case the given text is a MultiText new line characters in the string will increase the height of the returned size, otherwise (text is a Text) any new line characters will be ignored.
        Specified by:
        calculateTextSize in interface IUiLayoutService
        Parameters:
        text - the AbstractText to calculate the rendering size for
        Returns: