skip to main content
Developing with design tools > Using the Symbol Compiler > Using compiled symbols in applications > Generated class of a compiled symbol
 
Generated class of a compiled symbol
For each palette symbol, the Symbol Compiler generates a subclass of IlvCompositeGraphic and a corresponding Java™ BeanInfo class to expose the symbol parameters as JavaBean™ properties.
Class name and package
The package of the generated Java class is defined by the symbol palette package name. The class name is the ID of the symbol with the first character converted to uppercase if it is not a capital letter.
A palette symbol can only be compiled if its ID is a valid Java class name and its palette package name is a valid Java package.
Constructor
The generated symbol constructor of the symbol class creates the elements of the composite graphic as they are specified in the Symbol Editor, with the attachments and initial properties, according to the default values of the parameters.
Parameters
Each symbol parameter is translated into a JavaBean property with the same name. All the properties corresponding to the parameters are exported to a BeanInfo class. The getter and setter functions are generated with the additional Parameter prefix. For this reason, the parameter IDs must be valid Java identifiers.
For example, for a string parameter named label, you will have:
*a bean property named label, of type String
*the getter function: String getLabelParameter()
*the setter function: void setLabelParameter(String value)
The generated code of a parameter setter function updates the properties of the symbol elements that reference the parameter in their value definitions with direct function calls. If the parameter is referenced in rule conditions, the applicable symbol element properties are also updated in the conditional block of the generated Java code.
Selectable symbols
If your palette symbol has elements that respond to selection, the generated class implements the IlvSelectableSymbol interface and defines the selectionStateChanged method that you can call to update the symbol when it is selected or deselected.

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.