| Styling > Customizing Shelves and Cards > Card Carrier Representation |
Card Carrier Representation |
INDEX
PREVIOUS
NEXT
|
The graphic representation of a card carrier is based on the information that is available in the business model. Each decoration that is created depends on an attribute and on properties that can be customized through CSS. The following image shows a card carrier with the following attribute set:
This section contains information on:
You can customize the graphic representation of card carriers using the CSS properties detailed in Table 8.1, CSS Properties for the Representation of Shelves, Card Carriers, Cards and Ports.
Card carriers display state and alarm information, as the other predefined business objects. Refer to Customizing Object and Alarm States of Predefined Business Objects for a complete list of properties.
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. Please refer to Customizing the Label of Business Objects for a complete list of properties.
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.
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 Internationalization in the Context and Deployment Descriptor documentation).
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
You can also create new card carrier types by using global CSS settings (see Using Global Settings in Chapter 2, Using Cascading Style Sheets for more information):
setting."ilog.tgo.model.IltCardCarrier"{
types[0]: @+cardCarrierType0;
}
Subobject#cardCarrierType0 {
class: 'ilog.tgo.model.IltCardCarrier.Type';
name: "CCType";
}
Likewise, you can 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 here is renderer. In the example below, the name of the renderer factory class that is included in the search path is MyCardCarrierRendererFactory.
setting."ilog.tgo.model.IltCardCarrier.Type"[name="CCType"] {
renderer: @+cardCarrierRendererFactory;
}
Subobject#cardCarrierRendererFactory {
class: 'MyCardCarrierRendererFactory';
}
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.
IltCardCarrier.Type MyType = new IltCardCarrier.Type("CCType");
IltSettings.SetValue("CardCarrier.TinyType.MyType.Renderer",
new IltTinyImageBaseRendererFactory(YOUR_IMAGE, YOUR_IMAGE_PARAMETERS));
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 Customizing Network Element Types From Images.
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. All rights reserved. Legal terms. | PREVIOUS NEXT |