My favorites | Sign in
Project Logo
                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package org.goverla.managers
{
import mx.rpc.AsyncDispatcher;

import org.goverla.interfaces.IPropertiesInvalidable;

public class PropertiesInvalidationManager
{
public static function get instance() : PropertiesInvalidationManager
{
if (_instance == null)
{
_instance = new PropertiesInvalidationManager();
}
return _instance;
}

private static var _instance : PropertiesInvalidationManager;

public function invalidateProperties(target : IPropertiesInvalidable) : void
{
if (_targets.indexOf(target) < 0)
{
_targets.push(target);

if (_dispatcher == null)
{
_dispatcher = new AsyncDispatcher(commitProperties, [], 0);
}
}
}

public function commitProperties() : void
{
for each (var target : IPropertiesInvalidable in _targets)
{
target.commitProperties();
}
_targets = [];
_dispatcher = null;
}

private var _needInvalidation : Boolean;

private var _targets : Array = [];

private var _dispatcher : AsyncDispatcher;

}
}
Show details Hide details

Change log

r200 by tearaway.tea on Apr 16, 2009   Diff
PropertiesInvalidationManager is a class
for simulation properties invalidation
like UIComponent do.
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 1070 bytes, 50 lines
Hosted by Google Code