public class Widget extends Component<Component>
Constructor and Description |
---|
Widget()
Creates a widget with default title text.
|
Widget(float x,
float y,
float width,
float height)
Creates a widget with default title text and specified position and size.
|
Widget(java.lang.String title)
Creates a widget with specified title text.
|
Widget(java.lang.String title,
float x,
float y,
float width,
float height)
Creates a widget with specified title text and specified position and size.
|
Widget(java.lang.String title,
org.joml.Vector2f position,
org.joml.Vector2f size)
Creates a widget with specified title text and specified position and size.
|
Widget(org.joml.Vector2f position,
org.joml.Vector2f size)
Creates a widget with default title text and specified position and size.
|
Modifier and Type | Method and Description |
---|---|
void |
addWidgetCloseEventListener(EventListener<WidgetCloseEvent> eventListener)
Used to add event listener for widget close event.
|
boolean |
equals(java.lang.Object o) |
Button |
getCloseButton()
Returns close button of widget.
|
org.joml.Vector4f |
getCloseButtonBackgroundColor()
Returns close button background color.
|
org.joml.Vector4f |
getCloseButtonColor()
Returns close button text color.
|
Icon |
getCloseIcon()
Returns close icon that used by close button.
|
Component<Component> |
getContainer()
Returns widget container that hold all other elements.
|
Icon |
getMaximizeIcon()
Returns maximize icon that used by minimize button.
|
Button |
getMinimizeButton()
Returns minimize button of widget.
|
Icon |
getMinimizeIcon()
Returns minimize icon that used by minimize button.
|
org.joml.Vector4f |
getTitleBackgroundColor()
Returns background color of title container.
|
Component<Component> |
getTitleContainer()
Returns title container.
|
float |
getTitleHeight()
Returns height of title.
|
TextState |
getTitleTextState()
Returns title text state.
|
java.util.List<EventListener<WidgetCloseEvent>> |
getWidgetCloseEvents()
Returns all event listeners for widget close event.
|
int |
hashCode() |
boolean |
isCloseable()
Returns true if widget should be closeable.
|
boolean |
isDraggable()
Returns true if widget could be dragged.
|
boolean |
isMinimizable()
Returns true if widget could be minimized (minimize button is visible).
|
boolean |
isMinimized()
Returns true if widget minimized.
|
boolean |
isTitleEnabled()
Returns true if title enabled.
|
void |
removeWidgetCloseEventListener(EventListener<WidgetCloseEvent> eventListener)
Used to remove event listener for widget close event.
|
void |
resize()
Used to resize widget container and title elements.
|
void |
setCloseable(boolean closeable)
Used to set would widget closeable or not.
|
void |
setCloseButtonBackgroundColor(org.joml.Vector4f closeButtonBackgroundColor)
Used to set close button background color.
|
void |
setCloseButtonColor(org.joml.Vector4f closeButtonColor)
Used to set close button text color.
|
void |
setCloseIcon(Icon closeIcon)
Used to set close icon to close button.
|
void |
setContainer(Component container)
Used to set widget container.
|
void |
setDraggable(boolean draggable)
Used to set widget draggable or not.
|
void |
setMaximizeIcon(Icon maximizeIcon)
Used to set maximize icon to minimize button.
|
void |
setMinimizable(boolean minimizable)
Used to make minimize button visible or not.
|
void |
setMinimized(boolean minimized)
Used to minimize/maximize widget.
|
void |
setMinimizeIcon(Icon minimizeIcon)
Used to set minimize icon to minimize button.
|
void |
setSize(float width,
float height)
Used to set size of widget.
|
void |
setSize(org.joml.Vector2f size)
Used to set size of widget.
|
void |
setTitleBackgroundColor(org.joml.Vector4f titleBackgroundColor)
Used to set title background color.
|
void |
setTitleEnabled(boolean titleEnabled)
Used to set title enabled or not.
|
void |
setTitleHeight(float titleHeight)
Used to set title height.
|
java.lang.String |
toString() |
add, addAll, clearChilds, containerIterator, contains, containsAll, count, forEach, getAbsolutePosition, getBackgroundColor, getBorder, getChilds, getCornerRadius, getFocusedStrokeColor, getIntersector, getListenerMap, getMetadata, getParent, getPosition, getSize, getTooltip, intersects, isEmpty, isEnabled, isFocused, isHovered, isPressed, isVisible, parallelStream, remove, removeAll, removeIf, setBackgroundColor, setBackgroundColor, setBorder, setCornerRadius, setEnabled, setFocused, setFocusedStrokeColor, setFocusedStrokeColor, setHovered, setIntersector, setListenerMap, setParent, setPosition, setPosition, setPressed, setTooltip, setVisible, stream
public Widget()
public Widget(float x, float y, float width, float height)
x
- x position in parent.y
- y position in parent.width
- width of component.height
- height of component.public Widget(org.joml.Vector2f position, org.joml.Vector2f size)
position
- position in parent.size
- size of component.public Widget(java.lang.String title)
title
- widget text.public Widget(java.lang.String title, float x, float y, float width, float height)
title
- widget text.x
- x position in parent.y
- y position in parent.width
- width of component.height
- height of component.public Widget(java.lang.String title, org.joml.Vector2f position, org.joml.Vector2f size)
title
- widget text.position
- position in parent.size
- size of component.public void resize()
public void setSize(org.joml.Vector2f size)
public void setSize(float width, float height)
public float getTitleHeight()
public void setTitleHeight(float titleHeight)
titleHeight
- title height to set.public boolean isTitleEnabled()
public void setTitleEnabled(boolean titleEnabled)
titleEnabled
- title state (enable or not) to set.public boolean isCloseable()
public void setCloseable(boolean closeable)
closeable
- widget state (closeable or not) to set.public Button getCloseButton()
public Button getMinimizeButton()
public Component<Component> getTitleContainer()
public org.joml.Vector4f getTitleBackgroundColor()
public void setTitleBackgroundColor(org.joml.Vector4f titleBackgroundColor)
titleBackgroundColor
- title background color to set.public TextState getTitleTextState()
public org.joml.Vector4f getCloseButtonColor()
public void setCloseButtonColor(org.joml.Vector4f closeButtonColor)
closeButtonColor
- close button text color to set.public org.joml.Vector4f getCloseButtonBackgroundColor()
public void setCloseButtonBackgroundColor(org.joml.Vector4f closeButtonBackgroundColor)
closeButtonBackgroundColor
- close button background color to set.public Component<Component> getContainer()
public void setContainer(Component container)
container
- widget container to set.public boolean isDraggable()
public void setDraggable(boolean draggable)
draggable
- new draggable state of widget.public boolean isMinimizable()
public void setMinimizable(boolean minimizable)
minimizable
- new minimizable state of widget.public boolean isMinimized()
public void setMinimized(boolean minimized)
minimized
- true to minimize, false to maximize.public Icon getCloseIcon()
public void setCloseIcon(Icon closeIcon)
closeIcon
- close icon to set.public Icon getMaximizeIcon()
public void setMaximizeIcon(Icon maximizeIcon)
maximizeIcon
- maximize icon to set.public Icon getMinimizeIcon()
public void setMinimizeIcon(Icon minimizeIcon)
minimizeIcon
- minimize icon to set.public void addWidgetCloseEventListener(EventListener<WidgetCloseEvent> eventListener)
eventListener
- event listener to add.public java.util.List<EventListener<WidgetCloseEvent>> getWidgetCloseEvents()
public void removeWidgetCloseEventListener(EventListener<WidgetCloseEvent> eventListener)
eventListener
- event listener to remove.