|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ILegendItem
Provides access to members that control how a layer appears in a legend. Can be stored in a style.
The Legend can be seen as a collection of map layers each layer being represented by a LegendItem.
The ILegendItem interface controls all the properties of a legend item:
CanDisplay will be true if the type of the LegendItem is compatible with the rendering of the layer. NestedLegendItem for instance, cannot be used by all renderers.
The Layer property returns the layer this LegendItem is associated with
Columns is the number of columns it should span. Height and Width control the size of the legend item.
ILegendItem also gives access to the graphic elements used to draw the legend item - Graphics property - to the symbols specific to this legend item - HeadingSymbol, LayerNameSymbol - and to the legend items LegendClassFormat object.
NewColumn controls whether the LegendItem should be displayed starting a new column. KeepTogether indicates if it can be split over different columns. A number of properties control whether the label, description, heading, and layer name should be displayed.
Horizontal and Vertical legend items use the esriLegendItemArrangement enumeration which can be set with IHorizontalLegendItem::Arrangement and IVerticalLegendItem::Arrangement to specify the position of the label, patch, and description. The default is esriPatchLabelDescription, which translates to the patch on the far left, label to the right of the patch, then the description, if available, on the far right.
There are currently four types of legend items: HorizontalLegendItem, VerticalLegendItem, HorizontalBarLegendItem, and NestedLegendItem with corresponding interfaces.
Horizontal legend items are the default and most commonly used class of legend items.
Method Summary | |
---|---|
void |
createGraphics(IDisplay display,
ILegendFormat legendFormat)
Rebuilds the list of graphics. |
short |
getColumns()
Number of columns in the legend item. |
IEnumElement |
getGraphics()
List of graphics that represent the legend item. |
int |
getGroupIndex()
Zero-based index of the legend group shown by this item. |
ITextSymbol |
getHeadingSymbol()
Text symbol used to draw the heading. |
double |
getHeight()
Height of the item in points. |
ILayer |
getLayer()
Associated layer. |
ITextSymbol |
getLayerNameSymbol()
Text symbol used to draw the layer name. |
ILegendClassFormat |
getLegendClassFormat()
Default formatting information for the legend classes. |
String |
getName()
Name of the style. |
double |
getWidth()
Width of the item in points. |
boolean |
isCanDisplay(ILayer layer)
Indicates if the style is compatible with the specified layer. |
boolean |
isKeepTogether()
Indicates if classes must appear in a single column or whether they can be split across multiple columns. |
boolean |
isNewColumn()
Indicates if the item starts a new column in the legend. |
boolean |
isShowDescriptions()
Indicates if descriptions are visible. |
boolean |
isShowHeading()
Indicates if heading is visibile. |
boolean |
isShowLabels()
Indicates if labels are visible. |
boolean |
isShowLayerName()
Indicates if layer name is visibile. |
void |
setColumns(short columns)
Number of columns in the legend item. |
void |
setGroupIndex(int index)
Zero-based index of the legend group shown by this item. |
void |
setHeadingSymbol(ITextSymbol symbol)
Text symbol used to draw the heading. |
void |
setKeepTogether(boolean flag)
Indicates if classes must appear in a single column or whether they can be split across multiple columns. |
void |
setLayerByRef(ILayer layer)
Associated layer. |
void |
setLayerNameSymbol(ITextSymbol symbol)
Text symbol used to draw the layer name. |
void |
setLegendClassFormat(ILegendClassFormat format)
Default formatting information for the legend classes. |
void |
setNewColumn(boolean flag)
Indicates if the item starts a new column in the legend. |
void |
setShowDescriptions(boolean showDescriptions)
Indicates if descriptions are visible. |
void |
setShowHeading(boolean showHeading)
Indicates if heading is visibile. |
void |
setShowLabels(boolean showLabels)
Indicates if labels are visible. |
void |
setShowLayerName(boolean showLayerName)
Indicates if layer name is visibile. |
Method Detail |
---|
String getName() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean isCanDisplay(ILayer layer) throws IOException, AutomationException
layer
- A reference to a com.esri.arcgis.carto.ILayer (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ILayer getLayer() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setLayerByRef(ILayer layer) throws IOException, AutomationException
layer
- A reference to a com.esri.arcgis.carto.ILayer (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean isNewColumn() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setNewColumn(boolean flag) throws IOException, AutomationException
flag
- The flag (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.short getColumns() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setColumns(short columns) throws IOException, AutomationException
columns
- The columns (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean isKeepTogether() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setKeepTogether(boolean flag) throws IOException, AutomationException
flag
- The flag (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean isShowLayerName() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setShowLayerName(boolean showLayerName) throws IOException, AutomationException
showLayerName
- The showLayerName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ITextSymbol getLayerNameSymbol() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setLayerNameSymbol(ITextSymbol symbol) throws IOException, AutomationException
symbol
- A reference to a com.esri.arcgis.display.ITextSymbol (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.int getGroupIndex() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setGroupIndex(int index) throws IOException, AutomationException
index
- The index (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean isShowHeading() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setShowHeading(boolean showHeading) throws IOException, AutomationException
showHeading
- The showHeading (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ITextSymbol getHeadingSymbol() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setHeadingSymbol(ITextSymbol symbol) throws IOException, AutomationException
symbol
- A reference to a com.esri.arcgis.display.ITextSymbol (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ILegendClassFormat getLegendClassFormat() throws IOException, AutomationException
The layer can provide legend class formatting information via ILegendClass.Format. This makes it possible to store legend formatting information with layers in metadata-like fashion. However, layers normally do not provide a LegendClassFormat object. Rather, legend formatting information usually comes from the legend. ILegendItem.LegendClassFormat is used and some patch settings can come from ILegend.LegendFormat .
So, when a legend is created, the code follows this logic:
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setLegendClassFormat(ILegendClassFormat format) throws IOException, AutomationException
The layer can provide legend class formatting information via ILegendClass.Format. This makes it possible to store legend formatting information with layers in metadata-like fashion. However, layers normally do not provide a LegendClassFormat object. Rather, legend formatting information usually comes from the legend. ILegendItem.LegendClassFormat is used and some patch settings can come from ILegend.LegendFormat .
So, when a legend is created, the code follows this logic:
format
- A reference to a com.esri.arcgis.carto.ILegendClassFormat (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean isShowLabels() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setShowLabels(boolean showLabels) throws IOException, AutomationException
showLabels
- The showLabels (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean isShowDescriptions() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setShowDescriptions(boolean showDescriptions) throws IOException, AutomationException
showDescriptions
- The showDescriptions (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void createGraphics(IDisplay display, ILegendFormat legendFormat) throws IOException, AutomationException
display
- A reference to a com.esri.arcgis.display.IDisplay (in)legendFormat
- A reference to a com.esri.arcgis.carto.ILegendFormat (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.double getWidth() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.double getHeight() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IEnumElement getGraphics() throws IOException, AutomationException
Graphics are measured in points. The lower left corner is (0, 0). Put elements in groups to keep the legend from flowing them across columns.
Each element in the graphic list should be flowable, i.e,. can be moved to a new column in the legend if necessary. Implement "keep together" by putting the elements that need to stay together in a group. The top level elements must be put in the list in top to bottom order.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |