Package snap.view
Class ViewUpdater
java.lang.Object
snap.view.ViewUpdater
A class to update view painting, layout and animation and ViewOwner resets.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
An interface to listen to ViewUpdater events. -
Field Summary
Modifier and TypeFieldDescriptionprotected static long[]
protected static boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(ViewUpdater.Listener aLsnr) Adds a ViewUpdater listener.Returns the current repaint rect combined rects of RepaintViews.RepaintRects.static boolean
Returns whether painting is debug.static boolean
Returns whether to show frame rate.protected void
paintDebug
(Painter aPntr, Shape aShape) Do debug paint: Paints a yellow flash and registers for a later paint to clear flash.void
paintViews
(Painter aPntr, Rect aRect) Paint views.void
Registers to do layout for views.void
Removes a ViewUpdater listener.void
repaintLater
(View aView) Called to register a view for repaint.void
resetLater
(ViewOwner anOwnr) Adds a given ViewOwner to set of owners that need reset on next UI update call.void
runBeforeUpdate
(Runnable aRun) Adds a given ViewOwner to set of owners that need reset on next UI update call.static void
setPaintDebug
(boolean aValue) Set whether painting is debug.static void
setShowFrameRate
(boolean aValue) Set whether to show frame rate.void
Adds given ViewAnim to set of anims that are running.void
Removes given ViewAnim to set of anims that are running.protected final void
Register call to update via runLater.protected void
Main update method: Updates these view things: - View animation - ViewOwner resetUI calls - View layout - View painting.
-
Field Details
-
_paintDebug
protected static boolean _paintDebug -
_frames
protected static long[] _frames
-
-
Constructor Details
-
ViewUpdater
Creates a ViewUpdater.
-
-
Method Details
-
runBeforeUpdate
Adds a given ViewOwner to set of owners that need reset on next UI update call. -
resetLater
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
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
Paint views. -
paintDebug
Do debug paint: Paints a yellow flash and registers for a later paint to clear flash. -
getRepaintRect
Returns the current repaint rect combined rects of RepaintViews.RepaintRects. -
startAnim
Adds given ViewAnim to set of anims that are running. -
stopAnim
Removes given ViewAnim to set of anims that are running. -
addListener
Adds a ViewUpdater listener. -
removeListener
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.
-