Interface IPlatformVisualComputer


  • public interface IPlatformVisualComputer
    Computes visual element properties dependent on the specific client platform.
    • Method Detail

      • getStandardWidth

        int getStandardWidth​(HTMStandardWidthType widthType)
        Returns standart width for the given type.
        Parameters:
        widthType - the standard width type, cannot be null
        Returns:
        width
      • getStandardHeight

        int getStandardHeight​(HTMStandardHeightType heightType)
        Returns standart height for the given type.
        Parameters:
        heightType - the standard height type, cannot be null
        Returns:
        height
      • scaleWidth

        int scaleWidth​(int width)
        Returns scaled width.
        Parameters:
        width - the width
        Returns:
        scaled width
      • scaleHeight

        int scaleHeight​(int height)
        Returns scaled height.
        Parameters:
        width - the width
        Returns:
        scaled width
      • getHorSpacing

        int getHorSpacing​(FormItemSpacing horSpacingVariant)
        Returns horisontal spacing for the given variant.
        Parameters:
        horSpacingVariant - the horisontal spacing variant, cannot be null
        Returns:
        spacing
      • getVerSpacing

        int getVerSpacing​(FormItemSpacing verSpacingVariant)
        Returns vertical spacing for the given variant.
        Parameters:
        verSpacingVariant - the vertical spacing variant, cannot be null
        Returns:
        spacing
      • getSpaceLength

        int getSpaceLength​(int characterCount,
                           Font font)
        Returns the space length for the given font and amount of characters.
        Parameters:
        characterCount - the abount of characters for calculation
        font - the font, cannot be null
        Returns:
        length
      • getLogicRowHeight

        int getLogicRowHeight​(HTMRowType rowType,
                              Font font)
        Returns a hight of the logic row.
        Parameters:
        rowType - the row type, cannot be null
        font - the font, cannot be null
        Returns:
        height
      • scale

        int scale​(double pixels,
                  boolean addMobileScale,
                  boolean dpiCompensation)
        Calculates scale for the given pixels and dpi.
        Parameters:
        pixels - the size
        addMobileScale - true if it is mobile theme
        dpiCompensation - the dpi compensation
        Returns:
        size
      • scaleFont

        void scaleFont​(Font font,
                       MeasurerFontKind fontKind)
        Scales the given font.
        Parameters:
        font - the font is mutable, cannot be null
        fontKind - the font kind is immutable, cannot be null
      • getIndent

        int getIndent​(HTMIndentType indentType)
        Returns indent value for the given type.
        Parameters:
        indentType - the indent type, cannot be null
        Returns:
        indent value
      • getStringSize

        Size getStringSize​(String text,
                           Font font,
                           PrefSpac ps)
        Calculates the string size.
        Parameters:
        text - the string, cannot be null
        font - the font, cannot be null
        ps - the spacing preferences, cannot be null
        Returns:
        size, cannot be null
      • getV8LogFont

        V8LogFont getV8LogFont​(Font font,
                               MeasurerFontKind fontKind,
                               boolean noScale)
        Returns V8 logic font for the given font.
        Parameters:
        font - the font, cannot be null
        fontKind - the font kind, cannot be null
        noScale - , use true if scale is required
        Returns:
        font, cannot be null
      • getV8LogFont

        void getV8LogFont​(Font font,
                          V8LogFont logFont,
                          int dpi,
                          IV8Style pStyle,
                          int ratio,
                          double angle,
                          boolean alwaysHighQuality)
        Assign new V8 logic font value for the given logic font.
        Parameters:
        font - the font, cannot be null
        logFont - is mutable logical font, cannot be null
        dpi - the dpi compensation
        pStyle - the v8 style, cannot be null
        ratio - the ratio
        angle - the angle
        alwaysHighQuality - the hight quality flag
      • getDPI

        int getDPI()
        Returns DPI compensation.
        Returns:
        DPI
      • getMobileDPI

        int getMobileDPI()
        Returns mobile DPI compensation.
        Returns:
        mobile DPI
      • getCommonRatio

        int getCommonRatio()
        Returns the common ratio.
        Returns:
        ratio
      • setCommonRatio

        void setCommonRatio​(int ratio)
        Set the common ratio.
        Parameters:
        ratio -
      • measureString

        org.eclipse.swt.graphics.Rectangle measureString​(String text,
                                                         V8LogFont logFont,
                                                         PrefSpac ps,
                                                         boolean alwaysUseFormattedString)
        Calculates text size as rectangle.
        Parameters:
        text - , cannot be null
        logFont - , cannot be null
        ps - , cannot be null
        alwaysUseFormattedString - the flag for formatted string
        Returns:
        rectangle, cannot be null
      • dereferenceFont

        void dereferenceFont​(Font font)
        Dereference the given font.
        Parameters:
        font - , cannot be null
      • getV8PictureProps

        V8PictureProps getV8PictureProps​(V8Picture picture,
                                         boolean useDPI,
                                         boolean useScale,
                                         boolean keepOriginalSize)
        Returns properties for the given picture.
        Parameters:
        picture - the picture, can be null
        useDPI - whether DPI should be used or not
        useScale - whether scale should be used or not
        keepOriginalSize - the keep original size flag
        Returns:
      • getSumRatio

        int getSumRatio​(boolean useScale,
                        boolean useMobileScale,
                        boolean useDPI)
        Returns sum ratio.
        Parameters:
        useScale - whether scale should be used or not
        useMobileScale - whether mobile scale should be used or not
        useDPI - whether DPI should be used or not
        Returns:
        ratio
      • getStyle

        IV8Style getStyle()
        Returns style.
        Returns:
        cannot be null
      • getBaseFont

        Font getBaseFont()
        Returns the base font.
        Returns:
        the base font, can be null
      • getCharWidth

        double getCharWidth()
        Returns the char width.
        Returns:
        the char width.
      • getCharHeight

        double getCharHeight()
        Returns the char height.
        Returns:
        the char height.
      • calcFormattedStringByMaxWidth

        IPlatformVisualComputer.FormattedStringCalculationMaxResult calcFormattedStringByMaxWidth​(String text,
                                                                                                  int maxWidth,
                                                                                                  Font fnt,
                                                                                                  boolean noPrefix,
                                                                                                  TextBreakMode breakMode,
                                                                                                  FormVisualEntity formElement)
        Calculates a formatted string by max width.
        Parameters:
        text - the text, cannot be null
        maxWidth - the max width
        fnt - the font, cannot be null
        noPrefix - the prefix flag
        breakMode - the word break mode, cannot be null
        formElement - the form element, cannot be null
        Returns:
        formatted string calculation result, cannot be null
      • getFormattedStringInfo

        IPlatformVisualComputer.FormattedStringInfo getFormattedStringInfo​(String formattedString)
        Returns information for the given formatted string.
        Parameters:
        formattedString - the formatted string, cannot be null
        Returns:
        formatted string information, cannot be null