Release Notes > JTGO 4.0 Release Notes > New Features > Off-page Connectors |
Off-page Connectors |
PREVIOUS NEXT |
Off-page connectors (OPC) can now have different graphic representations according to the value of their new attribute type
. By default, JTGO provides the following OPC types and representations:
The off-page connector type can be set to the object through XML or through the API. Refer to the class ilog.tgo.model.IltOffPageConnector
in the JTGO Java API Reference Documentation for more information.
You can customize the graphic representation of an off-page connector type by registering a new base renderer (see ilog.tgo.graphic.renderer.IltOPCBaseRenderer
). This base renderer is registered in the JTGO default settings (see ilog.tgo.resource.IltSettings#SetValue
). Besides the predefined base renderers, you can also register base renderers based on images or on any IlvGraphic
class, including SVG support.
The following example shows how you create a new off-page connector type and define its graphic representation:
IltOffPageConnector.Type newType = new IltOffPageConnector.Type(YOUR_NEW_TYPE_NAME); try { Image img = null; URL url = new URL("file", "", YOUR_IMAGE_FILE_NAME); img = getImage(url); if (img != null) { IltOPCImageBaseRendererFactory factory = new IltOPCImageBaseRendererFactory(img, YOUR_IMAGE_PARAMETERS ); IltSettings.SetValue("OffPageConnector.Type.YOUR_NEW_TYPE_NAME.Renderer", factory); } } catch (Exception e) { e.printStackTrace(); }
YOUR_NEW_TYPE_NAME
should be replaced with a string of your choice. YOUR_IMAGE_FILE_NAME
should be replaced with the appropriate string to create a URL object for your image. YOUR_IMAGE_PARAMETERS
is optional.
Like network elements, ports and LEDs, off-page connectors are represented in the tree and table components with a reduced version of the type representation.
Copyright © Rogue Wave Software, Inc. 1997, 2015. All rights reserved. Legal terms. | PREVIOUS NEXT |