Interface Legend
- All Superinterfaces:
Block
,org.eclipse.emf.ecore.EObject
,IChartObject
,org.eclipse.emf.common.notify.Notifier
- All Known Implementing Classes:
LegendImpl
A representation of the model object
'Legend'.
Legend represents the rectangular area in chart,
where its legends are displayed. It holds also a group of attributes and
elements to specify how the legend items are laid out and displayed. The
legend items usually describe either the series or categories, depeding on
the chart type. Legend is a sub-type of Block, and exists as a child block of
the chart's block in a chart's model.
Besides the general approach of using Chart.getBlock( ).getChildren( ) we can also access it using the convenient method: Chart.getLegend( );
The following features are supported:
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the value of the 'Client Area' containment reference.Returns the value of the 'Direction' attribute.int
Returns the value of the 'Ellipsis' attribute.Returns the value of the 'Format Specifier' containment reference.int
Returns the value of the 'Horizontal Spacing' attribute.Returns the value of the 'Item Type' attribute.double
Returns the value of the 'Max Percent' attribute.Returns the value of the 'Orientation' attribute.Returns the value of the 'Position' attribute.Returns the value of the 'Separator' containment reference.getText()
Returns the value of the 'Text' containment reference.getTitle()
Returns the value of the 'Title' containment reference.double
Returns the value of the 'Title Percent' attribute.Returns the value of the 'Title Position' attribute.int
Returns the value of the 'Vertical Spacing' attribute.double
Returns the value of the 'Wrapping Size' attribute.boolean
Returns whether the value of the 'Direction
' attribute is set.boolean
Returns whether the value of the 'Ellipsis
' attribute is set.boolean
Returns whether the value of the 'Horizontal Spacing
' attribute is set.boolean
Returns whether the value of the 'Item Type
' attribute is set.boolean
Returns whether the value of the 'Max Percent
' attribute is set.boolean
Returns whether the value of the 'Orientation
' attribute is set.boolean
Returns whether the value of the 'Position
' attribute is set.boolean
Returns whether the value of the 'Show Percent
' attribute is set.boolean
Returns whether the value of the 'Show Total
' attribute is set.boolean
Returns whether the value of the 'Show Value
' attribute is set.boolean
Returns whether the value of the 'Title Percent
' attribute is set.boolean
Returns whether the value of the 'Title Position
' attribute is set.boolean
Returns whether the value of the 'Vertical Spacing
' attribute is set.boolean
Returns whether the value of the 'Wrapping Size
' attribute is set.boolean
Returns the value of the 'Show Percent' attribute.boolean
Returns the value of the 'Show Total' attribute.boolean
Returns the value of the 'Show Value' attribute.void
setClientArea
(ClientArea value) Sets the value of the 'Client Area
' containment reference.void
setDirection
(Direction value) Sets the value of the 'Direction
' attribute.void
setEllipsis
(int value) Sets the value of the 'Ellipsis
' attribute.void
Sets the value of the 'Format Specifier
' containment reference.void
setHorizontalSpacing
(int value) Sets the value of the 'Horizontal Spacing
' attribute.void
setItemType
(LegendItemType value) Sets the value of the 'Item Type
' attribute.void
setMaxPercent
(double value) Sets the value of the 'Max Percent
' attribute.void
setOrientation
(Orientation value) Sets the value of the 'Orientation
' attribute.void
setPosition
(Position value) Sets the value of the 'Position
' attribute.void
setSeparator
(LineAttributes value) Sets the value of the 'Separator
' containment reference.void
setShowPercent
(boolean value) Sets the value of the 'Show Percent
' attribute.void
setShowTotal
(boolean value) Sets the value of the 'Show Total
' attribute.void
setShowValue
(boolean value) Sets the value of the 'Show Value
' attribute.void
Sets the value of the 'Text
' containment reference.void
Sets the value of the 'Title
' containment reference.void
setTitlePercent
(double value) Sets the value of the 'Title Percent
' attribute.void
setTitlePosition
(Position value) Sets the value of the 'Title Position
' attribute.void
setVerticalSpacing
(int value) Sets the value of the 'Vertical Spacing
' attribute.void
setWrappingSize
(double value) Sets the value of the 'Wrapping Size
' attribute.void
Unsets the value of the 'Direction
' attribute.void
Unsets the value of the 'Ellipsis
' attribute.void
Unsets the value of the 'Horizontal Spacing
' attribute.void
Unsets the value of the 'Item Type
' attribute.void
Unsets the value of the 'Max Percent
' attribute.void
Unsets the value of the 'Orientation
' attribute.void
Unsets the value of the 'Position
' attribute.void
Unsets the value of the 'Show Percent
' attribute.void
Unsets the value of the 'Show Total
' attribute.void
Unsets the value of the 'Show Value
' attribute.void
Unsets the value of the 'Title Percent
' attribute.void
Unsets the value of the 'Title Position
' attribute.void
Unsets the value of the 'Vertical Spacing
' attribute.void
Unsets the value of the 'Wrapping Size
' attribute.void
updateLayout
(Chart cm) Update the legend's block relationship in the hierarchy w.r.t.Methods inherited from interface org.eclipse.birt.chart.model.layout.Block
add, children, getAnchor, getBackground, getBounds, getChildren, getColumn, getColumnspan, getCursor, getHeightHint, getInsets, getMinSize, getOutline, getPreferredSize, getRow, getRowspan, getStretch, getTriggers, getWidthHint, isCustom, isLegend, isPlot, isSetAnchor, isSetColumn, isSetColumnspan, isSetHeightHint, isSetRow, isSetRowspan, isSetStretch, isSetVisible, isSetWidthHint, isText, isTitle, isVisible, remove, setAnchor, setBackground, setBounds, setColumn, setColumnspan, setCursor, setHeightHint, setInsets, setMinSize, setOutline, setRow, setRowspan, setStretch, setVisible, setWidthHint, unsetAnchor, unsetColumn, unsetColumnspan, unsetHeightHint, unsetRow, unsetRowspan, unsetStretch, unsetVisible, unsetWidthHint
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnset
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
-
Method Details
-
getHorizontalSpacing
int getHorizontalSpacing()Returns the value of the 'Horizontal Spacing' attribute. Gets the horizontal spacing between entries in the legend. The horizontal spacing between elements in the legend.- Returns:
- the value of the 'Horizontal Spacing' attribute.
- See Also:
-
setHorizontalSpacing
void setHorizontalSpacing(int value) Sets the value of the 'Horizontal Spacing
' attribute.- Parameters:
value
- the new value of the 'Horizontal Spacing' attribute.- See Also:
-
unsetHorizontalSpacing
void unsetHorizontalSpacing()Unsets the value of the 'Horizontal Spacing
' attribute. -
isSetHorizontalSpacing
boolean isSetHorizontalSpacing()Returns whether the value of the 'Horizontal Spacing
' attribute is set.- Returns:
- whether the value of the 'Horizontal Spacing' attribute is set.
- See Also:
-
getVerticalSpacing
int getVerticalSpacing()Returns the value of the 'Vertical Spacing' attribute. Gets the vertical spacing between entries in the legend. The vertical spacing between elements in the legend.- Returns:
- the value of the 'Vertical Spacing' attribute.
- See Also:
-
setVerticalSpacing
void setVerticalSpacing(int value) Sets the value of the 'Vertical Spacing
' attribute.- Parameters:
value
- the new value of the 'Vertical Spacing' attribute.- See Also:
-
unsetVerticalSpacing
void unsetVerticalSpacing()Unsets the value of the 'Vertical Spacing
' attribute. -
isSetVerticalSpacing
boolean isSetVerticalSpacing()Returns whether the value of the 'Vertical Spacing
' attribute is set.- Returns:
- whether the value of the 'Vertical Spacing' attribute is set.
- See Also:
-
getClientArea
ClientArea getClientArea()Returns the value of the 'Client Area' containment reference. Gets the client area of the legend where the legend entries will be displayed. The area of the legend block within which the legend items are displayed.- Returns:
- the value of the 'Client Area' containment reference.
- See Also:
-
setClientArea
Sets the value of the 'Client Area
' containment reference.- Parameters:
value
- the new value of the 'Client Area' containment reference.- See Also:
-
getText
Text getText()Returns the value of the 'Text' containment reference. Gets the text instance that holds the formatting information for entries in the legend. The actual text content of the block.- Returns:
- the value of the 'Text' containment reference.
- See Also:
-
setText
Sets the value of the 'Text
' containment reference.- Parameters:
value
- the new value of the 'Text' containment reference.- See Also:
-
getOrientation
Orientation getOrientation()Returns the value of the 'Orientation' attribute. The default value is"Horizontal"
. The literals are from the enumerationOrientation
. Gets the orientation to be used for entries in the legend. This determines the way the entries are arranged in the legend. The orientation of elements in the legend.- Returns:
- the value of the 'Orientation' attribute.
- See Also:
-
setOrientation
Sets the value of the 'Orientation
' attribute.- Parameters:
value
- the new value of the 'Orientation' attribute.- See Also:
-
unsetOrientation
void unsetOrientation()Unsets the value of the 'Orientation
' attribute. -
isSetOrientation
boolean isSetOrientation()Returns whether the value of the 'Orientation
' attribute is set.- Returns:
- whether the value of the 'Orientation' attribute is set.
- See Also:
-
getDirection
Direction getDirection()Returns the value of the 'Direction' attribute. The default value is"Left_Right"
. The literals are from the enumerationDirection
. Gets the direction to be used for entries in the legend. This determines the flow of the entries in the legend. The direction in which the entries are added to the legend.- Returns:
- the value of the 'Direction' attribute.
- See Also:
-
setDirection
Sets the value of the 'Direction
' attribute.- Parameters:
value
- the new value of the 'Direction' attribute.- See Also:
-
unsetDirection
void unsetDirection()Unsets the value of the 'Direction
' attribute. -
isSetDirection
boolean isSetDirection()Returns whether the value of the 'Direction
' attribute is set.- Returns:
- whether the value of the 'Direction' attribute is set.
- See Also:
-
getSeparator
LineAttributes getSeparator()Returns the value of the 'Separator' containment reference. Gets the separator attributes. The separator is used in the legend to separate entries that are produced by different series keys. The line attributes to be used for the line separating groups of entries in the legend.- Returns:
- the value of the 'Separator' containment reference.
- See Also:
-
setSeparator
Sets the value of the 'Separator
' containment reference.- Parameters:
value
- the new value of the 'Separator' containment reference.- See Also:
-
getPosition
Position getPosition()Returns the value of the 'Position' attribute. The default value is"Above"
. The literals are from the enumerationPosition
. The position of the legend.- Returns:
- the value of the 'Position' attribute.
- See Also:
-
setPosition
Sets the value of the 'Position
' attribute.- Parameters:
value
- the new value of the 'Position' attribute.- See Also:
-
unsetPosition
void unsetPosition()Unsets the value of the 'Position
' attribute. -
isSetPosition
boolean isSetPosition()Returns whether the value of the 'Position
' attribute is set.- Returns:
- whether the value of the 'Position' attribute is set.
- See Also:
-
getItemType
LegendItemType getItemType()Returns the value of the 'Item Type' attribute. The default value is"Series"
. The literals are from the enumerationLegendItemType
. The form rendering of series should take (by Series or by Categories).- Returns:
- the value of the 'Item Type' attribute.
- See Also:
-
setItemType
Sets the value of the 'Item Type
' attribute.- Parameters:
value
- the new value of the 'Item Type' attribute.- See Also:
-
unsetItemType
void unsetItemType()Unsets the value of the 'Item Type
' attribute. -
isSetItemType
boolean isSetItemType()Returns whether the value of the 'Item Type
' attribute is set.- Returns:
- whether the value of the 'Item Type' attribute is set.
- See Also:
-
getTitle
Label getTitle()Returns the value of the 'Title' containment reference. Element "Title" of type Label specifies the content and graphical properties of the title of the legend block.- Returns:
- the value of the 'Title' containment reference.
- See Also:
-
setTitle
Sets the value of the 'Title
' containment reference.- Parameters:
value
- the new value of the 'Title' containment reference.- See Also:
-
getTitlePosition
Position getTitlePosition()Returns the value of the 'Title Position' attribute. The literals are from the enumerationPosition
. Attribute "TitlePosition" specifies the position of the legend title inside the legend block. It can be Above, Below, Left and Right - by default it's Above.- Returns:
- the value of the 'Title Position' attribute.
- See Also:
-
setTitlePosition
Sets the value of the 'Title Position
' attribute.- Parameters:
value
- the new value of the 'Title Position' attribute.- See Also:
-
unsetTitlePosition
void unsetTitlePosition()Unsets the value of the 'Title Position
' attribute. -
isSetTitlePosition
boolean isSetTitlePosition()Returns whether the value of the 'Title Position
' attribute is set.- Returns:
- whether the value of the 'Title Position' attribute is set.
- See Also:
-
isShowValue
boolean isShowValue()Returns the value of the 'Show Value' attribute. The boolean attribute "ShowValue" specifies whether a descriptive value of the related series will be displayed under the legend item, normally this value will be the first value in the series.- Returns:
- the value of the 'Show Value' attribute.
- See Also:
-
setShowValue
void setShowValue(boolean value) Sets the value of the 'Show Value
' attribute.- Parameters:
value
- the new value of the 'Show Value' attribute.- See Also:
-
unsetShowValue
void unsetShowValue()Unsets the value of the 'Show Value
' attribute. -
isSetShowValue
boolean isSetShowValue()Returns whether the value of the 'Show Value
' attribute is set.- Returns:
- whether the value of the 'Show Value' attribute is set.
- See Also:
-
isShowPercent
boolean isShowPercent()Returns the value of the 'Show Percent' attribute. This attribute is not currently used.- Returns:
- the value of the 'Show Percent' attribute.
- See Also:
-
setShowPercent
void setShowPercent(boolean value) Sets the value of the 'Show Percent
' attribute.- Parameters:
value
- the new value of the 'Show Percent' attribute.- See Also:
-
unsetShowPercent
void unsetShowPercent()Unsets the value of the 'Show Percent
' attribute. -
isSetShowPercent
boolean isSetShowPercent()Returns whether the value of the 'Show Percent
' attribute is set.- Returns:
- whether the value of the 'Show Percent' attribute is set.
- See Also:
-
isShowTotal
boolean isShowTotal()Returns the value of the 'Show Total' attribute. This attribute is not currently used.- Returns:
- the value of the 'Show Total' attribute.
- See Also:
-
setShowTotal
void setShowTotal(boolean value) Sets the value of the 'Show Total
' attribute.- Parameters:
value
- the new value of the 'Show Total' attribute.- See Also:
-
unsetShowTotal
void unsetShowTotal()Unsets the value of the 'Show Total
' attribute. -
isSetShowTotal
boolean isSetShowTotal()Returns whether the value of the 'Show Total
' attribute is set.- Returns:
- whether the value of the 'Show Total' attribute is set.
- See Also:
-
getWrappingSize
double getWrappingSize()Returns the value of the 'Wrapping Size' attribute. Attribute "WrappingSize" specifies the behavior of automatically wrapping the legend items text into multiple lines when lacking in display space. Value zero means this feature is disabled, a positive value represents the maximal width of the text in points.- Returns:
- the value of the 'Wrapping Size' attribute.
- See Also:
-
setWrappingSize
void setWrappingSize(double value) Sets the value of the 'Wrapping Size
' attribute.- Parameters:
value
- the new value of the 'Wrapping Size' attribute.- See Also:
-
unsetWrappingSize
void unsetWrappingSize()Unsets the value of the 'Wrapping Size
' attribute. -
isSetWrappingSize
boolean isSetWrappingSize()Returns whether the value of the 'Wrapping Size
' attribute is set.- Returns:
- whether the value of the 'Wrapping Size' attribute is set.
- See Also:
-
getMaxPercent
double getMaxPercent()Returns the value of the 'Max Percent' attribute. The default value is"0.33333333"
. Attribute "MaxPercent" specifies the maximal percent of space which the legend can take from the whole chart block. By default, it's 0.33333333, which means the legend block will either be dropped or occupy less than 33.3% space of the whole chart block.- Returns:
- the value of the 'Max Percent' attribute.
- See Also:
-
setMaxPercent
void setMaxPercent(double value) Sets the value of the 'Max Percent
' attribute.- Parameters:
value
- the new value of the 'Max Percent' attribute.- See Also:
-
unsetMaxPercent
void unsetMaxPercent()Unsets the value of the 'Max Percent
' attribute. -
isSetMaxPercent
boolean isSetMaxPercent()Returns whether the value of the 'Max Percent
' attribute is set.- Returns:
- whether the value of the 'Max Percent' attribute is set.
- See Also:
-
getTitlePercent
double getTitlePercent()Returns the value of the 'Title Percent' attribute. The default value is"0.6"
. Attribute "TitlePercent" specifies the maximal percent of space which the legend title can take from the whole legend block. By default, it's 0.6, which means the legend title will either be dropped or occupy less than 60% space of the whole legend block.- Returns:
- the value of the 'Title Percent' attribute.
- See Also:
-
setTitlePercent
void setTitlePercent(double value) Sets the value of the 'Title Percent
' attribute.- Parameters:
value
- the new value of the 'Title Percent' attribute.- See Also:
-
unsetTitlePercent
void unsetTitlePercent()Unsets the value of the 'Title Percent
' attribute. -
isSetTitlePercent
boolean isSetTitlePercent()Returns whether the value of the 'Title Percent
' attribute is set.- Returns:
- whether the value of the 'Title Percent' attribute is set.
- See Also:
-
getEllipsis
int getEllipsis()Returns the value of the 'Ellipsis' attribute. The default value is"1"
. Int attribute "Ellipsis" specifies the behavior of shortening the legend item's text with ellipsis if there is not enough space to display the whole text. Value 0 indicates that the feature is disabled, and the legend item will either be displayed with whole text or be dropped. A positive value n represents the minimal count of characters to be displayed before the ellipsis, which means the legend item will either be dropped or be displayed with at least n characters.- Returns:
- the value of the 'Ellipsis' attribute.
- See Also:
-
setEllipsis
void setEllipsis(int value) Sets the value of the 'Ellipsis
' attribute.- Parameters:
value
- the new value of the 'Ellipsis' attribute.- See Also:
-
unsetEllipsis
void unsetEllipsis()Unsets the value of the 'Ellipsis
' attribute.- See Also:
-
isSetEllipsis
boolean isSetEllipsis()Returns whether the value of the 'Ellipsis
' attribute is set.- Returns:
- whether the value of the 'Ellipsis' attribute is set.
- See Also:
-
getFormatSpecifier
FormatSpecifier getFormatSpecifier()Returns the value of the 'Format Specifier' containment reference.If the meaning of the 'Format Specifier' containment reference isn't clear, there really should be more of a description here...
Element "FormatSpecifier" specifies how the legend item text will be formated.- Returns:
- the value of the 'Format Specifier' containment reference.
- See Also:
-
setFormatSpecifier
Sets the value of the 'Format Specifier
' containment reference.- Parameters:
value
- the new value of the 'Format Specifier' containment reference.- See Also:
-
updateLayout
Update the legend's block relationship in the hierarchy w.r.t. the chart model- Parameters:
cm
-
-
copyInstance
Legend copyInstance()- Specified by:
copyInstance
in interfaceBlock
- Specified by:
copyInstance
in interfaceIChartObject
-