Perforce JViews TGO Sample: Network Component - Styling
Description
This sample shows how to customize the rendering of the business objects in the network using cascading style sheets (CSS).
How to Use the Sample
A checkbox list is available to enable/disable specific CSS customizations. Enabling a checkbox will make the application parse a specific CSS file so that the corresponding customization is applied. Disabling a checkbox will remove the CSS customization. In this sample, the configuration of the following elements is illustrated:
- Adapter: sets the filter and origins on the network component adapter.
- Toolbar: adds buttons to the toolbar.
See the ilog.cpl.network.renderer.IlpToolBarRenderer class. - View: customizes properties in the network view.
See the ilog.cpl.network.renderer.IlpViewRenderer class. - Overview: customizes the visibility and availability of the overview window.
See the ilog.cpl.network.renderer.IlpOverviewRenderer class. - Interactor: customizes the default interactor to use.
This should be the name of one of the buttons of the toolbar or the default view interactor instance. See the ilog.cpl.network.renderer.IlpInteractorRenderer class. - Zooming: customizes the zoom policy applied to the network view.
See the ilog.cpl.network.renderer.IlpZoomingRenderer class. - Graph Layout: applies a graph layout to the network component.
Please note that once the node layout is performed in the network component, the nodes are repositioned. Resetting the node layout does not turn the network objects to their original position. To return to the original state, reload the business objects in the network component.
See the ilog.cpl.network.renderer.IlpGraphLayoutRenderer class. - Link Layout: applies a link layout to the network component.
See the ilog.cpl.network.renderer.IlpLinkLayoutRenderer class. - Label Layout: configures a layout layout for the network component.
Please note that the label layout is not applied automatically to the network component. You can perform the label layout by clicking on the Perform Label Layout button that is available in the network component toolbar. See the ilog.cpl.network.renderer.IlpLabelLayoutRenderer class. - Backgrounds: configures a background for the network component.
See the ilog.cpl.network.renderer.IlpBackgroundsRenderer class.
How to Run the Sample as an Application
This sample can
be run as an application.
The installation directory contains
an executable JAR file,
network-styling.jar
,
that allows you to execute the sample with a double click from a
file browser. Note that if you are using Internet Explorer, you can
open the installation directory
and execute the JAR file from the browser. This
technique may not work in other Web browsers.
Alternatively, you
can run the sample application from the command line.
First check that the Ant utility is properly configured. If not, see the
instructions on how to configure Ant for Perforce JViews.
Then, go to the installation directory
of the sample and type:
ant run
Topics Covered
- Initializing a JTGO application using a deployment descriptor
- Creating a data source
- Reading data from an XML file into a data source
- Creating a network component and configuring it using multiple CSS configuration files
- Associating the data source with the network component
Detailed Description
This sample differs from the basic sample in that it allows the user to interact with the CSS files applied on the network view, the network adapter and the business objects.
In this sample, the configuration of the following elements is illustrated:
- Adapter: sets the filter and origins on the network component adapter.
- Toolbar: adds buttons to the toolbar.
See the ilog.cpl.network.renderer.IlpToolBarRenderer class. - View: customizes properties in the network view.
See the ilog.cpl.network.renderer.IlpViewRenderer class. - Overview: customizes the visibility and availability of the overview window.
See the ilog.cpl.network.renderer.IlpOverviewRenderer class. - Interactor: customizes the default interactor to use and specifies an object interactor.
The default interactor configuration should be the name of one of the buttons of the toolbar or the default view interactor instance. The object interactor configuration is achieved using and actions associated with gestures MOUSE_ENTERED and MOUSE_EXITED (ilog.cpl.interactor.IlpDefaultObjectInteractor).
See the ilog.cpl.network.renderer.IlpInteractorRenderer class. - Zooming: customizes the zoom policy applied to the network view.
See the ilog.cpl.network.renderer.IlpZoomingRenderer class. - Graph Layout: applies a graph layout to the network component.
Please note that once the node layout is performed in the network component, the nodes are repositioned. Resetting the node layout does not turn the network objects to their original position. To return to the original state, reload the business objects on the network component.
See the ilog.cpl.network.renderer.IlpGraphLayoutRenderer class. - Link Layout: applies a link layout to the network component.
See the ilog.cpl.network.renderer.IlpLinkLayoutRenderer class. - Label Layout: configures a label layout for the network component.
Please note that the label layout is not applied automatically to the network component. You can perform the label layout by clicking thePerform Label Layout
button that is available in the network component toolbar. See the ilog.cpl.network.renderer.IlpLabelLayoutRenderer class. - Backgrounds: configures a background for the network component.
See the ilog.cpl.network.renderer.IlpBackgroundsRenderer class.
Installation Directory
The Network Component - Styling sample is installed here.
Classes Involved
-
ilog.tgo.IltSystem
The class that initializes a JViews TGO application.
-
ilog.tgo.datasource.IltDefaultDataSource
The default datasource implementation.
-
ilog.cpl.IlpNetwork
The network component.
-
ilog.cpl.network.renderer.IlpToolBarRenderer
This class gives control over the toolbar of a network component.
-
ilog.cpl.network.renderer.IlpBackgroundsRenderer
This class gives control over the backgrounds of a network component.
-
ilog.cpl.network.renderer.IlpViewRenderer
This class gives control over the view of a network component.
-
ilog.cpl.network.renderer.IlpOverviewRenderer
This class gives control over the overview of a network component.
-
ilog.cpl.network.renderer.IlpInteractorRenderer
This class gives control over the interactors of a network component.
-
ilog.cpl.network.renderer.IlpZoomingRenderer
This class gives control over the zooming policy of a network component.
-
ilog.cpl.network.renderer.IlpGraphLayoutRenderer
This class gives control over the graph layout of a network component.
-
ilog.cpl.network.renderer.IlpLinkLayoutRenderer
This class gives control over the link layout of a network component.
-
ilog.cpl.network.renderer.IlpLabelLayoutRenderer
This class gives control over the label layout of a network component.
-
ilog.cpl.network.renderer.IlpPositioningRenderer
This class gives control over the positioning of a network component.
-
ilog.cpl.interactor.IlpDefaultObjectInteractor
This class provides a default implementation of
IlpObjectInteractor
.
Source Files
-
styling.Main
The entry point of the sample.
-
styling.CustomFilter
The custom adapter filter.
-
styling.CustomPopupMenuFactory
The custom factory to create pop-up menus.
-
styling.CustomMouseCursorAction
The custom action that changes the mouse cursor when the cursor enters and exits an object.