Package | net.user1.reactor.ui |
Class | public class StatsPane |
Inheritance | StatsPane ![]() |
Since : | ReactorGUI 1.0.0 |
See also
Method | Defined By | ||
---|---|---|---|
StatsPane | |||
addStat(name:String, func:Function):void
Adds a new statistic to the StatsPane. | StatsPane | ||
dispose():void
Disposes of the resources used by this object, preparing it for garbage
collection. | StatsPane | ||
setReactor(reactor:Reactor):void
Assigns the Reactor object for which this StatsPane will display
statistics. | StatsPane | ||
start():void
Activates the statistics pane. | StatsPane | ||
stop():void
Deactivates the statistics pane. | StatsPane |
StatsPane | () | Constructor |
public function StatsPane()
addStat | () | method |
public function addStat(name:String, func:Function):void
Since : | ReactorGUI 1.0.0 |
Adds a new statistic to the StatsPane. Each statistic must have a string name and a corresponding function that returns the value for that statistic. The StatsPane periodically calculates and displays the value of each statistic by calling the statistic's function. For example, the following code adds a "Connection Attempts" statistic that displays the number of times a Reactor application has attempted to connect to Union. The statistic's value is returned by the ConnectionManager class's built-in method, getConnectAttemptCount().
addStat("Connection Attempts", reactor.getConnectionManager().getConnectAttemptCount);
Parameters
name:String — The name of the statistic to add to the StatsPane.
| |
func:Function — The function that calculates and returns the statistic's
value.
|
dispose | () | method |
public function dispose():void
Since : | ReactorGUI 1.0.0 |
Disposes of the resources used by this object, preparing it for garbage collection.
setReactor | () | method |
public function setReactor(reactor:Reactor):void
Since : | ReactorGUI 1.0.0 |
Assigns the Reactor object for which this StatsPane will display statistics.
Parameters
reactor:Reactor |
start | () | method |
public function start():void
Since : | ReactorGUI 1.0.0 |
Activates the statistics pane.
stop | () | method |
public function stop():void
Since : | ReactorGUI 1.0.0 |
Deactivates the statistics pane.