public final class Context
extends java.lang.Object
| Constructor and Description |
|---|
Context(Context context,
int left,
int right,
int offset,
boolean focus,
boolean onTop)
Constructor that should be used when a parent is calling a method by the child.
|
Context(Interface inter,
int width,
java.awt.Point position,
boolean focus,
boolean onTop)
Constructor that should be used by the root parent (i.e.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
focusReleased()
Returns
focusOverride. |
boolean |
foucsRequested()
Returns
focusRequested. |
java.lang.String |
getDescription()
Get the description set by the child.
|
Interface |
getInterface()
Returns the current
Interface. |
java.awt.Point |
getPos()
Returns the component position.
|
java.awt.Rectangle |
getRect()
Get rectangle indicating component position.
|
java.awt.Dimension |
getSize()
Returns the component size.
|
boolean |
hasFocus()
Returns the focus state of the parent.
|
boolean |
isClicked()
Get mouse click state.
|
boolean |
isHovered()
Get mouse hover state.
|
boolean |
onTop()
Check if component is the highest at cursor position.
|
void |
releaseFocus()
Reverses
requestFocus() and ask parent not to request focus. |
void |
requestFocus()
Used to indicate to the parent that the current component has to have focus within the parent.
|
void |
setDescription(java.lang.String description)
Set the description when rendering.
|
void |
setHeight(int height)
Sets the height of the component.
|
public Context(Context context, int left, int right, int offset, boolean focus, boolean onTop)
inter and onTop are inherited without modification.context - the context of the parentleft - the left horizontal border for the childright - the right horizontal border for the childoffset - the vertical position of the child relative to the parent's positionfocus - focus state of the parentonTop - whether component is in the frontpublic Context(Interface inter, int width, java.awt.Point position, boolean focus, boolean onTop)
ClickGUI).inter - the current Interfacewidth - the width of the componentposition - the position of the componentfocus - set to false, to disable the component from having focusonTop - set to false, if a component is above another component at the current cursor positionpublic Interface getInterface()
Interface.Interfacepublic java.awt.Dimension getSize()
public void setHeight(int height)
height - the component's heightpublic java.awt.Point getPos()
public boolean hasFocus()
public boolean onTop()
public void requestFocus()
public void releaseFocus()
requestFocus() and ask parent not to request focus.public boolean foucsRequested()
focusRequested.public boolean focusReleased()
focusOverride.public boolean isHovered()
public boolean isClicked()
isHovered() is true and the left mouse button is clickedpublic java.awt.Rectangle getRect()
public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description - the new description