Class CameraThreadControllerWithTime

All Implemented Interfaces:
Runnable, ICameraMouseController

public class CameraThreadControllerWithTime extends CameraThreadController implements Runnable
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
  • Field Details

    • speed

      protected double speed
    • rateLimiter

      protected RateLimiter 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_MS
      Used in case no rate limiter is used
      See Also:
    • RATE_CHECK_RATE

      protected static final int RATE_CHECK_RATE
      The 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

      public CameraThreadControllerWithTime(Chart chart)
      Defaults time to spin to 10
      Parameters:
      chart -
    • CameraThreadControllerWithTime

      public CameraThreadControllerWithTime(Chart chart, double secondsToCompleteSpin)
      Parameters:
      chart -
      secondsToCompleteSpin - time in second to let the chart rotate of 2xPI
  • Method Details