public class AlarmSeverity
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable
Please note that each alarm severity defines a nickname string (most of the time the nickname is just one letter long), which will displayed on the alarm bubble to indicate the severity.
If the color of the predefined alarm severity changed in the runtime, TWaver will update all user interfaces and graphical components to update to use the new color automatically, you don't need to restart or do any effort to make it effective.
Modifier and Type | Field and Description |
---|---|
static AlarmSeverity |
CLEARED |
static java.awt.Color |
COLOR_CLEARED |
static java.awt.Color |
COLOR_CRITICAL |
static java.awt.Color |
COLOR_INDETERMINATE |
static java.awt.Color |
COLOR_MAJOR |
static java.awt.Color |
COLOR_MINOR |
static java.awt.Color |
COLOR_WARNING |
static AlarmSeverity |
CRITICAL |
static AlarmSeverity |
INDETERMINATE |
static AlarmSeverity |
MAJOR |
static AlarmSeverity |
MINOR |
static java.lang.String |
NAME_CLEARED |
static java.lang.String |
NAME_CRITICAL |
static java.lang.String |
NAME_INDETERMINATE |
static java.lang.String |
NAME_MAJOR |
static java.lang.String |
NAME_MINOR |
static java.lang.String |
NAME_WARNING |
static java.lang.String |
NICKNAME_CLEARED |
static java.lang.String |
NICKNAME_CRITICAL |
static java.lang.String |
NICKNAME_INDETERMINATE |
static java.lang.String |
NICKNAME_MAJOR |
static java.lang.String |
NICKNAME_MINOR |
static java.lang.String |
NICKNAME_WARNING |
static java.util.Random |
random |
static int |
VALUE_CLEARED |
static int |
VALUE_CRITICAL |
static int |
VALUE_INDETERMINATE |
static int |
VALUE_MAJOR |
static int |
VALUE_MINOR |
static int |
VALUE_WARNING |
static AlarmSeverity |
WARNING |
Modifier and Type | Method and Description |
---|---|
static void |
addAlarmSeverityChangeListener(AlarmSeverityChangeListener l)
Add a severity change listener.
|
static void |
clearAlarmSeverity()
clear all registered alarm severity, may be used when
the user want to define their a new suit of alarm severity
|
int |
compareTo(java.lang.Object o) |
boolean |
equals(java.lang.Object object)
By default, only
object is an AlarmSeverity object and
has the equal value with this alarm severity, this method will return true. |
static java.util.List |
getAllSeverity()
Get all defined alarm severities.
|
static AlarmSeverity |
getByName(java.lang.String name)
Get the alarm severity via name.
|
static AlarmSeverity |
getByValue(int value)
Get the alarm severity via severity value.
|
static AlarmSeverity |
getClearedAlarmSeverity()
Gets the cleared alarm severity.
|
java.awt.Color |
getColor()
Get the color of this alarm severity.
|
java.lang.String |
getDisplayName()
Get the display name of this alarm severity.
|
java.lang.String |
getName()
Get the name of this alarm severity.
|
java.lang.String |
getNickName()
Get the nickname of this alarm severity.
|
static AlarmSeverity |
getNonClearedRandomSeverity()
Get a random alarm severity, not include
AlarmSeverity.CLEARED . |
static AlarmSeverity |
getRandomSeverity()
Generate a random alarm severity.
|
static java.util.Comparator |
getSeverityComparator()
Get the alarm severity comparator object
|
int |
getValue()
Get the severe value of this alarm severity.
|
int |
hashCode() |
static boolean |
isNonClearedSeverity(AlarmSeverity severity)
Checks whether the given alarm severity is not a cleared alarm severity.
|
static java.util.Iterator |
iterator()
Gets a iterator object over all defined alarm severities.
|
static AlarmSeverity |
registerAlarmSeverity(java.lang.String name,
java.lang.String nickName,
int value,
java.awt.Color color,
java.lang.String displayName)
Register a new alarm severity.
|
static void |
setClearedAlarmSeverity(AlarmSeverity severity)
Sets the appointed alarm severity as cleared alarm severity.
|
void |
setColor(java.awt.Color color)
Change the color of this alarm severity.
|
void |
setDisplayName(java.lang.String displayName)
Change the new display name of this alarm severity.
|
void |
setNickName(java.lang.String nickName)
Change the new nickname of this severity.
|
static void |
setSeverityComparator(java.util.Comparator severityComparator)
Set the alarm severity comparator object.
|
static int |
size()
Gets the count of defined alarm severities.
|
java.lang.String |
toString()
Returns the name of this alarm severity.
|
public static final java.lang.String NAME_CRITICAL
public static final java.lang.String NAME_MAJOR
public static final java.lang.String NAME_MINOR
public static final java.lang.String NAME_WARNING
public static final java.lang.String NAME_INDETERMINATE
public static final java.lang.String NAME_CLEARED
public static final java.lang.String NICKNAME_INDETERMINATE
public static final java.lang.String NICKNAME_CRITICAL
public static final java.lang.String NICKNAME_MAJOR
public static final java.lang.String NICKNAME_MINOR
public static final java.lang.String NICKNAME_WARNING
public static final java.lang.String NICKNAME_CLEARED
public static final int VALUE_CRITICAL
public static final int VALUE_MAJOR
public static final int VALUE_MINOR
public static final int VALUE_WARNING
public static final int VALUE_INDETERMINATE
public static final int VALUE_CLEARED
public static final java.awt.Color COLOR_CRITICAL
public static final java.awt.Color COLOR_MAJOR
public static final java.awt.Color COLOR_MINOR
public static final java.awt.Color COLOR_WARNING
public static final java.awt.Color COLOR_INDETERMINATE
public static final java.awt.Color COLOR_CLEARED
public static AlarmSeverity INDETERMINATE
public static AlarmSeverity CRITICAL
public static AlarmSeverity MAJOR
public static AlarmSeverity MINOR
public static AlarmSeverity WARNING
public static AlarmSeverity CLEARED
public static final java.util.Random random
public static void addAlarmSeverityChangeListener(AlarmSeverityChangeListener l)
l
- AlarmSeverityChangeListener the listenerpublic static void setClearedAlarmSeverity(AlarmSeverity severity)
CLEARED
is cleared alarm severity.severity
- the appointed alarm severity.public static AlarmSeverity getClearedAlarmSeverity()
setClearedAlarmSeverity(AlarmSeverity)
public static AlarmSeverity getRandomSeverity()
public static AlarmSeverity getNonClearedRandomSeverity()
AlarmSeverity.CLEARED
.public static boolean isNonClearedSeverity(AlarmSeverity severity)
severity
- the alarm severity to be checked.public static AlarmSeverity registerAlarmSeverity(java.lang.String name, java.lang.String nickName, int value, java.awt.Color color, java.lang.String displayName)
name
- alarm severity's namenickname
- alarm severity's nicknamevalue
- alarm severity's valuecolor
- alarm severity's render colorpublic static void clearAlarmSeverity()
public static java.util.List getAllSeverity()
public static java.util.Iterator iterator()
public static int size()
public static AlarmSeverity getByName(java.lang.String name)
name
- String the severity namepublic static AlarmSeverity getByValue(int value)
value
- int the alarm severity value.public java.awt.Color getColor()
public java.lang.String getName()
public java.lang.String getNickName()
public int getValue()
public void setColor(java.awt.Color color)
color
- Color the new severity colorpublic void setDisplayName(java.lang.String displayName)
displayName
- String the new display namepublic void setNickName(java.lang.String nickName)
nickName
- String the new nickname of this severity.public boolean equals(java.lang.Object object)
object
is an AlarmSeverity
object and
has the equal value with this alarm severity, this method will return true.equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getDisplayName()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public static java.util.Comparator getSeverityComparator()
public static void setSeverityComparator(java.util.Comparator severityComparator)
severityComparator
- Comparator the new alarm severity comparatorAlarmSeverityComparator.ASCENDING
Copyright © 2002 - 2010 Serva Software. All Rights Reserved.