| Styling > Customizing Subnetworks |
Customizing Subnetworks |
INDEX
PREVIOUS
NEXT
|
Subnetworks allow you to create applications that display a network inside another network. They are created automatically by the ILOG JViews TGO network component when you define a containment relationship between objects in the data source.
A subnetwork can be defined as any business object with child objects in the network component. You can display it either collapsed or expanded in the network component.
In the collapsed representation, the subnetwork is displayed using an overview object, which is the graphic representation of the parent object as defined in the business model.
For example, in the sample
<installdir>/samples/network/basic, where <installdir> is the directory where JViews TGO is installed,
a subnetwork is defined with the following properties:
IltNetworkElement
SubNetwork1
SubNetwork
IltNetworkElement.Type.NMW
The graphic representation of the subnetwork in its collapsed state is provided by the same attributes and properties defined for network element objects. When customizing your subnetwork objects, you should use the CSS properties that apply to the business class used as the overview object.
#SubNetwork1 {
functionVisible: false;
detailLevel: MaximumDetails;
}
The following example illustrates the use of CSS to customize the graphic representation of an expanded subnetwork:
object."test.MyObject" {
subnetworkTitle: @name;
subnetworkTitleJustification: CENTER;
subnetworkFrame: TITLEBAR_FRAME;
subnetworkTitleColor: white;
subnetworkRightMargin: 3;
subnetworkLeftMargin: 3;
}
Please refer to the following table for a complete list of properties that can be used to customize subnetworks in their expanded representation.
object."mypackage.MyType" {
subnetworkTitle: @name;
subnetworkTitleJustification: Center;
subnetworkFrame: TITLEBAR_FRAME;
subnetworkTitleColor: blue;
subnetworkRightMargin: 3;
subnetworkLeftMargin: 3;
}
The IlpGraphController methods setCollapsionBackgroundInteractor and setExpandInteractor can be used to customize subnetwork interactors to replace the default behavior of expand/collapse when double clicking a subnetwork.
Example
IlpDefaultObjectInteractor objInteractor = new IlpDefaultObjectInteractor(); Action myAction = new TestAction(); objInteractor.setGestureAction(IlpGesture.BUTTON1_DOUBLE_CLICKED, myAction); objInteractor.setPopupMenuFactory(new TestPopupMenuFactory()); networkComponent.getController(). setCollapsionBackgroundInteractor(objInteractor); networkComponent.getController().setExpansionInteractor(objInteractor);
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. All rights reserved. Legal terms. | PREVIOUS NEXT |