Class AbstractWebDepictContext

    • Constructor Detail

      • AbstractWebDepictContext

        public AbstractWebDepictContext​(GuiseSession session,
                                        Destination destination)
                                 throws java.io.IOException
        Guise session constructor.
        Parameters:
        session - The Guise user session of which this context is a part.
        destination - The destination with which this context is associated.
        Throws:
        java.lang.NullPointerException - if the given session and/or destination is null.
        java.io.IOException - If there was an I/O error loading a needed resource.
    • Method Detail

      • isQuirksMode

        public boolean isQuirksMode()

        This implementation always returns false.

        Specified by:
        isQuirksMode in interface WebDepictContext
        Returns:
        Whether quirks mode is being used.
      • getCSSStyleString

        public java.lang.String getCSSStyleString​(java.util.Map<java.lang.String,​java.lang.Object> styles,
                                                  Orientation orientation)
        Description copied from interface: WebDepictContext
        Returns a string representation of the provided style declarations. This method performs special processing on the following properties, including generating user-agent-specific styles to allow proper display on certain browsers:
        • "color" with a value of Color and an alpha less than 1.0.
        • "cursor" with a value of URI, interpreted as a predefined cursor (one of Cursor.getURI()) or as a URI to a custom cursor; URI references are allowed in either.
        • "display" with a value of "inline-block".
        • "font-weight" with a value of Number, interpreted in terms of PresentationModel.FONT_WEIGHT_NORMAL and PresentationModel.FONT_WEIGHT_BOLD.
        • "max-width" or "max-height" with a pixel value of Extent.
        • "opacity" with a value of Number.
        These styles include the CSS property "display" with a value of "inline-block". This method supports values of the following types: All other values will be added using Object.toString().
        Specified by:
        getCSSStyleString in interface WebDepictContext
        Parameters:
        styles - The map of styles to write, each keyed to a CSS style property.
        orientation - The orientation of the component for which the style is being produced.
        Returns:
        A string containing the given CSS properties and styles.
      • appendCSSValue

        protected java.lang.StringBuilder appendCSSValue​(java.lang.StringBuilder stringBuilder,
                                                         java.lang.Object value,
                                                         Orientation orientation)
        Appends a CSS value to the given string builder. If the value is an array of a non-primitive type, each element in the array will be appended separated by spaces.
        Parameters:
        stringBuilder - The string builder to which the style value will be added.
        value - The value to append.
        orientation - The orientation of the component for which the style is being produced.
        Returns:
        The provided string builder.
      • appendCSSValue

        protected static java.lang.StringBuilder appendCSSValue​(java.lang.StringBuilder stringBuilder,
                                                                Color color)
        Appends a CSS string representation of the given color. This method correctly handles transparent colors with the special CSS keyword "transparent".
        Parameters:
        stringBuilder - The string builder to which the style will be added.
        color - The color to represent in CSS.
        Returns:
        The provided string builder.
      • appendCSSValue

        protected static java.lang.StringBuilder appendCSSValue​(java.lang.StringBuilder stringBuilder,
                                                                Cursor cursor,
                                                                Orientation orientation)
        Appends a CSS string representation of the given cursor.
        Parameters:
        stringBuilder - The string builder to which the style will be added
        cursor - The cursor to represent in CSS.
        orientation - The orientation of the component for which the cursor is being set.
        Returns:
        The provided string builder.
        Throws:
        java.lang.NullPointerException - if the given cursor is null.
      • appendCSSValue

        protected static java.lang.StringBuilder appendCSSValue​(java.lang.StringBuilder stringBuilder,
                                                                Extent extent)
        Appends a CSS string representation of the given extent.
        Parameters:
        stringBuilder - The string builder to which the style will be added
        extent - The extent to be represented by a CSS length string.
        Returns:
        The provided string builder.
      • appendCSSValue

        protected static java.lang.StringBuilder appendCSSValue​(java.lang.StringBuilder stringBuilder,
                                                                FontStyle fontStyle)
        Appends a CSS string representation of the given font style.
        Parameters:
        stringBuilder - The string builder to which the style will be added
        fontStyle - The font style to represent in CSS.
        Returns:
        The provided string builder.
        Throws:
        java.lang.NullPointerException - if the given font style is null.
      • appendCSSValue

        protected static java.lang.StringBuilder appendCSSValue​(java.lang.StringBuilder stringBuilder,
                                                                LineStyle lineStyle)
        Appends a CSS string representation of the given line style, such as used for a border style.
        Parameters:
        stringBuilder - The string builder to which the style will be added
        lineStyle - The line style to be represented in CSS.
        Returns:
        The provided string builder.
        Throws:
        java.lang.NullPointerException - if the given line style is null.
      • appendCSSValue

        protected static java.lang.StringBuilder appendCSSValue​(java.lang.StringBuilder stringBuilder,
                                                                java.util.List<?> items)
        Appends a CSS string containing the given list of items. Strings containing spaces will be quoted. Items that are null will be represented by a missing item in the list.
        Parameters:
        stringBuilder - The string builder to which the style will be added
        items - The list of items to be converted to a string.
        Returns:
        The provided string builder.
      • appendCSSValue

        protected java.lang.StringBuilder appendCSSValue​(java.lang.StringBuilder stringBuilder,
                                                         java.net.URI uri)
        Appends a CSS string representation of the given URI. The URI will be dereferenced and resolved to the application as well as converted to a depict URI.
        Parameters:
        stringBuilder - The string builder to which the style will be added
        uri - The URI to be represented in CSS.
        Returns:
        The provided string builder.
        See Also:
        AbstractDepictContext.getDepictionURI(URI, String...)