Class FanRenderer

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  FanRenderer.Triangle
      A helper class that models and renders a single sector.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static FanRenderer.Triangle[] createSectors​(int count, java.awt.Color baseColor)  
      private static java.awt.geom.Point2D getDefaultOrigin​(int width, int height)  
      java.awt.geom.Point2D getOrigin()  
      double getRotation()  
      private static java.awt.Color nextColor​(java.awt.Color baseColor)  
      void render​(java.awt.Graphics2D g2, int width, int height)
      Renders the animation on the specified graphics object using the given width and height.
      void setOrigin​(java.awt.geom.Point2D origin)  
      void setRotation​(double rotation)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • RANDOM

        private static final java.util.Random RANDOM
      • origin

        private java.awt.geom.Point2D origin
      • rotation

        private double rotation
    • Constructor Detail

      • FanRenderer

        public FanRenderer​(int triangleCount,
                           java.awt.Color baseColor)
    • Method Detail

      • createSectors

        public static FanRenderer.Triangle[] createSectors​(int count,
                                                           java.awt.Color baseColor)
      • nextColor

        private static java.awt.Color nextColor​(java.awt.Color baseColor)
      • getOrigin

        public java.awt.geom.Point2D getOrigin()
      • setOrigin

        public void setOrigin​(java.awt.geom.Point2D origin)
      • getRotation

        public double getRotation()
      • setRotation

        public void setRotation​(double rotation)
      • render

        public void render​(java.awt.Graphics2D g2,
                           int width,
                           int height)
        Description copied from interface: AnimationRenderer
        Renders the animation on the specified graphics object using the given width and height.
        Specified by:
        render in interface AnimationRenderer
        Parameters:
        g2 - the graphics to render on
        width - the used width of the render surface
        height - the used height of the render surface
      • getDefaultOrigin

        private static java.awt.geom.Point2D getDefaultOrigin​(int width,
                                                              int height)