Package ej.mwt.style

Interface Style

  • All Known Implementing Classes:
    EditableStyle

    public interface Style
    A style describes how widgets must be rendered on screen. The attributes of the style are strongly inspired from CSS.

    The dimension is used to control the size of the widget.

    The horizontal and vertical alignments are used to position the content of the widget within its bounds.

    The margin, border and padding are the used to wrap the content of the widget. The widget is wrapped in the following sequence: first the padding, then the border, and finally the margin.
    Outlines model.

    The background is used to render the background of the widget.

    The color can be used to render the content of the widget, such as text or drawings.

    The font can be used to render the text.

    • Method Detail

      • getDimension

        Dimension getDimension()
        Gets the dimension.
        Returns:
        the dimension.
      • getHorizontalAlignment

        int getHorizontalAlignment()
        Gets the horizontal alignment.
        Returns:
        the horizontal alignment.
        See Also:
        Alignment
      • getVerticalAlignment

        int getVerticalAlignment()
        Gets the vertical alignment.
        Returns:
        the vertical alignment.
        See Also:
        Alignment
      • getMargin

        Outline getMargin()
        Gets the margin.
        Returns:
        the margin.
      • getBorder

        Outline getBorder()
        Gets the border.
        Returns:
        the border.
      • getPadding

        Outline getPadding()
        Gets the padding.
        Returns:
        the padding.
      • getBackground

        Background getBackground()
        Gets the background.
        Returns:
        the background.
      • getColor

        int getColor()
        Gets the color.
        Returns:
        the color.
      • getFont

        ej.microui.display.Font getFont()
        Gets the font.
        Returns:
        the font.
      • getExtraObject

        <T> T getExtraObject​(int fieldId,
                             java.lang.Class<T> clazz,
                             T defaultValue)
        Gets an extra field as an object of the given type.
        Type Parameters:
        T - the type of the extra field.
        Parameters:
        fieldId - the ID of the extra field.
        clazz - the type of the extra field.
        defaultValue - the value to return if the extra field is not set or if it does not match the given type.
        Returns:
        the value of the extra field.
      • getExtraInt

        int getExtraInt​(int fieldId,
                        int defaultValue)
        Gets an extra field as an int.
        Parameters:
        fieldId - the ID of the extra field.
        defaultValue - the value to return if the extra field is not set or if it is not an integer.
        Returns:
        the value of the extra field.
      • getExtraFloat

        float getExtraFloat​(int fieldId,
                            float defaultValue)
        Gets an extra field as a float.
        Parameters:
        fieldId - the ID of the extra field.
        defaultValue - the value to return if the extra field is not set or if it is not a float.
        Returns:
        the value of the extra field.
      • equals

        boolean equals​(@Nullable
                       java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        int hashCode()
        Overrides:
        hashCode in class java.lang.Object