Crossfire JXClient, Trunk  R20561
GUIElement.java
Go to the documentation of this file.
1 /*
2  * This file is part of JXClient, the Fullscreen Java Crossfire Client.
3  *
4  * JXClient is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * JXClient is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with JXClient; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * Copyright (C) 2005-2008 Yann Chachkoff.
19  * Copyright (C) 2006-2011 Andreas Kirschbaum.
20  */
21 
22 package com.realtime.crossfire.jxclient.gui.gui;
23 
24 import java.awt.event.MouseEvent;
25 import org.jetbrains.annotations.NotNull;
26 import org.jetbrains.annotations.Nullable;
27 
32 public interface GUIElement {
33 
37  void dispose();
38 
44  boolean isDefault();
45 
51  void setDefault(boolean isDefault);
52 
56  void setIgnore();
57 
62  boolean isIgnore();
63 
69  @NotNull
70  String getName();
71 
77  void mouseClicked(@NotNull MouseEvent e);
78 
85  void mouseEntered(@NotNull MouseEvent e, boolean debugGui);
86 
93  void mouseExited(@NotNull MouseEvent e);
94 
99  void mousePressed(@NotNull MouseEvent e);
100 
107  void mouseReleased(@NotNull MouseEvent e);
108 
113  void mouseMoved(@NotNull MouseEvent e);
114 
125  void mouseDragged(@NotNull MouseEvent e);
126 
130  void setChanged();
131 
137  void setTooltipText(@Nullable String tooltipText);
138 
148  void setTooltipText(@Nullable String tooltipText, int x, int y, int w, int h);
149 
154  boolean hasTooltipText();
155 
161  void setChangedListener(@Nullable GUIElementChangedListener changedListener);
162 
163 }
boolean isDefault()
Returns whether this element is the default element.
void dispose()
Releases all allocated resources.
boolean isIgnore()
Returns whether this gui element is to be ignored for user interaction.
void setIgnore()
Marks this gui element to be ignored for user interaction.
String getName()
Returns the internal name of this gui element.
void mouseMoved(@NotNull MouseEvent e)
Will be called when the mouse moves within this component.
void mouseClicked(@NotNull MouseEvent e)
Will be called when the user has clicked (pressed+released) this element.
void setDefault(boolean isDefault)
Sets whether this element is the default element.
Interface defining an abstract GUI element.
Definition: GUIElement.java:32
void mouseEntered(@NotNull MouseEvent e, boolean debugGui)
Will be called when the mouse has entered the bounding box of this element.
void mouseExited(@NotNull MouseEvent e)
Will be called when the mouse has left the bounding box of this element.
void mouseReleased(@NotNull MouseEvent e)
Will be called when the user has released the mouse.
void mouseDragged(@NotNull MouseEvent e)
Will be called when the mouse moves within this component while the button is pressed.
Interface for listeners interested in the changed flag of GUIElement instances.
void setChangedListener(@Nullable GUIElementChangedListener changedListener)
Sets the GUIElementChangedListener to be notified.
boolean hasTooltipText()
Returns whether the tooltip is enabled.
void setChanged()
Records that the contents have changed and must be repainted.
void setTooltipText(@Nullable String tooltipText)
Sets the tooltip text to show when the mouse is inside this element.
void mousePressed(@NotNull MouseEvent e)
Will be called when the user has pressed the mouse inside this element.