Customizing various aspects of card carriers
Customizing card carrier names
By default, card carriers do not display their names when represented in the network and equipment components.
In the table and tree components, the card carrier label is displayed with a tiny representation of the card carrier. In this case, the card carrier name itself is represented using the same CSS properties as for all the other predefined business objects. For a complete list of name-related properties, refer to
Customizing the label of a business object.
Customizing card carrier states and alarms
Card carriers display state and alarm information in the same way as other predefined business objects. For a complete list of the relevant properties, refer to
Customizing object and alarm states of predefined business objects.
Customizing card carrier types
In JViews TGO, the card carrier type attribute defines how the object base is represented. Each card carrier type is associated with a specific base renderer that is in charge of drawing the object according to its type and state information.
In
JViews TGO, you can customize the base representation of card carrier objects by defining a new implementation of
IltCardCarrierBaseRenderer. The principle is the same as to create a new
IltNEBaseRenderer. For details, refer to
Extending the class IltNEBaseRenderer.
How to create and register a card carrier type (using the API)
IltCardCarrier.Type MyType = new IltCardCarrier.Type("CCType");
IltSettings.SetValue("CardCarrier.Type.CCType.Renderer",
new IltBaseRendererFactory() {
public IltBaseRenderer createValue() {
return new MyCCTypeBaseRenderer();
}
});
The predefined card carrier type has a label and a tooltip specified in the
JViews TGO resource bundle, see
About globalization.
The resources that apply to card carrier types are identified as:
ilog.tgo.CardCarrier_Type_<TYPE NAME> : card carrier type labels
ilog.tgo.CardCarrier_Type_<TYPE NAME>_ToolTip : card carrier type tooltips
You can edit the values directly in the JViews TGO resource bundle files.
When you create new card carrier types, the label and tooltip information will also be retrieved from this resource bundle to be displayed, for example, in a table cell. As you declare new card carrier types, register the corresponding entries into the resource bundle file, as follows:
Considering that you have created the following new card carrier type:
IltCardCarrier.Type MyType = new IltCardCarrier.Type("CCType");
You should declare the following properties in the JTGOMessages.properties file:
ilog.tgo.CardCarrier_Type_CCType=CC Type ilog.tgo.CardCarrier_Type_CCType_ToolTip=My New Card Carrier Type How to create and register a card carrier type (using CSS)
You can create new card carrier types by using global CSS settings as shown in the following code sample.
setting."ilog.tgo.model.IltCardCarrier"{
types[0]: @+cardCarrierType0;
}
Subobject#cardCarrierType0 {
class: 'ilog.tgo.model.IltCardCarrier.Type';
name: "CCType";
}
For more information, see
Using global settings.
You can also customize the renderer using global CSS settings. To do so, you need to specify the full path to the object to be customized, as well as the value of its name attribute in order to match the right type of object in the system. The CSS property to customize is renderer.
setting."ilog.tgo.model.IltCardCarrier.Type"[name="CCType"] {
renderer: @+cardCarrierRendererFactory;
}
Subobject#cardCarrierRendererFactory {
class: 'MyCardCarrierRendererFactory';
}
In this code sample, the name of the renderer factory class that is included in the search path is MyCardCarrierRendererFactory
Customizing card carrier tiny types
Besides the graphic representation in the network and equipment components, the card carrier objects can be represented as tiny objects in the tree and table components.
Each card carrier type can be associated with a tiny base renderer that is responsible for drawing the tiny graphic representation.
JViews TGO allows you to customize the tiny type representation by using one of the predefined base renderer factories, such as
IltTinyImageBaseRendererFactory or
IltTinySVGBaseRendererFactory, or by creating your own implementation of
IltTinyBaseRenderer. The principle to create a new
IltTinyBaseRenderer is the same as to create a new
IltNEBaseRenderer. For details, refer to
Extending the class IltNEBaseRenderer.
How to modify a card carrier tiny representation (using the API)
IltCardCarrier.Type MyType = new IltCardCarrier.Type("CCType");
IltSettings.SetValue("CardCarrier.TinyType.MyType.Renderer",
new IltTinyImageBaseRendererFactory(YOUR_IMAGE,
YOUR_IMAGE_PARAMETERS));
How to modify a card carrier tiny representation (using CSS)
You can customize the renderer using global CSS settings. The CSS property to customize here is tinyRenderer. In the example below, the name of the renderer factory class that is included in the search path is MyCardCarrierTinyRendererFactory.
setting."ilog.tgo.model.IltCardCarrier.Type"[name="CCType"] {
tinyRenderer: @+cardCarrierTinyRendererFactory0;
}
Subobject#CardCarrierTinyRendererFactory0 {
class: 'MyCardCarrierTinyRendererFactory';
}
For details about how to create image base renderers, refer to
Creating network element types from images and customizing them.
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.