Styling > Customizing Shelves and Cards > Shelf Representation

The graphic representation of a shelf is based on the information that is available in the business model. Although states and alarms may be associated with a shelf, you cannot display them in the shelf graphic representation. After all, a shelf is only a container for the cards themselves.

images/ShelfRepresentation.gif

Figure 8.1 A Shelf Representation

This section contains information on:

Customizing Shelf Representations

This section provides details about the CSS properties that you can use to customize the representation of shelves. Some properties are mapped, which means that they are computed on the basis of the state and alarm information set in the object (column Set).

Table 8.1 CSS Properties for the Representation of Shelves, Card Carriers, Cards and Ports 
Property Name 
Type 
Set 
Default Value 
Description 
foreground 
Color 
Yes 
Denotes the foreground color of the object base. 
background 
Color 
Yes 
Transparent (null
Denotes the background color of the object base. 
fillStyle 
ilog.util.IlFillStyle 
Network node 
IlFillStyle.SOLID_COLOR for user-defined business objects 
IlFillStyle.PATTERN for predefined business objects 
Denotes the style used to fill the base of an object. 
Possible values are: 
IlFillStyle.NO_FILL 
IlFillStyle.SOLID_COLOR 
IlFillStyle.LINEAR_GRADIENT 
IlFillStyle.RADIAL_GRADIENT 
IlFillStyle.TEXTURE 
IlFillStyle.PATTERN 
fillTexture 
Image 
Network node 
null 
Denotes the texture used to fill the base of an object. This property is only used if fillStyle is set to IlFillStyle.TEXTURE
fillStart 
Float 
Network node 
0f 
Returns the position where the gradient of an object starts, that is, where the color is the one defined by property foreground. This property is only used if fillStyle is set to IlFillStyle.RADIA_GRADIENT or IlFillStyle.LINEAR_GRADIENT
fillEnd 
Float 
Network node 
1f 
Returns the position where the gradient of an object ends, that is, where the color is the one defined by property background. This property is only used if fillStyle is set to IlFillStyle.RADIA_GRADIENT or IlFillStyle.LINEAR_GRADIENT 
fillAngle 
Float 
Network node 
0 
Returns the angle (in degrees) of the gradient used to fill the base of an object. This property is only used if fillStyle is set to IlFillStyle.RADIAL_GRADIENT or IlFillStyle.LINEAR_GRADIENT 
fillPattern 
Pattern 
Yes 
null (Solid) 
Denotes the pattern used to fill the base of an object. This property is only used if fillStyle is set to IlFillStyle.PATTERN
detailLevel 
enum 
Yes 
MaximumDetails 
Defines the level of detail to be used to draw the base. 
borderColor 
Color 
Yes 
10% gray 
Denotes the primary color of the base border. 
borderColor2 
Color 
Yes 
60% gray 
Denotes the secondary color of the base border. 
borderWidth 
float 
Yes 
1 pixel 
Denotes the width of the base border. 
borderLineStyle 
float[] 
Yes 
null (Solid) 
Denotes the line style used to draw the base border. 
borderPattern 
Pattern 
Yes 
null 
Denotes the pattern used to draw the base border. 
reliefBorders 
boolean 
Yes 
true 
Denotes whether the base border is drawn in relief or not. 

Note
The above table of properties also applies to card carriers, cards and ports.

A shelf also displays an outline around the slots and an alarm border in case of alarms. This representation can be customized through the following additional property:

Table 8.2 CSS Property for the Shelf Outline
Property Name 
Type 
Default Value 
Description 
frameColor 
Color 
black 
Denotes the outline color of a shelf. 

Customizing Shelf Names

In the network and equipment components, shelves do not display their names. Instead of the shelf name, you see the slot labels, which are customized by using the property XSlotLabels, or by setting the attribute xSlotIndex. The following properties can be used to customize slot labels:

Table 8.3 CSS Properties for Slot Labels
Property Name 
Type 
Default Value 
Description 
XSlotNumbersOnTop 
boolean 
true 
Denotes whether the slot numbers along the x axis are displayed on top of the shelf or not. 
XSlotNumbersOffset 
int 
Denotes the distance between the slot numbers and the shelf along the x axis. 
XSlotLabels 
String[] 
null 
Denotes the labels used on each slot along the x axis. 
labelVisible 
boolean 
true 
Controls whether the label is shown or not. 
labelAntialiasing 
boolean 
true 
Controls whether the label is drawn using antialiasing or not. 
labelFont 
Font 
Helvetica 12, except: 
- in IltShelf: Helvetica 10 
- in IltShelfItem: Helvetica 11 (Courier New 11 on Windows) 
Specifies the font to use to draw the label. 
labelForeground 
Color 
black, except: 
- in IltEmptySlot: 50% gray 
Gives the color of the label text. 

How to Customize Shelf Slot Labels
object."ilog.tgo.model.IltShelf" {
  labelVisible: true;
  labelForeground: blue;
  XSlotNumbersOffset: 3;
}

In the table and tree components, the shelf name displays with a tiny representation of the shelf. Instead of the slot labels, the shelf name 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.

Customizing Shelf States and Alarms

Although states and alarms can be associated with a shelf, they cannot be displayed in the shelf graphic representation in the network and equipment components. After all, a shelf is only a container for the cards themselves.

However, in the case of alarms, an alarm border is displayed around the shelf to indicate the presence of outstanding alarms (but no alarm balloon or alarm count), as illustrated below.

images/ShelfWithAlarms.gif

The following CSS properties are available to customize this representation:

Table 8.4 CSS Properties for the Shelf Alarms 
Property Name 
Type 
Default Value 
Description 
alarmBorderVisible 
boolean 
true 
Indicates whether the alarm border is visible or not around the object base. 
alarmBorderWidth 
int 
2 pixels 
Defines the width of the alarm border. 
alarmBorderColor 
Color 
transparent (null
Defines the color used to represent the alarm border around the base. Setting the value to null resets the alarm border color to its default value. 
alarmColorVisible 
boolean 
false 
Determines whether the alarm color is visible or not in the object value. 

How to Customize Shelf States and Alarms

The following CSS extract shows how you can customize a shelf object to not display alarm information.

object."ilog.tgo.model.IltShelf" {
  alarmBorderVisible: false;
  alarmColorVisible: false;
}

The predefined shelf 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 shelf types are identified as:

You can edit the values directly in the JViews TGO resource bundle file.

When you create new shelf 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 shelf types, register the corresponding entries into the resource bundle file, as follows:

Considering that you have created the following new shelf type:

IltShelf.Type MyType = new IltShelf.Type("MyType"); 

You should declare the following properties in the JTGOMessages.properties file:

Customizing Shelf Types

In JViews TGO, the shelf type defines how the object base will be represented. Each shelf 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 a shelf object by defining a new implementation of IltShelfBaseRenderer. 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 Shelf Type (using the API)
IltShelf.Type MyType = new IltShelf.Type("MyType");
 
IltSettings.SetValue("Shelf.Type.MyType.Renderer", 
                     new IltBaseRendererFactory() {
                       public IltBaseRenderer createValue() {
                         return new MyTypeBaseRenderer();
                       }
                     });
How to Create and Register a Shelf Type (using CSS)

You can also create new shelf types by using global CSS settings (see Using Global Settings in Chapter 2, Using Cascading Style Sheets for more information):

setting."ilog.tgo.model.IltShelf"{
   types[0]: @+shelfType0;
}
Subobject#shelfType0 {
  class: 'ilog.tgo.model.IltShelf.Type'; 
  name: "MyType";
}

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 MyShelfRendererFactory.

setting."ilog.tgo.model.IltShelf.Type"[name="MyType"] {
   renderer: @+shelfRendererFactory;
}
Subobject#shelfRendererFactory {
   class: 'MyShelfRendererFactory';
}

Customizing Shelf Tiny Types

Besides the graphic representation in the network and equipment components, the shelf object can be represented as tiny objects in the tree and table components.

Each shelf 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 Shelf Tiny Representation (using the API)
IltShelf.Type MyType = new IltShelf.Type("MyType");
 
IltSettings.SetValue("Shelf.TinyType.MyType.Renderer", 
                     new IltTinyImageBaseRendererFactory(YOUR_IMAGE, YOUR_IMAGE_PARAMETERS));
How to Modify a Shelf 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 MyShelfTinyRendererFactory.

setting."ilog.tgo.model.IltShelf.Type"[name="MyType"] {
   tinyRenderer: @+shelfTinyRendererFactory0;
}
Subobject#shelfTinyRendererFactory0 {
   class: 'MyShelfTinyRendererFactory';
}

For details about how to create image base renderers, refer to Customizing Network Element Types From Images.