Class Widget<W extends Widget<W,​WL>,​WL extends WidgetLook<WL>>

    • Field Detail

      • DEFAULT_CURSOR_ICON

        public static final CursorIcon DEFAULT_CURSOR_ICON
    • Constructor Detail

      • Widget

        public Widget()
        Creates a new Widget.
    • Method Detail

      • applyOnBaseLook

        public final W applyOnBaseLook​(IElementTaker<WL> baseLookMutator)
        Applies the given base look mutator to the base look of the current Widget.
        Parameters:
        baseLookMutator -
        Returns:
        the current Widget.
      • applyOnFocusLook

        public final W applyOnFocusLook​(IElementTaker<WL> focusLookMutator)
        Applies the given focus look mutator to the focus look of the current Widget.
        Parameters:
        focusLookMutator -
        Returns:
        the current Widget.
      • applyOnHoverLook

        public final W applyOnHoverLook​(IElementTaker<WL> hoverLookMutator)
        Applies the given hover look mutator to the hover look of the current Widget.
        Parameters:
        hoverLookMutator -
        Returns:
        the current Widget.
      • belongsDirectltyToGUI

        public final boolean belongsDirectltyToGUI()
        Returns:
        true if the current Widget belongs directly to a WidgetGUI.
      • belongsToGUI

        public final boolean belongsToGUI()
        Returns:
        true if the current Widget belongs to a WidgetGUI, directly or indirectly.
      • belongsToParent

        public final boolean belongsToParent()
        Returns:
        true if the current Widget belongs directly to a WidgetGUI or another Widget.
      • belongsToWidget

        public final boolean belongsToWidget()
        Returns:
        true if the current Widget belongs directly to another Widget.
      • containsPointOnGUI

        public final boolean containsPointOnGUI​(int xPositionOnGUI,
                                                int yPositionOnGUI)
        Parameters:
        xPositionOnGUI -
        yPositionOnGUI -
        Returns:
        true if the current Widget contains the point, that has: -the given x-position on the WidgetGUI the current Widget belongs to -the given y-position on the WidgetGUI the current Widget belongs to
      • containsPointOnParent

        public final boolean containsPointOnParent​(int xPositionOnParent,
                                                   int yPositionOnParent)
        Parameters:
        xPositionOnParent -
        yPositionOnParent -
        Returns:
        true if the current Widget contains the point, that has: -the given x-position on the parent the current Widget belongs to -the given y-position on the parent the current Widget belongs to
      • freeViewAreaIsUnderCursor

        public final boolean freeViewAreaIsUnderCursor()
        The free view area of a Widget is the part of the view area of the Widget where does not lie a child Widget, that is for painting, of the Widget.
        Returns:
        true if the free view area of the curent Widget is under the cursor.
      • getChildWidgetsRecursively

        public final LinkedList<Widget<?,​?>> getChildWidgetsRecursively()
        Returns:
        the child Widgets of the current Widget recursively.
      • getCursorXPosition

        public final int getCursorXPosition()
        Returns:
        the x-position of the cursor on the current Widget.
      • getCursorYPosition

        public final int getCursorYPosition()
        Returns:
        the y-position of the cursor on the current Widget.
      • getRefBaseLook

        public final WL getRefBaseLook()
        Returns:
        the base look of the current Widget.
      • getRefFocusLook

        public final WL getRefFocusLook()
        Returns:
        the focus look of the current Widget.
      • getRefHoverLook

        public final WL getRefHoverLook()
        Returns:
        the hover look of the current Widget.
      • getRefLook

        public final WL getRefLook()
        The current look of a Widget depends on its state. -not hovered, not focused -> base look -hovered, not focused -> hover look -hovered, focused -> hover look -focused, not hovered -> focus look
        Returns:
        the current look of the current Widget.
      • getRefPaintableWidgets

        public final LinkedList<Widget<?,​?>> getRefPaintableWidgets()
        Returns:
        the paintable Widgets of the current Widget.
      • getRefPaintableWidgetsRecursively

        public final LinkedList<Widget<?,​?>> getRefPaintableWidgetsRecursively()
        Returns:
        the paintable Widgets of the current Widget recursively.
      • getXPositionOnGUI

        public final int getXPositionOnGUI()
        Returns:
        the x-position of the current Widget on the parent of the current Widget.
      • getYPositionOnGUI

        public final int getYPositionOnGUI()
        Returns:
        the y-position of the current Widget on the parent of the current Widget.
      • greysOutWhenDisabled

        public final boolean greysOutWhenDisabled()
        Returns:
        true if the current Widget grays out when it is disabled.
      • hasLeftMouseButtonClickAction

        public final boolean hasLeftMouseButtonClickAction()
        Returns:
        true if the current Widget has a left mouse button click action.
      • hasLeftMouseButtonPressAction

        public final boolean hasLeftMouseButtonPressAction()
        Returns:
        true if the current Widget has a left mouse button press action.
      • hasLeftMouseButtonReleaseAction

        public final boolean hasLeftMouseButtonReleaseAction()
        Returns:
        true if the current Widget has a left mouse button release action.
      • hasMouseMoveAction

        public final boolean hasMouseMoveAction()
        Returns:
        true if the current Widget has a mouse move action.
      • hasMouseWheelClickAction

        public final boolean hasMouseWheelClickAction()
        Returns:
        true if the current Widget has a mouse wheel click action.
      • hasMouseWheelPressAction

        public final boolean hasMouseWheelPressAction()
        Returns:
        true if the current Widget has a mouse wheel press action.
      • hasMouseWheelReleaseAction

        public final boolean hasMouseWheelReleaseAction()
        Returns:
        true if the current Widget has a mouse wheel release action.
      • hasRightMouseButtonClickAction

        public final boolean hasRightMouseButtonClickAction()
        Returns:
        true if the current Widget has a right mouse button click action.
      • hasRightMouseButtonPressAction

        public final boolean hasRightMouseButtonPressAction()
        Returns:
        true if the current Widget has a right mouse button press action.
      • hasRightMouseButtonReleaseAction

        public final boolean hasRightMouseButtonReleaseAction()
        Returns:
        true if the current Widget has a right mouse button release action.
      • isFocused

        public final boolean isFocused()
        Returns:
        true if the current Widget is focused.
      • isHovered

        public final boolean isHovered()
        Returns:
        true if the current Widget is hovered.
      • isUnderCursor

        public final boolean isUnderCursor()
        Returns:
        true if the current Widget is under the cursor.
      • noteMouseMove

        public final void noteMouseMove​(int cursorXPosition,
                                        int cursorYPosition)
        Lets the current IInputTaker note a mouse move. The given cursorXPositionOnViewArea and cursorYPositionOnViewArea are the new position of the cursor.
        Specified by:
        noteMouseMove in interface IInputTaker
      • paintRecursively

        public final void paintRecursively​(IPainter painter)
        Paints the current Widget recursively using the position on its parent and the given painter. This method ensures that the given painter has the same position at the end of the painting as the beginning.
        Parameters:
        painter -
      • removeGreyOutWhenDisabled

        public final W removeGreyOutWhenDisabled()
        Avoids that the current Widget grays out when it is disabled.
        Returns:
        the current Widget.
      • removeLeftMouseButtonClickAction

        public final W removeLeftMouseButtonClickAction()
        Removes the left mouse button click action of the current Widget.
        Returns:
        the current Widget.
      • removeLeftMouseButtonPressAction

        public final W removeLeftMouseButtonPressAction()
        Removes the left mouse button press action of the current Widget.
        Returns:
        the current Widget.
      • removeLeftMouseButtonReleaseAction

        public final W removeLeftMouseButtonReleaseAction()
        Removes the left mouse button release action of the current Widget.
        Returns:
        the current Widget.
      • removeRightMouseButtonClickAction

        public final W removeRightMouseButtonClickAction()
        Removes the right mouse button click action of the current Widget.
        Returns:
        the current Widget.
      • removeRightMouseButtonPressAction

        public final W removeRightMouseButtonPressAction()
        Removes the right mouse button press action of the current Widget.
        Returns:
        the current Widget.
      • removeRightMouseButtonReleaseAction

        public final W removeRightMouseButtonReleaseAction()
        Removes the right mouse button release action of the current Widget.
        Returns:
        the current Widget.
      • setCollapsed

        public final W setCollapsed()
        Sets the current Widget collapsed.
        Returns:
        the current Widget.
      • setDisabled

        public final W setDisabled()
        Sets the current Widget disabled.
        Returns:
        the current Widget.
      • setEnabled

        public final W setEnabled()
        Sets the current Widget enabled.
        Returns:
        the current Widget.
      • setExpanded

        public final W setExpanded()
        Sets the current Widget expanded.
        Returns:
        the current Widget.
      • setFocused

        public final W setFocused()
        Sets the current Widget focused.
        Returns:
        the current Widget.
      • setGreyOutWhenDisabled

        public final W setGreyOutWhenDisabled()
        Lets the current Widget grey out when it is disabled.
        Returns:
        the current Widget.
      • setHovered

        public final W setHovered()
        Sets the current Widget hovered.
        Returns:
        the current Widget.
      • setPositionOnParent

        public final void setPositionOnParent​(int xPositionOnParent,
                                              int yPositionOnParent)
        Sets the position of the current Widget on its parent.
        Parameters:
        xPositionOnParent -
        yPositionOnParent -
      • setUnhovered

        public final W setUnhovered()
        Sets the current Widget unhovered.
        Returns:
        the current Widget.
      • setUnfocused

        public final W setUnfocused()
        Sets the current Widget unfocused.
        Returns:
        the current Widget.
      • showAreaIsUnderCursor

        public abstract boolean showAreaIsUnderCursor()
        Returns:
        true if the view are of the current Widget is under the cursor.