public class WidgetInteractor
extends vona.ui.RXSInteractor
Specializes an RXSInteractor
to drive the Widget.rx
of a
bound Widget
attached to a LinkageNode
.
Controller.LOCK
guards all state. Normally methods are called
from the update thread, e.g. by scheduling an update task.
TrajectoryActor
Copyright (C) 2008 Marsette A. Vona, III
Modifier and Type | Field and Description |
---|---|
protected boolean |
active
whether this interactor is currently activated for scheduling
|
private static java.lang.String |
cvsid |
protected double |
lastUpdateTime
RXSInteractor.clock timestamp of last update() since last bind(vona.j3d.Widget) or activate() or NaN if none. |
protected vona.math.RX |
manipulationToGroundRX
Similar to
InteractorDriver.manipulationToGroundRX . |
static double |
MIN_UPDATE_TIME
Minimum time between true returns from
needsUpdate() in RXSInteractor.clock time. |
protected vona.math.RX |
restoreRX
the original
Widget.rx state at activate() |
protected vona.math.RX |
subFrameCMT
Similar to
InteractorDriver.subFrameCMT . |
protected vona.math.RX |
tempRX
temporary storage
|
protected vona.j3d.Widget |
widget
the currently bound widget or null if none
|
ACCEL_SLIDER, accelChangeActionLabel, accelFactor, accelSliderEnabled, altDown, blockRotateFactor, blockScaleFactor, blockTranslateFactor, canvasSize, clock, controlInLocalFrame, controlInManipulationFrame, ctrlDown, DEF_BLOCK_ROTATE_FACTOR, DEF_BLOCK_SCALE_FACTOR, DEF_BLOCK_TRANSLATE_FACTOR, DEF_INTERPOLATION_THRESHOLD_PIXELS, DEF_INTERPOLATION_TIME, DEF_SCALE_BASE, downPressed, downReleased, eventsDuringInterpolationEnabled, eventsEnabled, firstMouseX, firstMouseY, fitTXEMS, focusListener, interpolationDeadline, interpolationStartTime, interpolationThresholdPixels, interpolationTime, KEY_REPEAT_SCALE_PIXELS_PER_MS, KEY_REPEAT_THRESHOLD_MS, KEY_TIMER_PERIOD_MS, keyListener, keyTimer, lastMouseX, lastMouseY, leftPressed, leftReleased, manipulationToWorld, mouseListener, mouseMotionListener, mouseWheelListener, rightPressed, rightReleased, rotateXYEnabled, rotateZEnabled, rotationCenter, rxsInterpolator, scaleBase, scaleEnabled, shiftDown, t0, t1, translateXYEnabled, translateZEnabled, TYPEMATIC_SLOP_MS, upPressed, upReleased, worldToCanvasScale
Constructor and Description |
---|
WidgetInteractor()
Makes a new widget interactor using a default
Clock (wall-clock
time). |
WidgetInteractor(vona.time.Clock clock)
Creates a new widget interactor with the given clock.
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
Enable this widget interactor for scheduling by the update thread.
|
void |
bind(vona.j3d.Widget widget)
Change the bound
widget . |
protected void |
checkBindings()
If bound, check that
widget 's parent LinkageNode is
present. |
protected void |
checkWidget(vona.j3d.Widget widget,
java.lang.String msg)
common impl of
bind(vona.j3d.Widget) and checkBindings() |
void |
deactivate()
Disable this widget interactor for scheduling by the update thread.
|
void |
enableScale(boolean enable)
Widget transforms are always rigid.
|
LinkageNode |
getBoundWidgetParentNode()
Get the
LinkageNode.WP_NODE of the bound widget , if
any. |
java.lang.String |
getBoundWidgetSubFrame()
Get the
LinkageNode.WP_FRAME of the bound widget , if
any. |
protected static LinkageNode |
getParentNode(vona.j3d.Widget widget)
get the
LinkageNode.WP_NODE of widget |
boolean |
isActive()
Check whether this widget interactor is enabled for scheduling by the
update thread.
|
boolean |
isBound()
check if
widget is non-null |
void |
modelStateChanged()
Called by the update thread when this widget interactor is active after
the model state changes, and after that state change has been otherwise
handled, including one
Solver iteration. |
void |
modelStructureChanged()
Called by the update thread when this widget interactor is active after
the model structure changes.
|
boolean |
needsUpdate()
Called by the update thread when this widget interactor is active to
check whether
update() needs to be called soon. |
boolean |
restore()
restore(boolean) without jumping |
boolean |
restore(boolean jump)
Restore the bound
Widget.rx to its original state at most
recent activate() or bind(vona.j3d.Widget) . |
void |
setManipulationToGround(vona.math.RX rx,
boolean invert)
|
void |
unbind()
null
widget |
void |
update()
Write interactor state to bound
Widget.rx . |
void |
updateManipulationFrameRX()
Similar to
InteractorDriver.updateManipulationFrameRX() . |
addListeners, appendManipulationToWorld, appendManipulationToWorld, areEventsDuringInterpolationEnabled, areEventsEnabled, canvasToWorldX, canvasToWorldY, cycleControlFrame, cycleControlFrame, dump, dump, dumpHelp, dumpHelp, dumpHelp, enableAccelSlider, enableAllSubEvents, enableAllSubEvents, enableAllSubEvents, enableEvents, enableEventsDuringInterpolation, enableRotateXY, enableRotateZ, enableTranslateXY, enableTranslateZ, fit, fit, getControlFrame, getControlFrame, getCurrentInterpolationCoordinate, getCurrentRX, getCurrentRX, getCurrentScale, getCurrentTime, getCurrentTransform, getCurrentTXEM, getCurrentTXEM, getCurrentTXEMS, getCurrentTXEMS, getRotationCenter, getRotationCenter, getRotationCenterInWorld, getRotationCenterInWorld, getRotationCenterZInWorld, handleEvent, handleEvent, handleEvent, handleEvent, handleKeyPressed, handleKeyReleased, handleKeyTyped, hasNext, interpolateTo, interpolateTo, interpolateTo, interpolateToAim, interpolateToNext, interpolateToNext, interpolateToTXEM, interpolateToTXEM, interpolateToTXEMS, interpolateToTXEMS, isAccelSliderEnabled, isControlInLocalFrame, isControlInManipulationFrame, isControlInWorldFrame, isInterpolating, isRotateXYEnabled, isRotateZEnabled, isScaleEnabled, isTranslateXYEnabled, isTranslateZEnabled, jumpTo, jumpTo, jumpToAim, jumpToNext, jumpToTXEM, jumpToTXEMS, nextSubAction, prependManipulationToWorld, prependManipulationToWorld, removeListeners, resetEventState, rotateEulerInLocal, rotateEulerInManipulationFrame, rotateEulerInWorld, rotateImpl, rotateXYBlocks, rotateXYPixels, rotateXYPixelsImpl, rotateZBlocks, rotateZPixels, rotateZPixelsImpl, scale, scale, scaleBlocks, scaleBlocks, scalePixels, scalePixels, scalePixelsImpl, selectSubAction, setAccelFactor, setBlockRotateDegrees, setBlockRotateFactor, setBlockRotateRadians, setBlockScaleFactor, setBlockTranslateFactor, setCanvasSize, setControlInLocalFrame, setControlInManipulationFrame, setControlInWorldFrame, setInterpolationThresholdPixels, setInterpolationTime, setManipulationToWorld, setManipulationToWorld, setRotationCenter, setRotationCenter, setScaleBase, setWorldToCanvasScale, transformDirty, translateImpl, translateInLocal, translateInManipulationFrame, translateInWorld, translateXYBlocks, translateXYPixels, translateXYPixelsImpl, translateZBlocks, translateZPixels, translateZPixelsImpl
private static final java.lang.String cvsid
public static final double MIN_UPDATE_TIME
Minimum time between true returns from needsUpdate()
in RXSInteractor.clock
time.
protected vona.j3d.Widget widget
protected boolean active
protected vona.math.RX tempRX
protected final vona.math.RX restoreRX
Widget.rx
state at activate()
protected final vona.math.RX manipulationToGroundRX
Similar to InteractorDriver.manipulationToGroundRX
.
protected final vona.math.RX subFrameCMT
Similar to InteractorDriver.subFrameCMT
.
protected double lastUpdateTime
RXSInteractor.clock
timestamp of last update()
since last bind(vona.j3d.Widget)
or activate()
or NaN if none.
public WidgetInteractor(vona.time.Clock clock)
Creates a new widget interactor with the given clock.
public WidgetInteractor()
Makes a new widget interactor using a default Clock
(wall-clock
time).
public void bind(vona.j3d.Widget widget)
Change the bound widget
.
widget
- the new Widget to bind, may be nulljava.lang.IllegalStateException
- see checkBindings()
public void unbind()
widget
public boolean isBound()
widget
is non-nullpublic void activate()
Enable this widget interactor for scheduling by the update thread.
java.lang.IllegalStateException
- see checkBindings()
public void deactivate()
Disable this widget interactor for scheduling by the update thread.
public boolean isActive()
Check whether this widget interactor is enabled for scheduling by the update thread.
public void modelStateChanged()
Called by the update thread when this widget interactor is active after
the model state changes, and after that state change has been otherwise
handled, including one Solver
iteration.
Default impl does nothing.
public void modelStructureChanged()
Called by the update thread when this widget interactor is active after the model structure changes.
Default impl calls checkBindings()
.
java.lang.IllegalStateException
- see checkBindings()
public void update()
Write interactor state to bound Widget.rx
.
java.lang.IllegalStateException
- see checkBindings()
public boolean needsUpdate()
Called by the update thread when this widget interactor is active to
check whether update()
needs to be called soon.
public LinkageNode getBoundWidgetParentNode()
Get the LinkageNode.WP_NODE
of the bound widget
, if
any.
protected static LinkageNode getParentNode(vona.j3d.Widget widget)
LinkageNode.WP_NODE
of widgetpublic java.lang.String getBoundWidgetSubFrame()
Get the LinkageNode.WP_FRAME
of the bound widget
, if
any.
protected void checkBindings()
If bound, check that widget
's parent LinkageNode
is
present.
java.lang.IllegalStateException
- if the currently bound widget
has no parent LinkageNode
or if the parent node is no longer
presentprotected void checkWidget(vona.j3d.Widget widget, java.lang.String msg)
bind(vona.j3d.Widget)
and checkBindings()
public boolean restore(boolean jump)
Restore the bound Widget.rx
to its original state at most
recent activate()
or bind(vona.j3d.Widget)
.
public boolean restore()
restore(boolean)
without jumpingpublic void setManipulationToGround(vona.math.RX rx, boolean invert)
public void updateManipulationFrameRX()
Similar to InteractorDriver.updateManipulationFrameRX()
.
public void enableScale(boolean enable)
Widget transforms are always rigid.
enableScale
in class vona.ui.RXSInteractor
java.lang.UnsupportedOperationException