ilog.views.maps.label
Class IlvMapDefaultLabeler

java.lang.Object
  extended by ilog.views.maps.label.IlvMapDefaultLabeler
All Implemented Interfaces:
IlvPersistentObject, IlvMapLabeler

public class IlvMapDefaultLabeler
extends Object
implements IlvMapLabeler

IlvMapDefaultLabeler is the default implementation of IlvMapLabeler. This labeler adds labels to the layers with the LABEL_ATTRIBUTE attribute set to a non null value. This attribute name tells the labeler which IlvAttributeProperty to take into account for labeling.

Since:
JViews 7.5

Nested Class Summary
static class IlvMapDefaultLabeler.LabelLayer
          This class is public for implementation purposes only.
 
Constructor Summary
IlvMapDefaultLabeler()
          Construct an IlvMapDefaultLabeler.
IlvMapDefaultLabeler(IlvInputStream stream)
          Reads an IlvMapDefaultLabeler from an IlvInputStream.
 
Method Summary
 void addLayer(IlvMapLayer layer)
          Add a layer to be labeled by this labeler.
 IlvMapLabelingLabel[] createLabels(IlvGraphic graphic, String message)
          Creates and sets up map label components.
 boolean equals(Object obj)
          Indicates whether some other labeler is "equal to" this one.
 IlvMapLabelFactory getLabelFactory()
          Returns the LabelFactory used by all label layers.
 IlvMapLayer getLabelLayer()
          Deprecated.  
 IlvMapLayer getLabelLayer(IlvMapLayer mapLayer)
          Retrieves the IlvMapLayer on which labels are drawn for this specific map layer.
 Iterator getLabelLayers()
          Returns an iterator to iterate through the label layers.
 IlvManagerView getView()
          Retreives the view associated to this labeler.
 boolean isGeneratingImage()
          Tests if this label manager is prepared for to generate images.
 void labelize()
          Deprecated. Use #performLabeling() instead.
 void performLabeling()
          Performs the labeling process.
 void removeLayer(IlvMapLayer layer)
          Removes a layer from this labeler.
 void setGeneratingImage(boolean generatingImage)
          Tells this label manager instance to be prepared to generate images.
 void setLabelFactory(IlvMapLabelFactory factory)
          Sets the LabelFactory used by all label layers.
 void setLabelLayer(IlvMapLayer layer)
          Sets the label layer.
 void setView(IlvManagerView view)
          Sets the view associated to this labeler.
 void write(IlvOutputStream stream)
          Writes the labeler into an IlvOutputStream.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvMapDefaultLabeler

public IlvMapDefaultLabeler()
Construct an IlvMapDefaultLabeler.


IlvMapDefaultLabeler

public IlvMapDefaultLabeler(IlvInputStream stream)
                     throws IlvReadFileException
Reads an IlvMapDefaultLabeler from an IlvInputStream.

Parameters:
stream - The stream to read from.
Throws:
IlvReadFileException
Method Detail

getView

public IlvManagerView getView()
Retreives the view associated to this labeler.

Specified by:
getView in interface IlvMapLabeler
Returns:
The view associated to this labeler.
See Also:
IlvMapLabeler.getView()

setView

public void setView(IlvManagerView view)
Sets the view associated to this labeler.

Specified by:
setView in interface IlvMapLabeler
Parameters:
view - The view to be associated to this labeler.
See Also:
IlvMapLabeler.setView(ilog.views.IlvManagerView)

write

public void write(IlvOutputStream stream)
           throws IOException
Writes the labeler into an IlvOutputStream.

Specified by:
write in interface IlvPersistentObject
Parameters:
stream - The stream to write to.
Throws:
IOException

createLabels

public IlvMapLabelingLabel[] createLabels(IlvGraphic graphic,
                                          String message)
Creates and sets up map label components. Composite objects such as IlvGraphicSet can have more than one label component. This utility method is typically used in IlvMapLabelFactory.getGisLabel(IlvGraphic).

Parameters:
graphic - The graphic object for which one or more labels should be created.
message - A String containing the label message.
Returns:
The table of label components created for this graphic object.
Since:
JViews 8.1

setLabelFactory

public void setLabelFactory(IlvMapLabelFactory factory)
Sets the LabelFactory used by all label layers.

Parameters:
factory - The LabelFactory to use.
Since:
JViews 8.0

getLabelFactory

public IlvMapLabelFactory getLabelFactory()
Returns the LabelFactory used by all label layers. Creates a default label factory (that returns the selected metadata in the layer style) if none has been set.

Returns:
The LabelFactory used by all label layers.
Since:
JViews 8.0

setLabelLayer

public void setLabelLayer(IlvMapLayer layer)
Sets the label layer.

Specified by:
setLabelLayer in interface IlvMapLabeler
Parameters:
layer - The new label layer.
See Also:
IlvMapLabeler.setLabelLayer(ilog.views.maps.beans.IlvMapLayer)

getLabelLayer

public IlvMapLayer getLabelLayer()
Deprecated. 

Deprecated method because it supposed only one label layer existed. Use getLabelLayer(IlvMapLayer) instead.

Specified by:
getLabelLayer in interface IlvMapLabeler
Returns:
The label IlvMapLayer.

getLabelLayer

public IlvMapLayer getLabelLayer(IlvMapLayer mapLayer)
Retrieves the IlvMapLayer on which labels are drawn for this specific map layer.

Specified by:
getLabelLayer in interface IlvMapLabeler
Parameters:
mapLayer - the layer to retrieve label layer for.
Returns:
The label IlvMapLayer

addLayer

public void addLayer(IlvMapLayer layer)
Add a layer to be labeled by this labeler.

Specified by:
addLayer in interface IlvMapLabeler
Parameters:
layer - A new layer to be labeled.
See Also:
IlvMapLabeler.addLayer(ilog.views.maps.beans.IlvMapLayer)

removeLayer

public void removeLayer(IlvMapLayer layer)
Removes a layer from this labeler. The specified layer will no longer be labeled by this labeler.

Specified by:
removeLayer in interface IlvMapLabeler
Parameters:
layer - The layer to remove.
See Also:
IlvMapLabeler.removeLayer(ilog.views.maps.beans.IlvMapLayer)

labelize

public void labelize()
Deprecated. Use #performLabeling() instead.

Create labels from the specified IlvMapLayer. The name of the attribute to be labeled if the one returned by IlvMapStyle.getLabelAttribute()

Specified by:
labelize in interface IlvMapLabeler

performLabeling

public void performLabeling()
Performs the labeling process.

Specified by:
performLabeling in interface IlvMapLabeler
Since:
JViews 8.0
See Also:
labelize()

equals

public boolean equals(Object obj)
Indicates whether some other labeler is "equal to" this one.

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

getLabelLayers

public Iterator getLabelLayers()
Returns an iterator to iterate through the label layers.

Specified by:
getLabelLayers in interface IlvMapLabeler
Returns:
An iterator for the label layers.
Since:
JViews 8.0

isGeneratingImage

public boolean isGeneratingImage()
Tests if this label manager is prepared for to generate images.

Returns:
If this label manager is prepared to generate images, true is returned.
Since:
JViews 8.0

setGeneratingImage

public void setGeneratingImage(boolean generatingImage)
Tells this label manager instance to be prepared to generate images.

Parameters:
generatingImage - Set to true to generate images.
Since:
JViews 8.0


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