public abstract class WheelTransformInteractor extends Object implements TransformInteractor, FigMouseWheelListener, FigMouseButtonListener
Details:
This class delivers the common functionality of transform interactors that respond to mouse wheel events.
Subclasses should implement wheelTransform(FigMouseEvent, int)
.
Modifier | Constructor and Description |
---|---|
protected |
WheelTransformInteractor(boolean iArmedWhenPressed,
boolean iWheelReversed)
Details:
This constructor configures the behavior of this wheel transform interactor.
|
Modifier and Type | Method and Description |
---|---|
void |
mouseButtonPressed(FigMouseEvent iEvent)
Arms or disarms.
|
void |
mouseButtonReleased(FigMouseEvent iEvent)
Arms or disarms.
|
void |
mouseWheelRotated(FigMouseEvent iEvent)
Sends transform messages subclass if armed.
|
protected abstract void |
wheelTransform(FigMouseEvent iEvent,
int iTicks)
Executes transform.
|
protected WheelTransformInteractor(boolean iArmedWhenPressed, boolean iWheelReversed)
Details: This constructor configures the behavior of this wheel transform interactor.
iArmedWhenPressed
indicates the state that the wheel button must be in for this interactor to be armed.
If this parameter is true
, then the wheel button must be pressed for this interactor to fire.
If this parameter is false
, then the wheel button must be unpressed for this interactor to fire.
iWheelReversed
indicates whether the wheel direction is reversed.
If this value is false
, then rolling the wheel towards the user sends positive wheel rotation values;
otherwise, the opposite is true.
iArmedWhenPressed
- true iff button must be pressed for interactor to fireiWheelReversed
- true iff wheel rotation values should be reversedpublic void mouseButtonPressed(FigMouseEvent iEvent)
Details: This implementation responds only to mouse wheel button pressed events, effectively arming or disarming this interactor.
mouseButtonPressed
in interface FigMouseButtonListener
iEvent
- the eventFigMouseButtonListener.mouseButtonReleased(FigMouseEvent)
public void mouseButtonReleased(FigMouseEvent iEvent)
Details: This implementation responds only to mouse wheel button released events, effectively arming or disarming this interactor.
mouseButtonReleased
in interface FigMouseButtonListener
iEvent
- the eventpublic void mouseWheelRotated(FigMouseEvent iEvent)
Details:
This implementation responds to mouse wheel rotated events, but only if this interactor is armed.
If this interactor is armed, then this implementation determines the amount and direction of the transform and forwards that information to wheelTransform(FigMouseEvent, int)
, which is implemented in a subclass.
mouseWheelRotated
in interface FigMouseWheelListener
iEvent
- the eventprotected abstract void wheelTransform(FigMouseEvent iEvent, int iTicks)
Details: This method is called when a transform has been successfully commanded through this interactor. The implementing subclass should perform the transformation based on the computed number of "ticks," which is provided as a parameter. For convenience and reference, the original mouse event is also transmitted.
iEvent
- original mouse eventiTicks
- amount of commanded transformationCopyright © 2013. All Rights Reserved.