Package com.j3d.engine.interact.input.mouse
MouseOwner
What?
MouseOwner is exactly what it describes itself. It's a class which owns
all input of the user's mouse. It's registered within EngineFrame
to listen for motion, mouseWheel and clicks. (Literally anything and everything)
Generally speaking each mouse owner is actually responsible for checking whether it is actually the active owner
of the input, since EngineFrame goes ahead and registers all of them. This means that a mouse owner who does not
check, can technically always run regardless. Although this breaks the "trust" system of mouse owner. The only exception
is AlwaysMouseOwner who has been given the privilege of running regardless.
Why?
MouseOwner has multiple more features than the standrd abstract
MouseAdapter gives. which includes:
- Having a click delay threshold since the smallest movement counts as a drag/move to awt. This is a configurable property such as to allow small human err
- Wrapping the mouse from left to right so it just scrolls over to the user view. However, this has alot more state to it and requires owners to handle a bit more state.
- Event emitting capabilities. Why? why not.
Classes
Most MouseOwners can only be found where they are used. e.g. OrbitMouseOwner
can only be found within that command's sub-package within the commands package and do not live here. Only the generic owners
live here.
-
MouseOwner, the main guy. extendsMouseAdapterand implementsEventEmitterInterface, and is the base class for all other mouse owners. -
Mouse, a simple object holding an x, y and deltas. Any MouseOwner which plans on using mouse wrapping will make use of this mouse and notMouseEventdeltas. SeeMouseOwner.wrap(java.awt.event.MouseEvent) -
MOwneran enum that defines the different types of mouse owners in the engine. usually each concrete owner has it's own enum entry defining itself. -
NoMouseOwner, a specialMouseOwnerthat represents the absence of an active mouse owner. The only thing this provides, is wrapping the mouse form left to right. generally this isnt used elsewhere other than testing or making so no other input is given -
AlwaysMouseOwner, a specialMouseOwnerthat always executes its mouse event methods, regardless of whether it is the active mouse owner. -
SnapMouseOwner, a special type of mouse owner which by itself is not a concrete owner, but when extended allows for snapping mouse movements to certain geometry. be it end points mid points, etc.. -
SnapPayload, a payload class used to carry information about a snap event, such as the snapped point and the type of snap.
Other important mouse owners
-
TransformMouseOwner, An extremely complex mouse owner which is the base class for the 3 transform mouse owners. This allows its extenders to draw transform handles beyond what MouseOwner alone can do.An extender
TransformMouseOwner, extends this base class and also implementsSnapMouseOwner, making it allow snapping too. -
OrbitMouseOwner, the most interactive, is how theorbitcommand works by turning drag input into rotating the global camera. -
QTranslateMouseOwner, another interactive, and also linear algebra heavy one, which acts as a quicker form of transform to just displace a group selection by a mouse movement delta. -
SelectionMouseOwnerthe mouse owner responsible for the most important user feature. selection and selection feedback. Although most of its logic is displaced elsewhere and not within the owner itself (intersection checks, union selection, etc)
-
ClassDescriptionMouseOwner is a class which represents an entity that can own the mouse input in the sceneManager.MOwner is an enum which represents the different types of mouse owners in the sceneManager.NoMouseOwner is a MouseOwner which represents the absence of a mouse owner in the sceneManager.A
MouseOwnerwhich enables child classes which extend it, the capability to snap toGObjects.