| Styling > Customizing Shelves and Cards > Shelf Representation |
Shelf Representation |
INDEX
PREVIOUS
NEXT
|
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.
This section contains information on:
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).
Property Name |
Type |
Set |
Default Value |
Description |
|---|---|---|---|---|
foreground | Color |
Yes |
28% gray in the IltObject class style |
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:
Property Name |
Type |
Default Value |
Description |
|---|---|---|---|
frameColor | Color |
black |
Denotes the outline color of a shelf. |
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:
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 |
1 |
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. |
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.
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.
The following CSS properties are available to customize this representation:
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:
ilog.tgo.Shelf_Type_<TYPE NAME>: shelf type labels
ilog.tgo.Shelf_Type_<TYPE NAME>_ToolTip: shelf type tooltips
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:
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.
IltShelf.Type MyType = new IltShelf.Type("MyType");
IltSettings.SetValue("Shelf.Type.MyType.Renderer",
new IltBaseRendererFactory() {
public IltBaseRenderer createValue() {
return new MyTypeBaseRenderer();
}
});
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';
}
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.
IltShelf.Type MyType = new IltShelf.Type("MyType");
IltSettings.SetValue("Shelf.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 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.
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. All rights reserved. Legal terms. | PREVIOUS NEXT |