Release Notes > JTGO 4.0 Release Notes > New Features > Styling |
Styling |
PREVIOUS NEXT |
The following improvements have been added to the JTGO styling feature:
You can create dynamic CSS files in an easier way by using the support provided by IlpMutableStyleSheet
. This class allows you to define selectors and manage declarations using an API. The following example illustrates how you can create a mutable style sheet and use it to modify dynamically the configuration of your component:
IlpNetworkView view = networkComponent.getView(); IlpMutableStyleSheet stylesheet = new IlpMutableStyleSheet(view); String[] current = view.getStyleSheets(); int index = current.length; view.setStyleSheets(index, stylesheet.toString()); ... stylesheet.setDeclaration(selector, declaration, value); ... stylesheet.removeDeclaration(selector, declaration); ...
Predefined business objects, and custom business objects using the default representation have now a more complete support for label configuration. The following CSS properties are available to all objects:
Besides property toolTipText
, the following properties are now available to customize tooltips in the objects and attributes displayed in the JTGO components:
The following example shows you how to customize your component to display tooltips with a specific font on the objects:
object."ilog.tgo.model.IltObject" { toolTipText: @name; toolTipFont: "arial-plain-12"; }
In the network and equipment components, it is now possible to specify whether a given object can be moved or not by the user through interactors. This configuration is achieved by setting the value of the property movable
. The following example sets all objects to not movable:
object { movable: false; }
You can now create value map instances in CSS files to store complex types created either using the beans support provided by CSS or CSS functions. The following example illustrates this feature:
#perceivedSeverityBackgroundMap { class: 'ilog.cpl.service.IlpIndexedValueMap'; keyClass: 'java.lang.Integer'; valueClass: 'java.awt.Color'; keys[0]: 0; keys[1]: 1; keys[2]: 2; keys[3]: 3; keys[4]: 4; keys[5]: 5; values[0]: '@|blinkingcolor("#FFFFFF")'; values[1]: '@|blinkingcolor("#C0C0C0")'; values[2]: '@|blinkingcolor("#FFCC00")'; values[3]: '@|blinkingcolor("#FFB200")'; values[4]: '@|blinkingcolor("#FF0000")'; values[5]: '@|blinkingcolor("#FF0000")'; }
While IlpOrderedValueMap
is a value map implementation in which the keys and values can be created in a CSS using a single-line comma-separated string, IlpIndexedValueMap
supports any type of object created using all the CSS features such as bean support and CSS functions. According to your customization needs, you can use one implementation or the other.
The pattern support has been improved and extended. In addition to the predefined patterns and to the two methods for customizing patterns (IltPattern.NewSkewGridPattern
and IltPattern.NewGridPattern
), it is now possible to use the pattern types defined by ilog.views.util.java2d.IlvPattern
class.
The following example shows how to specify the IlvPattern.BRICKS_HORIZONTAL
pattern type in CSS:
object { fillStyle: PATTERN; pattern: '@|pattern("BRICKS_HORIZONTAL")'; }
Following the introduction of impact alarms and their distinction from raw alarms, the CSS selectors for alarm states have changed.
The following type of selector is deprecated:
object."ilog.tgo.model.IltObject"["objectState.Alarm.Critical.New"] { // Matches all objects that have new raw alarms with the severity critical. }
Use instead:
object."ilog.tgo.model.IltObject"["objectState.Alarm.Raw.Critical.New"] { // Matches all objects that have new raw alarms with the severity critical. }
The corresponding selector for new impact alarms with a severity of critical high is:
object."ilog.tgo.model.IltObject"["objectState.Alarm.Impact.CriticalHigh.New"] { // Matches all objects that have new impact alarms with the severity critical high.
Copyright © Rogue Wave Software, Inc. 1997, 2016. All rights reserved. Legal terms. | PREVIOUS NEXT |