Skip navigation links

Package ilog.views.prototypes

Provides legacy facilities that allow you to define custom graphic objects easily.

See: Description

Package ilog.views.prototypes Description

Provides legacy facilities that allow you to define custom graphic objects easily. The package is delivered for backward compatibility reasons. The recommended way to define custom graphic objects today is by using the composite graphic framework instead of the prototypes framework.

The core package of Perforce JViews provides basic graphic objects to build your applications: lines, rectangles, ellipses, splines, etc. Using prototypes, you can enrich this set of graphic objects by defining your own custom graphic objects.

Prototypes are meant to be designed using the Perforce JViews editor, IlvEdit. You draw the graphic appearance of a prototype in an IlvEdit buffer by assembling basic graphic objects (lines, rectangles, etc) or instances of other prototypes.

Prototypes are not simply static combinations of graphics: you can make them active by defining their properties, and associating these properties with graphic feedback and animations.

The classes of this package can be divided in two categories: the classes that you use to load and access existing prototypes in your applications, and the classes that you use to create new prototypes.

Using Prototypes in Applications

The central class of the prototypes package is IlvGroup. A group is a hierarchy of elements (instances of subclasses of IlvGroupElement. Group elements can contain graphic objects (class IlvGraphicElement) or sub-groups.

A prototype is the "model" of a custom graphic object that you have created with IlvEdit. It is an instance of the class IlvPrototype. Prototypes are grouped in prototype libraries (class IlvPrototypeLibrary.

To use a prototype in your application, you make a copy (or "clone") of the prototype: these clones are represented by instances of the class IlvPrototypeInstance.

Prototype instances are stored in an IlvGroupBag, which is associated with a manager. Once the prototype instances are stored in the group bag, they are drawn by the manager as if they were basic graphic objects. Prototype instances can be selected, moved, resized just like other JViews objects.

Prototypes have properties that you define when you design the prototype in IlvEdit. You read and write the values of these properties using the methods get and set of IlvGroupElement. Each property is handled by one or several instances of a subclass of IlvBehavior objects. Setting (or getting) a property will trigger the behavior objects that handle this property.

Creating New Prototypes by Coding

You can create prototypes directly by coding, although the preferred way is to use IlvEdit.

To build a prototype, you create an instance of IlvPrototype, and you add instances of IlvGraphicElement to define its graphic appearance. You can also add subgroups (instances of IlvGroup) containing other graphic elements, or instances of other prototypes (IlvPrototypeInstance).

To define the properties of the prototype, you add instance of subclasses of IlvBehavior to the prototype. There are many predefined subclasses of IlvBehavior that let you define how your prototype will react when a property is changed.

To save a prototype, you add it to a prototype library (class IlvPrototypeLibrary) and you save the library.

Skip navigation links

© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.