ilog.views.maps.datasource
Interface IlvPolylineMergerDataSource.IlvGraphicIdentifier

Enclosing class:
IlvPolylineMergerDataSource

public static interface IlvPolylineMergerDataSource.IlvGraphicIdentifier

This interface compares collections of features that are to be merged as a single polyline. If the interface finds the same java.lang.Object as the identifier for the two specified IlvGraphic, the IlvPolylineMergerDataSource assumes that these two IlvGraphic can be merged together as a single polyline if their extremities are close to one another.

Example:

 // Create an object that implements IlvPolylineMergerDataSource.IlvGraphicIdentifier 
 // For instance, the identifier returns the value of the field "STREETNAME" if any
 IlvPolylineMergerDataSource.IlvGraphicIdentifier identifier = new
 IlvPolylineMergerDataSource.IlvGraphicIdentifier() { 
     public String getIdentifierPropertyName() { return "STREETNAME"; }
     public Object getIdentifier(IlvGraphic component) {
       if (component != null) {
         IlvAttributeProperty properties = (IlvAttributeProperty) component.getNamedProperty(IlvAttributeProperty.NAME);
         if (properties  instanceof IlvFeatureAttributeProperty) {
           try {
             return ((IlvFeatureAttributeProperty)properties).getAttribute(getIdentifierPropertyName());
           } catch (IllegalArgumentException e){
                // if property does not exist    
           }
         }
       }
       return null;
     }
 IlvMapDataSource newSource=new IlvPolylineMergerDataSource(oldSource,identifier);
 IlvMapDataSourceModel dsm = IlvMapDataSourceProperty.getMapDataSourceModel(manager);
 dsm.addChild(reader);

 

Since:
JViews 7.5

Method Summary
 Object getIdentifier(IlvGraphic graphic)
          Identifies this
 String getIdentifierPropertyName()
          Returns the property name (to reintroduce into the merged object)
 

Method Detail

getIdentifier

Object getIdentifier(IlvGraphic graphic)
Identifies this

Parameters:
graphic - the object to identify
Returns:
an object identifying this graphic for the purpose of merge comparison

getIdentifierPropertyName

String getIdentifierPropertyName()
Returns the property name (to reintroduce into the merged object)

Returns:
the property name (to reintroduce into the merged object)


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.