Package | twaver |
Class | public class AlarmSeverity |
Inheritance | AlarmSeverity ![]() |
Every alarm severity defines a nickname string, most of the time, the nickname is just one letter long. This nickname will be displayed in the alarm bubble to indicate the severity.
Also every severity has a color. Normally you don't need to change the color of the predefined severities. However you can do it even in the runtime if you really need to change the default colors. When the color is changed, all views will be changed in the same time and you don't need to restart your application.
See also
Property | Defined By | ||
---|---|---|---|
CLEARED : AlarmSeverity [static] | AlarmSeverity | ||
clearedAlarmSeverity : AlarmSeverity [static]
Get the alarm severity which one is present the "alarm is cleared". | AlarmSeverity | ||
color : uint
Get alarm severity color. | AlarmSeverity | ||
compareFunction : Function [static]
Get the comparator function. | AlarmSeverity | ||
count : int [static] [read-only]
Get the total count of all predefined alarm severities. | AlarmSeverity | ||
CRITICAL : AlarmSeverity [static] | AlarmSeverity | ||
displayName : String
Get display name of this alarm severity. | AlarmSeverity | ||
INDETERMINATE : AlarmSeverity [static] | AlarmSeverity | ||
MAJOR : AlarmSeverity [static] | AlarmSeverity | ||
MINOR : AlarmSeverity [static] | AlarmSeverity | ||
name : String [read-only]
Get alarm severity name. | AlarmSeverity | ||
nickName : String
Get alarm severity nick name. | AlarmSeverity | ||
severities : ICollection [static] [read-only]
Get all predefined alarm severities as a collection. | AlarmSeverity | ||
value : int [read-only]
Get alarm severity severe value. | AlarmSeverity | ||
WARNING : AlarmSeverity [static] | AlarmSeverity |
Method | Defined By | ||
---|---|---|---|
AlarmSeverity(value:int, name:String, nickName:String, color:uint, displayName:String = null) | AlarmSeverity | ||
addAlarmSeverityChangeListener(listener:Function, priority:int = 0):void [static]
Add a listener to this class to monitoring the change of alarm severity. | AlarmSeverity | ||
[static]
The predefined alarm severity comparator which sorts the alarm
severity in ascending order. | AlarmSeverity | ||
clear():void [static]
Clear all predefined alarm severities. | AlarmSeverity | ||
[static]
Compare specified two alarm severity objects which one is more severe. | AlarmSeverity | ||
[static]
The predefined alarm severity comparator which sorts the alarm
severity in descending order. | AlarmSeverity | ||
forEach(callbackFunction:Function):void [static]
Iterate the alarm severities. | AlarmSeverity | ||
getByName(name:String):AlarmSeverity [static]
Get the predefined alarm severity by severity name. | AlarmSeverity | ||
getByValue(value:int):AlarmSeverity [static]
Get predefined alarm severity by severity value. | AlarmSeverity | ||
isClearedAlarmSeverity(severity:AlarmSeverity):Boolean [static]
Check whether the given alarm severity is the cleared severity. | AlarmSeverity | ||
register(value:int, name:String, nickName:String, color:uint, displayName:String = null):AlarmSeverity [static]
Register a new predefined alarm severity into this class. | AlarmSeverity | ||
removeAlarmSeverityChangeListener(listener:Function):void [static]
Remove a installed listener from this class. | AlarmSeverity | ||
toString():String | AlarmSeverity | ||
unregister(name:String):AlarmSeverity [static]
Remove the registered alarm severity from this class. | AlarmSeverity |
CLEARED | property |
public static var CLEARED:AlarmSeverity
clearedAlarmSeverity | property |
clearedAlarmSeverity:AlarmSeverity
Get the alarm severity which one is present the "alarm is cleared". Cleared severity is a special alarm severity which means the the problem combines with original alarm is recovered.
public static function get clearedAlarmSeverity():AlarmSeverity
public static function set clearedAlarmSeverity(value:AlarmSeverity):void
color | property |
color:uint
Get alarm severity color.
public function get color():uint
public function set color(value:uint):void
compareFunction | property |
compareFunction:Function
Get the comparator function.
public static function get compareFunction():Function
public static function set compareFunction(value:Function):void
count | property |
count:int
[read-only] Get the total count of all predefined alarm severities.
public static function get count():int
CRITICAL | property |
public static var CRITICAL:AlarmSeverity
displayName | property |
displayName:String
Get display name of this alarm severity.
public function get displayName():String
public function set displayName(value:String):void
INDETERMINATE | property |
public static var INDETERMINATE:AlarmSeverity
MAJOR | property |
public static var MAJOR:AlarmSeverity
MINOR | property |
public static var MINOR:AlarmSeverity
name | property |
name:String
[read-only] Get alarm severity name. For example "Critical".
public function get name():String
nickName | property |
nickName:String
Get alarm severity nick name. This nickname normally is a short one-letter name and will be used to display the alarm bubble. For example, the nickname of "Critical" will be letter "C".
public function get nickName():String
public function set nickName(value:String):void
severities | property |
severities:ICollection
[read-only] Get all predefined alarm severities as a collection. return the collection of all predefined alarm severities.
public static function get severities():ICollection
value | property |
value:int
[read-only] Get alarm severity severe value. For this default alarm severity implementation, more bigger this value is, the severity is more severe.
public function get value():int
WARNING | property |
public static var WARNING:AlarmSeverity
AlarmSeverity | () | Constructor |
public function AlarmSeverity(value:int, name:String, nickName:String, color:uint, displayName:String = null)
value:int | |
name:String | |
nickName:String | |
color:uint | |
displayName:String (default = null )
|
addAlarmSeverityChangeListener | () | method |
public static function addAlarmSeverityChangeListener(listener:Function, priority:int = 0):void
Add a listener to this class to monitoring the change of alarm severity. Any change of alarm severity is occured, this listener will be notified. You can do some extra job in with this listener machnism.
Parameters
listener:Function — the alarm severity change listener.
| |
priority:int (default = 0 ) — the priority of this listener which is when the event
is dispached by the internal EventDispatcher. The default value is 0.
|
See also
ASCENDING_FUNCTION | () | method |
public static function ASCENDING_FUNCTION(severity1:AlarmSeverity, severity2:AlarmSeverity):int
The predefined alarm severity comparator which sorts the alarm severity in ascending order. The default alarm severity comparator uses severity value to compare which one is more severe. More bigger value, more severe.
Parameters
severity1:AlarmSeverity | |
severity2:AlarmSeverity |
int |
clear | () | method |
public static function clear():void
Clear all predefined alarm severities.
compare | () | method |
public static function compare(severity1:AlarmSeverity, severity2:AlarmSeverity):int
Compare specified two alarm severity objects which one is more severe.
Parameters
severity1:AlarmSeverity — alarm severity 1
| |
severity2:AlarmSeverity — alarm severity 2
|
int — for the default comparator:
if result > 0, alarm severity 1 is more severe;
if result = 0, the two alarm severities are equivalent;
if result < 0, alarm severity 2 is more severe.
|
DESCENDING_FUNCTION | () | method |
public static function DESCENDING_FUNCTION(severity1:AlarmSeverity, severity2:AlarmSeverity):int
The predefined alarm severity comparator which sorts the alarm severity in descending order. The default alarm severity comparator uses severity value to compare which one is more severe. More bigger value, more severe.
Parameters
severity1:AlarmSeverity | |
severity2:AlarmSeverity |
int |
forEach | () | method |
public static function forEach(callbackFunction:Function):void
Iterate the alarm severities.
Parameters
callbackFunction:Function |
getByName | () | method |
public static function getByName(name:String):AlarmSeverity
Get the predefined alarm severity by severity name.
Parameters
name:String — the alarm severity name.
|
AlarmSeverity — the alarm severity which name equals to the given name.
|
getByValue | () | method |
public static function getByValue(value:int):AlarmSeverity
Get predefined alarm severity by severity value.
Parameters
value:int — the alarm severity value.
|
AlarmSeverity — the alarm severity which value equals to the given value.
|
isClearedAlarmSeverity | () | method |
public static function isClearedAlarmSeverity(severity:AlarmSeverity):Boolean
Check whether the given alarm severity is the cleared severity.
Parameters
severity:AlarmSeverity — the severity need to check
|
Boolean — true if the severity is cleared alarm severity, false otherwise.
|
register | () | method |
public static function register(value:int, name:String, nickName:String, color:uint, displayName:String = null):AlarmSeverity
Register a new predefined alarm severity into this class. Use this way to create your own predefined alarm severities for your OSS software without creating a new alarm severity instance.
Parameters
value:int — the alarm severity severe value.
| |
name:String — the alarm severity name.
| |
nickName:String — the alarm severity nickname
| |
color:uint — color of the registered alarm severity
| |
displayName:String (default = null ) — display name of the registered alarm severity
|
AlarmSeverity — the new registered alarm severity object.
|
removeAlarmSeverityChangeListener | () | method |
public static function removeAlarmSeverityChangeListener(listener:Function):void
Remove a installed listener from this class.
Parameters
listener:Function — the listener need to remove.
|
toString | () | method |
public function toString():String
Returns
String |
unregister | () | method |
public static function unregister(name:String):AlarmSeverity
Remove the registered alarm severity from this class.
Parameters
name:String — the alarm severity name which to be removed.
|
AlarmSeverity — the removed alarm severity object.
|