ilog.views.maps.datasource
Class IlvDataSourceStylingFactory

java.lang.Object
  extended by ilog.views.maps.datasource.IlvDataSourceStylingFactory

public class IlvDataSourceStylingFactory
extends Object

This class is a factory used by all vector data sources to create default renderers and styles

Since:
JViews 7.5

Field Summary
static String ATTRIBUTETABLE_BACKGROUND
          Name of the attribute defining the background color.
static String ATTRIBUTETABLE_FILL
          Name of the attribute defining the filling status for areas.
static String ATTRIBUTETABLE_FOREGROUND
          Name of the attribute defining the foreground color.
static String ATTRIBUTETABLE_ICON
          Name of the attribute defining the icon for points.
static String ATTRIBUTETABLE_STROKE
          Name of the attribute defining the stroking status for areas.
 
Method Summary
 IlvMapStyle createDefaultFeatureStyle(Class geometryClass, Object styleKey, boolean useGeneralPath)
          Creates a map style designed to be applied to the specified geometry class.
 IlvDefaultFeatureRenderer createDefaultRenderer(boolean useGeneralPath, boolean useGeodeticComputation)
          Creates and sets up a map renderer designed to create IlvMapGraphic objects.
 HashMap getDefaultAttributeTable(String attributeName)
          Returns a hash map containing the attribute values to use for each particular style key.
 HashMap getDefaultStyleTable()
          Returns a hash map containing the style to use for each particular key.
static IlvDataSourceStylingFactory getFactory()
          Returns the default style factory.
 boolean isShareDefaultStyles()
          Indicates whether styles are shared between all feature layers with the same key.
static void setFactory(IlvDataSourceStylingFactory factory)
          Allows to change the default style factory, by overriding createDefaultRenderer or createDefaultFeatureStyle in a subclass.
 void setShareDefaultStyles(boolean shareDefaultStyles)
          Determines whether styles are shared between all feature layers with the same key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTETABLE_BACKGROUND

public static final String ATTRIBUTETABLE_BACKGROUND
Name of the attribute defining the background color.
The attribute table accessible through getDefaultAttributeTable(String)for this name will contain styleKey/Color pairs.

See Also:
Constant Field Values

ATTRIBUTETABLE_FILL

public static final String ATTRIBUTETABLE_FILL
Name of the attribute defining the filling status for areas.
The attribute table accessible through getDefaultAttributeTable(String)for this name will contain styleKey/Boolean pairs.

See Also:
Constant Field Values

ATTRIBUTETABLE_ICON

public static final String ATTRIBUTETABLE_ICON
Name of the attribute defining the icon for points.
The attribute table accessible through getDefaultAttributeTable(String)for this name will contain styleKey/String pairs.

Since:
JViews 8.0
See Also:
Constant Field Values

ATTRIBUTETABLE_FOREGROUND

public static final String ATTRIBUTETABLE_FOREGROUND
Name of the attribute defining the foreground color.
The attribute table accessible through getDefaultAttributeTable(String)for this name will contain styleKey/Color pairs.

See Also:
Constant Field Values

ATTRIBUTETABLE_STROKE

public static final String ATTRIBUTETABLE_STROKE
Name of the attribute defining the stroking status for areas.
The attribute table accessible through getDefaultAttributeTable(String)for this name will contain styleKey/Boolean pairs.

See Also:
Constant Field Values
Method Detail

getFactory

public static IlvDataSourceStylingFactory getFactory()
Returns the default style factory.

Returns:
Returns the default style factory.

setFactory

public static void setFactory(IlvDataSourceStylingFactory factory)
Allows to change the default style factory, by overriding createDefaultRenderer or createDefaultFeatureStyle in a subclass.

Parameters:
factory -

createDefaultFeatureStyle

public IlvMapStyle createDefaultFeatureStyle(Class geometryClass,
                                             Object styleKey,
                                             boolean useGeneralPath)
Creates a map style designed to be applied to the specified geometry class.
If the style key is not null, and a style exists in the style table for this key, it will be returned. If no style exists, one random style will be added in the table for further calls.
This mechanism permits using the same styles for features of the same type among different data sources.

Parameters:
geometryClass - subclass IlvMapGeometry
styleKey - style key.
useGeneralPath - true if curve and area renderers should use general paths.
Returns:
the default style to use.
See Also:
getDefaultAttributeTable(String)

createDefaultRenderer

public IlvDefaultFeatureRenderer createDefaultRenderer(boolean useGeneralPath,
                                                       boolean useGeodeticComputation)
Creates and sets up a map renderer designed to create IlvMapGraphic objects.

Parameters:
useGeneralPath - true if curves and areas should be general paths.
useGeodeticComputation - true if curves and areas should use the geodetic computation.
Returns:
a newly created feature renderer.

getDefaultAttributeTable

public HashMap getDefaultAttributeTable(String attributeName)
Returns a hash map containing the attribute values to use for each particular style key.
The key will be dependant on the format used. It is usually the default name of the layer where features are put.
This attribute value will be used when creating the style for this style key.

Parameters:
attributeName - attribute name. The default factory uses the following predefined names:
  • {link #ATTRIBUTETABLE_BACKGROUND}
  • {link #ATTRIBUTETABLE_FOREGROUND}
  • {link #ATTRIBUTETABLE_FILL}
  • {link #ATTRIBUTETABLE_STROKE}
  • {link #ATTRIBUTETABLE_ICON}

getDefaultStyleTable

public HashMap getDefaultStyleTable()
Returns a hash map containing the style to use for each particular key.
The key will be dependant on the format used. It is usually the default name of the layer where features are put.
You can fill this hash map with default styles for each feature.

Returns:
a hashmap containing pair style key/style.
See Also:
createDefaultFeatureStyle(Class, Object, boolean)

isShareDefaultStyles

public boolean isShareDefaultStyles()
Indicates whether styles are shared between all feature layers with the same key.

Returns:
true if styles are shared.

setShareDefaultStyles

public void setShareDefaultStyles(boolean shareDefaultStyles)
Determines whether styles are shared between all feature layers with the same key.
By default, when a style is requested by calling createDefaultFeatureStyle(Class, Object, boolean), a copy of the registered style (if any) is returned.
Using this method will allow to reuse the same style every time, effectively sharing the style through all layers.

Parameters:
shareDefaultStyles - style sharing to use when creating a new style.


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