Visible, Comparable<View>SimpleView, Windowpublic abstract class View extends be.yildizgames.common.util.BaseRegisterable implements Comparable<View>, Visible
| Constructor | Description |
|---|---|
View(Container wrappedContainer,
Zorder z,
GuiEventManager eventManager) |
Full constructor, initialize the visibility to true, add the view to the event dispatcher.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addKeyboardListener(KeyboardListener listener) |
Add a keyboard listener to this view.
|
void |
addMouseDragListener(MouseDragListener listener) |
Add a mouse drag listener to this view.
|
void |
addMouseLeftClickListener(MouseLeftClickListener listener) |
Add a mouse click listener to this view.
|
void |
addMouseMoveListener(MouseMoveListener listener) |
Add a mouse listener to this view.
|
void |
addMouseReleaseListener(MouseReleaseListener listener) |
Add a mouse release listener to this view.
|
void |
addMouseWheelListener(MouseWheelListener listener) |
Add a mouse wheel listener to this view.
|
void |
addSpecialKeyListener(SpecialKeyPressedListener listener) |
Add a keyboard special key listener to this view.
|
int |
compareTo(View otherView) |
Compare 2 View by their z order.
|
boolean |
contains(int x,
int y) |
|
boolean |
contains(MousePosition position) |
Compute if the point is in the view.
|
void |
delete() |
Delete the view.
|
void |
disableHighlight() |
|
boolean |
equals(Object obj) |
|
static View |
get(String name) |
Get a view from its name.
|
Container |
getContainer() |
|
Widget |
getFocus() |
|
int |
hashCode() |
|
void |
hide() |
Set the view invisible.
|
boolean |
isActive() |
|
boolean |
isVisible() |
|
void |
setActive(boolean active) |
Called when the mouse is in the view.
|
protected abstract void |
setActiveImpl(boolean active) |
Implementation specific set active.
|
void |
setBackground(Material background) |
Set the background material.
|
protected void |
setFocus(BaseWidget focus) |
|
void |
setPosition(int left,
int top) |
Set the view position.
|
void |
setVisible(boolean visibleState) |
Set the View visible or not.
|
protected abstract void |
setVisibleImpl(boolean show) |
Set specific implementation when setVisible is called.
|
void |
show() |
Set the view visible.
|
String |
toString() |
public View(Container wrappedContainer, Zorder z, GuiEventManager eventManager)
wrappedContainer - Wrapped container.z - Z order.eventManager - Event manager to notify.public static View get(String name)
name - View name to retrieve.public boolean contains(MousePosition position)
position - Point to test.true if the point is inside the view, false otherwise.public boolean contains(int x,
int y)
public final void delete()
public final void addMouseMoveListener(MouseMoveListener listener)
listener - Listener to use when the mouse is moved in the view.public final void addMouseLeftClickListener(MouseLeftClickListener listener)
listener - Listener to use when the mouse button is pressed in the view.public final void addMouseReleaseListener(MouseReleaseListener listener)
listener - Listener to use when the mouse button is released in the view.public final void addKeyboardListener(KeyboardListener listener)
listener - Listener to use when the keyboard is used in the view.public final void addSpecialKeyListener(SpecialKeyPressedListener listener)
listener - Listener to use when the keyboard is used in the view.public final void addMouseDragListener(MouseDragListener listener)
listener - Listener to use when the mouse is dragged in this view.public final void addMouseWheelListener(MouseWheelListener listener)
listener - Listener to use when the mouse is scrolled in this view.public final boolean isVisible()
true if the view is currently visible.public final void setVisible(boolean visibleState)
visibleState - true to set the View visible, false to hide it.public final int compareTo(View otherView)
compareTo in interface Comparable<View>otherView - Other View to compare with this one.public final void setPosition(int left,
int top)
left - View left position value.top - View top position value.public final void setBackground(Material background)
background - New background material.protected abstract void setVisibleImpl(boolean show)
show - true if the view is set to visible, false if it is hidden.public final void setActive(boolean active)
active - true if the mouse is in the view, false otherwise.protected abstract void setActiveImpl(boolean active)
active - Active state.public final int hashCode()
hashCode in class be.yildizgames.common.util.BaseRegisterablepublic final boolean equals(Object obj)
equals in class be.yildizgames.common.util.BaseRegisterablepublic final String toString()
toString in class be.yildizgames.common.util.BaseRegisterablepublic void disableHighlight()
public Container getContainer()
public boolean isActive()
public Widget getFocus()
protected void setFocus(BaseWidget focus)
Copyright © 2014–2018. All rights reserved.