Interface GUIElement
- All Known Implementing Classes:
AbstractButton,AbstractButton2,AbstractGUIElement,AbstractGUIMap,AbstractLabel,ActivatableGUIElement,GUIButton,GUICharacter,GUICharacterList,GUICharOptionsComboBox,GUICheckBox,GUIClassesComboBox,GUIComboBox,GUICommandText,GUIDialogBackground,GUIDialogTitle,GUIDupGauge,GUIFill,GUIFloorList,GUIGauge,GUIHTMLLabel,GUIInventoryList,GUIItem,GUIItemFloor,GUIItemInventory,GUIItemItem,GUIItemKnowledge,GUIItemKnowledgeType,GUIItemList,GUIItemQuest,GUIItemShortcut,GUIItemSpell,GUIItemSpellSkill,GUIKnowledgeList,GUIKnowledgeTypeList,GUILabel,GUILabelFailure,GUILabelLog,GUILabelMessage,GUILabelQuery,GUILabelStats,GUILabelStats2,GUIList,GUILog,GUIMap,GUIMapDirections,GUIMessageLog,GUIMetaElement,GUIMetaElementList,GUIMiniMap,GUIMultiLineLabel,GUINewcharLabel,GUIOneLineLabel,GUIPicture,GUIPictureStat,GUIQueryText,GUIQuestList,GUIRacesComboBox,GUIScrollBar,GUISelectableButton,GUISpellList,GUISpellSkillList,GUISpinner,GUIStartingMapsComboBox,GUIText,GUITextButton,GUITextField,GUITextGauge
public interface GUIElement
Interface defining an abstract GUI element.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Releases all allocated resources.@NotNull StringgetName()Returns the internal name of this gui element.booleanReturns whether this element is the default element.booleanisIgnore()Returns whether this gui element is to be ignored for user interaction.voidmouseClicked(@NotNull MouseEvent e) Will be called when the user has clicked (pressed+released) this element.voidmouseDragged(@NotNull MouseEvent e) Will be called when the mouse moves within this component while the button is pressed.voidmouseEntered(@NotNull MouseEvent e) Will be called when the mouse has entered the bounding box of this element.voidmouseExited(@NotNull MouseEvent e) Will be called when the mouse has left the bounding box of this element.voidmouseMoved(@NotNull MouseEvent e) Will be called when the mouse moves within this component.voidmousePressed(@NotNull MouseEvent e) Will be called when the user has pressed the mouse inside this element.voidmouseReleased(@NotNull MouseEvent e) Will be called when the user has released the mouse.voidmouseWheelMoved(int wheelRotation) Will be called when the mouse wheel has been moved.voidCalled each time the enclosing dialog is opened (or raised).voidRecords that the contents have changed and must be repainted.voidsetChangedListener(@Nullable GUIElementChangedListener changedListener) Sets theGUIElementChangedListenerto be notified.voidsetDefault(boolean isDefault) Sets whether this element is the default element.voidMarks this gui element to be ignored for user interaction.
-
Method Details
-
dispose
void dispose()Releases all allocated resources. -
isDefault
boolean isDefault()Returns whether this element is the default element. The default element is selected with the ENTER key.- Returns:
- whether this element is the default element
-
setDefault
void setDefault(boolean isDefault) Sets whether this element is the default element. The default element is selected with the ENTER key.- Parameters:
isDefault- whether this element is the default element
-
setIgnore
void setIgnore()Marks this gui element to be ignored for user interaction. -
isIgnore
boolean isIgnore()Returns whether this gui element is to be ignored for user interaction.- Returns:
- whether this gui element is ignored
-
getName
Returns the internal name of this gui element. The name is used in skin files for identifying an element.- Returns:
- the name
-
mouseClicked
Will be called when the user has clicked (pressed+released) this element. This event will be delivered aftermouseReleased(MouseEvent).- Parameters:
e- the mouse event relative to this element
-
mouseEntered
Will be called when the mouse has entered the bounding box of this element.- Parameters:
e- the mouse event relative to this element
-
mouseExited
Will be called when the mouse has left the bounding box of this element. This function will not be called unlessmouseEntered(MouseEvent)has been called before.- Parameters:
e- the mouse event relative to this element
-
mousePressed
Will be called when the user has pressed the mouse inside this element.- Parameters:
e- the mouse event relative to this element
-
mouseReleased
Will be called when the user has released the mouse. This event may be delivered even if no previousmousePressed(MouseEvent)has been delivered before.- Parameters:
e- the mouse event relative to this element
-
mouseMoved
Will be called when the mouse moves within this component. before.- Parameters:
e- the mouse event relative to this element
-
mouseDragged
Will be called when the mouse moves within this component while the button is pressed. This event will be delivered aftermouseMoved(MouseEvent).Note: if the mouse leaves this element's bounding box while the mouse button is still pressed, further
mouseDragged(but nomouseMoved) events will be generated.- Parameters:
e- the mouse event relative to this element
-
mouseWheelMoved
void mouseWheelMoved(int wheelRotation) Will be called when the mouse wheel has been moved.- Parameters:
wheelRotation- the movement amount; negative=away from the user, positive=towards the user
-
setChanged
void setChanged()Records that the contents have changed and must be repainted. -
setChangedListener
Sets theGUIElementChangedListenerto be notified. Note that at most one such listener may be set per gui element.- Parameters:
changedListener- the listener ornullto unset
-
notifyOpen
void notifyOpen()Called each time the enclosing dialog is opened (or raised).
-