ilog.views.maps.graphic.style
Class IlvColorAttributeFilter

java.lang.Object
  extended by ilog.views.maps.graphic.style.IlvColorAttributeFilter
All Implemented Interfaces:
IlvPersistentObject, IlvMapAttributeFilter

public class IlvColorAttributeFilter
extends Object
implements IlvMapAttributeFilter

IlvColorAttributeFilter is an IlvMapAttributeFilter used to add color depending on a numerical attribute value.

Since:
JViews 8.1

Field Summary
 
Fields inherited from interface ilog.views.maps.graphic.style.IlvMapAttributeFilter
DEFAULT_VALUE
 
Constructor Summary
IlvColorAttributeFilter(IlvInputStream stream)
          Reads a ColorAttributeFilter object from an IlvInputStream.
IlvColorAttributeFilter(String attributeName, IlvColorEncoder encoder)
          Constructs a new IlvColorAttributeFilter object from a given attribute name and an IntervalColorModel instance.
 
Method Summary
 Object get(IlvGraphic g, String styleAttributeName)
          This method is is invoked when the IlvMapStyle instance this object is attached to attempts to retrieve an attribute value.
 String getAttributeName()
          Returns the attribute name given at construction time.
static IlvAttributeProperty getAttributeProperty(IlvGraphic g)
          Returns a IlvAttributeProperty instance for an IlvGraphic object.
 IlvColorEncoder getEncoder()
          Returns the IlvColorEncoder object given at construction time.
 void write(IlvOutputStream stream)
          Writes a ColorAttributeFilter object to an IlvOutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvColorAttributeFilter

public IlvColorAttributeFilter(String attributeName,
                               IlvColorEncoder encoder)
Constructs a new IlvColorAttributeFilter object from a given attribute name and an IntervalColorModel instance.

Parameters:
attributeName - The name of the attribute to filter on.
encoder - The encoder used to colorize the graphics.

IlvColorAttributeFilter

public IlvColorAttributeFilter(IlvInputStream stream)
                        throws IlvReadFileException
Reads a ColorAttributeFilter object from an IlvInputStream.

Parameters:
stream - The stream to read from.
Throws:
IlvReadFileException - if there is a problem reading from stream.
Method Detail

write

public void write(IlvOutputStream stream)
           throws IOException
Writes a ColorAttributeFilter object to an IlvOutputStream.

Specified by:
write in interface IlvPersistentObject
Parameters:
stream - The stream to write to.
Throws:
IOException - if there is a problem writing to stream.

getAttributeName

public String getAttributeName()
Returns the attribute name given at construction time.

Returns:
The attribute name given at construction time.

getEncoder

public IlvColorEncoder getEncoder()
Returns the IlvColorEncoder object given at construction time.

Returns:
The IlvColorEncoder object given at construction time.

getAttributeProperty

public static IlvAttributeProperty getAttributeProperty(IlvGraphic g)
Returns a IlvAttributeProperty instance for an IlvGraphic object.

Parameters:
g - The graphic object to retrieve the property from.
Returns:
The associated property or null if no associated property exists.

get

public Object get(IlvGraphic g,
                  String styleAttributeName)
This method is is invoked when the IlvMapStyle instance this object is attached to attempts to retrieve an attribute value.

This method can return a value different from the one that is stored in the style. The value returned depends on the metadata found in the IlvAttributeProperty instance stored in g.

Specified by:
get in interface IlvMapAttributeFilter
Parameters:
g - The current IlvGraphic.
styleAttributeName - The name of the attribute to be retrieved.
Returns:
The computed value or this.DEFAULT_VALUE if no change is calculated.
See Also:
A code example.


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