com.esri.aims.mtier.model.map.layer.renderer
Class ValueMapLabelRenderer

java.lang.Object
  extended by com.esri.aims.mtier.model.map.layer.renderer.Renderer
      extended by com.esri.aims.mtier.model.map.layer.renderer.ValueMapLabelRenderer
All Implemented Interfaces:
Serializable

public class ValueMapLabelRenderer
extends Renderer

Implements a ValueMapLabelRenderer that allows different label symbols to be set for different features on the map. The differences are set with the Exact, Other, and Range objects. The ValueMapLabelRenderer object extends the Renderer object.

See Also:
Serialized Form

Field Summary
static String HIGH_WEIGHT
          Defines that the feature has high importance and cannot be labeled over.
static String MED_WEIGHT
          Defines that the feature has medium importance.
static String NO_WEIGHT
          Defines that the feature has no importance and can be labeled over.
static String ONE_LABEL_PER_NAME
          Labels once per feature name.
static String ONE_LABEL_PER_PART
          Labels all parts of a feature in the case of multipart features.
static String ONE_LABEL_PER_SHAPE
          Labels once per feature even if there are multiple segments.
static String PLACE_ABOVE
          Determines the label be placed above the line.
static String PLACE_ABOVE_BELOW
          Determines the label be placed above or below the line.
static String PLACE_BELOW
          Determines the label be placed below the line.
static String PLACE_IN_LINE
          Determines the label be placed anywhere on the line.
static String PLACE_LEFT
          Determines the label be placed to the left of the line.
static String PLACE_LEFT_RIGHT
          Determines the label be placed to the right or left of the line.
static String PLACE_ON_TOP
          Determines the label be placed on top of the line.
static String PLACE_ON_TOP_HORIZONTAL
          Determines the label be placed on top of the line but always horizontal.
static String PLACE_PARALLEL
          Determines the label be placed parallel to the line.
static String PLACE_RIGHT
          Determines the label be placed to the right of the line.
 
Constructor Summary
ValueMapLabelRenderer()
          Constructs an instance of a ValueMapLabelRenderer object.
 
Method Summary
 boolean addObject(Object object)
          Adds the given object to the ValueMapLabelRenderer Object.
 void clear()
          Clears all ValueMapLabelRenderer from the collection.
 int getCount()
          Returns a count of ValueMapLabelRenderer objects.
 String getFeatureWeight()
          Returns the feature weight property associated with this ValueMapLabelRenderer.
 String getHowManyLabels()
          Returns the value associated with the 'how many labels' attribute.
 double getLabelBufferRatio()
          Returns the label buffer ratio value for the ValueMapLabelRenderer.
 String getLabelField()
          Returns the label field value for this ValueMapLabelRenderer.
 String getLabelPriorities()
          Returns the label priority set for this ValueMapLabelRenderer.
 String getLabelWeight()
          Returns the label weight associated with this ValueMapLabelRenderer.
 String getLineLabelPosition()
          Returns the line label position set for this ValueMapLabelRenderer.
 String getLookupField()
          Returns the lookup field value for the ValueMapLabelRenderer.
 ValueMap getObject(int index)
          Returns the ValueMapLabelRenderer at given index from the ValueMapLabelRenderer collection.
 String getRotationalAngles()
          Returns the rotational angles associated with this ValueMapLabelRenderer.
 String getType()
          Returns the name string that defines the renderer type.
 Object remove(int index)
          Removes the ValueMapLabelRenderer at given index from the collection.
 Object Remove(int index)
          Deprecated. As of ArcIMS 9.3 Java Connector, replaced by remove(int).
 Object replace(int index, Object obj)
          Replaces the ValueMapLabelRenderer at given index with the specified object.
 Object Replace(int index, Object obj)
          Deprecated. As of ArcIMS 9.3 Java Connector, replaced by replace(int, java.lang.Object).
 void setFeatureWeight(String value)
          When set, the feature weight property prioritizes the importance of features.
 void setHowManyLabels(String value)
          When set, this property determines how often a feature is labeled.
 void setLabelBufferRatio(double value)
          Sets the label buffer ratio for this ValueMapLabelRenderer.
 void setLabelField(String value)
          Sets the label field value for the ValueMapLabelRenderer.
 void setLabelPriorities(String value)
          Sets the label priority for this ValueMapLabelRenderer.
 void setLabelWeight(String value)
          Sets the label weight to prioritize the importance of this ValueMapLabelRenderer.
 void setLineLabelPosition(String value)
          When set, this property determines where on the line to place the label.
 void setLookupField(String value)
          Sets the lookup field for this ValueMapLabelRenderer.
 void setRotationalAngles(String value)
          Sets the given value as the rotational angle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_WEIGHT

public static final String NO_WEIGHT
Defines that the feature has no importance and can be labeled over.

See Also:
Constant Field Values

MED_WEIGHT

public static final String MED_WEIGHT
Defines that the feature has medium importance.

See Also:
Constant Field Values

HIGH_WEIGHT

public static final String HIGH_WEIGHT
Defines that the feature has high importance and cannot be labeled over.

See Also:
Constant Field Values

ONE_LABEL_PER_NAME

public static final String ONE_LABEL_PER_NAME
Labels once per feature name. When several features share the same name, only one label is shown. For example, if there is more than one polygon with the name "Residential", only one "Residential" polygon is labeled.

See Also:
Constant Field Values

ONE_LABEL_PER_SHAPE

public static final String ONE_LABEL_PER_SHAPE
Labels once per feature even if there are multiple segments. For example, the group of islands that make up Hawaii are only labeled once. If there are other features with the same name, they are also labeled.

See Also:
Constant Field Values

ONE_LABEL_PER_PART

public static final String ONE_LABEL_PER_PART
Labels all parts of a feature in the case of multipart features. For instance, the State of Hawaii consists of several islands, but they are grouped together as one polygon feature. Each island is labeled.

See Also:
Constant Field Values

PLACE_ABOVE

public static final String PLACE_ABOVE
Determines the label be placed above the line.

See Also:
Constant Field Values

PLACE_BELOW

public static final String PLACE_BELOW
Determines the label be placed below the line.

See Also:
Constant Field Values

PLACE_ON_TOP

public static final String PLACE_ON_TOP
Determines the label be placed on top of the line.

See Also:
Constant Field Values

PLACE_LEFT

public static final String PLACE_LEFT
Determines the label be placed to the left of the line.

See Also:
Constant Field Values

PLACE_RIGHT

public static final String PLACE_RIGHT
Determines the label be placed to the right of the line.

See Also:
Constant Field Values

PLACE_ABOVE_BELOW

public static final String PLACE_ABOVE_BELOW
Determines the label be placed above or below the line.

See Also:
Constant Field Values

PLACE_LEFT_RIGHT

public static final String PLACE_LEFT_RIGHT
Determines the label be placed to the right or left of the line.

See Also:
Constant Field Values

PLACE_IN_LINE

public static final String PLACE_IN_LINE
Determines the label be placed anywhere on the line.

See Also:
Constant Field Values

PLACE_PARALLEL

public static final String PLACE_PARALLEL
Determines the label be placed parallel to the line.

See Also:
Constant Field Values

PLACE_ON_TOP_HORIZONTAL

public static final String PLACE_ON_TOP_HORIZONTAL
Determines the label be placed on top of the line but always horizontal.

See Also:
Constant Field Values
Constructor Detail

ValueMapLabelRenderer

public ValueMapLabelRenderer()
Constructs an instance of a ValueMapLabelRenderer object. Example:
ValueMapLabelRenderer valueMapLabel = new ValueMapLabelRenderer();

Method Detail

getType

public String getType()
Returns the name string that defines the renderer type.

Specified by:
getType in class Renderer
Returns:
a string

addObject

public boolean addObject(Object object)
Adds the given object to the ValueMapLabelRenderer Object. Example:
 ValueMap valueMap = new ValueMap();
 TextSymbol textSymbol = new TextSymbol();
 textSymbol.setFont("arial");
 valueMap.setSymbol(textSymbol);
 valueMap.addObject(textSymbol);
 

Parameters:
object - the symbol object.
Returns:
a boolean value.
See Also:
remove(int), clear(), getObject(int)

getObject

public ValueMap getObject(int index)
Returns the ValueMapLabelRenderer at given index from the ValueMapLabelRenderer collection. Example:
 ValueMap valueMap = valueMapLabel.getObject(1);
 

Parameters:
index - the item in the collection.
Returns:
the ValueMapLabelRenderer object.
See Also:
addObject(java.lang.Object)

setLookupField

public void setLookupField(String value)
Sets the lookup field for this ValueMapLabelRenderer. Example:
 valueMapLabel.setLookupField("trout");
 

Parameters:
value - the name of field used to specify ranges for Range or exact values for Exact.
See Also:
getLookupField()

getLookupField

public String getLookupField()
Returns the lookup field value for the ValueMapLabelRenderer. Example:
 String lookupField = valueMap.getLookUpField();
 

Returns:
the lookup field as string.
See Also:
setLookupField(java.lang.String)

setLabelField

public void setLabelField(String value)
Sets the label field value for the ValueMapLabelRenderer. The label field specifies text for labeling features. The field can be in a layer table or in a joined table. Example:
    valueMapLabel.setLabelField("Brown");
 

Parameters:
value - the labelfield value.
See Also:
getLabelField()

getLabelField

public String getLabelField()
Returns the label field value for this ValueMapLabelRenderer. The label field specifies text for labeling features. The field can be in a layer table or in a joined table. Example:
  String labelField = valueMapLabel.getLabelField();
 

Returns:
String

setFeatureWeight

public void setFeatureWeight(String value)
When set, the feature weight property prioritizes the importance of features. The feature weight determines how important the feature labeled is for the label placement algorithm. If NO_WEIGHT is specified, then the feature has no importance and can be labeled over. If HIGH_WEIGHT is specified, then the feature has high importance and cannot be labeled over. Note that giving importance to features increases the complexity of the labeling problem and also the processing time. Example:
  valueMapLabel.setFeatureWeight("HIGH_WEIGHT");
 

Parameters:
value - the feature weight value.
See Also:
getFeatureWeight()

getFeatureWeight

public String getFeatureWeight()
Returns the feature weight property associated with this ValueMapLabelRenderer. Example:
 String fWeight = valueMapLabel.getFeatureWeight();
 

Returns:
the feature weight property as NO_WEIGHT, MED_WEIGHT, or HIGH_WEIGHT.
See Also:
setFeatureWeight(java.lang.String)

setLineLabelPosition

public void setLineLabelPosition(String value)
When set, this property determines where on the line to place the label. You can choose from the following options:
  • PLACE_ABOVE - Place above the line.
  • PLACE_BELOW - Place below the line.
  • PLACE_ON_TOP - Place on the line.
  • PLACE_LEFT - Place at the left side of the line.
  • PLACE_RIGHT - Place at the right side of the line.
  • PLACE_ABOVE_BELOW - Place above or below the line.
  • PLACE_LEFT_RIGHT - Place at either side of the line.
  • PLACE_IN_LINE - Place anywhere on the line.
  • PLACE_PARALLEL - Place parallel to the line.
  • PLACE_ON_TOP_HORIZONTAL - Place label on top of the line but always horizontal. Example:
     valueMapLabel.setLineLabelPosition("PLACE_PARALLEL");
     

    Parameters:
    value - the line label position.
    See Also:
    getLineLabelPosition()

  • getLineLabelPosition

    public String getLineLabelPosition()
    Returns the line label position set for this ValueMapLabelRenderer. Example:
     String LLPosition = valueMapLabel.getLineLabelPosition();
     

    Returns:
    the line label position.
    See Also:
    setLineLabelPosition(java.lang.String)

    setLabelWeight

    public void setLabelWeight(String value)
    Sets the label weight to prioritize the importance of this ValueMapLabelRenderer. The label weight is usually set to HIGH_WEIGHT since the labels are most important. This priority can be set lower if the labels are not as important as the features. Example:
     valueMapLabel.setLabelWeight("HIGH_WEIGHT");
     

    Parameters:
    value - the label weight.
    See Also:
    getLabelWeight()

    getLabelWeight

    public String getLabelWeight()
    Returns the label weight associated with this ValueMapLabelRenderer. Example:
     String labelWeight = valueMapLabel.getLabelWeight();
     

    Returns:
    the label weight.
    See Also:
    setLabelWeight(java.lang.String)

    setHowManyLabels

    public void setHowManyLabels(String value)
    When set, this property determines how often a feature is labeled. Example:
     valueMapLabel.setHowManyLabels("ONE_LABEL_PER_SHAPE"); 

    Parameters:
    value - defines the property as ONE_LABEL_PER_NAME/ONE_LABEL_PER_PART/ONE_LABEL_PER_SHAPE
    See Also:
    getHowManyLabels()

    getHowManyLabels

    public String getHowManyLabels()
    Returns the value associated with the 'how many labels' attribute. Example:
     String HMLabels = valueMapLabel.getHowManyLabels(); 

    Returns:
    the how many labels value.
    See Also:
    setHowManyLabels(java.lang.String)

    setLabelPriorities

    public void setLabelPriorities(String value)
    Sets the label priority for this ValueMapLabelRenderer. When set, this property determines where to place the label around the point.
    The attribute accepts different weights for each of eight positions around the point. Each position corresponds to the positions as shown below:
    
        1  2  3
        8  X  4
        7  6  5  
    In each position, the user can prioritize the importance of that position from 0 upwards. 0 signifies that the label should not be placed in that position. 1 means that this is an acceptable position for the label, and all higher numbers represent lesser priorities for that position. For example, "1,0,1,0,0,0,0,0" means that only the first and third label positions will be taken into account when labeling. In another example, "1,2,3,0,1,0,0,0" means try to label at the first and fifth position; if not, then put the label at the second position; if not, then put it at the third position; if this is not possible, then don't label it.
    Another option is to place a label on top of points rather than around points. To do this, use the property "PlaceOnTopHorizontal" for the label priority. Example:
     valueMapLabel.setLabelPriorities("0,0,0,0,0,0,0,0");
     

    Parameters:
    value - the label priorities value.
    See Also:
    getLabelPriorities()

    getLabelPriorities

    public String getLabelPriorities()
    Returns the label priority set for this ValueMapLabelRenderer. Example:
     String lPriorities = valueMapLabel.getLabelPriorities();
     

    Returns:
    String
    See Also:
    setLabelPriorities(java.lang.String)

    setRotationalAngles

    public void setRotationalAngles(String value)
    Sets the given value as the rotational angle. Rotational angles are possible angles that the label can be placed at, relative to the labeled point. By default, labels are always placed horizontally.
    Label priorities always take precedence over rotational angles. If you find that your labels are not rotating as expected, remove the labelpriorities attribute if present. Alternatively, you can set all the labelpriorities to "0". Example:
    valueMapLabel.setRotationalAngles("45");

    Parameters:
    value - the rotational angles value.
    See Also:
    getRotationalAngles()

    getRotationalAngles

    public String getRotationalAngles()
    Returns the rotational angles associated with this ValueMapLabelRenderer. Example:
    String rAngles = valueMapLabel.getRotationalAngles();

    Returns:
    the rotational angle.
    See Also:
    setRotationalAngles(java.lang.String)

    getCount

    public int getCount()
    Returns a count of ValueMapLabelRenderer objects. Example:
    int count = valueMap.getCount();

    Returns:
    a count

    clear

    public void clear()
    Clears all ValueMapLabelRenderer from the collection. Example:
    valueMapLabel.clear();

    See Also:
    remove(int), addObject(java.lang.Object)

    Remove

    public Object Remove(int index)
    Deprecated. As of ArcIMS 9.3 Java Connector, replaced by remove(int).

    Removes the ValueMapLabelRenderer at given index from the collection. Example:
    valueMapLabel.remove(1);

    Parameters:
    index - the object to remove
    Returns:
    Object
    See Also:
    clear(), addObject(java.lang.Object)

    remove

    public Object remove(int index)
    Removes the ValueMapLabelRenderer at given index from the collection. Example:
    valueMapLabel.remove(1);

    Parameters:
    index - the object to remove
    Returns:
    Object
    See Also:
    clear(), addObject(java.lang.Object)

    Replace

    public Object Replace(int index,
                          Object obj)
    Deprecated. As of ArcIMS 9.3 Java Connector, replaced by replace(int, java.lang.Object).

    Replaces the ValueMapLabelRenderer at given index with the specified object. Example:
     ValueMap value = (ValueMap)valueMapLabel.getObject(2);
     valueMapLabel.replace(3, value);
     

    Parameters:
    index - the object at this index to replace.
    obj - the replacement object.
    Returns:
    Object

    replace

    public Object replace(int index,
                          Object obj)
    Replaces the ValueMapLabelRenderer at given index with the specified object. Example:
     ValueMap value = (ValueMap)valueMapLabel.getObject(2);
     valueMapLabel.replace(3, value);
     

    Parameters:
    index - the object at this index to replace.
    obj - the replacement object.
    Returns:
    Object

    setLabelBufferRatio

    public void setLabelBufferRatio(double value)
    Sets the label buffer ratio for this ValueMapLabelRenderer. This property sets the buffer around the label. when this is set, no labels overlap within the buffer range.

    Parameters:
    value - the label buffer ratio value. The ratio is a fraction of the height or width of the rectangle (whichever is smaller) compared to the width of the buffer. For example, a ratio of 0.0 means no buffer, and a ratio of 1.0 means the buffer is twice the size of the label (the label width equals the buffer width). A negative ratio causes the buffer to be smaller than the label. This can be used to allow labels to overlap. Example:
     valueMapLabel.setLabelBufferRatio(2.0);
     
    See Also:
    getLabelBufferRatio(), getLabelBufferRatio()

    getLabelBufferRatio

    public double getLabelBufferRatio()
    Returns the label buffer ratio value for the ValueMapLabelRenderer. Example:
     double lbRatio = valueMapLabel.getLabelBufferRatio();
     

    Returns:
    long
    See Also:
    setLabelBufferRatio(double)