Class CameraThreadControllerWithTime
java.lang.Object
org.jzy3d.chart.controllers.AbstractController
org.jzy3d.chart.controllers.camera.AbstractCameraController
org.jzy3d.chart.controllers.thread.camera.AbstractCameraThreadController
org.jzy3d.chart.controllers.thread.camera.CameraThreadController
org.jzy3d.chart.controllers.thread.camera.CameraThreadControllerWithTime
- All Implemented Interfaces:
Runnable,ICameraMouseController
The
CameraThreadControllerWithTime handle rotation of a Camera according to a
speed given in second, which is the time required to make a complete 360° rotation.
If the chart is configured to repaint on demand, then the thread will adapt the amount of
rendering request according to the current computer capabilities w.r.t. the configuration
constraints (size, HiDPI, etc). The rate limiter may be disabled by
setRateLimiter(RateLimiterAdaptsToRenderTime)
In case the angle steps for the rotation are too high, then one should let the chart work with
less demanding processing
- Disable HiDPI
}
invalid @link
{@link Quality#setPreserveViewportSize(true) - Use smaller canvas size.
- Author:
- Martin Pernollet
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CameraThreadControllerWithTime.DirectionRotation direction : Direction.LEFT makes negative azimuth increments, while Direction.RIGHT make positive azimuth increments.protected static final intUsed in case no rate limiter is usedprotected static final intThe interval between each rate limit verification in MSprotected RateLimiterA rate limiter to avoid flooding AWT Event thread.protected doubleFields inherited from class org.jzy3d.chart.controllers.thread.camera.CameraThreadController
move, sleep, stepFields inherited from class org.jzy3d.chart.controllers.thread.camera.AbstractCameraThreadController
id, processFields inherited from class org.jzy3d.chart.controllers.camera.AbstractCameraController
perf, threadController, updateViewDefaultFields inherited from class org.jzy3d.chart.controllers.AbstractController
controllerListeners, target -
Constructor Summary
ConstructorsConstructorDescriptionDefaults time to spin to 10CameraThreadControllerWithTime(Chart chart, double secondsToCompleteSpin) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoRun()Will only update screen ifAbstractCameraController.isUpdateViewDefault(), otherwise the thread only move camera and let thetrigger continuous repaints.invalid @link
EmulGLAnimatordoublegetSpeed()voidvoidsetRateLimiter(RateLimiter rateLimiter) voidsetSpeed(double speed) Methods inherited from class org.jzy3d.chart.controllers.thread.camera.CameraThreadController
getStep, setStepMethods inherited from class org.jzy3d.chart.controllers.thread.camera.AbstractCameraThreadController
dispose, run, start, stopMethods inherited from class org.jzy3d.chart.controllers.camera.AbstractCameraController
addSlaveThreadController, addThread, getLODPerf, getSlaveThreadController, getThread, isUpdateViewDefault, removeSlaveThreadController, rotate, rotate, rotate, setLODPerf, setUpdateViewDefault, shift, shift, startThreadController, stopThreadController, zoomX, zoomX, zoomY, zoomY, zoomZ, zoomZMethods inherited from class org.jzy3d.chart.controllers.AbstractController
addControllerEventListener, fireControllerEvent, getChart, getCharts, register, removeControllerEventListener, unregister
-
Field Details
-
speed
protected double speed -
rateLimiter
A rate limiter to avoid flooding AWT Event thread. It adapts according to rendering time to ensure rate limit is not to high (chart rendering capabilities may change over time due to many parameters (chart size, number of drawable, availability of CPU, etc) -
MIN_LOOP_PAUSE_MS
protected static final int MIN_LOOP_PAUSE_MSUsed in case no rate limiter is used- See Also:
-
RATE_CHECK_RATE
protected static final int RATE_CHECK_RATEThe interval between each rate limit verification in MS- See Also:
-
direction
Rotation direction : Direction.LEFT makes negative azimuth increments, while Direction.RIGHT make positive azimuth increments.
-
-
Constructor Details
-
CameraThreadControllerWithTime
public CameraThreadControllerWithTime() -
CameraThreadControllerWithTime
Defaults time to spin to 10- Parameters:
chart-
-
CameraThreadControllerWithTime
- Parameters:
chart-secondsToCompleteSpin- time in second to let the chart rotate of 2xPI
-
-
Method Details
-
doRun
protected void doRun()Will only update screen ifAbstractCameraController.isUpdateViewDefault(), otherwise the thread only move camera and let thetrigger continuous repaints.invalid @link
EmulGLAnimator- Overrides:
doRunin classCameraThreadController
-
getSpeed
public double getSpeed() -
setSpeed
public void setSpeed(double speed) -
getDirection
-
setDirection
-
getRateLimiter
-
setRateLimiter
-