Package org.jzy3d.chart.controllers
Class RateLimiterAdaptsToRenderTime
java.lang.Object
org.jzy3d.chart.controllers.RateLimiterByMilisecond
org.jzy3d.chart.controllers.RateLimiterAdaptsToRenderTime
- All Implemented Interfaces:
RateLimiter
This rate limiter keeps an history of past rendering time to auto configure the rate limit
and ensure we stick to actual rendering time before doing an action.
This rate limiter is useful to ensure a controller such as mouse or thread won't ask more
rendering than possible.
The time limit is computed as follow
- Compute the maximum rendering time in the list of the 10 last rendering time
- Adds a 20ms margin
-
Field Summary
Fields inherited from class org.jzy3d.chart.controllers.RateLimiterByMilisecond
RATE_LIMIT, rateLimitMilis, rateLimitStarted, t
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected double
protected double
boolean
Returns true if the canvas is NOT renderingvoid
-
Field Details
-
canvas
-
-
Constructor Details
-
RateLimiterAdaptsToRenderTime
-
RateLimiterAdaptsToRenderTime
public RateLimiterAdaptsToRenderTime()
-
-
Method Details
-
rateLimitCheck
public boolean rateLimitCheck()Returns true if the canvas is NOT rendering- Specified by:
rateLimitCheck
in interfaceRateLimiter
- Overrides:
rateLimitCheck
in classRateLimiterByMilisecond
- Returns:
-
adaptRateLimitToRenderTimeHistory
protected void adaptRateLimitToRenderTimeHistory() -
getLastRenderingTimeFromCanvas
protected double getLastRenderingTimeFromCanvas() -
max
-
getCanvas
-
setCanvas
-