mkv.MyGUI
Class MyGUIButtonDrag

java.lang.Object
  extended bymkv.MyGUI.MyGUIObject
      extended bymkv.MyGUI.MyGUIButton
          extended bymkv.MyGUI.MyGUIButtonDrag

public class MyGUIButtonDrag
extends MyGUIButton


Field Summary
 
Fields inherited from class mkv.MyGUI.MyGUIButton
_actionCommand, _disabled, _height, _icon, _id, _parent, _root, _rotation, _scale, _style, _text, _visible, _width, _x, _y, dragged, hover, lastHover, tmouseX, tmouseY
 
Constructor Summary
MyGUIButtonDrag(processing.core.PApplet root, int x, int y, int width, int height)
           
MyGUIButtonDrag(processing.core.PApplet root, int x, int y, processing.core.PImage icon)
           
 
Method Summary
 void clearDragArea()
           
 void mouseDragged()
          Interface method.
 void mousePressed()
          Sets dragged to true if object has focus.
 void setDragArea(int minx, int miny, int maxx, int maxy)
           
 
Methods inherited from class mkv.MyGUI.MyGUIButton
checkForHit, disable, draw, drawStates, enable, getFocusIndex, getStyle, hasFocus, isDisabled, isDragged, keyPressed, keyReleased, keyTyped, mouseReleased, normalize, rotate, rotateRadians, setActionCommand, setID, setLabel, setLabel, setParent, setStyle, updateLocalMouse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyGUIButtonDrag

public MyGUIButtonDrag(processing.core.PApplet root,
                       int x,
                       int y,
                       int width,
                       int height)

MyGUIButtonDrag

public MyGUIButtonDrag(processing.core.PApplet root,
                       int x,
                       int y,
                       processing.core.PImage icon)
Method Detail

clearDragArea

public void clearDragArea()

setDragArea

public void setDragArea(int minx,
                        int miny,
                        int maxx,
                        int maxy)

mousePressed

public void mousePressed()
Description copied from class: MyGUIObject
Sets dragged to true if object has focus. This is the most basic response to a mouse click. Arguably it could generate an actionEvent as well if it had focus. This method can be easily overriden for custom handling of mouse events, specifically the mousePressed() event. It is called by its parent every time the mouse is pressed.

Overrides:
mousePressed in class MyGUIObject
See Also:
MyGUIObject.mouseReleased(), MyGUIObject.mouseDragged()

mouseDragged

public void mouseDragged()
Description copied from class: MyGUIObject
Interface method. It does nothing. When the mouse is dragged this method is called by the parent object. Useful for real time dragging. MyGUIButtonDrag uses this to update its _x and _y coordinates when the dragged state is set to true.

Overrides:
mouseDragged in class MyGUIObject