public abstract class BlinkingRule
extends java.lang.Object
BlinkingRule
is used to determine whether an element
should blink in its body or outline.
Using code snippet:
class Rule1 extends BlinkingRule{ public boolean isBodyBlinking(Element element) { return false; } public boolean isOutlineBlinking(Element element) { // blink when element has propagate severity return element.getAlarmState().getPropagateSeverity() != null; } } class Rule2 extends BlinkingRule{ public boolean isBodyBlinking(Element element) { // blink when element has new alarm return element.getAlarmState().getHighestNewAlarmSeverity() != null; } public boolean isOutlineBlinking(Element element) { // blink when element has state outline color return element.getClientProperty(TWaverConst.PROPERTYNAME_STATE_OUTLINE_COLOR) != null; } } class Rule3 extends BlinkingRule{ public boolean isBodyBlinking(Element element) { // if element has renderer color if(element.getClientProperty(TWaverConst.PROPERTYNAME_RENDER_COLOR) != null){ return true; } // blink when element's new alarm severity // is more urgent than warning level AlarmSeverity severity = element.getAlarmState().getHighestNewAlarmSeverity(); if(severity == AlarmSeverity.CRITICAL){ return true; } return false; } public boolean isOutlineBlinking(Element element) { return false; } }
Constructor and Description |
---|
BlinkingRule() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
isBodyBlinking(Element element)
Determines whether the given element need to blink its body.
|
boolean |
isEnableBodyBlinking()
Checks whether the element body blinking is enable for this rule.
|
boolean |
isEnableOutlineBlinking()
Checks whether the element outline blinking is enable for this rule.
|
abstract boolean |
isOutlineBlinking(Element element)
Determines whether the given element need to blink its outline.
|
void |
setEnableBlinking(boolean enableBlinking)
Sets whether the element body and outline blinking is enable for this rule.
|
void |
setEnableBodyBlinking(boolean enableBlinking)
Sets whether the element body blinking is enable for this rule.
|
void |
setEnableOutlineBlinking(boolean enableBlinking)
Sets whether the element outline blinking is enable for this rule.
|
public abstract boolean isBodyBlinking(Element element)
element
- the element to be checked.public abstract boolean isOutlineBlinking(Element element)
element
- the element to be checked.public boolean isEnableBodyBlinking()
public void setEnableBodyBlinking(boolean enableBlinking)
enableBlinking
- True if the element body blinking is enable for this rule, false otherwise.public boolean isEnableOutlineBlinking()
public void setEnableOutlineBlinking(boolean enableBlinking)
enableBlinking
- True if the element outline blinking is enable for this rule, false otherwise.public void setEnableBlinking(boolean enableBlinking)
enableBlinking
- Copyright © 2002 - 2010 Serva Software. All Rights Reserved.