public class IltSettings extends Object implements IlvStylable
This is the JTGO top-level global settings class. It contains the default configuration for the JTGO look and feel. It also applies user-defined global settings defined in a CSS file.
the JTGO look and feel stores information about how object attributes, states and alarm information are mapped to decorations in order to create the graphic representation.
Each property is identified by a name, and can be retrieved or set
through the methods GetValue
and SetValue
.
Properties can also be set by first defining the settings within a CSS
file and applying the settings using the setStylesheet
methods.
For settings details within CSS files please refer to classes in the
ilog.tgo.resource.css.handlers
package.
the JTGO look and feel characteristics can be customized as follows:
IltLink.Media
representation. The property name
is defined by the prefix Link.Media.
, the media name and
the Icon
suffix. For example:
IltSettings.SetValue("Link.Media.Fiber.Icon", image)
IltLink.Technology
representation. The property
name is defined by the prefix Link.Technology.
, the
technology name and the Icon
(or Color
)
suffix. For example:
IltSettings.SetValue("Link.Technology.WirelessEdge.Icon", image) IltSettings.SetValue("Link.Technology.WirelessEdge.Color", color)
IltNetworkElement.Function
representation. The
property name is defined by the prefix
NetworkElement.Function.
, the function name and the
Icon
suffix. For example:
IltSettings.SetValue("NetworkElement.Function.ADM.Icon", image)
type
attribute, such as IltNetworkElement
,
IltShelf
, IltPort
and IltLed
,
the type label is retrieved automatically from the JTGO resource
bundle. However, it is also possible to customize the textual
representation of the type so that it is appropriately displayed in a
table component. To customize the label representation, configure the
label value as illustrated in the example below:
IltSettings.SetValue("Led.Type.Circular.Label", "Circular") IltSettings.SetValue("Port.Type.IEEE_1394_4f.Label", "IEEE 1394") IltSettings.SetValue("NetworkElement.Type.NE.Label", "Network Element");
IltNetworkElement.Family
representation is a
label retrieved automatically from the JTGO resource bundle. As you
create new families, register the appropriate entries in the resource
bundle. However, it is also possible to set the family label here,
using the following setting name:
NetworkElement.Family.YOUR FAMILY NAME.Label
, as
illustrated below:
IltSettings.SetValue("NetworkElement.Family.FCOT.Label", "FCOT")
IltNetworkElement.Type
representation. The
property name is defined by the prefix NetworkElement.Type.
,
the type name and CenterFunctionIcon
. The example below
illustrates this configuration:
IltSettings.SetValue("NetworkElement.Type.NE.CenterFunctionIcon", Boolean.FALSE);
IltNetworkElement.Type
base representation. The
property name is defined by the prefix NetworkElement.Type.
,
the type name and the Renderer
suffix. The property value
should be an IltBaseRendererFactory
that creates
IltNEBaseRenderer
instances. For
example:
IltSettings.SetValue("NetworkElement.Type.NE.Renderer", new IltNEImageBaseRendererFactory(...))
IltCard.Type
base representation. The property
name is defined by the prefix Card.Type.
, the type name
and the Renderer
suffix. The property value should be
an IltBaseRendererFactory
that creates
IltCardBaseRenderer
instances. For
example:
IltSettings.SetValue("Card.Type.Standard.Renderer", new IltCardImageBaseRendererFactory(...))
IltCardCarrier.Type
base representation. The
property name is defined by the prefix CardCarrier.Type.
,
the type name and the Renderer
suffix. The property value
should be an IltBaseRendererFactory
that creates
IltCardCarrierBaseRenderer
instances.
For example:
IltBaseRendererFactory yourCardCarrierBaseRendererFactory = ...; IltSettings.SetValue("CardCarrier.Type.Standard.Renderer", yourCardCarrierBaseRendererFactory)
IltPort.Type
base representation. The property
name is defined by the prefix Port.Type.
, the type name
and the Renderer
suffix. The property value should be an
IltBaseRendererFactory
that creates
IltPortBaseRenderer
instances. For
example:
IltSettings.SetValue("Port.Type.IEEE_1394_4f.Renderer", new IltPortImageBaseRendererFactory(...))
IltLed.Type
base representation. The property
name is defined by the prefix Led.Type.
, the type name and
the Renderer
suffix. The property value should be an
IltBaseRendererFactory
that creates
IltLedBaseRenderer
instances. For
example:
IltSettings.SetValue("Port.Type.Circular.Renderer", new IltLedImageBaseRendererFactory(...))
IltOffPageConnector.Type
base representation. The
property name is defined by the prefix
OffPageConnector.Type.
, the type name and the
Renderer
suffix. The property value should be an
IltBaseRendererFactory
that creates
IltOPCBaseRenderer
instances. For
example:
IltSettings.SetValue("OffPageConnector.Type.Standard.Renderer", new IltOPCImageBaseRendererFactory(...))
General settings: modify the icons used to represent the information window, system window and subnetwork status. The following property names can be set:
Miscellaneous states: modify the
IltMisc.SecState
representation.
Property names are defined by the state name and the Icon
suffix, for example:
IltSettings.SetValue("Misc.SecState.DoorAjar.Icon", image)
Performance, SAN and SNMP states: modify
IltPerformance.SecState
, IltSAN.SecState
and
IltSNMP
state representation, so that the state can be
represented as a gauge, a chart or a counter.
Property names are defined by the state name, and a suffix that determines the type of configuration that is applied. This suffix can be:
IltDecorationType.Gauge
.IltGaugeMapping
.IltChartMapping
.IltCounterMapping
.The following example illustrates how to customize the representation of
the state IltPerformance.SecState.Input
.
IltSettings.SetValue("Performance.SecState.Input.Type", IltDecorationType.Chart); IltSettings.SetValue("Performance.SecState.Input.Chart", new IltChartMapping(chart1, chart2));
SONET protections: modify the
IltSONET.Protection
representation. The property name is
defined by the prefix SONET.Protection.
, the protection name
and the Icon
suffix. For example:
IltSettings.SetValue("SONET.Protection.Exercisor.Icon", image)
OSI primary states: modify the icons displayed according to the primary states set in the object. The following properties can be customized:
Bellcore secondary state and OSI status: modify
IltBellcore.SecState
, IltOSI.Availability
,
IltOSI.Control
, IltOSI.Repair
,
IltOSI.Procedural
and IltOSI.Standby
state
representation. Property names are defined by the state name, and a suffix
that determines the object condition according to its primary state.
This suffix can be:
The following example illustrates how to customize the representation of the
state IltBellcore.SecState.Blocked
.
IltSettings.SetValue("Bellcore.SecState.Blocked.OOS.Icon", blockedOOS); IltSettings.SetValue("Bellcore.SecState.Blocked.NT.Icon", blockedNT); IltSettings.SetValue("Bellcore.SecState.Blocked.CT.Icon", blockedCT);
Alarm Severities: modify the alarm severity configuration. The following properties can be customized:
The following properties can be used to customize the representation of raw alarms in the business objects:
For instance Alarm.Raw.Critical.Color.
The following properties can be used to customize the representation of impact alarms in the business objects:
For instance Alarm.Impact.CriticalHigh.Color.
The following properties can be used to customize the representation of traps in the business objects:
For instance: Trap.Type.LinkFailure.Color.
The following properties can be used to toggle the offscreen buffered image optimizations (enabled by default). Complex graphic objects are expensive to render and update, taking extra resources every time they are computed. The offscreen buffered image technique renders such complex graphics into a buffered image kept in memory. This takes advantage of the fact that in memory, buffered images are quickly rendered. This process consumes extra memory due to the number of cached resources, therefore it can be disabled when memory footprint is critical.
IltPolyGroup
and IltLinearGroup
.IltBTSAntenna
.To disable the offscreen performance improvements for polygons, do the following:
IltSettings.SetValue("OffscreenCache.Polygon", Boolean.FALSE);
Similarly, to enable the performance improvements for BTS antennas, do the following:
IltSettings.SetValue("OffscreenCache.BTS", Boolean.TRUE);
IltAlarmRenderer
,
IltBellcoreRenderer
,
IltMiscRenderer
,
IltOSIRenderer
,
IltPerformanceRenderer
,
IltSANRenderer
,
IltSNMPRenderer
,
IltSONETRenderer
,
IltInfoWindowRenderer
,
IltSystemWindowRenderer
,
IltSubnetworkRenderer
,
IltCardRenderer
,
IltCardCarrierRenderer
,
IltLedRenderer
,
IltLinkRenderer
,
IltNetworkElementRenderer
,
IltOffPageConnectorRenderer
,
IltObjectRenderer
,
IltPortRenderer
,
IltShelfRenderer
APPLIED_RULE_MASK, BAD_CLASS_MASK, BAD_PROP_MASK, BAD_PROP_WITH_STACK_MASK, CREATED_MASK, DECL_MASK, DECL_VALUE_MASK, FAILED_CONVERSIONS_MASK, TIME_REPORT_MASK, WARNING_PROP_MASK
Constructor and Description |
---|
IltSettings()
Creates an instance of
IltSettings with a default context. |
IltSettings(IlpContext context)
Creates an instance of
IltSettings with the given context. |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a property modification listener.
|
IlpContext |
getContext()
Retrieves current application context.
|
static Image |
GetImage(Object key)
Returns an image property value.
|
static IltLookAndFeel |
getLookAndFeel()
Returns the current look and feel.
|
int |
getStyleSheetDebugMask()
Returns the current debug level.
|
String[] |
getStyleSheets()
Returns the cascaded style sheets.
|
String |
getStyleSheets(int index)
Returns one of the cascaded style sheets.
|
static Object |
GetValue(Object key)
Returns the value of a property.
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a property modification listener.
|
static void |
setLookAndFeel(IltLookAndFeel lf)
Sets a new Look and Feel.
|
void |
setStyleSheetDebugMask(int mask)
Sets the debug level while parsing the style sheets.
|
void |
setStyleSheets(int index,
String css)
Changes one of the cascading style sheets.
|
void |
setStyleSheets(String[] css)
Sets the cascading style sheets.
|
static Object |
SetValue(Object key,
Object value)
Sets the value of a property in the current configuration.
|
public IltSettings()
IltSettings
with a default context.public IltSettings(IlpContext context)
IltSettings
with the given context.context
- The used context.public static IltLookAndFeel getLookAndFeel()
public static void setLookAndFeel(IltLookAndFeel lf)
This method sets new configuration values to the global settings.
This new configuration is not immediately applied to the objects that are already being displayed in graphic views. These objects will be updated once needed, that is:
IlpGraphicView.invalidateGraphics()
for more information.lf
- The new look and feel.public static Object GetValue(Object key)
key
- The property identifier.public static Object SetValue(Object key, Object value)
key
- The property identifier.value
- The property value.public static Image GetImage(Object key)
key
- The property identifier.Image
that is defined for key
.public void setStyleSheets(String[] css) throws IlvStylingException
IlvStylable
This is a bound property. It
means the implementation should fire a PropertyChange
event to all registered PropertyChangeListener
s after
setting the new value.
setStyleSheets
in interface IlvStylable
css
- An array of strings representing the CSS document (usually
with a file or URL with .css
suffix).IlvStylingException
public void setStyleSheets(int index, String css) throws IlvStylingException
IlvStylable
IlvStylable.setStyleSheets(java.lang.String[])
.
It lets you change one particular style sheet file, instead of setting
the whole style sheet array.
This is a bound property. It means the implementation should
fire a PropertyChange
event to all registered
PropertyChangeListener
s after setting the new value.
The old and new value arguments of the event represent the whole array.
setStyleSheets
in interface IlvStylable
index
- The index of the style sheet to replace.css
- A String representing the CSS document (usually
with a file or URL with .css
suffix).IlvStylingException
IlvStylable.setStyleSheets(java.lang.String[])
public String[] getStyleSheets()
IlvStylable
getStyleSheets
in interface IlvStylable
public String getStyleSheets(int index)
IlvStylable
getStyleSheets
in interface IlvStylable
index
- The position of the cascading style sheet to return.index
style sheet.public void setStyleSheetDebugMask(int mask)
IlvStylable
IlvStylable.setStyleSheets(java.lang.String[])
to debug
problems during configuration.
This is a bound property. It means the implementation should
fire a PropertyChange
event to all registered
PropertyChangeListener
s after setting the new value.setStyleSheetDebugMask
in interface IlvStylable
mask
- The debug mask, expressed as an OR combination of the
predefined flags.IlvStylable.setStyleSheets(java.lang.String[])
,
IlvStylable.getStyleSheetDebugMask()
,
IlvStylable.APPLIED_RULE_MASK
,
IlvStylable.BAD_CLASS_MASK
,
IlvStylable.BAD_PROP_MASK
,
IlvStylable.BAD_PROP_WITH_STACK_MASK
,
IlvStylable.CREATED_MASK
,
IlvStylable.DECL_MASK
,
IlvStylable.DECL_VALUE_MASK
,
IlvStylable.FAILED_CONVERSIONS_MASK
,
IlvStylable.TIME_REPORT_MASK
,
IlvStylable.WARNING_PROP_MASK
public int getStyleSheetDebugMask()
IlvStylable
getStyleSheetDebugMask
in interface IlvStylable
IlvStylable.setStyleSheetDebugMask(int)
public void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener
in interface IlvStylable
listener
- The listener to add.public void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener
in interface IlvStylable
listener
- The listener to remove.public IlpContext getContext()
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.