Package com.biglybt.ui.swt.uiupdater
Class UIUpdaterSWT
- java.lang.Object
-
- com.biglybt.core.util.AEThread2
-
- com.biglybt.ui.swt.uiupdater.UIUpdaterSWT
-
- All Implemented Interfaces:
ParameterListener
,UIUpdater
public class UIUpdaterSWT extends AEThread2 implements ParameterListener, UIUpdater
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.biglybt.core.util.AEThread2
AEThread2.threadWrapper
-
Nested classes/interfaces inherited from interface com.biglybt.ui.common.updater.UIUpdater
UIUpdater.UIUpdaterListener
-
-
Field Summary
Fields Modifier and Type Field Description private CopyOnWriteList<UIUpdatable>
alwaysUpdateables
(package private) java.util.WeakHashMap<UIUpdatable,java.lang.Long[]>
averageTimes
private static java.lang.String
CFG_REFRESH_INACTIVE_FACTOR
private static java.lang.String
CFG_REFRESH_INTERVAL
private static boolean
DEBUG_TIMER
Calculate timer statistics for GUI updateprivate java.util.WeakHashMap<UIUpdatable,java.lang.String>
debug_Updateables
private static boolean
DEBUG_UPDATEABLES
private boolean
finished
private int
inactiveFactor
private int
inactiveTicks
private CopyOnWriteList<UIUpdater.UIUpdaterListener>
listeners
private static LogIDs
LOGID
private CopyOnWriteList<UIUpdatable>
perioidic_updateables
private int
pu_counter
private int
update_count
private CopyOnWriteList<UIUpdatable>
updateables
private AEMonitor
updateables_mon
private static UIUpdater
updater
private int
waitTimeMS
-
Fields inherited from class com.biglybt.core.util.AEThread2
TRACE_TIMES
-
-
Constructor Summary
Constructors Constructor Description UIUpdaterSWT()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(UIUpdater.UIUpdaterListener listener)
void
addPeriodicUpdater(UIUpdatable updateable)
TriggerUIUpdatable.updateUI()
every secondvoid
addUpdater(UIUpdatable updateable)
static void
destroyInstance()
static UIUpdater
getInstance()
boolean
isAdded(UIUpdatable updateable)
private void
makeDebugToolTip(java.util.Map<UIUpdatable,java.lang.Long> timeMap)
void
parameterChanged(java.lang.String parameterName)
Called, when a parameter has changed.void
removeListener(UIUpdater.UIUpdaterListener listener)
void
removePeriodicUpdater(UIUpdatable updateable)
void
removeUpdater(UIUpdatable updateable)
void
run()
void
stopIt()
private void
update(CopyOnWriteList<UIUpdatable> updateables, boolean is_visible)
-
Methods inherited from class com.biglybt.core.util.AEThread2
createAndStartDaemon, getDebug, getName, interrupt, isAlive, isCurrentThread, isOurThread, join, setDebug, setName, setOurThread, setOurThread, setPriority, start, toString
-
-
-
-
Field Detail
-
LOGID
private static final LogIDs LOGID
-
CFG_REFRESH_INTERVAL
private static final java.lang.String CFG_REFRESH_INTERVAL
- See Also:
- Constant Field Values
-
CFG_REFRESH_INACTIVE_FACTOR
private static final java.lang.String CFG_REFRESH_INACTIVE_FACTOR
- See Also:
- Constant Field Values
-
DEBUG_TIMER
private static final boolean DEBUG_TIMER
Calculate timer statistics for GUI update
-
DEBUG_UPDATEABLES
private static final boolean DEBUG_UPDATEABLES
-
updater
private static UIUpdater updater
-
waitTimeMS
private int waitTimeMS
-
finished
private boolean finished
-
updateables
private CopyOnWriteList<UIUpdatable> updateables
-
debug_Updateables
private java.util.WeakHashMap<UIUpdatable,java.lang.String> debug_Updateables
-
alwaysUpdateables
private CopyOnWriteList<UIUpdatable> alwaysUpdateables
-
updateables_mon
private AEMonitor updateables_mon
-
inactiveFactor
private int inactiveFactor
-
inactiveTicks
private int inactiveTicks
-
averageTimes
java.util.WeakHashMap<UIUpdatable,java.lang.Long[]> averageTimes
-
update_count
private int update_count
-
listeners
private CopyOnWriteList<UIUpdater.UIUpdaterListener> listeners
-
perioidic_updateables
private CopyOnWriteList<UIUpdatable> perioidic_updateables
-
pu_counter
private int pu_counter
-
-
Method Detail
-
getInstance
public static UIUpdater getInstance()
-
destroyInstance
public static void destroyInstance()
-
parameterChanged
public void parameterChanged(java.lang.String parameterName)
Description copied from interface:ParameterListener
Called, when a parameter has changed. The listener could only react if the parameter name is relevant. Or the listener can just read all parameters again.- Specified by:
parameterChanged
in interfaceParameterListener
- Parameters:
parameterName
- the name of the parameter that has changed
-
addUpdater
public void addUpdater(UIUpdatable updateable)
- Specified by:
addUpdater
in interfaceUIUpdater
-
isAdded
public boolean isAdded(UIUpdatable updateable)
-
removeUpdater
public void removeUpdater(UIUpdatable updateable)
- Specified by:
removeUpdater
in interfaceUIUpdater
-
update
private void update(CopyOnWriteList<UIUpdatable> updateables, boolean is_visible)
-
makeDebugToolTip
private void makeDebugToolTip(java.util.Map<UIUpdatable,java.lang.Long> timeMap)
-
addListener
public void addListener(UIUpdater.UIUpdaterListener listener)
- Specified by:
addListener
in interfaceUIUpdater
-
removeListener
public void removeListener(UIUpdater.UIUpdaterListener listener)
- Specified by:
removeListener
in interfaceUIUpdater
-
addPeriodicUpdater
public void addPeriodicUpdater(UIUpdatable updateable)
Description copied from interface:UIUpdater
TriggerUIUpdatable.updateUI()
every second- Specified by:
addPeriodicUpdater
in interfaceUIUpdater
-
removePeriodicUpdater
public void removePeriodicUpdater(UIUpdatable updateable)
- Specified by:
removePeriodicUpdater
in interfaceUIUpdater
-
-