A new state can also be used as a BiSONET
state. In this case, you should define how the state will be
represented as a state and as a reverse state.
Customize the link representation when it uses the BiSONET
object state and its primary state is set to the newly created
state. This configuration is illustrated by the following
selector which indicates all objects that have the primary
state
InError
and contain a reverse state.
object."ilog.tgo.model.IltLink"["objectState.SONET.State"=InError]["objectSt
ate.SONET.ReverseState"] {
foreground:'';
innerCenterWidth: 2;
innerForeground: red;
toArrowColor: red;
toArrowReliefBorders: true;
toArrowBorderColor: red;
toArrowBorderColor2: red;
}
Customize
the link representation when the new state is set to the
reverse state. Use the following selector.
object."ilog.tgo.model.IltLink"["objectState.SONET.ReverseState"=InError] {
fromArrowColor: red;
fromArrowReliefBorders: true;
fromArrowBorderColor: red;
fromArrowBorderColor2: red;
foreground: red;
centerWidth: 6;
}
Define
a generic rule to be matched when the new state is not set.
This generic rule specifies that, for the states that are not
defined in the cascading style sheets, the default
configuration will be applied. The corresponding selector
simply sets all properties set by the other selectors to their
default value, so that the configuration of the other SONET
states is appropriately applied to the objects.
object."ilog.tgo.model.IltLink" {
foreground: '';
centerWidth: -1;
reliefBorders: '';
innerCenterWidth: -1;
innerForeground:'';
toArrowColor:'';
toArrowBorderColor:'';
toArrowBorderColor2:'';
toArrowReliefBorders: '';
fromArrowColor:'';
fromArrowBorderColor:'';
fromArrowBorderColor2:'';
fromArrowReliefBorders: '';
}
The created state can be set on the object
in the following way.
IltBiSONETObjectState ostate = new IltBiSONETObjectState();
ostate.setState(IltSONET.State.ActiveProtecting);
ostate.setReverseState(inErrorState);
IltLink link = new IltLink(ostate, null);