public abstract class AbstractInteractableComponent extends AbstractComponent implements InteractableComponent
Interactable.FocusChangeDirection, Interactable.Result
Component.Alignment
Constructor and Description |
---|
AbstractInteractableComponent() |
Modifier and Type | Method and Description |
---|---|
protected void |
afterEnteredFocus(Interactable.FocusChangeDirection direction) |
protected void |
afterLeftFocus(Interactable.FocusChangeDirection direction) |
TerminalPosition |
getHotspot()
When the component has keyboard focus, this method is called by the GUI
system to figure out where should the cursor be positioned.
|
boolean |
hasFocus()
This method will return true if the component currently has input focus in the GUI
|
void |
onEnterFocus(Interactable.FocusChangeDirection direction)
Method called when this component gained keyboard focus.
|
void |
onLeaveFocus(Interactable.FocusChangeDirection direction)
Method called when this component leaves keyboard focus.
|
protected void |
setHotspot(TerminalPosition point)
Sets the hotspot, in global coordinates, of where to put the text cursor when this component
is active.
|
addBorder, addComponentListener, calculatePreferredSize, getAlignment, getComponentListeners, getGUIScreen, getMinimumSize, getParent, getPreferredSize, getWindow, invalidate, isScrollable, isVisible, removeComponentListener, setAlignment, setParent, setPreferredSize, setVisible, transformAccordingToAlignment
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
keyboardInteraction
addBorder, addComponentListener, getAlignment, getMinimumSize, getParent, getPreferredSize, getWindow, isScrollable, isVisible, removeComponentListener, repaint, setAlignment, setPreferredSize, setVisible
public final void onEnterFocus(Interactable.FocusChangeDirection direction)
Interactable
onEnterFocus
in interface Interactable
direction
- What direction did the focus come frompublic final void onLeaveFocus(Interactable.FocusChangeDirection direction)
Interactable
onLeaveFocus
in interface Interactable
direction
- What direction is focus going toprotected void afterEnteredFocus(Interactable.FocusChangeDirection direction)
protected void afterLeftFocus(Interactable.FocusChangeDirection direction)
public boolean hasFocus()
true
if the component has input focus, otherwise false
public TerminalPosition getHotspot()
Interactable
getHotspot
in interface Interactable
null
if the cursor should
be hiddenprotected void setHotspot(TerminalPosition point)
null
argument, the cursor will be hidden while this
component has focus.point
- Global coordinates of the hotspot position for this component, or null
if the cursor is to be hiddenCopyright © 2015. All Rights Reserved.