ilog.views.maps.labelling
Class IlvLabeledAreaRenderer

java.lang.Object
  extended by ilog.views.maps.rendering.IlvDefaultAreaRenderer
      extended by ilog.views.maps.labelling.IlvLabeledAreaRenderer
All Implemented Interfaces:
IlvPersistentObject, IlvFeatureRenderer

public class IlvLabeledAreaRenderer
extends IlvDefaultAreaRenderer

A point renderer which produces an IlvAnchoredLabel. An IlvAnchoredLabel is a subclass of IlvGraphic containing an IlvMapLabel and a reference IlvGaphic.
The renderer makes a label if an attribute corresponding to the specified name is found.

Since:
JViews 5.0

Constructor Summary
IlvLabeledAreaRenderer()
          Constructs an empty IlvLabeledAreaRenderer.
IlvLabeledAreaRenderer(IlvInputStream stream)
          Reads an IlvLabeledAreaRenderer from the stream stream
IlvLabeledAreaRenderer(String[] attributeNames, String[] rejectedValues)
          Constructs a IlvLabeledAreaRenderer with the list of attributes names of interest and the attributes values to discard.
 
Method Summary
 String[] getAttributeNames()
          Retrieves the array of attribute names.
 String getName(IlvMapFeature feature)
          Retrieves a name in the attributes of the feature that matches the criteria defined in the constructor.
 String[] getRejectedValues()
          Retrieves the arrays of values to be rejected from attribute values.
 IlvMapTextRenderingStyle getTextRenderingStyle()
          Retrieves the test rendering style for the IlvAnchoredLabels label.
 boolean isAlwaysProducingGraphic()
          Tells if the renderer is alway producing graphic even if there is no matching name or value in the attributes.
 IlvGraphic makeGraphic(IlvMapFeature feature, IlvCoordinateTransformation tr)
          Makes the graphic accordingly to the rule described in the constructor documentation.
 void setAlwaysProducingGraphic(boolean produce)
          Tells the renderer if it should produce an IlvGraphic even if there is no matching name or value in the attributes.
 void setAttributeNames(String[] attributeNames)
          Sets the attributes whose names are candidate to be displayed by the label.
 void setRejectedValues(String[] rejectedValues)
          Sets the arrays of values to be rejected from attribute values.
 void setTextRenderingStyle(IlvMapTextRenderingStyle style)
          Sets the text style for the IlvAnchoredLabel's label.
 void write(IlvOutputStream stream)
          Writes the renderer to the stream stream
 
Methods inherited from class ilog.views.maps.rendering.IlvDefaultAreaRenderer
getAreaRenderingStyle, isPersistent, isUsingGeneralPath, setAreaRenderingStyle, setUsingGeneralPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvLabeledAreaRenderer

public IlvLabeledAreaRenderer(String[] attributeNames,
                              String[] rejectedValues)
Constructs a IlvLabeledAreaRenderer with the list of attributes names of interest and the attributes values to discard. If the an attribute whose name is contained in the attributeNames array is found, and if the value of this attribute is different from a value found in the rejectedValues array, an IlvAnchoredLabel with a label will be made. Otherwise, depending on the AlwaysProducingGraphic flag, a null graphic or a IlvAnchoredLabel with only a reference graphic will be produced.

Parameters:
attributeNames - the list of attribute names to be taken in account.
rejectedValues - the list if attribute values that are to be ignored.

IlvLabeledAreaRenderer

public IlvLabeledAreaRenderer()
Constructs an empty IlvLabeledAreaRenderer. The attribute names and rejected values must be set using the setAttributeNames and setRejectedValues methods.

Since:
JViews 5.5
See Also:
IlvLabeledAreaRenderer(java.lang.String[], java.lang.String[])

IlvLabeledAreaRenderer

public IlvLabeledAreaRenderer(IlvInputStream stream)
                       throws IlvReadFileException
Reads an IlvLabeledAreaRenderer from the stream stream

Throws:
IlvReadFileException
Method Detail

setAttributeNames

public void setAttributeNames(String[] attributeNames)
Sets the attributes whose names are candidate to be displayed by the label.

Parameters:
attributeNames - Array of attribute names whose values are candidate to be displayed.
Since:
JViews 5.5

getAttributeNames

public String[] getAttributeNames()
Retrieves the array of attribute names.

Returns:
The array of attribute names.
Since:
JViews 5.5

setRejectedValues

public void setRejectedValues(String[] rejectedValues)
Sets the arrays of values to be rejected from attribute values.

Since:
JViews 5.5

getRejectedValues

public String[] getRejectedValues()
Retrieves the arrays of values to be rejected from attribute values.

Since:
JViews 5.5

setTextRenderingStyle

public void setTextRenderingStyle(IlvMapTextRenderingStyle style)
Sets the text style for the IlvAnchoredLabel's label.

Parameters:
style - The text rendering style.

getTextRenderingStyle

public IlvMapTextRenderingStyle getTextRenderingStyle()
Retrieves the test rendering style for the IlvAnchoredLabels label.


write

public void write(IlvOutputStream stream)
           throws IOException
Writes the renderer to the stream stream

Specified by:
write in interface IlvPersistentObject
Specified by:
write in interface IlvFeatureRenderer
Overrides:
write in class IlvDefaultAreaRenderer
Parameters:
stream - the output stream
Throws:
IOException - thrown when an exception occurs during the write operation for this object.

setAlwaysProducingGraphic

public void setAlwaysProducingGraphic(boolean produce)
Tells the renderer if it should produce an IlvGraphic even if there is no matching name or value in the attributes.


isAlwaysProducingGraphic

public boolean isAlwaysProducingGraphic()
Tells if the renderer is alway producing graphic even if there is no matching name or value in the attributes.


getName

public String getName(IlvMapFeature feature)
Retrieves a name in the attributes of the feature that matches the criteria defined in the constructor. This method is used by the makeGraphic method to create an IlvAnchoredLabel.

Parameters:
feature - The map feature containing the attributes to match.

makeGraphic

public IlvGraphic makeGraphic(IlvMapFeature feature,
                              IlvCoordinateTransformation tr)
                       throws IlvMapRenderException,
                              IlvProjectionException,
                              IlvCoordinateTransformationException
Makes the graphic accordingly to the rule described in the constructor documentation. This method is used by the makeGraphic method to create an IlvAnchoredLabel.

Specified by:
makeGraphic in interface IlvFeatureRenderer
Overrides:
makeGraphic in class IlvDefaultAreaRenderer
Parameters:
feature - The map feature to translate.
tr - The transformation. This parameter should never be null.
Throws:
IlvMapRenderException - If the renderer can not process the map feature.
IlvCoordinateTransformationException - If a transformation exception occurs.
IlvProjectionException


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