mhframework.gui
Class MHGUIComponent

java.lang.Object
  extended by mhframework.gui.MHGUIComponent
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.MouseListener, java.util.EventListener, MHRenderable
Direct Known Subclasses:
MHGUIButton, MHGUIButtonMenu, MHGUIChatClient, MHGUIClientListDisplay, MHGUICycleControl, MHGUILabel, MHGUIListBox, MHGUIStatusIndicator, MHGUITextDisplayArea

public abstract class MHGUIComponent
extends java.lang.Object
implements MHRenderable, java.awt.event.ActionListener, java.awt.event.MouseListener

Base class for creating custom visual components.


Field Summary
protected  boolean focusable
          Flag indicating whether component can get focus.
protected  int height
          Size of the component.
protected  int state
          The state of the component.
protected  int width
          Size of the component.
 
Constructor Summary
MHGUIComponent()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 java.awt.geom.Rectangle2D getBounds()
           
 int getHeight()
           
 int getWidth()
           
 int getX()
           
 int getY()
           
 boolean hasFocus()
           
 boolean isEnabled()
           
 boolean isVisible()
           
abstract  void keyPressed(java.awt.event.KeyEvent e)
           
abstract  void keyReleased(java.awt.event.KeyEvent e)
           
abstract  void keyTyped(java.awt.event.KeyEvent e)
           
abstract  void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
abstract  void mouseMoved(java.awt.event.MouseEvent e)
           
abstract  void mousePressed(java.awt.event.MouseEvent e)
           
abstract  void mouseReleased(java.awt.event.MouseEvent e)
           
 void paint(java.awt.Graphics2D g)
           
 void setEnabled(boolean e)
           
 void setFocus(boolean f)
           
 void setFocusable(boolean f)
           
 void setHeight(int height)
           
 void setPosition(int px, int py)
           
 void setSize(int w, int h)
           
 void setVisible(boolean v)
           
 void setWidth(int width)
           
 void setX(int px)
           
 void setY(int py)
           
protected  java.awt.geom.Rectangle2D updateBounds()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface mhframework.MHRenderable
advance, render
 

Field Detail

width

protected int width
Size of the component.


height

protected int height
Size of the component.


focusable

protected boolean focusable
Flag indicating whether component can get focus.


state

protected int state
The state of the component. This has different meanings for different types of components.

Constructor Detail

MHGUIComponent

public MHGUIComponent()
Method Detail

paint

public void paint(java.awt.Graphics2D g)

setEnabled

public void setEnabled(boolean e)

isEnabled

public boolean isEnabled()

setVisible

public void setVisible(boolean v)

isVisible

public boolean isVisible()

setFocusable

public void setFocusable(boolean f)

setFocus

public void setFocus(boolean f)

hasFocus

public boolean hasFocus()

setX

public void setX(int px)

getX

public int getX()

setY

public void setY(int py)

getY

public int getY()

setPosition

public void setPosition(int px,
                        int py)

setSize

public void setSize(int w,
                    int h)

updateBounds

protected java.awt.geom.Rectangle2D updateBounds()

getBounds

public java.awt.geom.Rectangle2D getBounds()

getWidth

public int getWidth()

setWidth

public void setWidth(int width)

getHeight

public int getHeight()

setHeight

public void setHeight(int height)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

mouseClicked

public abstract void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public abstract void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public abstract void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseMoved

public abstract void mouseMoved(java.awt.event.MouseEvent e)

keyPressed

public abstract void keyPressed(java.awt.event.KeyEvent e)

keyReleased

public abstract void keyReleased(java.awt.event.KeyEvent e)

keyTyped

public abstract void keyTyped(java.awt.event.KeyEvent e)

mouseEntered

public final void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public final void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseDragged

public final void mouseDragged(java.awt.event.MouseEvent e)