com.esri.aims.mtier.model.map
Class Legend

java.lang.Object
  extended by com.esri.aims.mtier.model.map.Legend
All Implemented Interfaces:
Serializable

public class Legend
extends Object
implements Serializable

Represents the legend associated with a Map object.

See Also:
Serialized Form

Constructor Summary
Legend()
          Constructs a new Legend object specific to the Map objects service.
 
Method Summary
 void clearHiddenLayers()
          Clears all Layer objects from the hidden layers collection.
 String getBackground()
          Returns the legends background color.
 int getCellSpacing()
          Returns the cellspacing value for the legend.
 int getColumns()
          Returns the number of legend display columns.
 String getFont()
          Returns the font associated with this Legend.
 long getHeight()
          Returns the legend's height in pixels.
 Object getHiddenLayer(int index)
          Returns the Layer at the given index from the hidden layers collection.
 int getHiddenLayersCount()
          Returns a count of all Layers in the hidden layers collection.
 int getLayerFontSize()
          Returns the layer's fontsize value.
 LegendOutput getLegendOutput()
          Returns the output object associated with the legend.
 String getSplitText()
          Returns the splitText value.
 byte[] getStream()
          Returns the raw bytes associated with this Legend image.
 String getStreamType()
          Returns the Legend's raw bytes image type.
 int getSwatchHeight()
          Returns the swatch height value for the legend.
 int getSwatchWidth()
          Returns the swatch width value for the legend.
 String getTitle()
          Returns the title value for this legend.
 int getTitleFontSize()
          Returns the title font size associated with this legend.
 String getTransColor()
          Returns the transparency color value for the legend.
 int getValueFontSize()
          Returns the layer value's font size.
 long getWidth()
          Returns the legend's width in pixels.
 void hideLayer(Object layerObject)
          Adds the given Layer to the hidden layers collection.
 boolean isAntialiasing()
          Returns 'True' if antialiasing is set.
 boolean isAutoExtend()
          Returns 'True' if the autoextend property is set to true.
 boolean isCanSplit()
          Returns 'True' if canSplit was set.
 boolean isDisplay()
          Returns 'True' if Display property is set.
 boolean isDrawMap()
          Returns 'True', if the DrawMap method was set.
 boolean isReverseOrder()
          Returns "True" if the reverseorder property is set.
 void removeHiddenLayer(int index)
          Removes a layer object from the hidden layers collection by index.
 void setAntialiasing(boolean value)
          Sets antialiasing on the legend.
 void setAutoExtend(boolean value)
          Sets the auto extend value for the legend.
 void setBackground(String value)
          Sets the specified color as background color for the legend.
 void setCanSplit(boolean value)
          If set to 'True', splits the legend entities into multiple columns.
 void setCellSpacing(int value)
          Sets the cell spacing value for the legend with given value.
 void setColumns(int value)
          Sets the number of columns to display the legend entities in.
 void setDisplay(boolean value)
          Sets the Display property of the legend.
 void setDrawMap(boolean value)
          When set to 'False', this method disables Map generation and displays only the Legend when the Map object's refresh method is called.
 void setFont(String value)
          Sets the legend's font.
 void setHeight(long value)
          Sets the legend's height in pixels.
 void setLayerFontSize(int value)
          Sets the layer's font size value for the legend.
 void setReverseOrder(boolean value)
          Sets the reverseOrder value to "True", so that the legend entities are displayed in reverse order.
 void setSplitText(String value)
          Splits text that displays in the bottom of a column, if a ValueMapRenderer is carried over into the next column.
 void setStream(byte[] stream)
          set legend image raw bytes
 void setStreamType(String type)
          Sets the Legend's raw bytes image type using given string.
 void setSwatchHeight(int value)
          Sets the swatch height value for the legend.
 void setSwatchWidth(int value)
          Sets the given value as swatch width for the legend.
 void setTitle(String value)
          Sets the title for the legend.
 void setTitleFontSize(int value)
          Sets the title font size for this legend.
 void setTransColor(String value)
          Sets the transparency color for the legend.
 void setValueFontSize(int value)
          Sets the value's fontsize.
 void setWidth(long value)
          Sets the width in pixels for this legend.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Legend

public Legend()
Constructs a new Legend object specific to the Map objects service. Example:
Legend legend = new Legend();

Method Detail

setColumns

public void setColumns(int value)
Sets the number of columns to display the legend entities in. Example:
legend.setColumns(1);

Parameters:
value - the number of columns.
See Also:
getColumns()

getColumns

public int getColumns()
Returns the number of legend display columns. Example:
int columns = legend.getColumns();

Returns:
the number of legend display columns.
See Also:
setColumns(int)

setReverseOrder

public void setReverseOrder(boolean value)
Sets the reverseOrder value to "True", so that the legend entities are displayed in reverse order. Example:
legend.setReverseOrder(false);

Parameters:
value - boolean value - set to "True" to display in reverse order.
See Also:
isReverseOrder()

isReverseOrder

public boolean isReverseOrder()
Returns "True" if the reverseorder property is set. Example:
if(legend.isReverseOrder() == true){ legend.setReverseOrder(false); }

Returns:
boolean
See Also:
setReverseOrder(boolean)

setTransColor

public void setTransColor(String value)
Sets the transparency color for the legend. Example:
legend.setTransColor("255,0,0");

Parameters:
value - the transparency color.
See Also:
getTransColor()

getTransColor

public String getTransColor()
Returns the transparency color value for the legend. Example:
String transcolor = legend.getTransColor();

Returns:
the transparency color value as a string.
See Also:
setTransColor(java.lang.String)

setSwatchWidth

public void setSwatchWidth(int value)
Sets the given value as swatch width for the legend. Example:
legend.setSwatchWidth(10);

Parameters:
value - the swatch width value.
See Also:
getSwatchWidth()

getSwatchWidth

public int getSwatchWidth()
Returns the swatch width value for the legend. Example:
int width = legend.getSwatchWidth();

Returns:
the swatch width as integer.
See Also:
setSwatchWidth(int)

setStream

public void setStream(byte[] stream)
set legend image raw bytes


getStream

public byte[] getStream()
Returns the raw bytes associated with this Legend image.


setStreamType

public void setStreamType(String type)
Sets the Legend's raw bytes image type using given string.


getStreamType

public String getStreamType()
Returns the Legend's raw bytes image type.


setSwatchHeight

public void setSwatchHeight(int value)
Sets the swatch height value for the legend. Example:
legend.setSwatchHeight(20);

Parameters:
value - the swatch height value.
See Also:
getSwatchHeight()

getSwatchHeight

public int getSwatchHeight()
Returns the swatch height value for the legend. Example:
int height = legend.getSwatchHeight();

Returns:
integer
See Also:
setSwatchHeight(int)

setAutoExtend

public void setAutoExtend(boolean value)
Sets the auto extend value for the legend. Example:
legend.setAutoExtend(true);

Parameters:
value - a boolean variable - True or false.
See Also:
isAutoExtend()

isAutoExtend

public boolean isAutoExtend()
Returns 'True' if the autoextend property is set to true. Example:
if(legend.isAutoExtend() == true){ legend.setAutoExtend(false); }

Returns:
boolean
See Also:
setAutoExtend(boolean)

setBackground

public void setBackground(String value)
Sets the specified color as background color for the legend. Example:
legend.setBackground("255,0,0");

Parameters:
value - the background color.
See Also:
getBackground()

getBackground

public String getBackground()
Returns the legends background color. Example:
String backColor = legend.getBackground();

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

getLegendOutput

public LegendOutput getLegendOutput()
Returns the output object associated with the legend. Example:
String legurl = legend.getLegendOutput().getURL();

Returns:
Output

setCellSpacing

public void setCellSpacing(int value)
Sets the cell spacing value for the legend with given value. Example:
legend.setCellSpacing(10);

Parameters:
value - the cellSpacing value.
See Also:
getCellSpacing()

getCellSpacing

public int getCellSpacing()
Returns the cellspacing value for the legend. Example:
int spacing = legend.getCellSpacing();

Returns:
integer
See Also:
setCellSpacing(int)

setTitleFontSize

public void setTitleFontSize(int value)
Sets the title font size for this legend. Example:
legend.setTitleFontSize(10);

Parameters:
value - the fontsize value.
See Also:
getTitleFontSize()

getTitleFontSize

public int getTitleFontSize()
Returns the title font size associated with this legend. Example:
int tfsize = legend.getTitleFontSize();

Returns:
integer
See Also:
setTitleFontSize(int)

setLayerFontSize

public void setLayerFontSize(int value)
Sets the layer's font size value for the legend. Example:
legend.setLayerFontSize(10);

Parameters:
value - the fontsize value.
See Also:
getLayerFontSize()

getLayerFontSize

public int getLayerFontSize()
Returns the layer's fontsize value. Example:
int lfsize = legend.getLayerFontSize();

Returns:
integer
See Also:
setLayerFontSize(int)

setValueFontSize

public void setValueFontSize(int value)
Sets the value's fontsize. Example:
legend.setValueFontSize(10);

Parameters:
value - the fontsize value.
See Also:
getValueFontSize()

getValueFontSize

public int getValueFontSize()
Returns the layer value's font size. Example:
int vfsize = legend.getValueFontSize();

Returns:
the layer values font size.
See Also:
setValueFontSize(int)

setTitle

public void setTitle(String value)
Sets the title for the legend. Example:
legend.setTitle("My Legend");

Parameters:
value - the title value.
See Also:
getTitle()

getTitle

public String getTitle()
Returns the title value for this legend. Example:
String title = legend.getTitle();

Returns:
the legends title value as string.
See Also:
setTitle(java.lang.String)

setWidth

public void setWidth(long value)
Sets the width in pixels for this legend. Example:
legend.setWidth(300);

Parameters:
value - the pixel width value.
See Also:
getWidth()

getWidth

public long getWidth()
Returns the legend's width in pixels. Example:
long width = legend.getWidth();

Returns:
the width of this legend.
See Also:
setWidth(long)

setHeight

public void setHeight(long value)
Sets the legend's height in pixels. Example:
legend.setHeight(400);

Parameters:
value - the pixel height value.
See Also:
getHeight()

getHeight

public long getHeight()
Returns the legend's height in pixels. Example:
long height = legend.getHeight();

Returns:
the legends height in pixels.
See Also:
setHeight(long)

setAntialiasing

public void setAntialiasing(boolean value)
Sets antialiasing on the legend. This property is used to make edges of labels and symbols smoother. When set to true, antialiasing is active. Note that the time to generate a map may significantly increase when antialiasing is turned on. Example:
legend.setAntialiasing(true);

Parameters:
value - the antialiasing value.
See Also:
isAntialiasing()

isAntialiasing

public boolean isAntialiasing()
Returns 'True' if antialiasing is set. Example:
if(legend.isAntialiasing() == true){ legend.setAntialiasing(false); }

Returns:
boolean
See Also:
setAntialiasing(boolean)

setCanSplit

public void setCanSplit(boolean value)
If set to 'True', splits the legend entities into multiple columns. Example:
legend.setCanSplit(true);

Parameters:
value - the cansplit value.
See Also:
isCanSplit()

isCanSplit

public boolean isCanSplit()
Returns 'True' if canSplit was set. Example:
if(legend.isCanSplit() == true){ legend.setCanSplit(false); }

Returns:
boolean
See Also:
setCanSplit(boolean)

setDisplay

public void setDisplay(boolean value)
Sets the Display property of the legend. If set to 'False', legend image file will not be generated. Example:
legend.setDisplay(true);

Parameters:
value - the display value.
See Also:
isDisplay()

isDisplay

public boolean isDisplay()
Returns 'True' if Display property is set. Example:
if(legend.isDisplay() == true){ legend.setDisplay(false); }

Returns:
boolean
See Also:
setDisplay(boolean)

setFont

public void setFont(String value)
Sets the legend's font. Example:
legend.setFont("verdana");

Parameters:
value - the font value.
See Also:
getFont()

getFont

public String getFont()
Returns the font associated with this Legend. Example:
String font = legend.getFont();

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

setSplitText

public void setSplitText(String value)
Splits text that displays in the bottom of a column, if a ValueMapRenderer is carried over into the next column. Example:
legend.setSplitText("Alabama");

Parameters:
value - the text to split.
See Also:
getSplitText()

getSplitText

public String getSplitText()
Returns the splitText value. Example:
String splitText = legend.getSplitText(); 

Returns:
the value of splitText as string
See Also:
setSplitText(java.lang.String)

setDrawMap

public void setDrawMap(boolean value)
When set to 'False', this method disables Map generation and displays only the Legend when the Map object's refresh method is called. Example:
map.setDrawMap(true);

Parameters:
value - a boolean value - True/False.
See Also:
isDrawMap()

isDrawMap

public boolean isDrawMap()
Returns 'True', if the DrawMap method was set. Example:
if(map.isDrawMap() == true){ map.setDrawMap(false); }

Returns:
boolean
See Also:
setDrawMap(boolean)

hideLayer

public void hideLayer(Object layerObject)
Adds the given Layer to the hidden layers collection. The layers in this collection are not included on the image legend. Example:
map.hideLayer(featureLayer);

Parameters:
layerObject - the layer object to be hidden. This layer can include FeatureLayer, ImageLayer, and AcetateLayer.
See Also:
getHiddenLayer(int), removeHiddenLayer(int), clearHiddenLayers(), getHiddenLayersCount()

getHiddenLayer

public Object getHiddenLayer(int index)
Returns the Layer at the given index from the hidden layers collection. Example:
FeatureLayer fl = (FeatureLayer)legend.getHiddenLayer(0);

Parameters:
index - the index of the Layer to be removed.
Returns:
Object
See Also:
hideLayer(java.lang.Object), removeHiddenLayer(int), clearHiddenLayers(), getHiddenLayersCount()

removeHiddenLayer

public void removeHiddenLayer(int index)
Removes a layer object from the hidden layers collection by index. Example:
legend.removeHiddenLayer(0);

Parameters:
index - the index of the Layer to be removed.
See Also:
hideLayer(java.lang.Object), getHiddenLayer(int), clearHiddenLayers(), getHiddenLayersCount()

clearHiddenLayers

public void clearHiddenLayers()
Clears all Layer objects from the hidden layers collection. Example:
legend.clearHiddenLayers();

See Also:
hideLayer(java.lang.Object), getHiddenLayer(int), getHiddenLayersCount(), removeHiddenLayer(int)

getHiddenLayersCount

public int getHiddenLayersCount()
Returns a count of all Layers in the hidden layers collection. Example:
int count = legend.getHiddenLayersCount();

Returns:
int
See Also:
hideLayer(java.lang.Object), getHiddenLayer(int), removeHiddenLayer(int), clearHiddenLayers()