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
-
Field Summary
Modifier and TypeFieldDescriptionprotected CameraThreadControllerWithTime.Direction
Rotation direction : Direction.LEFT makes negative azimuth increments, while Direction.RIGHT make positive azimuth increments.protected static final int
Used in case no rate limiter is usedprotected static final int
The interval between each rate limit verification in MSprotected RateLimiter
A rate limiter to avoid flooding AWT Event thread.protected double
Fields inherited from class org.jzy3d.chart.controllers.thread.camera.CameraThreadController
move, sleep, step
Fields inherited from class org.jzy3d.chart.controllers.thread.camera.AbstractCameraThreadController
id, process
Fields inherited from class org.jzy3d.chart.controllers.camera.AbstractCameraController
perf, threadController, updateViewDefault
Fields inherited from class org.jzy3d.chart.controllers.AbstractController
controllerListeners, target
-
Constructor Summary
ConstructorDescriptionDefaults time to spin to 10CameraThreadControllerWithTime
(Chart chart, double secondsToCompleteSpin) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doRun()
Will only update screen ifAbstractCameraController.isUpdateViewDefault()
, otherwise the thread only move camera and let theinvalid @link
EmulGLAnimator
double
getSpeed()
void
void
setRateLimiter
(RateLimiter rateLimiter) void
setSpeed
(double speed) Methods inherited from class org.jzy3d.chart.controllers.thread.camera.CameraThreadController
getStep, setStep
Methods inherited from class org.jzy3d.chart.controllers.thread.camera.AbstractCameraThreadController
dispose, run, start, stop
Methods 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, zoomZ
Methods 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 theinvalid @link
EmulGLAnimator
- Overrides:
doRun
in classCameraThreadController
-
getSpeed
public double getSpeed() -
setSpeed
public void setSpeed(double speed) -
getDirection
-
setDirection
-
getRateLimiter
-
setRateLimiter
-