Package ch.nolix.element.gui
Class Widget<W extends Widget<W,WL>,WL extends WidgetLook<WL>>
- java.lang.Object
-
- ch.nolix.element.base.Element<CE>
-
- ch.nolix.element.configuration.ConfigurableElement<W>
-
- ch.nolix.element.gui.Widget<W,WL>
-
- Type Parameters:
W
- The type of aWidget
.WL
- The type of theWidgetLook
of aWidget
.
- All Implemented Interfaces:
Castable
,IFluentObject<W>
,ISmartObject<W>
,Listable<W>
,Transformable<W>
,TypeRequestable
,OptionalIdentifiableByString<W>
,OptionalTokenable<W>
,OptionalIdentifiedByString
,OptionalTokened
,Rectangular
,TopLeftPositioned
,TopLeftPositionedRecangular
,ContainsElementByStringIdRequestable
,EnablingRequestable
,ExpansionRequestable
,Recalculable
,Resettable
,IInputActionManager<W>
,IConfigurableElement<W>
,IElement
,IMutableElement<W>
,IInputTaker
,ISmartElement<W>
- Direct Known Subclasses:
Area
,BorderWidget
,Line
public abstract class Widget<W extends Widget<W,WL>,WL extends WidgetLook<WL>> extends ConfigurableElement<W> implements EnablingRequestable, ExpansionRequestable, IInputActionManager<W>, IInputTaker, Recalculable, TopLeftPositionedRecangular
AWidget
is an element on aWidgetGUI
. AWidget
determines its width and height. AWidget
is aConfigurableElement
.- Author:
- Silvan Wyss
-
-
Field Summary
Fields Modifier and Type Field Description static CursorIcon
DEFAULT_CURSOR_ICON
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addOrChangeAttribute(BaseNode attribute)
Adds or changes the given attribute to the currentWidget
.W
applyOnBaseLook(IElementTaker<WL> baseLookMutator)
Applies the given base look mutator to the base look of the currentWidget
.W
applyOnFocusLook(IElementTaker<WL> focusLookMutator)
Applies the given focus look mutator to the focus look of the currentWidget
.W
applyOnHoverLook(IElementTaker<WL> hoverLookMutator)
Applies the given hover look mutator to the hover look of the currentWidget
.boolean
belongsDirectltyToGUI()
boolean
belongsToGUI()
boolean
belongsToParent()
boolean
belongsToWidget()
boolean
containsPointOnGUI(int xPositionOnGUI, int yPositionOnGUI)
boolean
containsPointOnParent(int xPositionOnParent, int yPositionOnParent)
boolean
freeViewAreaIsUnderCursor()
IFrontEndReader
fromFrontEnd()
LinkedList<Node>
getAttributes()
LinkedList<Widget<?,?>>
getChildWidgets()
LinkedList<Widget<?,?>>
getChildWidgetsRecursively()
CursorIcon
getCursorIcon()
int
getCursorXPosition()
int
getCursorYPosition()
CursorIcon
getCustomCursorIcon()
int
getHeight()
int
getIndexOnGUI()
WidgetParent
getParent()
WidgetGUI<?>
getParentGUI()
Widget<?,?>
getParentWidget()
WL
getRefBaseLook()
WL
getRefFocusLook()
WL
getRefHoverLook()
IKeyBoard
getRefKeyBoard()
WL
getRefLook()
The current look of aWidget
depends on its state.LinkedList<Widget<?,?>>
getRefPaintableWidgets()
LinkedList<Widget<?,?>>
getRefPaintableWidgetsRecursively()
IContainer<IConfigurableElement<?>>
getSubConfigurables()
int
getWidth()
int
getXPosition()
int
getXPositionOnGUI()
int
getYPosition()
int
getYPositionOnGUI()
boolean
greysOutWhenDisabled()
boolean
hasLeftMouseButtonClickAction()
boolean
hasLeftMouseButtonPressAction()
boolean
hasLeftMouseButtonReleaseAction()
boolean
hasMouseMoveAction()
boolean
hasMouseWheelClickAction()
boolean
hasMouseWheelPressAction()
boolean
hasMouseWheelReleaseAction()
boolean
hasRightMouseButtonClickAction()
boolean
hasRightMouseButtonPressAction()
boolean
hasRightMouseButtonReleaseAction()
boolean
isEnabled()
boolean
isExpanded()
boolean
isFocused()
boolean
isHovered()
boolean
isUnderCursor()
void
noteKeyPress(Key key)
Lets the currentIInputTaker
note a key press.void
noteKeyRelease(Key key)
Lets the currentIInputTaker
note a key release.void
noteKeyTyping(Key key)
Lets the currentIInputTaker
note a key typing.void
noteLeftMouseButtonClick()
Lets the currentIInputTaker
note a left mouse button click.void
noteLeftMouseButtonPress()
Lets the currentIInputTaker
note a left mouse button press.void
noteLeftMouseButtonRelease()
Lets the currentIInputTaker
note a left mouse button release.void
noteMouseMove(int cursorXPosition, int cursorYPosition)
Lets the currentIInputTaker
note a mouse move.void
noteMouseWheelClick()
Lets the currentIInputTaker
note a mouse wheel clcik.void
noteMouseWheelPress()
Lets the currentIInputTaker
note a mouse wheel press.void
noteMouseWheelRelease()
Lets the currentIInputTaker
note a mouse wheel release.void
noteMouseWheelRotationStep(RotationDirection rotationDirection)
Lets the currentIInputTaker
note a mouse wheel rotation step.void
noteRightMouseButtonClick()
Lets the currentIInputTaker
note a right mouse button click.void
noteRightMouseButtonPress()
Lets the currentIInputTaker
note a right mouse button press.void
noteRightMouseButtonRelease()
Lets the currentIInputTaker
note a right mouse button release.IFrontEndWriter
onFrontEnd()
void
paintRecursively(IPainter painter)
Paints the currentWidget
recursively using the position on its parent and the given painter.void
recalculate()
W
removeGreyOutWhenDisabled()
Avoids that the currentWidget
grays out when it is disabled.W
removeLeftMouseButtonClickAction()
Removes the left mouse button click action of the currentWidget
.W
removeLeftMouseButtonPressAction()
Removes the left mouse button press action of the currentWidget
.W
removeLeftMouseButtonReleaseAction()
Removes the left mouse button release action of the currentWidget
.W
removeRightMouseButtonClickAction()
Removes the right mouse button click action of the currentWidget
.W
removeRightMouseButtonPressAction()
Removes the right mouse button press action of the currentWidget
.W
removeRightMouseButtonReleaseAction()
Removes the right mouse button release action of the currentWidget
.void
resetConfigurationOnSelf()
Resets the configuration of the currentIConfigurableElement
on itself, and on itself only.W
setCollapsed()
Sets the currentWidget
collapsed.W
setContinuousKeyPressAction(I2ElementTaker<W,Key> continuousKeyPressAction)
Sets the continuous key press action of the currentWidget
.W
setCustomCursorIcon(CursorIcon customCursorIcon)
Sets the customCursorIcon
of the currentWidget
.W
setDisabled()
Sets the currentWidget
disabled.W
setEnabled()
Sets the currentWidget
enabled.W
setExpanded()
Sets the currentWidget
expanded.W
setFocused()
Sets the currentWidget
focused.W
setGreyOutWhenDisabled()
Lets the currentWidget
grey out when it is disabled.W
setHovered()
Sets the currentWidget
hovered.W
setLeftMouseButtonClickAction(IElementTaker<W> leftMouseButtonClickAction)
Sets the left mouse button click action of the currentWidget
.W
setLeftMouseButtonPressAction(IElementTaker<W> leftMouseButtonPressAction)
Sets the left mouse button press action of the currentWidget
.W
setLeftMouseButtonReleaseAction(IElementTaker<W> leftMouseButtonReleaseAction)
Sets the left mouse button release action of the currentWidget
.W
setMouseMoveAction(IElementTaker<W> mouseMoveAction)
Sets the mouse move action of the currentWidget
.W
setMouseWheelClickAction(IElementTaker<W> mouseWheelClickAction)
Sets the mouse wheel click action of the currentWidget
.W
setMouseWheelPressAction(IElementTaker<W> mouseWheelPressAction)
Sets the mouse wheel press action of the currentWidget
.W
setMouseWheelReleaseAction(IElementTaker<W> mouseWheelReleaseAction)
Sets the mouse wheel release action of the currentWidget
.void
setParent(WidgetGUI<?> parentGUI)
void
setPositionOnParent(int xPositionOnParent, int yPositionOnParent)
Sets the position of the currentWidget
on its parent.W
setRightMouseButtonClickAction(IElementTaker<W> rightMouseButtonClickAction)
Sets the right mouse button click action of the currentWidget
.W
setRightMouseButtonPressAction(IElementTaker<W> rightMouseButtonPressAction)
Sets the right mouse button press action of the currentWidget
.W
setRightMouseButtonReleaseAction(IElementTaker<W> rightMouseButtonReleaseAction)
Sets the right mouse button release action of the currentWidget
.W
setUnfocused()
Sets the currentWidget
unfocused.W
setUnhovered()
Sets the currentWidget
unhovered.abstract boolean
showAreaIsUnderCursor()
-
Methods inherited from class ch.nolix.element.configuration.ConfigurableElement
getId, getToken, hasId, hasToken, removeId, removeToken, reset, setId, setToken
-
Methods inherited from interface ch.nolix.common.requestapi.EnablingRequestable
isDisabled
-
Methods inherited from interface ch.nolix.common.requestapi.ExpansionRequestable
isCollapsed
-
Methods inherited from interface ch.nolix.element.elementapi.IConfigurableElement
containsElement, getSubConfigurablesRecursively, hasRole, resetConfiguration
-
Methods inherited from interface ch.nolix.element.elementapi.IElement
fillUpAttributesInto, getSpecification, getSpecificationAs, getSpecificationWithoutHeader, saveAsTo, saveAsTo, saveTo, saveTo, toFormatedString, toXML, toXMLAs
-
Methods inherited from interface ch.nolix.common.generalskillapi.IFluentObject
asConcrete
-
Methods inherited from interface ch.nolix.element.baseguiapi.IInputActionManager
setContinuousKeyPressAction, setLeftMouseButtonClickAction, setLeftMouseButtonPressAction, setLeftMouseButtonReleaseAction, setMouseMoveAction, setMouseWheelClickAction, setMouseWheelPressAction, setMouseWheelReleaseAction, setRightMouseButtonClickAction, setRightMouseButtonPressAction, setRightMouseButtonReleaseAction
-
Methods inherited from interface ch.nolix.element.input.IInputTaker
noteInput, noteKeyInput, noteLeftMouseButtonClick, noteLeftMouseButtonPress, noteLeftMouseButtonRelease, noteMouseInput, noteMouseWheelClick, noteMouseWheelPress, noteMouseWheelRelease, noteRightMouseButtonClick, noteRightMouseButtonPress, noteRightMouseButtonRelease
-
Methods inherited from interface ch.nolix.element.elementapi.IMutableElement
addOrChangeAttribute, addOrChangeAttribute, addOrChangeAttribute, addOrChangeAttributes, resetFrom, resetFrom, resetFrom, resetFromFile
-
Methods inherited from interface ch.nolix.common.generalskillapi.Listable
intoList, intoListAs
-
Methods inherited from interface ch.nolix.common.optionalattributeapi.OptionalIdentifiedByString
getIdInQuotes, hasId
-
Methods inherited from interface ch.nolix.common.optionalattributeapi.OptionalTokened
hasSameTokenAs, hasToken
-
Methods inherited from interface ch.nolix.common.rasterapi.Rectangular
getDiagonal, getPerimeter, isQuadratic
-
Methods inherited from interface ch.nolix.common.rasterapi.TopLeftPositionedRecangular
containsPoint, containsPointRelatively
-
Methods inherited from interface ch.nolix.common.generalskillapi.Transformable
to, to
-
Methods inherited from interface ch.nolix.common.generalskillapi.TypeRequestable
getType, getTypeInPlural, getTypes, isOfConcreteType, isOfConcreteType, isOfType, isOfType
-
-
-
-
Field Detail
-
DEFAULT_CURSOR_ICON
public static final CursorIcon DEFAULT_CURSOR_ICON
-
-
Constructor Detail
-
Widget
public Widget()
Creates a newWidget
.
-
-
Method Detail
-
addOrChangeAttribute
public void addOrChangeAttribute(BaseNode attribute)
Adds or changes the given attribute to the currentWidget
.- Specified by:
addOrChangeAttribute
in interfaceIMutableElement<W extends Widget<W,WL>>
- Overrides:
addOrChangeAttribute
in classConfigurableElement<W extends Widget<W,WL>>
- Parameters:
attribute
-- Throws:
InvalidArgumentException
- if the given attribute is not valid.
-
applyOnBaseLook
public final W applyOnBaseLook(IElementTaker<WL> baseLookMutator)
Applies the given base look mutator to the base look of the currentWidget
.- 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 currentWidget
.- 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 currentWidget
.- Parameters:
hoverLookMutator
-- Returns:
- the current
Widget
.
-
belongsDirectltyToGUI
public final boolean belongsDirectltyToGUI()
-
belongsToGUI
public final boolean belongsToGUI()
-
belongsToParent
public final boolean belongsToParent()
-
belongsToWidget
public final boolean belongsToWidget()
-
containsPointOnGUI
public final boolean containsPointOnGUI(int xPositionOnGUI, int yPositionOnGUI)
-
containsPointOnParent
public final boolean containsPointOnParent(int xPositionOnParent, int yPositionOnParent)
-
freeViewAreaIsUnderCursor
public final boolean freeViewAreaIsUnderCursor()
The free view area of aWidget
is the part of the view area of theWidget
where does not lie a childWidget
, that is for painting, of theWidget
.- Returns:
- true if the free view area of the curent
Widget
is under the cursor.
-
fromFrontEnd
public IFrontEndReader fromFrontEnd()
- Returns:
- the
IFrontEndReader
of the parentGUI
of the currentWidget
. - Throws:
ArgumentDoesNotBelongToParentException
- if the currentWidget
does not belong to aGUI
.
-
getAttributes
public LinkedList<Node> getAttributes()
- Specified by:
getAttributes
in interfaceIElement
- Overrides:
getAttributes
in classConfigurableElement<W extends Widget<W,WL>>
- Returns:
- the attributes of the current
IElement
.
-
getChildWidgets
public final LinkedList<Widget<?,?>> getChildWidgets()
-
getChildWidgetsRecursively
public final LinkedList<Widget<?,?>> getChildWidgetsRecursively()
-
getCursorIcon
public CursorIcon getCursorIcon()
- Returns:
- the
CursorIcon
of the currentWidget
.
-
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
.
-
getCustomCursorIcon
public final CursorIcon getCustomCursorIcon()
- Returns:
- the custom
CursorIcon
of the currentWidget
.
-
getHeight
public final int getHeight()
- Specified by:
getHeight
in interfaceRectangular
- Returns:
- the height of the current
Rectangular
.
-
getIndexOnGUI
public final int getIndexOnGUI()
-
getParent
public final WidgetParent getParent()
- Returns:
- the parent the current
Widget
belongs to. - Throws:
ArgumentDoesNotBelongToParentException
- if the currentWidget
does not belong to a parent.
-
getParentGUI
public final WidgetGUI<?> getParentGUI()
- Returns:
- the
GUI
the currentWidget
belongs to, directly or indirectly. - Throws:
ArgumentDoesNotBelongToParentException
- if the currentWidget
does not belong to aGUI
.
-
getParentWidget
public final Widget<?,?> getParentWidget()
- Returns:
- the
Widget
the currentWidget
belongs to. - Throws:
ArgumentDoesNotBelongToParentException
- if the currentWidget
does not belong to aWidget
.
-
getRefKeyBoard
public final IKeyBoard getRefKeyBoard()
-
getRefLook
public final WL getRefLook()
The current look of aWidget
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()
-
getRefPaintableWidgetsRecursively
public final LinkedList<Widget<?,?>> getRefPaintableWidgetsRecursively()
-
getSubConfigurables
public final IContainer<IConfigurableElement<?>> getSubConfigurables()
- Specified by:
getSubConfigurables
in interfaceIConfigurableElement<W extends Widget<W,WL>>
- Returns:
- the
IConfigurableElement
s of the currentIConfigurableElement
.
-
getWidth
public final int getWidth()
- Specified by:
getWidth
in interfaceRectangular
- Returns:
- the width of the current
Rectangular
.
-
getXPosition
public final int getXPosition()
- Specified by:
getXPosition
in interfaceTopLeftPositioned
- Returns:
- the top left x-position of the current
TopLeftPositioned
.
-
getXPositionOnGUI
public final int getXPositionOnGUI()
-
getYPosition
public final int getYPosition()
- Specified by:
getYPosition
in interfaceTopLeftPositioned
- Returns:
- the top left y-position of the current
TopLeftPositioned
.
-
getYPositionOnGUI
public final int getYPositionOnGUI()
-
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.
-
isEnabled
public final boolean isEnabled()
- Specified by:
isEnabled
in interfaceEnablingRequestable
- Returns:
- true if the current
EnablingRequestable
is enabled.
-
isExpanded
public final boolean isExpanded()
- Specified by:
isExpanded
in interfaceExpansionRequestable
- Returns:
- true if the current
ExpansionRequestable
is expanded.
-
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.
-
noteKeyPress
public final void noteKeyPress(Key key)
Lets the currentIInputTaker
note a key press.- Specified by:
noteKeyPress
in interfaceIInputTaker
-
noteKeyRelease
public final void noteKeyRelease(Key key)
Lets the currentIInputTaker
note a key release.- Specified by:
noteKeyRelease
in interfaceIInputTaker
-
noteKeyTyping
public final void noteKeyTyping(Key key)
Lets the currentIInputTaker
note a key typing.- Specified by:
noteKeyTyping
in interfaceIInputTaker
-
noteLeftMouseButtonClick
public final void noteLeftMouseButtonClick()
Lets the currentIInputTaker
note a left mouse button click.- Specified by:
noteLeftMouseButtonClick
in interfaceIInputTaker
-
noteLeftMouseButtonPress
public final void noteLeftMouseButtonPress()
Lets the currentIInputTaker
note a left mouse button press.- Specified by:
noteLeftMouseButtonPress
in interfaceIInputTaker
-
noteLeftMouseButtonRelease
public final void noteLeftMouseButtonRelease()
Lets the currentIInputTaker
note a left mouse button release.- Specified by:
noteLeftMouseButtonRelease
in interfaceIInputTaker
-
noteMouseMove
public final void noteMouseMove(int cursorXPosition, int cursorYPosition)
Lets the currentIInputTaker
note a mouse move. The given cursorXPositionOnViewArea and cursorYPositionOnViewArea are the new position of the cursor.- Specified by:
noteMouseMove
in interfaceIInputTaker
-
noteMouseWheelClick
public final void noteMouseWheelClick()
Lets the currentIInputTaker
note a mouse wheel clcik.- Specified by:
noteMouseWheelClick
in interfaceIInputTaker
-
noteMouseWheelPress
public final void noteMouseWheelPress()
Lets the currentIInputTaker
note a mouse wheel press.- Specified by:
noteMouseWheelPress
in interfaceIInputTaker
-
noteMouseWheelRelease
public final void noteMouseWheelRelease()
Lets the currentIInputTaker
note a mouse wheel release.- Specified by:
noteMouseWheelRelease
in interfaceIInputTaker
-
noteMouseWheelRotationStep
public void noteMouseWheelRotationStep(RotationDirection rotationDirection)
Lets the currentIInputTaker
note a mouse wheel rotation step.- Specified by:
noteMouseWheelRotationStep
in interfaceIInputTaker
-
noteRightMouseButtonClick
public final void noteRightMouseButtonClick()
Lets the currentIInputTaker
note a right mouse button click.- Specified by:
noteRightMouseButtonClick
in interfaceIInputTaker
-
noteRightMouseButtonPress
public final void noteRightMouseButtonPress()
Lets the currentIInputTaker
note a right mouse button press.- Specified by:
noteRightMouseButtonPress
in interfaceIInputTaker
-
noteRightMouseButtonRelease
public final void noteRightMouseButtonRelease()
Lets the currentIInputTaker
note a right mouse button release.- Specified by:
noteRightMouseButtonRelease
in interfaceIInputTaker
-
onFrontEnd
public IFrontEndWriter onFrontEnd()
- Returns:
- the
IFrontEndWriter
of the parentGUI
of the currentWidget
. - Throws:
ArgumentDoesNotBelongToParentException
- if the currentWidget
does not belong to aGUI
.
-
paintRecursively
public final void paintRecursively(IPainter painter)
Paints the currentWidget
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
-
-
recalculate
public final void recalculate()
- Specified by:
recalculate
in interfaceRecalculable
-
removeGreyOutWhenDisabled
public final W removeGreyOutWhenDisabled()
Avoids that the currentWidget
grays out when it is disabled.- Returns:
- the current
Widget
.
-
removeLeftMouseButtonClickAction
public final W removeLeftMouseButtonClickAction()
Removes the left mouse button click action of the currentWidget
.- Returns:
- the current
Widget
.
-
removeLeftMouseButtonPressAction
public final W removeLeftMouseButtonPressAction()
Removes the left mouse button press action of the currentWidget
.- Returns:
- the current
Widget
.
-
removeLeftMouseButtonReleaseAction
public final W removeLeftMouseButtonReleaseAction()
Removes the left mouse button release action of the currentWidget
.- Returns:
- the current
Widget
.
-
removeRightMouseButtonClickAction
public final W removeRightMouseButtonClickAction()
Removes the right mouse button click action of the currentWidget
.- Returns:
- the current
Widget
.
-
removeRightMouseButtonPressAction
public final W removeRightMouseButtonPressAction()
Removes the right mouse button press action of the currentWidget
.- Returns:
- the current
Widget
.
-
removeRightMouseButtonReleaseAction
public final W removeRightMouseButtonReleaseAction()
Removes the right mouse button release action of the currentWidget
.- Returns:
- the current
Widget
.
-
resetConfigurationOnSelf
public final void resetConfigurationOnSelf()
Resets the configuration of the currentIConfigurableElement
on itself, and on itself only.- Specified by:
resetConfigurationOnSelf
in interfaceIConfigurableElement<W extends Widget<W,WL>>
-
setCollapsed
public final W setCollapsed()
Sets the currentWidget
collapsed.- Returns:
- the current
Widget
.
-
setContinuousKeyPressAction
public final W setContinuousKeyPressAction(I2ElementTaker<W,Key> continuousKeyPressAction)
Sets the continuous key press action of the currentWidget
.- Specified by:
setContinuousKeyPressAction
in interfaceIInputActionManager<W extends Widget<W,WL>>
- Returns:
- the current
Widget
. - Throws:
ArgumentIsNullException
- if the given continuousKeyPressAction is null.
-
setCustomCursorIcon
public final W setCustomCursorIcon(CursorIcon customCursorIcon)
Sets the customCursorIcon
of the currentWidget
.- Parameters:
customCursorIcon
-- Returns:
- the current
Widget
. - Throws:
ArgumentIsNullException
- if the given customCursorIcon is null.
-
setDisabled
public final W setDisabled()
Sets the currentWidget
disabled.- Returns:
- the current
Widget
.
-
setEnabled
public final W setEnabled()
Sets the currentWidget
enabled.- Returns:
- the current
Widget
.
-
setExpanded
public final W setExpanded()
Sets the currentWidget
expanded.- Returns:
- the current
Widget
.
-
setFocused
public final W setFocused()
Sets the currentWidget
focused.- Returns:
- the current
Widget
.
-
setGreyOutWhenDisabled
public final W setGreyOutWhenDisabled()
Lets the currentWidget
grey out when it is disabled.- Returns:
- the current
Widget
.
-
setHovered
public final W setHovered()
Sets the currentWidget
hovered.- Returns:
- the current
Widget
.
-
setLeftMouseButtonClickAction
public final W setLeftMouseButtonClickAction(IElementTaker<W> leftMouseButtonClickAction)
Sets the left mouse button click action of the currentWidget
.- Specified by:
setLeftMouseButtonClickAction
in interfaceIInputActionManager<W extends Widget<W,WL>>
- Parameters:
leftMouseButtonClickAction
-- Returns:
- the current
Widget
. - Throws:
ArgumentIsNullException
- if the given leftMouseButtonClickAction is null.
-
setLeftMouseButtonPressAction
public final W setLeftMouseButtonPressAction(IElementTaker<W> leftMouseButtonPressAction)
Sets the left mouse button press action of the currentWidget
.- Specified by:
setLeftMouseButtonPressAction
in interfaceIInputActionManager<W extends Widget<W,WL>>
- Parameters:
leftMouseButtonPressAction
-- Returns:
- the current
Widget
. - Throws:
ArgumentIsNullException
- if the given leftMouseButtonPressAction is null.
-
setLeftMouseButtonReleaseAction
public final W setLeftMouseButtonReleaseAction(IElementTaker<W> leftMouseButtonReleaseAction)
Sets the left mouse button release action of the currentWidget
.- Specified by:
setLeftMouseButtonReleaseAction
in interfaceIInputActionManager<W extends Widget<W,WL>>
- Parameters:
leftMouseButtonReleaseAction
-- Returns:
- the current
Widget
. - Throws:
ArgumentIsNullException
- if the given leftMouseButtonReleaseAction is null.
-
setMouseMoveAction
public final W setMouseMoveAction(IElementTaker<W> mouseMoveAction)
Sets the mouse move action of the currentWidget
.- Specified by:
setMouseMoveAction
in interfaceIInputActionManager<W extends Widget<W,WL>>
- Parameters:
mouseMoveAction
-- Returns:
- the current
Widget
. - Throws:
ArgumentIsNullException
- if the given leftMouseButtonPressAction is null.
-
setMouseWheelClickAction
public final W setMouseWheelClickAction(IElementTaker<W> mouseWheelClickAction)
Sets the mouse wheel click action of the currentWidget
.- Specified by:
setMouseWheelClickAction
in interfaceIInputActionManager<W extends Widget<W,WL>>
- Parameters:
mouseWheelClickAction
-- Returns:
- the current
Widget
. - Throws:
ArgumentIsNullException
- if the given mouseWheelClickAction is null.
-
setMouseWheelPressAction
public final W setMouseWheelPressAction(IElementTaker<W> mouseWheelPressAction)
Sets the mouse wheel press action of the currentWidget
.- Specified by:
setMouseWheelPressAction
in interfaceIInputActionManager<W extends Widget<W,WL>>
- Parameters:
mouseWheelPressAction
-- Returns:
- the current
Widget
. - Throws:
ArgumentIsNullException
- if the given mouseWheelPressAction is null.
-
setMouseWheelReleaseAction
public final W setMouseWheelReleaseAction(IElementTaker<W> mouseWheelReleaseAction)
Sets the mouse wheel release action of the currentWidget
.- Specified by:
setMouseWheelReleaseAction
in interfaceIInputActionManager<W extends Widget<W,WL>>
- Parameters:
mouseWheelReleaseAction
-- Returns:
- the current
Widget
. - Throws:
ArgumentIsNullException
- if the given mouseWheelReleaseAction is null.
-
setParent
public final void setParent(WidgetGUI<?> parentGUI)
- Parameters:
parentGUI
-- Throws:
ArgumentIsNullException
- if the given parentGUI is null.InvalidArgumentException
- if the currentWidget
belongs already to a parent.
-
setPositionOnParent
public final void setPositionOnParent(int xPositionOnParent, int yPositionOnParent)
Sets the position of the currentWidget
on its parent.- Parameters:
xPositionOnParent
-yPositionOnParent
-
-
setRightMouseButtonClickAction
public final W setRightMouseButtonClickAction(IElementTaker<W> rightMouseButtonClickAction)
Sets the right mouse button click action of the currentWidget
.- Specified by:
setRightMouseButtonClickAction
in interfaceIInputActionManager<W extends Widget<W,WL>>
- Parameters:
rightMouseButtonClickAction
-- Returns:
- the current
Widget
. - Throws:
ArgumentIsNullException
- if the given rightMouseButtonClickAction is null.
-
setRightMouseButtonPressAction
public final W setRightMouseButtonPressAction(IElementTaker<W> rightMouseButtonPressAction)
Sets the right mouse button press action of the currentWidget
.- Specified by:
setRightMouseButtonPressAction
in interfaceIInputActionManager<W extends Widget<W,WL>>
- Parameters:
rightMouseButtonPressAction
-- Returns:
- the current
Widget
. - Throws:
ArgumentIsNullException
- if the given rightMouseButtonPressAction is null.
-
setRightMouseButtonReleaseAction
public final W setRightMouseButtonReleaseAction(IElementTaker<W> rightMouseButtonReleaseAction)
Sets the right mouse button release action of the currentWidget
.- Specified by:
setRightMouseButtonReleaseAction
in interfaceIInputActionManager<W extends Widget<W,WL>>
- Parameters:
rightMouseButtonReleaseAction
-- Returns:
- the current
Widget
. - Throws:
ArgumentIsNullException
- if the given rightMouseButtonReleaseAction is null.
-
setUnhovered
public final W setUnhovered()
Sets the currentWidget
unhovered.- Returns:
- the current
Widget
.
-
setUnfocused
public final W setUnfocused()
Sets the currentWidget
unfocused.- Returns:
- the current
Widget
.
-
showAreaIsUnderCursor
public abstract boolean showAreaIsUnderCursor()
- Returns:
- true if the view are of the current
Widget
is under the cursor.
-
-