Package snap.view

Class ViewUpdater

java.lang.Object
snap.view.ViewUpdater

public class ViewUpdater extends Object
A class to update view painting, layout and animation and ViewOwner resets.
  • Field Details

    • _paintDebug

      protected static boolean _paintDebug
    • _frames

      protected static long[] _frames
  • Constructor Details

    • ViewUpdater

      public ViewUpdater(WindowView aWin)
      Creates a ViewUpdater.
  • Method Details

    • runBeforeUpdate

      public void runBeforeUpdate(Runnable aRun)
      Adds a given ViewOwner to set of owners that need reset on next UI update call.
    • resetLater

      public void resetLater(ViewOwner anOwnr)
      Adds a given ViewOwner to set of owners that need reset on next UI update call.
    • relayoutLater

      public void relayoutLater()
      Registers to do layout for views.
    • repaintLater

      public void repaintLater(View aView)
      Called to register a view for repaint.
    • updateLater

      protected final void updateLater()
      Register call to update via runLater.
    • updateViews

      protected void updateViews()
      Main update method: Updates these view things: - View animation - ViewOwner resetUI calls - View layout - View painting.
    • paintViews

      public void paintViews(Painter aPntr, Rect aRect)
      Paint views.
    • paintDebug

      protected void paintDebug(Painter aPntr, Shape aShape)
      Do debug paint: Paints a yellow flash and registers for a later paint to clear flash.
    • getRepaintRect

      public Rect getRepaintRect()
      Returns the current repaint rect combined rects of RepaintViews.RepaintRects.
    • startAnim

      public void startAnim(ViewAnim anAnim)
      Adds given ViewAnim to set of anims that are running.
    • stopAnim

      public void stopAnim(ViewAnim anAnim)
      Removes given ViewAnim to set of anims that are running.
    • addListener

      public void addListener(ViewUpdater.Listener aLsnr)
      Adds a ViewUpdater listener.
    • removeListener

      public void removeListener(ViewUpdater.Listener aLsnr)
      Removes a ViewUpdater listener.
    • isPaintDebug

      public static boolean isPaintDebug()
      Returns whether painting is debug.
    • setPaintDebug

      public static void setPaintDebug(boolean aValue)
      Set whether painting is debug.
    • isShowFrameRate

      public static boolean isShowFrameRate()
      Returns whether to show frame rate.
    • setShowFrameRate

      public static void setShowFrameRate(boolean aValue)
      Set whether to show frame rate.