skip to main content
Charts > Programmer's documentation > Developing with the JViews Charts SDK > Integrating a chart customizer into your application > Main classes of the chart customizer
 
Main classes of the chart customizer
*IlvChartCSSCustomizerPanel
This class is the panel that displays the chart customizer.
Occasionally, you may need to use the following classes:
*IlvChartCSSAdapterIlvChart
This class is used to manipulate the CSS of the chart and to retrieve information about the CSS.
*IlvRuleCustomizerLogic
When you set a style rule in the panel of the chart customizer, an IlvRuleCustomizerLogic is selected to handle this rule. The IlvRuleCustomizerLogic class contains the logic of what happens when you click a control. It knows which parameters are customizable for the corresponding style rule and how the CSS declaration values in this style rule need to look like.
Chart Customizer Main Classes
The chart customizer panel
The chart customizer panel (IlvChartCSSCustomizerPanel is a Swing panel that displays the GUI elements used to customize the chart.
The chart customizer panel is attached to a chart CSS adapter. The CSS adapter can be obtained by using the method IlvChartCSSAdapter getAdapter().
To set the target of the chart customizer, you can use one of the following methods:
*void setRule(String selector)
Receives the selector of a style rule as a string. It searches for an IlvRuleCustomizerLogic that matches the selector, sets this IlvRuleCustomizerLogic in the chart customizer panel and removes any existing IlvRuleCustomizerLogic.
*void setRule(IlvCSSRule rule)
Receives the style rule directly. It searches for an IlvRuleCustomizerLogic that matches the style rule and sets this IlvRuleCustomizerLogic in the chart customizer panel.
*void setRuleCustomizerLogic(IlvRuleCustomizerLogic ruleCustomizerLogic)
Receives the IlvRuleCustomizerLogic of a style rule and sets it in the chart customizer panel.
To retrieve the current IlvRuleCustomizerLogic, use the method IlvRuleCustomizerLogic getRuleCustomizerLogic(). The chart customizer panel updates its controls automatically when the parameters of the chart change.
It is rarely necessary to update the panel explicitly. If you need to do so, use one of the following methods:
*void update()
*void update(boolean updateValue, boolean updateEnabled, boolean updateVisible)
This method allows you to specify whether one of the following elements should be updated:
*values of the parameters displayed in the chart customizer panel
*enabled state of the controls
*visibility of the controls
The Chart CSS adapter
The chart CSS adapter ( IlvChartCSSAdapter allows you to retrieve information about the CSS of the chart component. The CSS of a chart component can be very complex and can contain many auxiliary style rules. To simplify the situation, only the main style rules should be passed to the panel (such as chartArea, chartLegend, chart3Dview ), since all tiny auxiliary style rules are handled automatically. Basically, the chart CSS adapter provides information about the selectors that can be passed to the method:
 
customizerPanel.setRule(selector)
To retrieve all possible selectors, you can use the following method:
 
String[] getCustomizableRuleSelectors()
The resulting string array contains all selectors that are currently active in the chart.
If you have an object that is part of the chart, for example an IlvGrid object, which can be the x-grid or the y-grid object, you can query which selector fits to this object. The method String getSingleObjectCustomizableRuleSelector(Object object) returns the corresponding selector.
Decoration rules specify the image decorations or the data indicators of the chart. Since an arbitrary number of decorations can be added to the chart, it is often necessary to retrieve in particular the selectors of the decoration rules of the chart. You can do this by using the method:
 
String[] getDecorationRuleSelectors()
Furthermore, the chart CSS adapter allows you to retrieve the instances of IlvRuleCustomizerLogic that fit a particular selector, by using the method
 
IlvRuleCustomizerLogic getRuleCustomizerLogic(String selector)
The returned IlvRuleCustomizerLogic is initialized with the style rule that corresponds to the input selector.
The IlvRuleCustomizerLogic class
The instances of the class IlvRuleCustomizerLogic represent the logic of how a style rule can be customized.
When you call the method customizerPanel.setRule(selector), the IlvRuleCustomizerLogic appropriate to this selector is set in the chart customizer panel.
The chart CSS adapter provides only a fixed set of IlvRuleCustomizerLogic classes, and each IlvRuleCustomizerLogic provides only a fixed set of chart parameters that can be manipulated.
The available IlvRuleCustomizerLogic classes allow you to control a large set of parameters suitable for common cases. All IlvRuleCustomizerLogic classes can be retrieved from the chart component adapter by using the following code:
 
IlvRuleCustomizerLogic[] getRuleCustomizerLogics()
The same IlvRuleCustomizerLogic is reused for multiple style rules of the same type. For example, the IlvRuleCustomizerLogic of an image decoration can be reused for all image decorations. To test whether a style rule fits an IlvRuleCustomizerLogic, you can use the following method:
 
boolean match(IlvCSSRule rule)
If an IlvRuleCustomizerLogic is activated (which happens automatically when setting the style rule of the customizer panel), the method IlvCSSRule getMainRule() returns the style rule that is currently handled by an instance of the IlvRuleCustomizerLogic. Furthermore, every IlvRuleCustomizerLogic fires property change events whenever the main style rule has changed. If you want to listen to these events, you can set a property change listener on the IlvRuleCustomizerLogic by using the following method:
 
void addPropertyChangeListener(PropertyChangeListener listener)

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