G4P (GUI for Processing) 4.3.11
A set of GUI controls for your Processing sketch.
|
Public Member Functions | |
final int | button () |
final int | count () |
final MouseEvent | getEvent () |
final int | getFlavor () |
final PGraphics | getGraphics () |
final int | getModifiers () |
final Object | getNative () |
final PApplet | getPApplet () |
final int | height () |
final void | invalidate () |
final boolean | is3D () |
final boolean | isAltDown () |
final boolean | isControlDown () |
final boolean | isMetaDown () |
final boolean | isMouseOver () |
final boolean | isMousePressed () |
final boolean | isShiftDown () |
void | mouseClicked () |
void | mouseDragged () |
void | mouseEntered () |
void | mouseEvent (MouseEvent event) |
void | mouseExited () |
void | mouseMoved () |
void | mousePressed () |
void | mouseReleased () |
void | mouseWheel (MouseEvent event) |
final int | mouseX () |
final int | mouseY () |
final int | pmouseX () |
final int | pmouseY () |
void | update () |
final void | validate () |
final float | wheelSensitivity () |
final void | wheelSensitivity (float sensitivity) |
final int | width () |
Protected Member Functions | |
void | setView (GAbstractView view) |
Protected Attributes | |
GAbstractView | gview = null |
float | wheel_sensitivity = 1 |
This class provides all the key methods needed to respond to mouse events from a GView controlled and render the view.
The user should create their own class that inherits from this class and override the update() method and any of the mouse???() methods they want to use.
final int g4p_controls.GViewListener.button | ( | ) |
final int g4p_controls.GViewListener.count | ( | ) |
Get the raw count value returned by the mouse wheel.
You would need to scale this for your mouse by multiplying by the wheel sensitivity.
final MouseEvent g4p_controls.GViewListener.getEvent | ( | ) |
Use this to get the last event processed. Useful for those methods not included in this class.
final int g4p_controls.GViewListener.getFlavor | ( | ) |
final PGraphics g4p_controls.GViewListener.getGraphics | ( | ) |
Get the PGrahics canvas for this viewer. The returned value should be cast to Graphics3D is view is 3D (i.e. uses P3D)
final int g4p_controls.GViewListener.getModifiers | ( | ) |
final Object g4p_controls.GViewListener.getNative | ( | ) |
Get the platform-native event object. This might be the java.awt event on the desktop, though if you're using OpenGL on the desktop it'll be a NEWT event that JOGL uses. Android events are something else altogether. Bottom line, use this only if you know what you're doing, and don't make assumptions about the class type.
final PApplet g4p_controls.GViewListener.getPApplet | ( | ) |
Get the PApplet used to create the view.
final int g4p_controls.GViewListener.height | ( | ) |
final void g4p_controls.GViewListener.invalidate | ( | ) |
This method will cause the update() method to be executed at the next frame.
final boolean g4p_controls.GViewListener.is3D | ( | ) |
final boolean g4p_controls.GViewListener.isAltDown | ( | ) |
final boolean g4p_controls.GViewListener.isControlDown | ( | ) |
final boolean g4p_controls.GViewListener.isMetaDown | ( | ) |
final boolean g4p_controls.GViewListener.isMouseOver | ( | ) |
final boolean g4p_controls.GViewListener.isMousePressed | ( | ) |
final boolean g4p_controls.GViewListener.isShiftDown | ( | ) |
void g4p_controls.GViewListener.mouseClicked | ( | ) |
This method should be overridden in the child class
void g4p_controls.GViewListener.mouseDragged | ( | ) |
This method should be overridden in the child class
void g4p_controls.GViewListener.mouseEntered | ( | ) |
This method should be overridden in the child class
void g4p_controls.GViewListener.mouseEvent | ( | MouseEvent | event | ) |
This method should be overridden in the child class
event | the mouse event corrected for the associated view position |
void g4p_controls.GViewListener.mouseExited | ( | ) |
This method should be overridden in the child class
void g4p_controls.GViewListener.mouseMoved | ( | ) |
This method should be overridden in the child class
void g4p_controls.GViewListener.mousePressed | ( | ) |
This method should be overridden in the child class
void g4p_controls.GViewListener.mouseReleased | ( | ) |
This method should be overridden in the child class
void g4p_controls.GViewListener.mouseWheel | ( | MouseEvent | event | ) |
This method should be overridden in the child class
final int g4p_controls.GViewListener.mouseX | ( | ) |
final int g4p_controls.GViewListener.mouseY | ( | ) |
final int g4p_controls.GViewListener.pmouseX | ( | ) |
final int g4p_controls.GViewListener.pmouseY | ( | ) |
|
protected |
This method is called by the GView control when this listener is added to it.
view | the GView this listener is for. |
void g4p_controls.GViewListener.update | ( | ) |
This method should be overridden in the child class
final void g4p_controls.GViewListener.validate | ( | ) |
This method will stop the update() method being executed until the next call to invalidate().
final float g4p_controls.GViewListener.wheelSensitivity | ( | ) |
Get the mouse wheel sensitivity for this listener
final void g4p_controls.GViewListener.wheelSensitivity | ( | float | sensitivity | ) |
Set the mouse wheel sensitivity for this listener
sensitivity | the wheel sensitivity to use |
final int g4p_controls.GViewListener.width | ( | ) |