ESRIMapModel: Display Properties

The ESRIMapModel is used to change general display properties, such as how the map should be categorized, as shown in the following example:


OLAPDataSetInterface olapModel = <...>;  // some data
   ESRIMapOLAPDataModel dataModel = new ESRIMapOLAPDataModel(olapModel);

// Get an ESRIMap
   OLAPESRIMapChart mapChart = new OLAPESRIMapChart();
   mapChart.setDataModel( dataModel );

// Get the MapChart's graphModel
   ESRIMapModel ESRIMapModel = mapChart.getGraphModel();

// Set the categorization used to Natural Breaks, with 4 buckets
   ESRIMapModel.setRenderAlgorithm( ESRIMapModel.NATURALBREAKS );
   ESRIMapModel.setNumIntervals( 4 );

ESRIMapModel: Behavior

ESRIMapModel properties are bound properties. Modifying a property triggers a PropertyChangeEvent. The OLAPESRIMapChart asynchronously updates when a PropertyChangeEvent is received from the ESRIMapModel. Similarly, modifying a property in any of the ESRIMapModel's contained models triggers a PropertyChangeEvent. A PropertyChangeEvent from contained models will bubble up to cause a PropertyChangeEvent to be fired from the ESRIMapModel.

For example, the following call


ESRIMapModel.getLegendModel().getValueTextStyle().setColor(java.awt.Color.yellow);

would cause the legend's value text style model to fire a "color" PropertyChangeEvent, causing legend model to fire a "valueTextStyle" PropertyChangeEvent, causing the ESRIMapModel to fire a "legendModel" PropertyChangeEvent. This bubbling up of events enables the graph or any other listener to manage updates at a higher level of containment.