| Modifier and Type | Class and Description |
|---|---|
static class |
Widget.NotifyEvent |
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
COMMAND_KEY_ENTER |
protected static java.lang.String |
COMMAND_MOUSE_CLICK |
protected static java.lang.String |
COMMAND_UNKNOWN |
protected boolean |
culled |
protected int |
fontChangeId |
protected java.lang.String |
fontName |
protected int |
fontSize |
protected IFont |
lastFont |
protected int |
lastFontSize |
protected static boolean |
RENDER_BACKGROUND |
protected static boolean |
RENDER_FOREGROUND |
| Constructor and Description |
|---|
Widget() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
addActionListener(ActionListener listener) |
void |
addAnimator(WidgetAnimator<?> a) |
protected boolean |
addChangeListener(ChangeListener l) |
void |
addFocusListener(FocusListener l) |
void |
addKeyListener(KeyListener l) |
void |
addMouseListener(MouseListener l) |
void |
addMouseMotionListener(MouseMotionListener l) |
void |
addMouseWheelListener(MouseWheelListener l) |
void |
bindTo(java.lang.Object object)
|
boolean |
contains(Widget widget) |
protected void |
delayNotifyEvent(Widget.NotifyEvent event)
Notify event with a delay, parent notification should use this
|
boolean |
dispatchKeyEvent(UI ui,
KeyEvent e,
boolean toFocusable) |
protected void |
dispatchMouseExited(UI ui,
MouseEvent e) |
EventState |
dispatchMouseMoved(UI ui,
MouseEvent e,
EventState eventState) |
EventState |
dispatchMousePressed(UI ui,
MouseEvent e) |
boolean |
dispatchMouseReleased(UI ui,
MouseEvent e) |
EventState |
dispatchMouseWheelMoved(UI ui,
MouseWheelEvent e) |
void |
dispatchNotifyEvent(Widget.NotifyEvent event) |
protected boolean |
dispatchShowPopup(UI ui,
MouseEvent e) |
protected void |
doMoveOpti(int dx,
int dy) |
<W extends Widget> |
find(java.util.function.Predicate<Widget> predicate) |
<W extends Widget> |
find(java.lang.String name) |
protected boolean |
fireAction(UI ui,
InputEvent sourceEvent,
java.lang.String command) |
protected void |
fireAnimator(long timePassedMS) |
protected void |
fireChange() |
protected boolean |
fireKeyEvent(UI ui,
KeyEvent e) |
protected boolean |
fireMouseEvent(UI ui,
MouseEvent e)
Process the mouse events of the widget
|
protected Widget |
focusableTraversalDown(boolean next) |
protected Widget |
focusableTraversalUp(boolean next) |
Widget |
focusTraversal(boolean next) |
void |
forceSize(int w,
int h)
For the size of a widget.
|
protected Sprite |
getCurrentBackground() |
protected Color4 |
getCurrentBackgroundColor() |
Widget |
getFocusable() |
protected int |
getFontSizeForRender(IFont font) |
int |
getHeightOnScreen() |
Insets |
getInsets(Insets dst) |
int |
getInsetsHeight() |
int |
getInsetsWidth() |
void |
getLocation(Point dst) |
Point |
getLocationOnScreen(Point dst) |
int |
getLocationXOnScreen() |
int |
getLocationYOnScreen() |
<W extends MenuPopup> |
getMenuPopup() |
protected int |
getMinHeightLayout() |
int |
getMinHeightWidget() |
protected int |
getMinWidthLayout() |
int |
getMinWidthWidget() |
<W extends Widget> |
getPopup() |
int |
getPreferredHeight() |
int |
getPreferredWidth() |
Sprite |
getRefBackground() |
Widget |
getRoot() |
<W extends Widget> |
getTooltip() |
int |
getViewportBorderBottom() |
int |
getViewportBorderHeight() |
int |
getViewportBorderLeft() |
int |
getViewportBorderWidth() |
int |
getWidthOnScreen() |
boolean |
hasFocus() |
protected boolean |
hasKeyEventFocus() |
protected boolean |
hasMenuPopupVisible() |
protected boolean |
isBackgroundOpaque() |
protected boolean |
isDownOrMouseDown() |
boolean |
isFocusable() |
protected boolean |
isFree() |
boolean |
isMouseOverOrDown() |
boolean |
isOver(int pointX,
int pointY) |
protected boolean |
isOverlappingRendering() |
boolean |
isRenderingAndEnabled() |
protected void |
notifyEvent(UI ui,
Widget.NotifyEvent event) |
protected boolean |
onActionPerformed(UI ui,
ActionEvent e) |
protected void |
onDiscardState() |
protected void |
onFocusChanged(UI ui,
FocusEvent e) |
protected void |
onFontChanged(UI ui) |
protected boolean |
onKeyPressed(UI ui,
KeyEvent e) |
protected boolean |
onKeyReleased(UI ui,
KeyEvent e) |
protected boolean |
onMouseClicked(UI ui,
MouseEvent e) |
protected boolean |
onMouseDownDragUp(UI ui,
MouseEvent e) |
protected boolean |
onMouseDragged(UI ui,
MouseEvent e) |
protected void |
onMouseEntered(UI ui,
MouseEvent e) |
protected void |
onMouseExited(UI ui,
MouseEvent e) |
protected boolean |
onMouseMoved(UI ui,
MouseEvent e) |
protected boolean |
onMousePressed(UI ui,
MouseEvent e) |
protected boolean |
onMouseReleased(UI ui,
MouseEvent e) |
protected boolean |
onMouseWheelMoved(UI ui,
MouseWheelEvent e) |
protected void |
onMove(int dx,
int dy) |
protected void |
onParentChanged() |
protected void |
onStateChanged(ChangeEvent e) |
protected void |
onStyleChanged() |
void |
refreshFocus() |
protected boolean |
removeActionListener(ActionListener listener) |
protected void |
removeAllActionListener() |
boolean |
removeAnimator(WidgetAnimator<?> a) |
protected boolean |
removeChangeListener(ChangeListener listener) |
boolean |
removeFocusListener(FocusListener listener) |
boolean |
removeKeyListener(KeyListener l) |
boolean |
removeMouseListener(MouseListener l) |
boolean |
removeMouseMotionListener(MouseMotionListener l) |
boolean |
removeMouseWheelListener(MouseWheelListener l) |
void |
render(UI ui)
Widget rendering |
protected void |
renderGL(UI ui) |
void |
requestFocus() |
protected boolean |
resolveBlockEvents(int x,
int y) |
Widget |
resolveLocationRef() |
void |
setAutoPack(boolean autoPack) |
void |
setAutoPackHeight(boolean autoPackHeight) |
void |
setAutoPackWidth(boolean autoPackWidth) |
void |
setBackgroundColor(Color4 backgroundColor) |
protected void |
setDown(boolean down) |
void |
setEnabled(boolean enabled) |
void |
setFocusable(boolean focusable) |
void |
setInsets(Insets insets) |
void |
setInsets(int top,
int left,
int bottom,
int right) |
protected void |
setIsBackground(boolean isBackground) |
void |
setLocation(int x,
int y)
Set the location of this
Widget relatively to its parent. |
void |
setLocation(Point src) |
void |
setLocationAnchor(Anchor locationAnchor) |
void |
setLocationRef(java.lang.String locationRef) |
void |
setLocationRef2(Widget locationRef2) |
void |
setLocationRefAnchor(Anchor locationAnchorRef) |
void |
setMaxSize(int w,
int h) |
void |
setMaxSize(Size size) |
void |
setMenuPopup(MenuPopup menuPopup) |
void |
setMinSize(int w,
int h) |
void |
setMinSize(Size size) |
protected void |
setMinSizeLayout(int w,
int h) |
protected void |
setParent(Panel parent) |
void |
setPopup(Widget popup) |
void |
setSize(int w,
int h)
Set size.
|
void |
setSize(Size size) |
void |
setSizeOnScreen(int w,
int h)
Entrypoint for layouot manager
|
void |
setStyle(java.lang.String style) |
void |
setTooltip(Widget tooltip) |
void |
setVisible(boolean visible) |
java.lang.String |
toString() |
WidgetTraversal.Status |
traverse(WidgetTraversal consumer) |
protected boolean |
triggerChildsUpdate() |
boolean |
uiFireAction(UI ui,
InputEvent event,
java.lang.String command)
Used internally
|
void |
update(UI ui,
long timePassedMS)
Widget update. |
protected void |
updateListenersForPosition() |
protected void |
updateMinViewport(Viewport dst) |
protected static boolean RENDER_BACKGROUND
protected static boolean RENDER_FOREGROUND
protected static final java.lang.String COMMAND_UNKNOWN
protected static final java.lang.String COMMAND_KEY_ENTER
protected static final java.lang.String COMMAND_MOUSE_CLICK
protected java.lang.String fontName
protected int fontSize
protected IFont lastFont
protected int lastFontSize
protected int fontChangeId
protected boolean culled
protected final int getFontSizeForRender(IFont font)
public java.lang.String toString()
toString in class java.lang.Objectpublic void update(UI ui, long timePassedMS)
Widget update. Occures before rendering to compute current states and absolute positioning.ui - timePassedMS - protected void onStyleChanged()
protected void onFontChanged(UI ui)
protected final boolean triggerChildsUpdate()
protected final boolean isFree()
public final Widget resolveLocationRef()
protected final void updateListenersForPosition()
protected void updateMinViewport(Viewport dst)
public int getViewportBorderLeft()
public int getViewportBorderBottom()
public int getViewportBorderWidth()
public int getViewportBorderHeight()
protected boolean isOverlappingRendering()
Widget has overlapping rendering elementprotected void renderGL(UI ui)
protected final void setIsBackground(boolean isBackground)
protected void notifyEvent(UI ui, Widget.NotifyEvent event)
protected void onDiscardState()
public final void dispatchNotifyEvent(Widget.NotifyEvent event)
protected final void delayNotifyEvent(Widget.NotifyEvent event)
public final void addAnimator(WidgetAnimator<?> a)
a - listener to register to this widgetpublic final boolean removeAnimator(WidgetAnimator<?> a)
protected final void fireAnimator(long timePassedMS)
protected boolean addActionListener(ActionListener listener)
protected boolean removeActionListener(ActionListener listener)
protected void removeAllActionListener()
public final boolean uiFireAction(UI ui, InputEvent event, java.lang.String command)
protected final boolean fireAction(UI ui, InputEvent sourceEvent, java.lang.String command)
protected boolean onActionPerformed(UI ui, ActionEvent e)
protected boolean addChangeListener(ChangeListener l)
protected boolean removeChangeListener(ChangeListener listener)
protected final void fireChange()
protected void onStateChanged(ChangeEvent e)
public void addFocusListener(FocusListener l)
l - listener to register to this widgetpublic boolean removeFocusListener(FocusListener listener)
protected void onFocusChanged(UI ui, FocusEvent e)
protected boolean onMouseClicked(UI ui, MouseEvent e)
protected void onMouseEntered(UI ui, MouseEvent e)
protected void onMouseExited(UI ui, MouseEvent e)
protected boolean onMousePressed(UI ui, MouseEvent e)
protected boolean onMouseReleased(UI ui, MouseEvent e)
protected boolean onMouseDownDragUp(UI ui, MouseEvent e)
protected boolean onMouseMoved(UI ui, MouseEvent e)
protected boolean onMouseDragged(UI ui, MouseEvent e)
protected boolean onMouseWheelMoved(UI ui, MouseWheelEvent e)
protected boolean resolveBlockEvents(int x,
int y)
protected boolean isBackgroundOpaque()
protected boolean hasMenuPopupVisible()
public void addKeyListener(KeyListener l)
l - listener to register to this widgetpublic final boolean removeKeyListener(KeyListener l)
public final void addMouseListener(MouseListener l)
l - listener to register to this widgetpublic final boolean removeMouseListener(MouseListener l)
public final void addMouseMotionListener(MouseMotionListener l)
l - listener to register to this widgetpublic final boolean removeMouseMotionListener(MouseMotionListener l)
public final void addMouseWheelListener(MouseWheelListener l)
l - listener to register to this widgetpublic final boolean removeMouseWheelListener(MouseWheelListener l)
protected boolean fireMouseEvent(UI ui, MouseEvent e)
protected boolean hasKeyEventFocus()
public EventState dispatchMousePressed(UI ui, MouseEvent e)
public boolean dispatchMouseReleased(UI ui, MouseEvent e)
protected boolean dispatchShowPopup(UI ui, MouseEvent e)
public EventState dispatchMouseMoved(UI ui, MouseEvent e, EventState eventState)
protected void dispatchMouseExited(UI ui, MouseEvent e)
public EventState dispatchMouseWheelMoved(UI ui, MouseWheelEvent e)
public boolean isOver(int pointX,
int pointY)
public final boolean isMouseOverOrDown()
protected final boolean isDownOrMouseDown()
protected final void setDown(boolean down)
public final boolean hasFocus()
public final void requestFocus()
public final void refreshFocus()
public final Widget focusTraversal(boolean next)
protected final Widget focusableTraversalUp(boolean next)
protected Widget focusableTraversalDown(boolean next)
public final Widget getFocusable()
public final void setStyle(java.lang.String style)
style - the style of this Widgetpublic final <W extends Widget> W getTooltip()
public final <W extends MenuPopup> W getMenuPopup()
public void setMenuPopup(MenuPopup menuPopup)
menuPopup - the new menuPopup Widgetprotected void onParentChanged()
public void bindTo(java.lang.Object object)
java.lang.SecurityExceptionjava.lang.NoSuchMethodExceptionpublic WidgetTraversal.Status traverse(WidgetTraversal consumer)
public final <W extends Widget> W find(java.lang.String name)
Widget with the specified name found, or null if non foundpublic final boolean contains(Widget widget)
public final Widget getRoot()
public final void setAutoPack(boolean autoPack)
autoPack - setAutoPackWidth(boolean),
setAutoPackHeight(boolean)public final void setAutoPackWidth(boolean autoPackWidth)
public final void setAutoPackHeight(boolean autoPackHeight)
public final void setEnabled(boolean enabled)
enabled - true to enable this widget#isEnabledHerited(),
isRenderingAndEnabled()public void setVisible(boolean visible)
visible - true to show this widget, false to hide himpublic final boolean isFocusable()
Widget is focusablepublic final void setFocusable(boolean focusable)
focusable - true to set this Widget focusablepublic final boolean isRenderingAndEnabled()
public final void getLocation(Point dst)
dst - destination Point to store this Widget relative location.Widget parent and anchors, if any.getLocationOnScreen(Point),
#getLocationAnchor(),
#getLocationRefAnchor()public final void setLocation(Point src)
src - new relative locationsetLocation(int, int)public final void setLocation(int x,
int y)
Widget relatively to its parent.x - position along x axis, 0 is lefty - position along y axis, 0 is bottomprotected void onMove(int dx,
int dy)
protected void doMoveOpti(int dx,
int dy)
public final void setLocationAnchor(Anchor locationAnchor)
locationAnchor - new location anchor, default is Anchor.BotLeftpublic final void setLocationRef(java.lang.String locationRef)
locationRef - public final void setLocationRef2(Widget locationRef2)
locationRef2 - public final void setLocationRefAnchor(Anchor locationAnchorRef)
locationAnchorRef - public final Point getLocationOnScreen(Point dst)
dst - destination Point to store this Widget absolute location.getLocation(Point)public final int getLocationXOnScreen()
public final int getLocationYOnScreen()
public final void forceSize(int w,
int h)
public final void setSize(Size size)
setSize(int, int)public final void setSize(int w,
int h)
w - new widthh - new heightpublic final void setMinSize(Size size)
public final void setMinSize(int w,
int h)
protected final int getMinWidthLayout()
protected final int getMinHeightLayout()
protected final void setMinSizeLayout(int w,
int h)
public final int getPreferredWidth()
public final int getPreferredHeight()
public final int getMinWidthWidget()
public final int getMinHeightWidget()
public final void setMaxSize(Size size)
public final void setMaxSize(int w,
int h)
public final void setSizeOnScreen(int w,
int h)
public final int getWidthOnScreen()
public final int getHeightOnScreen()
public final int getInsetsWidth()
public final int getInsetsHeight()
public final void setInsets(Insets insets)
public final void setInsets(int top,
int left,
int bottom,
int right)
public final void setBackgroundColor(Color4 backgroundColor)
backgroundColor - the color of the textprotected final Color4 getCurrentBackgroundColor()
protected final Sprite getCurrentBackground()
public final Sprite getRefBackground()
Bonzai Engine 1.4.1-20200831 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2019 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com