|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mkv.MyGUI.MyGUIObject mkv.MyGUI.MyGUIGroup mkv.MyGUI.MyGUI
Controller object that registers Draw, Mouse and Key events with PApplet.
Since the introduction of MyGUIGroup, most the code from MyGUI has been stripped out to the extent where I decided that MyGUI should now extend MyGUIGroup to regain the same level of functionality.
So, the MyGUI controller is infact a fancy version of a MyGUIGroup. That is besides from containing other MyGUI elements as the root of the hierarchy it also has the important task of registering its methods with the parent PApplet so that it, and all its children will respond to mouse and key events as well as automatically drawing them selves to the screen.
MyGUIGroup
Field Summary |
Fields inherited from class mkv.MyGUI.MyGUIGroup |
_actionCommand, _disabled, _height, _id, _root, _rotation, _scale, _style, _visible, _width, _x, _y, customMouse, dragged, hover, lastHover, tmouseX, tmouseY |
Constructor Summary | |
MyGUI(processing.core.PApplet parent)
Default class constructor. |
|
MyGUI(processing.core.PApplet parent,
int size)
Class constructor where the size of the element array can be specified. |
|
MyGUI(processing.core.PApplet parent,
int size,
MyGUIStyle style)
Class constructor where the size of the element array can be specified as well as a reference to a MyGUIStyle object. |
|
MyGUI(processing.core.PApplet parent,
MyGUIStyle style)
Class constructor with a reference to a custom MyGUIStyle object. |
Method Summary | |
boolean |
isDisabled()
Returns the enabled or disabled state of this object. |
void |
keyEvent(java.awt.event.KeyEvent e)
Recalls Key events based on type. |
void |
mouseEvent(java.awt.event.MouseEvent e)
Recalls Mouse events based on type. |
void |
updateLocalMouse()
Updates local mouse coordinates tmouseX and tmouseY. |
Methods inherited from class mkv.MyGUI.MyGUIGroup |
add, checkForHit, disable, draw, drawStates, enable, get, getFocused, getFocusIndex, getStyle, hasFocus, isDragged, isEmpty, isFull, keyPressed, keyReleased, keyTyped, mouseDragged, mousePressed, mouseReleased, normalize, remove, rotate, rotateRadians, setActionCommand, setID, setMouseCoords, setParent, setStyle, useCustomMouse |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MyGUI(processing.core.PApplet parent)
parent
- the processing PApplet where all elements will be drawn topublic MyGUI(processing.core.PApplet parent, int size)
parent
- the processing PApplet where all elements will be drawn tosize
- size of element array. The default size is 25.public MyGUI(processing.core.PApplet parent, int size, MyGUIStyle style)
parent
- the processing PApplet where all elements will be drawn tosize
- size of element array. The default size is 25.style
- the style object used by all MyGUI elements when they draw themselvespublic MyGUI(processing.core.PApplet parent, MyGUIStyle style)
parent
- the processing PApplet where all elements will be drawn tostyle
- the style object used by all MyGUI elements when they draw themselvesMethod Detail |
public void mouseEvent(java.awt.event.MouseEvent e)
public void keyEvent(java.awt.event.KeyEvent e)
public boolean isDisabled()
isDisabled
in class MyGUIObject
MyGUIObject._disabled
public void updateLocalMouse()
Because the MyGUI controller is considered a parent object that sits above all others then it has a customized updateLocalMouse() method that uses PApplet mouseX, mouseY instead of _parent.tmouseX, _parent.tmouseY.
updateLocalMouse
in class MyGUIGroup
MyGUIGroup.useCustomMouse(boolean)
,
MyGUIGroup.setMouseCoords(int, int)
,
MyGUIObject.checkForHit()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |