Changes between Version 2 and Version 3 of HowToCustomizeLegend


Ignore:
Timestamp:
Sep 16, 2008, 7:29:51 AM (16 years ago)
Author:
aboudreault
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HowToCustomizeLegend

    v2 v3  
    11[[PageOutline]]
    2 = How To Customize !Legend widget =
     2= How To Customize Legend widget =
    33
    44== Introduction ==
    55
    6 This !HowTo describe how customize the !Legend widget for display the groups/layers the way you want. In this !HowTo,  we'll see what are the two possible methods to customize this widget and make a example for each. It's basicly the same pattern as the !SelectionPanel widget.
     6This !HowTo describes how customize the Legend widget for display the groups/layers the way you want. In this !HowTo,  we'll see what are the two possible methods to customize this widget and make a example for each. It's basicly the same pattern as the !SelectionPanel widget.
    77
    88== First method: customize by defining a function ==
     
    5353== Second method: customize by creating a renderer class ==
    5454
    55 This method let you define a special behavior for the !Legend. It can be a little bit more complicated than the first one but it can be very useful for those who have to make a complex behavior. It also keep a structured application using the ''Object Oriented programming''.
     55This method let you define a special behavior for the Legend. It can be a little bit more complicated than the first one but it can be very useful for those who have to make a complex behavior. It also keep a structured application using the ''Object Oriented programming''.
    5656
    57 Basicly, creating a renderer class is not very complicated. You'll have to create a class that inherit from the '''Fusion.Widget.!Legend.!LegendRenderer''' and implement these five functions: ''initialize'', ''renderLegend'', ''mapLoaded'', ''mapReloaded'', ''mapLoading''. The first function is for initialize the base class and initialize all specific properties of your renderer (creating div, button, image, adding CSS, etc.). The second is the main function that will draw the legend. The last three functions are only for handle the events and do specifics actions. (Fusion.Event.MAP_LOADED, Fusion.Event.MAP_RELOADED, Fusion.Event.MAP_LOADING).
     57Basicly, creating a renderer class is not very complicated. You'll have to create a class that inherit from the '''Fusion.Widget.Legend.!LegendRenderer''' and implement these five functions: ''initialize'', ''renderLegend'', ''mapLoaded'', ''mapReloaded'', ''mapLoading''. The first function is for initialize the base class and initialize all specific properties of your renderer (creating div, button, image, adding CSS, etc.). The second is the main function that will draw the legend. The last three functions are only for handle the events and do specific actions. (Fusion.Event.MAP_LOADED, Fusion.Event.MAP_RELOADED, Fusion.Event.MAP_LOADING).
    5858
    5959'''Example 1: simple renderer'''